[vtkusers] vtkImagePlaneWidget and image orientation
Marco Sambin
m.sambin at gmail.com
Fri Jan 13 11:42:27 EST 2012
Hi all.
I am developing a MPR (Multi-Planar Reformat) medical application through
VTK. I am working in Java.
I am using 3 vtkImagePlaneWidget's to display the axial, coronal and
sagittal views in a 3D scene.
I am loading DICOM images through custom DICOM decoding code (hence, not
using VTK nor ITK image readers), and I am building a vtkImageData input
object from my own custom DICOM decoded data.
I obviously know all details about the slices I am loading into the
vtkImageData data set, including pixel spacing, origin, orientation.
I've read several posts in this mailing list about this topic, and I have
followed the quite-common suggestion of leaving the vtkImageData at (0,0,0)
origin. Also, as known, no orientation information can be associated with
vtkImageData.
Hence, basically my vtkImageData is a set of slices, each one parallel to
the XY plane in the data coordinate system, with appropriate x, y, and z
pixel spacing.
Now, my main issue is orientation. In fact, of course there are several
DICOM data sets where the input slices are not axial (i.e., not parallel to
the XY plane), hence I need to account for the orientation when displaying
my volume in the 3D scene.
My plan would be to define "somewhere" a data-to-world transformation
matrix which would allow me to display my volume with the correct
orientation in the 3D scene. But my problem is: where to define this
transform when working with vtkImagePlaneWidget? Basically, the volume
would need to be "oriented" before being provided to
the vtkImagePlaneWidget as an input, in my opinion.
I have tried creating a vtkTransform starting from my vtkMatrix4x4 (built
from X, Y, Z direction cosines of my data set and from image origin in
patient coord system), and then calling "SetResliceTransform()" on the
vtkImageReslice object behind my vtkImagePlaneWidget, but this produces
strange results: nothing is visible inside my vtkImagePlaneWidget's after
this transform. I think I haven't exactly understood what
the "SetResliceTranform()" method does, and whether it is appropriate for
my purposes...
Do you have any suggestions about how/where I should account for image
orientation when working with vtkImagePlaneWidget?
Thanks in advance,
Marco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120113/2b9c296d/attachment.htm>
More information about the vtkusers
mailing list