[ITK] [ITK-users] Question about ImageFileReader

Bill Lorensen bill.lorensen at gmail.com
Thu Mar 27 11:33:37 EDT 2014


Are using CMake to configure your program?
On Mar 27, 2014 11:23 AM, "Tim Allman" <dr.tim.allman at gmail.com> wrote:

> Perhaps I misunderstand the documentation but I have written the following
> code with the idea that I could read arbitrary image file types and let the
> ImageFileReader instance figure out which ImageIO was needed. The files are
> Nrrd which seems to be supported but the last line fails with the error
> below.
>
> Any suggestions?
>
>      std::string name = /Users/tim/devel/ConvertToDicom/Case005/out_
> 000.nrrd
>
>     typedef unsigned short PixelType;
>     typedef itk::Image<PixelType, 2u> Image2DType;
>     typedef itk::ImageFileReader<Image2DType> ReaderType;
>
>     ReaderType::Pointer reader = ReaderType::New();
>     reader->SetFileName(name);
>     reader->Update();
>
> itk::ImageFileReaderException: /Users/tim/usr/local/ITK/
> Universal/Debug/include/ITK-4.5/itkImageFileReader.hxx:143:
>  Could not create IO object for file /Users/tim/devel/
> ConvertToDicom/Case005/out_000.nrrd
>   Tried to create one of the following:
>   You probably failed to set a file suffix, or
>     set the suffix to an unsupported type.
>
> Thanks,
> Tim
>
> --
> Tim Allman, Ph.D.
> 35 Margaret Street,
> Guelph Ontario N1E 5R6
> Canada
>
>
> _____________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140327/c33fd0ee/attachment-0002.html>
-------------- next part --------------
_____________________________________
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


More information about the Community mailing list