[Insight-users] Re: A bug in ImageFileReader with complex

Luis Ibanez luis.ibanez at kitware.com
Mon May 23 18:02:34 EDT 2005



Hi Martin,


Thanks for pointing this out.

You are right, the std::complex<> type cannot be used directly
as the pixel type for an image that is intended to be read into ITK.

The reason is that the ImageFileReader expect pixel types to have
number of traits defined. This pixel traits are to be defined in the
file:


        Insight/Code/IO/
           itkDefaultConvertPixelTraits.h


We just added the missing traits to this file, and committed the
changes to the CVS repository.


Please update your CVS checkout of ITK and let us know if you find
any further problems.


     Thanks



         Luis




----------------------------------------------
kavec at messi.uku.fi wrote:

> Hi,
> 
> I think there is a bug in ImageFileReader with complex pixel type.
> 
> typedef std::complex<double> ComplexPixelType;
> const   unsigned int        Dimension = 2;
> 
> typedef itk::Image< ComplexPixelType, Dimension > ComplexImageType;
> typedef itk::Image< double, Dimension >           OutputImageType;
> 
> typedef itk::ImageFileReader< ComplexImageType >  ReaderType;
> typedef itk::ImageFileWriter< ComplexImageType >   WriterType;
> 
> // ReaderType::Pointer reader = ReaderType::New();
> WriterType::Pointer writer = WriterType::New();
> 
> Uncommenting the line above triggers long list of compilation errors. It is
> attached. Interestingly, ImageFileWriter works fine with complex.
> 
> Any idea.





More information about the Insight-users mailing list