[Insight-users] ExtractFilter on VectorImage
    Jordi Inglada 
    jordi.inglada at cnes.fr
       
    Thu Jan 26 18:26:24 EST 2006
    
    
  
Hi,
As suggested by Karthik as an answer to my post on multi-dimensional 
images, we are now using the itkVectorImage class.
We are now facing a problem when plugging VectorImages into the 
itkExtractImageFilter. We use
  typedef itk::VectorImage < PixelType, Dimension>        ImageType;
and the pipeline is as follows :
Reader --> ExtractFilter --> Writer
Our first test used an RGB PNG image. Interestingly, the IO PNG 
ressource knows how to build a 3 channel VectorImage. Actually, if we 
use the very simple pipeline
Reader --> Writer
with the ImageType defined above, the output image is the exact copy of 
the input one.
However, when the extract filter is used, the output PNG image, even if 
it has the right dimensions, it is empty except for some columns. In the 
case where I try to write it in JPEG, I get the following message : "Too 
many color components: 0, max 10".
I have found a workaround by creating a VectorToRGBImageFilter which 
does the conversion (I wasn't able to make Adaptors work for 
VariableLengthVector pixels). And it works if the conversion is done 
BEFORE the extract filter. The output images are bad if the conversion 
is done AFTER the extract filter.
By now, this solution is OK for me, but I think that this is not really 
satisfacttory.
So my question is : can one use the VectorImage as any other itk::Image 
with itk filter, or has one to make the conversion to fixed array pixel 
types in order to make things work?
Thanks.
Jordi
-- 
CNES - DCT/SI/AP - BPI 1219
18, avenue Edouard Belin
31401 Toulouse Cedex 09 - France
Tel. +33.(0)5.61.27.33.97 - Fax. +33.(0)5.61.28.31.09
    
    
More information about the Insight-users
mailing list