[Insight-users] Multi-dimensional images

Karthik Krishnan Karthik.Krishnan at kitware.com
Thu Jan 19 11:55:39 EST 2006


Jordi Inglada wrote:

> Hello,
>
> I would like to be able to handle multispectral images for which the 
> number of channels can be any number from 1 to, say, 50. I am 
> wondering which is the "good" pixel type to use.

http://www.itk.org/Insight/Doxygen/html/classitk_1_1VariableLengthVector.html

You may also want to take a look at the Image:
http://www.itk.org/Insight/Doxygen/html/classitk_1_1VectorImage.html

where the number of channels can be specified at run time.

>
> When I write my application, I don't know which is the number of 
> channels of the images I will process, so I can not use a pixel type 
> derived from the fixed array class. I also want to write a class which 
> extracts a given number of channels from one image. This number is 
> defined by the user of the application, so it cannot be given as a 
> template parametter.

You could always write your own adaptor or your own filter to do that. 
It just needs an iterator and a little bit of code.

For instance the class
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkVectorImageToImageAdaptor.h?rev=1.7&root=Insight&view=markup

extracts the nth channel from a VectorImage.

> Can you give me any hints on this issue?
>
> Tanks in advance.
>
> Jordi
>


More information about the Insight-users mailing list