[Insight-developers] dimension reduction / VTK link

Damion Shelton dmshelto@andrew.cmu.edu
Tue, 12 Mar 2002 14:48:34 -0500


Hi,

We're working on a tool for visualizing ITK images (in the context of our 
core atom project) and we've run into the following situation:

VTK looks attractive, but can only handle 3D images. Is there an easy way 
(in ITK) to "lock" N-3 dimensions of an N-d dataset, and get the 3D subset 
this defines? E.g., I have a 4D "movie", I want to hold time constant and 
extract a 3D "frame".

itkVTKImageExport.h doesn't suggest how this should be done, but it seems 
like a fairly straightforward problem (interpolation issues aside). The 
naive way of doing it would be to compute the indices of interest for the 
"locked" dimensions, and then build an output image by looping over the 
free variables, but this isn't particularly elegant, and for large subsets 
could involve a lot of copying.

Alternatively, is it possible to use an ImageRegionIterator to accomplish 
this, by selecting origin=(0,0,0,timeindex) and size=(xsize,ysize,zsize,1)? 
If so, is there an established method (a filter perhaps) for creating an 
image given a source image and an iterator?

Also, is the interpretation of the image by itkVTKImageExport affected by 
the currently requested/buffered region definition?

In a separate but related question, is it possible in ITK to obtain 
arbitrary 2D slices through a 3D volume by defining the equation of a 
cutting plane, as can be done in VTK?

Thanks,
-Damion-