[Insight-users] A working code for rotating a 3D array withVersorRigid3DTransform

Atwood, Robert C r.atwood at imperial.ac.uk
Tue Sep 20 16:53:35 EDT 2005




> One thing which is making me skeptical 
> from the beginning is, why should I use ResampleImageFilter when I don't 
> need it. Other than using a filter, I did not find any way of feeding in 
> data directly to the VersorRigid3DTransfom class.
 
Perhaps I don't understand what the problem is but I'll have a go at trying to be helpful!

If you are trying to generate a new image (the 'image')  that represents the information of the old image (the 'preimage') rotated, and the transformation of the coordinate of a voxel in the preimage does not lie exactly on the coordinate of a voxel in the image, you need to decide what the value of the voxel in the image should be. This is the job of the resampler, using the method given to it as the interpolator (linear, nearest,...) and the coordinates calculated by the transform (rotation, translation, shrinking, ...) loosely speaking (since I did not write the code).
 
You need to "resample" for any transformation of the image . (one could argue that a fixed translation of an integer multiple of voxels exaclty is an exception, or rotation by pi/2 if the voxels are cubical, or reflection through a coordinate plane, or some other degenerate cases where a renumbering would do the trick... )

Probably you understand this already but confused by the naming scheme; I think anything that takes one image and produces another is a 'filter' in ITK and the 'resample' is needed to apply any of the general transformations, the 'transform' just performs the calculations to transform a single co-ordinate as I understand it. eg. you can transform a point co-ordinate.



Also I have come to agree with the ITK developers and the examples, to put the update inside try{}catch{} blocks or you will eventually come to grief ..probably sooner rather than later...




 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050920/9bc098df/attachment.html


More information about the Insight-users mailing list