[vtkusers] reslice problem

David Gobbi dgobbi at irus.rri.ca
Thu Feb 7 14:10:48 EST 2002


Hi Lydia,

When you use vtkImageReslice it is always a good idea to use
SetOutputExtent(), SetOutputOrigin(), and SetOutputSpacing()
together, because all of that information is required in order
to define your output sampling grid.

The 'resampling grid' is like set of 3D graph paper where
each square on the grid is one of the voxels in the output data.
In your case, you are extracting a 2D slice so you can think of
it as a piece of graph paper that is slicing through your data,
where each 'square' on the graph paper is colored according to
what point in the volume it samples.

If you don't explicitly set the SetOutputOrigin(), then vtkImageReslice
will choose an OutputOrigin for you.  In particular, it will usually
choose the OutputOrigin that places the center of your extracted slice
at the center of your input volume.  Hence, you will always get the
same output slice unless you set the OutputOrigin() yourself.

My recommendation is to always use SetOutputExtent(0,255,0,255,0,0)
and to use SetOutputOrigin(xorigin,yorigin,z) to position your slice.

 - David

--
  David Gobbi, MSc                       dgobbi at irus.rri.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Thu, 7 Feb 2002, lydia many wrote:

> Hi folks
> I used vtkImageReslice to display a stack of slices in axial, coronal and
> saggital orientation.
> The problem is that I need to display slice by slise using VisualC++ and
> inventor library.
> The probelem is the following:Images conversion from vtkImageData to
> inventor images.
> when I convert  vtkImagereader->Getoutput which gives a vtkImageData, it
> works if I use    vtkImagereader->SetDataExtent(0,0,255,255,i,i)
> I can get an image structure which I can convert
>
> BUT
>
> When I use vtkImageReslice, and use SetOutputExtent(0,255,0,255,i,i)
> it gives always the same image and dosn't change.
> Is there any solution to this problem
> Any help will be appreciated
>
> _________________________________________________________________
> Discutez en ligne avec vos amis, essayez MSN Messenger :
> http://messenger.msn.fr/
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list