[Insight-users] 3D RGB images in Analyze format
Karthik Krishnan
Karthik.Krishnan at kitware.com
Tue Jul 5 12:54:37 EDT 2005
The AnalyseImageIO in ITK does not seem to be capable of writing images
with more than one component. You could always use MHD (meta image ) etc..
Thanks
regards
karthik
Julian Tam wrote:
>Hello,
>
>I am trying to write a 3D RGB image in Analyze format, but the
>following exception is caught:
>
>itk::ExceptionObject (00FCE950)
>Location: "Unknown"
>File: \library\itk_1.8.0\src\Code\Io\itkAnalyzeImageIO.cxx
>Line: 965
>Description: More than one component per pixel not supported
>
>The following includes pertinent excerpts of my program.
>-------------------------------
>#include "itkRGBPixel.h"
>
>const unsigned int Dimension = 3;
>typedef itk::RGBPixel< unsigned char> outPixelType;
>typedef itk::Image< outPixelType, Dimension > outImageType;
>typedef itk::ImageFileWriter< outImageType > WriterType;
>
>outImageType::Pointer outputImage = outImageType::New();
>// outputImage allocated and processed here
>
>
>WriterType::Pointer writer = WriterType::New();
>writer->SetFileName("out.img");
>writer->SetInput( outputImage );
>
>try
> {
> writer->Update();
> }
>catch ( itk::ExceptionObject &err)
> {
> std::cerr << err << std::endl;
> return -1;
> }
>---------------------------
>
>When I alter my program to create 2D RGB images and output them as
>.png, I do not encounter any problems.
>
>Are there any special steps that I need to take to accomplish this task?
>
>Thanks,
>Julian
>_______________________________________________
>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