[Insight-users] Flexible Vector Image class

Karthik Krishnan Karthik.Krishnan at kitware.com
Fri Nov 18 17:29:38 EST 2005


Thanks very much for the bug report. One of those is a bug report, the 
other is not. The bug is  fixed.

Please update your CVS, (at least the files in the Statistics folder.)

The MHD reader and all other readers/writers that support 
multi-component images (VTK, Nrrd.... )

The reader has to be instantiated like this:

typedef itk::VectorImage< double, 3 > VectorImageType;
typedef itk::ImageFileReader< VectorImageType,
                                                          
itk::DefaultConvertPixelTraits< PixelType > > ReaderType;
........


The writer does not require this.

I thought I obtained that via traits from the ImageType, but looks like 
I forgot to do that. B

Please see
Testing/Code/Common/itkVectorImageTest.cxx
This does IO/Iterators/Adaptors etc on the VectorImage.


Thanks
Regards
Karthik.




Dr. Uwe Köhler wrote:

>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
>>
>>    
>>
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>  
>


More information about the Insight-users mailing list