Hi David,<br>Thanks a lot for the hint. It worked perfectly<br><br>The vtkImageData that comes out of GetResliceOutput() has a different number of points than the input<br>In my case the input was 232x232x232 and the output was 256x256x1<br>
I assume that it was scaled to the closest multiple of 2<br>Is there a way to control the output number or stepsize? Interpolating as necessary?<br><br>Thanks<br>Ryan<br><br><div class="gmail_quote">On Tue, Mar 16, 2010 at 5:48 PM, David Feng <span dir="ltr"><<a href="mailto:dfeng@cs.unc.edu" target="_blank">dfeng@cs.unc.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Check out the vtkImagePlaneWidget. It's an arbitrarily<br>
orientable/translatable slice plane that resamples the data onto the<br>
plane interactively. Check out the documentation for how to interact.<br>
To use:<br>
<br>
// assume "reader" is a normal image reader with vtkImageData as output,<br>
// and you've set up your renderer/renderwindow/renderwindowinteractor as usual.<br>
// "iren" is a pointer to the interactor.<br>
<br>
vtkImagePlaneWidget* ipwidget = vtkImagePlaneWidget::New();<br>
ipwidget->SetInteractor(iren);<br>
ipwidget->SetInput(reader->GetOutput);<br>
<br>
You can get a pointer to the resliced image for processing using<br>
"ipwidget->GetResliceOutput()."<br>
<br>
If this doesn't do exactly what you want, look at<br>
vtkImagePlaneWidget's source code. It has all you need for creating<br>
your own slice plane, resampling, etc.<br>
<br>
David<br>
<div><div></div><div><br>
<br>
On Tue, Mar 16, 2010 at 12:15 PM, Ryan Murray <<a href="mailto:rymurr@gmail.com" target="_blank">rymurr@gmail.com</a>> wrote:<br>
> Hi all,<br>
> I am trying to do something which I think should be straightforward.<br>
> I have a vtk image file which holds a large 3d array on a structured<br>
> rectilinear grid<br>
> The only part of the vtk file I want is a 2d slice in the x,y plane.<br>
> The problem is that the slice I want is not necessarily at a grid point and<br>
> the<br>
> grid I want to output is not necessarily on the same grid as the vtk file.<br>
><br>
><br>
> I have been able to successfully use vtkExtractVOI to extract a plane on teh<br>
> grid defined in the vtk file and obviously read in the vtk file<br>
> I really have no idea how to move the plane between z grid points or how to<br>
> resample the extracted grid<br>
><br>
> I would appreciate any suggestions<br>
> Thanks<br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
<a href="http://www.cs.unc.edu/%7Edfeng" target="_blank">http://www.cs.unc.edu/~dfeng</a><br>
</font></blockquote></div><br>