[Insight-users] ImageFilerWriter not accepting suffixs nrrd, png, jpg

Karl Diedrich karl.diedrich at azeresearch.com
Thu May 9 12:05:06 EDT 2013


I was writing NRRD images with code like this in an earlier version 3.20 of
ITK

typedef itk::Image<short, 3> ImageType;

  typedef itk::ImageFileWriter<ImageType> WriterType;


  typename WriterType::Pointer writer = WriterType::New();

  writer->SetInput(image);

  writer->SetFileName("output.nrrd");

  try

  {

    writer->Update();

  }

  catch (itk::ExceptionObject e)

  {

    std::cerr << "Error writing file " << "output.nrrd" << e << std::endl;

  }


And in ITK 4.3.1 I get the error

Error writing file output.nrrd
itk::ExceptionObject (0x7fff106e2d00)
Location: "void itk::ImageFileWriter<TInputImage>::Write() [with
TInputImage = itk::Image<short int, 2u>]"
File: ../../linux/include/ITK-4.3/itkImageFileWriter.hxx
Line: 152
Description:  Could not create IO object for file centerdot.nrrd
  Tried to create one of the following:
  You probably failed to set a file suffix, or
    set the suffix to an unsupported type.

I also tried writing a 2D image with the filename output.png and output.jpg
but got the same error.

Karl


-- 
Karl Diedrich, Ph.D.
Principal Engineer
----------------------------------------
AZE Research and Development
1 Broadway, 14th floor
Cambridge, MA 02142
Tel: +1 (617) 475-1502
http://www.azeresearch.com/ <http://www.azeofamerica.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130509/2fc01aee/attachment.htm>


More information about the Insight-users mailing list