[Insight-developers] Reading vector images

Luis Ibanez luis.ibanez at kitware.com
Wed, 12 May 2004 19:10:16 -0400


Hi Jim,

Yes, this is a known bug in the MetaImage reader.

  http://www.itk.org/Bug/bug.php?op=show&bugid=580&pos=12

Although, as you pointed out, the error may actually
be in the ImageFileReader<> class.


If you have any hints of how to solve it,
please go ahead   :-)


Your suggestion seem to be in the right direction.
We certainly have a lot more types defined in


          ImageIOBase::SetPixelType()

that in

          ImageIOBase::GetPixelType()


They should probably be made symmetrical...



   Luis




------------------------------------
Miller, James V (Research) wrote:

> I just tried to read an image of two component vectors into ITK using 
> the Meta format.
>  
> I get all zeros.
>  
> It looks to me that in ImageFileReader::GenerateData() there is a test for
>  
>       m_ImageIO->GetPixelType() == typeid(TOutputImage::PixelType)
>  
> TOutputImage::PixelType should be Vector<float, 2>
>  
> m_ImageIO->GetPixelType() returns float
>  
> The above check for equality fails and a data conversion occurs.  The 
> result is all zeros.
>  
> It looks as though people have asked this on the list before but I did 
> not find a response.
> I seem to recall people reading vectors as RGB pixels.
>  
> Perhaps if I add a GetPixelType() method to MetaImageIO that checks the 
> m_PixelType to be VECTOR?
>  
>  
>  
> 
> *Jim Miller*
> */_____________________________________/*
> /Visualization & Computer Vision//
> /GE Research/
> /Bldg. KW, Room C218B/
> /P.O. Box 8, Schenectady NY 12301/
> 
> //_millerjv at research.ge.com <mailto:millerjv at research.ge.com>_/
> 
> /_james.miller at research.ge.com_/
> /(518) 387-4005, Dial Comm: 8*833-4005, /
> /Cell: (518) 505-7065, Fax: (518) 387-6981/
> 
>