[vtkusers] Reslice

David Gobbi dgobbi at atamai.com
Tue Sep 20 16:35:54 EDT 2005


Hi James,

The easiest way to do this is to pass the image through 
vtkImageChangeInformation,
and use vtkImageChangeInformation::CenterImageOn(), which will adjust the
coordinate system of your image so that (0,0,0) is at the center of the 
stack.

Once that has been done, you can use a pure rotation transform with
vtkImageReslice and the rotations will always be around the center.

Using vtkImageChangeInformation isn't the only way to do this, but it is
probably the easiest.

The other way (which is not as easy) is to create a reslice transform that
will do everything for you, i.e. it would have to translate, rotate, then
translate back again.

 - David

James Carroll wrote:

>Hello,  I have an image stack, and am trying to resample a image out
>of the stack using vtkReslice.  I see that there are lots of powerful
>functions such as set Tranfromation matrix, and set origin, etc...  
>but I am having trouble figuring out how to use them together.
>
>What I want to do is be able to specify:
>
> -  the size of the resulting image (it will be small relative to the
>extents of the stack)
>
> - the center of the resulting image in stack coordinates (world
>coordinates.)  This center is the location of the pixel that will
>change the least when the rotation angles change.
>
> - the angles that specify how the resulting image rotates around the
>Y axis of the source stack at the center point,  and then a second
>angle rotates the image around the image's local X axis at the
>resulting image's center point.
>
>How do I translate this center, angle, angle to the vtkReslice's
>SetOrigin and Set Transform commands?
>
>What this will let me do is have a plane that is always facing the
>viewer, that is texture mapped with the reslice image.  As I rotate
>the stack (orbit around it or examine it), the resulting image shows
>different resliced images.
>
>Thanks!
>-Jim
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>  
>




More information about the vtkusers mailing list