[Insight-users] Setting Analyze datatype Header Field?

Luis Ibanez luis.ibanez at kitware.com
Sun Jul 22 10:12:01 EDT 2007


Hi Joe,

You should *NOT* call these methods in the ImageIO class.

The ImageIO takes these parameters from the ImageFileWriter,
and they are associated to the actual Type of the itk::Image.

If you want a specific Pixel type and Dimension, you *MUST*
use them to instantiate the itk::Image, and then use this
itk::Image type to instantiate the itk::ImageFileWriter.

In that process you may also have to do some intensity
values adjustments, in order to make sure that the pixel
values are represented correctly in the new image.

Please review the typedef that you used for:

                  OutputImageType


    Regards,


       Luis


----------------
Joe Maisog wrote:
> Hi all, due to legacy data and software constraints, I am trying to use 
> ITK to perform intermodality registration on Analyze format data.   The 
> image_dimension.datatype field in the header file of my output Analyze 
> image volume is set to 132, which is not a recognized value under the 
> Analyze format (see http://www.mayo.edu/bir/PDF/ANALYZE75.pdf, p. 3).  I 
> tried to set this field to one of the recognized values using the 
> AnalyzeImageIO class explicitly (as per Section 7.3 in the ITK Software 
> Guide), with calls to member functions SetPixelType() and 
> SetComponentType():
> 
>  
> 
>  
> 
>     typedef itk::ImageFileWriter< OutputImageType >  WriterType;
> 
>     WriterType::Pointer      writer =  WriterType::New();
> 
>     .
> 
>     .
> 
>     .
> 
>     typedef itk::AnalyzeImageIO ImageIOType;
> 
>     ImageIOType::Pointer analyzeIO = ImageIOType::New();
> 
>  
> 
>     analyzeIO->SetComponentType(itk::ImageIOBase::USHORT);
> 
>     analyzeIO->SetPixelType(itk::ImageIOBase::SCALAR);
> 
>  
> 
>     writer->SetImageIO( analyzeIO );
> 
>     writer->Update();
> 
>  
> 
>  
> 
> but the output Analyze header still has the image_dimension.datatype 
> field is set to 132.  How do I manually set this header field?
> 
>  
> 
>  
> 
> Thanks!
> 
>  
> 
> Joe
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list