[Insight-users] Vector field images

Peter Lorenzen lorenzen at cs . unc . edu
Sun, 11 May 2003 19:04:48 -0400


Hi All,

Has anyone done much work with 3D vector field images in ITK? The 
example in
InsightToolkit-1.2.0/Examples/DataRepresentation/Image/VectorImage.cxx 
suggests constructing a 3D image of type itkVector.  This seems like a 
reasonable plan if one knows, a priori, the depth of said vector (e.g. 
nD for a velocity field in nD space).

The project on which I am working requires that a vector in the vector 
field be of size 'n' where 'n' is determined at run time.  This 
precludes the itk::Vector solution. Another approach involves defining 
a 4D images. For example,

typedef itk::Image<float,4> ImageType4D;

SizeType size;
size[0]     // X
size[1]     // Y
size[2]     // Z
size[3]     //  'n'  which is the depth of the vector, if you will

This approach seems to work fine.  I am, however, trying to use 
GLSliceView (from InsightApplications/Auxiliary/FltkImageViewer) to 
display a 3D volume from the 4D image (e.g. the 3D volume where 'n=2'). 
  Conceptually, I would to be able to extract such a 3D volume as 
follows:

typedef itk::Image<float,3> ImageType3D;

ImageType4D::Pointer image4D;  // Somehow given

ImageType3D::Pointer  image3D = (ImageType3D::Pointer) image4D[2];

I would then use this image3D as input to GLSliceView for display 
purposes.  Does anyone know how this can be done without allocating new 
memory for an ImageType3D?

Thanks,

- Peter

--
Peter J. Lorenzen
Ph.D. Student
Department of Computer Science
University of North Carolina at Chapel Hill
Sitterson Hall 268, Campus Box 3175
Chapel Hill, NC  27599-3175

TEL (919) 962-1879
FAX (919) 962-1699
E-MAIL lorenzen@cs.unc.edu
WEB PAGE http://www.cs.unc.edu/~lorenzen