[vtkusers] Re: Clarification: vtkImageReslice->reorienting a volume

David Gobbi dgobbi at irus.rri.on.ca
Thu Jun 15 11:02:17 EDT 2000


On Thu, 15 Jun 2000, Audrius Stundzia wrote:

> Hi David,
> 
> Thanks for the explanations. Much appreciated.
> 
> One (last ?) pedantic question. If I set the origin of the vtkImageData such 
> that the rotation / origin is about a particular point in my data set, then 
> are the actual (x, y, z) values of the rotataion / origin point preserved if
> 
> 1. if the SetOutputOrigin is set, but not SetOutputExtent
> 2. if the SetOutputExtent is set, but not SetOutputOrigin
> 3. if both SetOutputOrigin and SetOutputExtent are set
> 4. if both SetOutputOrigin and SetOutputExtent are not set

Hi Andrius,

I would really have to go back to the code to be sure about this.
As for myself, if I am rotating the data set I _always_ call
SetOutputOrigin, SetOutputExtent, and SetOutputSpacing.  Always,
always, always!!!  Except for in my original submitted regression
tests, unfortunately.

The only time I allow the class to set these up for me is when I'm
doing simple things like permuting axes.  Nearly all the questions
I receive regarding vtkImageReslice relate to the fact that 
the default OutputOrigin and OutputExtent are not always as the
user expects.  In retrospect, I should have had these default
to be the same as the input origin and input extent.  Instead,
the default OutputOrigin and OutputExtent are set so that the
output bounds cover the entire rotated input bounds.  As I said,
I would have to look at the code to see how this rule applies to
your four cases above.

In general, anyone who uses vtkImageReslice must first understand
the relationship between Extent, Spacing, Origin and Bounds and
(more to the point) the relationship between (i,j,k) voxel 
indices and (x,y,z) structured points data coordinates.  Without
this understanding, it isn't possible to understand what
vtkImageReslice is doing.  I don't think that the User's Guide
goes into this, unfortunately.

 - David

> > > >If you just want to change the orientation, just use
> > > >SetResliceMatrix but not SetResliceTransform.
> > > >
> > >
> > > Got it. Thanks.
> > >
> > > >The 3x3 portion of the matrix should contain the direction cosines.
> > >
> > > Got this too. However, a clarification of the man pages entry for
> > > void SetResliceAxes (vtkMatrix4x4 *)
> > > would be very helpful:
> > > o The standard (i,j) = (row,column) convention is being used?
> >
> >Yes, as per vtkMatrix4x4.
> >
> > > o The column vectors are those of the old axes? or the new axes?
> >
> >The column vectors are the old axes.  The SetResliceTransform method
> >works in the same way, it is a transformation from the new coordinate
> >space to the old coordinate space.  The interpolation algorithm naturally
> >works in that direction.
> >
> > > Ie., x_p = Rx where R is the rotation matrix, are the column vectors the
> > > axes associated with x or with x_p? Looking at Eqn (3-13) in the book, I
> > > think column vectors are the "new, target" axes associated with x_p.
> > > Correct?
> >
> >Other way around.  But you should really try some simple test cases to
> >ensure that you're doing it the right way.
> >
> > > Finally, I think vtkImageReslice is a most useful contribution to vtk.
> >
> >Thanks.  It was my first VTK class, and I kind of let it grow out of
> >control.  It still doesn't do anti-aliasing though...
> >
> >  - David
> >
> >
> >_______________________________________________
> >This is the private VTK discussion list.
> >Please keep messages on-topic. Check the FAQ at: 
> ><http://public.kitware.com/cgi-bin/vtkfaq>
> >vtkusers mailing list
> >vtkusers at public.kitware.com
> >http://public.kitware.com/mailman/listinfo/vtkusers
> 
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
> 





More information about the vtkusers mailing list