[Insight-users] VectorImage Registration Metric

Kevin H. Hobbs hobbsk at ohiou.edu
Wed Jul 2 16:12:07 EDT 2008


Hi Luis,

I just got a chance to return to my project that requires me to register
two channel images.

I'm continuing the thread :

http://www.itk.org/pipermail/insight-users/2008-May/025666.html

You wrote a class to facilitate this, and posted it in the NAMIC
sandbox :

http://www.na-mic.org/svn/NAMICSandBox/trunk/VectorImageRegistrationMethod/

Thank you very much for this class!

My choice to use an itk::VectorImage was based in part on memory usage.
The images are large (about 1GB for two channels) even with a pixel type
of unsigned char. As I understand it an image of vectors stores at least
a pointer at each position in the image. That sounds like it would use
all of my 4GB of RAM without ever loading any data.

However, the documentation for itk::VectorImage says that they are used
the same way.

I pared my program down just to the minimum to show the compile problem
I'm getting and attached it.

The program compiles fine when I use an image of vectors in the template
for the metric like so :

typedef itk::Vector< PixelType, 2 >   V_PixelType;
  typedef itk::Image< V_PixelType, Dimension >  V_ImageType;

typedef itk::VectorMeanSquaresImageToImageMetric
    < V_ImageType, V_ImageType > MetricType;

But when I try to compile the program as it is in the attachment with:

typedef itk::VectorImage< PixelType, Dimension >  ImageType;

typedef itk::VectorMeanSquaresImageToImageMetric
    < ImageType, ImageType > MetricType;

I get the following output:

/home/kevin/kitware/Insight/Code/Common/itkVectorInterpolateImageFunction.h: In instantiation of ‘itk::VectorInterpolateImageFunction<itk::VectorImage<unsigned char, 3u>, double>’:
/home/kevin/Documents/VectorImageRegistrationMethod/Source/itkVectorImageToImageMetric.h:110:   instantiated from ‘itk::VectorImageToImageMetric<itk::VectorImage<unsigned char, 3u>, itk::VectorImage<unsigned char, 3u> >’
/home/kevin/Documents/VectorImageRegistrationMethod/Source/itkVectorMeanSquaresImageToImageMetric.h:50:   instantiated from ‘itk::VectorMeanSquaresImageToImageMetric<itk::VectorImage<unsigned char, 3u>, itk::VectorImage<unsigned char, 3u> >’
/home/kevin/Documents/stg_anatomy/align_rot_vect.cxx:25:   instantiated from here
/home/kevin/kitware/Insight/Code/Common/itkVectorInterpolateImageFunction.h:65: error: ‘Dimension’ is not a member of ‘itk::VariableLengthVector<unsigned char>’
/home/kevin/kitware/Insight/Code/Common/itkImageConstIteratorWithIndex.h: In member function ‘const typename TImage::PixelType& itk::ImageConstIteratorWithIndex<TImage>::Value() const [with TImage = itk::VectorImage<unsigned char, 3u>]’:
/home/kevin/Documents/VectorImageRegistrationMethod/Source/itkVectorMeanSquaresImageToImageMetric.txx:203:   instantiated from ‘void itk::VectorMeanSquaresImageToImageMetric<TFixedImage, TMovingImage>::GetDerivative(const typename itk::VectorImageToImageMetric<TFixedImage, TMovingImage>::TransformParametersType&, typename itk::VectorImageToImageMetric<TFixedImage, TMovingImage>::DerivativeType&) const [with TFixedImage = itk::VectorImage<unsigned char, 3u>, TMovingImage = itk::VectorImage<unsigned char, 3u>]’
/home/kevin/Documents/stg_anatomy/align_rot_vect.cxx:27:   instantiated from here
/home/kevin/kitware/Insight/Code/Common/itkImageConstIteratorWithIndex.h:241: warning: returning reference to temporary

Were these not meant to go together, or did I do something stupid?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: align_rot_vect.cxx
Type: text/x-c++src
Size: 715 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080702/eef9f03e/attachment.cxx>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080702/eef9f03e/attachment.pgp>


More information about the Insight-users mailing list