[Insight-developers] Complex Pixel Type

Kent Williams kent at psychiatry.uiowa.edu
Fri Jul 14 12:33:20 EDT 2006


I've gotten NIfTIImageIO patched to the point where it now reads and 
writes Complex pixels.

The reason it wasn't working is that for images with 
std::complex<pixel>, the number of components per pixel is 2, even 
though there's only one complex number per pixel.

In reviewing NrrdImageIO it looks like the way they handle is the same 
as what I ended up doing in NiftiImageIO: have a special case for when 
itk::ImageIOBase::GetNumberOfComponents() returns 2 and the pixel type 
is Complex, and assume there's really only one Complex number per pixel.

This seems strange to me, but I guess for image formats that do support 
scalar vectors but not complex numbers to read the image into images 
with a 2D scalar at each pixel. 

Was this a conscious design decision? Would setting the number of 
components to 1 for itk::Image<std::complex<floattype>,N> and fixing the 
ImageIO classes break anything?



More information about the Insight-developers mailing list