[Insight-users] Writing RGBPixel images problem, Bug?

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Jul 13 16:58:12 EDT 2006


I have been using itk::ImageFileWriter with pixel type  
itk::RGBPixel<unsigned char> to write my images and it was all  
working. With this useful function to wrap it:


template<class ImageType>
void WriteImage(typename ImageType::ConstPointer image, const  
std::string fname) {
	std::cout << "writing image \"" << fname << "\"..." << std::flush;
   typedef  itk::ImageFileWriter<   ImageType  > WriterType;
   typename WriterType::Pointer writer = WriterType::New();
   writer->SetFileName( fname.c_str() );
   writer->SetInput(image);
   writer->Update();
	std::cout<< "done." << std::endl;
}


  I am now trying to use ITK 2.8.1 and no matter what file type I try  
saving as I am getting a message similar to:

Description: itk::ERROR: VTKImageIO(0x166f6d0): Pixel type currently  
not supported. typeid.name = N3itk8RGBPixelIhEE

I have tried tiff,png,jpg all with the same results. Perhaps  
something changed in this version? Grepping around in the test I see  
that the writers now use SetImageIO (not sure if this is new)?


I switched to 2.8.1 to use the itk::Statistics::ChiSquareDistribution  
class. The ITK_USE_REVIEW or the Code/Review does not include  
installation of the headers is libraries (not sure if this is on  
purpose).


Thanks,


========================================================
Bradley Lowekamp
Management Systems Designers Contractor for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060713/d1682046/attachment-0001.htm


More information about the Insight-users mailing list