[vtkusers] help in using vtkImageReslice: extract a sub image of known geometry from the resliced image

Elvis Chen elvis.chen at gmail.com
Thu Apr 8 10:47:12 EDT 2010


hi all,

I would appreciate if someone can give me some insight on how to use
vtkImageReslice in a proper way.  I believe vtkImageReslice has all the
functionality for what I need to do but I have hard time figuring out how to
use it properly.

Objective:  extract a sub-region of a known 2D geometry on an oblique plane
that slices through a 3D volume, and save the output as an 2D image of
certain size (in pixel) for image-processing.

What I can do now:  extract the entire oblique slice using the following
code in python:


CTReslice = vtk.vtkImageReslice()
CTReslice.SetInputConnection( CTReader.GetOutputPort() )
CTReslice.SetOutputDimensionality( 2 )
CTReslice.SetInterpolationModeToLinear()
CTReslice.SetOutputSpacing( sx, sy, sz )
CTReslice.SetResliceAxes( Transform.GetMatrix() )


the Transform basically specifies the origin and the DirectionCosines
(correct me if I am wrong) of which the oblique plane lies.  This gave me
the entire oblique slice of the CT volume.  I could also specify the
origin/point1/point2/normal of the oblique plane which gave me the same
result as SetResliceAxes


What I like to do:  extract a sub-image on the oblique plane with a known
geometry (say, a 640x480 rectangular region).  The geometry can be specified
as polydata which by design lies on on the oblique plane.

Questions:

- how is CTReslice.Getoutput() oriented about the normal of the oblique
plane?  Does a programmer has a control of that?

- Why is the GetOutputExtent() and GetOutputOrigin() not updated?  According
to the html documentation, the default output extent/origin is the input
extend/origin permuted  through the ResliceAxes, and yet when I look at
these values they are (appeared to be) VTK_INT_MIN/MAX/VTK_DOUBLE_MAX

- I thought about the using vtkImageClip on CTReslice.GetOutput() but there
will be situation in which the geometry that I want to clip the image lies
*outside* of the extent of the input 3D volume.  Will vtkImageClip still
work property since it only makes the extent smaller?

I would really appreciate if someone can shed lights into this matter.

thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100408/d3371dd3/attachment.htm>


More information about the vtkusers mailing list