Permuting the axes of a volume

Ron Inbar rinbar at netvision.net.il
Sat Oct 30 07:12:25 EDT 1999


Hi all!

I have a bunch of CT slices and a the coordinates of a point in the
resulting volume.  I need to display the axial, coronal and sagittal slices
cutting through this point (I'm assuming the point doesn't fall between two
slices).  Currently I am doing the following:

vtkVolume16Reader read
...
vtkImageReslice axialReslice
axialReslice SetInput [read GetOutput]
axialReslice SetResliceAxes axialAxes
...
vtkImageReslice coronalReslice
coronalReslice SetInput [read GetOutput]
coronalReslice SetResliceAxes coronalAxes
...
vtkImageReslice sagittalReslice
sagittalReslice SetInput [read GetOutput]
sagittalReslice SetResliceAxes sagittalAxes
...
vtkImageViewer axialView
axialView SetInput [axialReslice GetOutput]
...
vtkImageViewer coronalView
coronalView SetInput [axialReslice GetOutput]
...
vtkImageViewer coronalView
coronalView SetInput [axialReslice GetOutput]

Then I use SetZSlice for each viewer to get the right slice.  This approach
has several drawbacks:
1. To ensure that the transformed volume doesn't exceed the all-positive
octant, the matrices coronalAxes and sagittalAxes have to contain a
translation which depends on the dimensions of the original volume.
2. It takes 3 times the memory to represent the same volume.

I'm looking for a better way to do it.  I considered the following ideas,
but each one has its own problems:

1. vtkImagePermute: can it handle reversed axes, e.g., (x, y, z) -> (x, -z,
y)?
2. vtkImageReader::SetTransform: but then I'll have to read the volume 3
times, each time with a different transform.  This could take a LOT of time,
quite unnecessarily.
3. vtkExtractVOI or vtkImageClip with an extent of just one slice along the
relevant axis: but I still have to permute the axes in order to display it
in the viewer (otherwise I just see a single line of pixels).

I would very much like to hear what you think is the best way to go about
this.

Thanks in advance,

Ron






-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list