Permuting the axes of a volume

David Gobbi dgobbi at irus.rri.on.ca
Sun Oct 31 13:46:58 EST 1999


Hi Bill,

I stand corrected.  I found the regression test:

vtk/imaging/examplesTcl/skinOrder.tcl,

and the file which demonstrates how to create the transforms for
vtkImageReader->SetTransform(), assuming that you want to view your 
data set in the 'face-to-face' orientation:

vtk/examplesTcl/frog/SliceOrder.tcl

Now here is what had confused me about vtkImageReader->SetTransform:  
I thought that the transform went from the original scan coordinate 
system to the desired output coordinate system.  Instead, it looks like
the opposite -- the permutation matrix describes the orientation of the
original scan slices in terms of the desired output coordinate system.

Apologies for the confusion.

 - David

--David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Sat, 30 Oct 1999, Bill Lorensen wrote:

> 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.
> -----------------------------------------------------------------------------
> 



-----------------------------------------------------------------------------
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