[Insight-users] Flexible Vector Image class

Dr. Uwe Köhler U.Koehler at gmx.de
Thu Nov 17 02:48:34 EST 2005


Dear  Karthik and listies,

many thanks for your help. The itk::VectorImage< float, 3 > class is exactly 
what we need. It is a very valuable addition to ITK. It seems, however, not 
all that well supported by other filters up to now. Can anybody provide help 
in that direction. I am pretty sure other people might want those extension, 
as well.

I particular I came across the following problems:

/usr/local/include/InsightToolkit/Numerics/Statistics/itkImageToListAdaptor.h:97:   
instantiated from `itk::Statistics::ImageToListAdaptor<VecImageType, 
itk::VariableLengthVector<float> >'
/home/ukoehler/devel/C++/ITK/FuzzyCMeans6var/FuzzyIO.h:88:   instantiated from 
here
/usr/local/include/InsightToolkit/Common/itkPixelTraits.h:39: error: `Length'
   is not a member of type `itk::VariableLengthVector<float>'

/usr/local/include/InsightToolkit/Numerics/Statistics/itkDistanceToCentroidMembershipFunction.h:88: 
error: `
   Dimension' is not a member of type `VecImagePixelType'
with VecImagePixelType = itk::VectorImage<float,3>::PixelType

/usr/local/include/InsightToolkit/Numerics/Statistics/itkDistanceToCentroidMembershipFunction.h:89: 
error: non-constant
   `
   itk::Statistics::DistanceToCentroidMembershipFunction<VecImagePixelType>::VectorDimension
   ' cannot be used as template argument

The MHD Reader also seems to lack support for this class. Any help is very 
wellcome.

Many help in advance.

Uwe 

Am Mittwoch, 9. November 2005 19:33 schrieben Sie:
> Folks at BWH ran into a similar problem.
>
> There are multiple solutions here:
>
> A.  You could live with an itk::Image< VariableLengthVector< float >, 3 >
>
> This would create a 3D image with each pixel being a pointer to an
> VariableLengthVector, which is just an array of pixels. You could fill
> those pixels at run time. The length of each vector can be defined at
> run time.
>
>
> B. Take a look at
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1VectorImage.html#_detai
>ls
>
> This creates an itk::VectorImage< float, 3 >
>
> which is conceptually similar to
> itk::Image< VariableLengthVector< float >, 3 >
>
> The difference being that internally it does not store a pointer to an
> object of type VariableLengthVector, but the pixels themselves. This has
> 2 advantages. It saves the extra bit of memory that you would incur if
> you stored an image of pointers, and it avoids fragmenting the memory
> space into thousands of tiny objects.  Again, you can set the length of
> the vectors in the image at run time. The VectorImage derives from
> itk::Image and behaves just like an itk::Image.
>
> The SetVectorLength(int) method sets the length of the pixels at run time.
>
> See Testing/Code/Common/itkVectorImageTest.cxx
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1VectorImageToImageAdapt
>or.html
>
>
> HTH
> Karthik
>



More information about the Insight-users mailing list