[vtkusers] Extract VOI and reposition to the origin

Michel-Alexandre Cardin ma.cardin at swri.ca
Tue Sep 7 16:06:48 EDT 2004


Hi,

I have a vtkImageData object representing a certain volume in space (this
volume has some arbitrary shape). The original volume is centered at
(0,0,0). I wish to extract a sub-volume or VOI from this original volume
using a function such as vtkExtractVOI. The center of this sub-volume is not
positioned at (0,0,0) within the original volume, so it has some relative
position with respect to (0,0,0). I want to have the center of this newly
extracted subvolume positioned at (0,0,0).

My problem is exemplified when I extract such VOI and start rotating it
using RotateX, RotateY, RotateZ, and SetOrientation. It will only rotate
around axes defined at the origin at (0,0,0), and I want it to rotate around
axes passing through its own center, which center I want to position at
(0,0,0).

In other words, I do not want to keep the original 3D position of the center
of this new sub-volume, and would like to position the center on the origin
at (0,0,0). I don't need any other information about the original volume
apart for that VOI. I could extract the sub-volume using vtkExtractVOI and
translate it to the origin, but I can't (don't know how to) measure the
coordinates of such sub-volume with respect to the original one. What are
the possibilities? Should I copy the VOI to another vtkImageData object? How
can I get rid of the original position of each voxel of the sub-volume with
respect to the origin (0,0,0)?

I'm new to VTK and may not be aware of all the tricks and trades. Thanks for
your help,

MIKE




More information about the vtkusers mailing list