Permuting the axes of a volume

Bill Lorensen wlorens1 at nycap.rr.com
Sat Oct 30 23:43:19 EDT 1999


David,
As far as I know, SetTransform is not broken It is used in a regression test. I've been out of town for two weeks (1/2
more to go). I'll check on it when I return.

Bill

At 10:34 AM 10/30/99 -0400, David Gobbi wrote:
>Hi Ron,
>
>Here is a brief summary of my experience in extracting 
>axial/sagittal/coronal slices from a volume.
>
>- don't use vtkImageReader->SetTransform, it is broken (someone
>   correct me if I'm wrong here).  It is not used in any of the 
>   regression tests. 
>
>- a vtkImagePermute followed by a vtkImageFlip is the easiest
>   solution.  This is the best bet.
>
>- vtkImageReslice will allow you to do many tricks which are
>   not possible with other filters, e.g. you can extract oblique
>   slices, do a zoom with tricubic interpolation, pad the output
>   image up to the nearest power of two for texture mapping, etc.
>
>   Unfortunately, using vtkImageReslice does require a little bit
>   of extra math (see contrib/examplesPython/TextureReslice.py or
>   contrib/examplesPython/TextureReslice.tcl).  If you are using
>   Tcl, the math becomes very cumbersome very quickly.
>
>   - David
>
>On Sat, 30 Oct 1999, Ron Inbar wrote:
>
> > 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