[Insight-users] Reading complex image file

Martin Kavec kavec at messi.uku.fi
Wed May 18 09:09:18 EDT 2005


Hi,

I am writing a class (by inheriting from ImageIOBase) to read  from an unknown 
file a complex image data, which I want to FFT afterwards (using 
VnlFFTComplex To* filter). So, I want to have somewhere:

typedef std::complex< double> ComplexPixelType;
typedef itk::Image< ComplexPixelType, Dimension > ComplexImageType;
typedef itk::MyComplexImageReader< ComplexImageType >;

to easy perform FFT.

I am running into problem in writing MyComplexImageReader. This class uses 
virtual void Read(void* buffer) to read from file and store the image data in 
the provided buffer. My question is, how to store the data in the buffer? I 
tried to figure out this from existing TIFF, JPEG, ..., readers, but got 
lost. Also, these file formats don't store complex data, I suppose. If I read 
the data sequentially (as they are stored in a file), complex double pairs, 
how would MyComplexImageReader::GetOutput() know how to format the data into 
ComplexPixelType? I guess that in RGB pixel type images, GetOutput() method 
knows the order from from ImageIOBase::SetPixelType( PixelType ) method, 
where PixelType can be one of SCALAR, VECTOR, RGB and so on.

Am I concerned with something, which is solved upstream of the ImageIOBase 
inheritance tree and don't need to be bothered with. Or, am I missing 
anything else?

Thanks for help.

Martin


More information about the Insight-users mailing list