[Insight-users] itkImageFileReader: could not create IO object
Bradley Lowekamp
blowekamp at mail.nih.gov
Wed Dec 12 08:32:49 EST 2012
It sounds like ITK's imageIO factories are not being registered.
What does your cmake code look like?
On Dec 12, 2012, at 7:54 AM, Marcos <fotosentido at gmail.com> wrote:
> I'm using ITK 4.2 with Qt Creator.
>
> Trying to read several images, I always get the same:
>
> itk::ImageFileReaderException (0x1efccb0) Location: "void itk::ImageFileReader::GenerateOutputInformation() [with TOutputImage = itk::Image; ConvertPixelTraits = itk::DefaultConvertPixelTraits]"
>
> File: /usr/local/include/ITK-4.2/itkImageFileReader.hxx Line: 143
>
> Description: Could not create IO object for file /home/marcos/d2.dcm
>
> Tried to create one of the following: You probably failed to set a file suffix, or set the suffix to an unsupported type.
>
> I've successfully readed it with
>
> vtkGDCMImageReader* reader = vtkGDCMImageReader::New();
> reader->SetFileName(fileName);
> reader->Update();
> vtkImageData* imageData = reader->GetOutput();
> cout << "imageData->GetScalarTypeAsString(): " << imageData->GetScalarTypeAsString() << endl;
> And GetScalarTypeAsString() returns unsigned short. Anyway, I tried with unsigned long, unsigned int, double, int, short, short unsigned int, unsigned char... I got the same.
>
> Edit: other tip, with gdcminfo I get UINT16 as ScalarType.
>
> This is the code:
>
> typedef itk::Image <unsigned short> ImageType;
> typedef itk::ImageFileReader<ImageType> ReaderType;
> ReaderType::Pointer reader = ReaderType::New();
> try
> {
> reader->SetFileName(nombreFichero);
> }
> catch (itk::ExceptionObject& excep)
> {
> cerr << excep << endl;
> return;
> }
>
>
> Any ideas? Thanks in advance.
> _____________________________________
> 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://www.itk.org/pipermail/insight-users/attachments/20121212/f8cc41a4/attachment-0001.htm>
More information about the Insight-users
mailing list