[Insight-users] Exception: No image IO set, or none could be created

Luis Ibanez luis.ibanez at kitware.com
Sat Oct 23 17:53:49 EDT 2004


Hi Aaron,

This error message indicates that the filename that you
provided for writing the output was not recorgnized by
any of the ImageIO objects in ITK.

If you want to write images in MetaImage format, please
make sure that you use the extension ".mhd" in the file
name that you pass to the ImageFileWriter.

For more details please look at the FAQ

       http://www.itk.org/Wiki/ITK_FAQ

in partiuclar to the entry:

http://www.itk.org/Wiki/ITK_FAQ#What_3D_file_formats_can_ITK_import_and_export.3F



and also read the IO chapter of the ITK Software Guide

    http://www.itk.org/ItkSoftwareGuide.pdf


Chater 7, "Reading and Writing Images", pdf-pages 219-240.



    Regards,



       Luis



---------------------
Aaron Skewes wrote:

> Hello folks,
> 
>  
> 
> I am trying to rescale some .mhd images, but I am receiving an exception 
> form the ImageFileWriter: No image IO set, or none could be created. I 
> am not sure why I am receiving this. Any ideas?
> 
>  
> 
> Thanks,
> 
> Aaron
> 
>  
> 
>  
> 
> typedef unsigned char          PixelType;
> 
> const unsigned int             Dimension = 3;
> 
> typedef itk::Image< PixelType, Dimension >   ImageType;
> 
> typedef itk::ImageFileReader< ImageType >   ReaderType;
> 
> typedef itk::ImageFileWriter< ImageType >   WriterType;
> 
> typedef itk::RescaleIntensityImageFilter< ImageType, ImageType > 
> RescaleFilterType;
> 
> :
> 
> :
> 
> :
> 
> inputFileName= inputFile.data();
> 
>             ReaderType::Pointer reader = 
> ReaderType::New();                     
> 
>             reader->SetFileName( inputFileName  );
> 
>             //Explicitly update the reader
> 
>             try
> 
>                         {
> 
>                         reader->Update();
> 
>                         }
> 
>             catch( itk::ExceptionObject & err )
> 
>                         {
> 
>                         std::cout << "ExceptionObject caught !" << 
> std::endl;
> 
>                         std::cout << err << std::endl;
> 
>                         }          
> 
>  
> 
>             RescaleFilterType::Pointer rescaler = RescaleFilterType::New();
> 
>             rescaler->SetOutputMinimum(   0 );
> 
>             rescaler->SetOutputMaximum( 255 );
> 
>             rescaler->SetInput(reader->GetOutput());
> 
>  
> 
>             try
> 
>                         {
> 
>                         rescaler->Update();
> 
>                         }
> 
>             catch ( itk::ExceptionObject &err)
> 
>                         {
> 
>                         std::cout << "ExceptionObject caught !" << 
> std::endl;
> 
>                         std::cout << err << std::endl;
> 
>             }
> 
>  
> 
>             outputFileName= outputFile.data();
> 
>             WriterType::Pointer writer = WriterType::New();
> 
>             writer->SetFileName( outputFileName );
> 
>             writer->SetInput(rescaler->GetOutput());
> 
>  
> 
>             try
> 
>                         {
> 
>                         writer->Update();
> 
>                         }
> 
>             catch ( itk::ExceptionObject &err)
> 
>                         {
> 
>                         std::cout << "ExceptionObject caught !" << 
> std::endl;
> 
>                         std::cout << err << std::endl;
> 
>             }
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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