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

Bill Lorensen bill.lorensen at gmail.com
Thu May 9 12:11:55 EDT 2013


Are you building your app with CMake? If so, does, your CMakeLists.txt file
contain

  FIND_PACKAGE(ITK REQUIRED)
  INCLUDE(${ITK_USE_FILE})



On Thu, May 9, 2013 at 12:05 PM, Karl Diedrich <
karl.diedrich at azeresearch.com> wrote:

> 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/>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130509/40fe6b45/attachment.htm>


More information about the Insight-users mailing list