[Insight-users] Reading complex image file

Martin Kavec kavec at messi.uku.fi
Thu May 19 06:05:42 EDT 2005


After further reading of the ITK docs, replying myself :).

It seems that I can use VECTOR pixel type to read complex data points from a 
file, since complex number is indeed a vector. However, still have a problem. 
In ITK, FFT needs as an input std::complex< Type >.

So it seems that I will have to do manual conversion from itk::Vector<double, 
2> to std::complex<double>. Am a right or is there any other - easier - way? 

Regards.

Martin

On Wednesday 18 May 2005 15:09, Martin Kavec wrote:
> 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
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users

-- 
*********************************
Department of Electrical Engineering and Computer Science
University of Liege
Sart-Tilman, Bldg. B28
Liege B-4000
BELGIUM

Phone: +32 4 366-2870
*********************************


More information about the Insight-users mailing list