<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>It sounds like ITK's imageIO factories are not being registered.</div><div><br></div>What does your cmake code look like?<div><br></div><div><br><div><div>On Dec 12, 2012, at 7:54 AM, Marcos <<a href="mailto:fotosentido@gmail.com">fotosentido@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div class=""><p>I'm using ITK 4.2 with Qt Creator.</p><p>Trying to read several images, I always get the same:</p>
<blockquote><p>itk::ImageFileReaderException (0x1efccb0)
Location: "void itk::ImageFileReader::GenerateOutputInformation()
[with TOutputImage = itk::Image; ConvertPixelTraits =
itk::DefaultConvertPixelTraits]" </p><p>File: /usr/local/include/ITK-4.2/itkImageFileReader.hxx
Line: 143</p><p>Description: <strong>Could not create IO object</strong> for file /home/marcos/d2.dcm</p><p>Tried to create one of the following:
You probably failed to set a file suffix, or
set the suffix to an unsupported type.</p>
</blockquote><p>I've successfully readed it with </p>
<pre><code>vtkGDCMImageReader* reader = vtkGDCMImageReader::New();
reader->SetFileName(fileName);
reader->Update();
vtkImageData* imageData = reader->GetOutput();
cout << "imageData->GetScalarTypeAsString(): " << imageData->GetScalarTypeAsString() << endl;
</code></pre><p>And <em>GetScalarTypeAsString()</em> returns <strong>unsigned short</strong>.
Anyway, I tried with unsigned long, unsigned int, double, int, short, short unsigned int, unsigned char... I got the same.</p><p>Edit: other tip, with gdcminfo I get UINT16 as ScalarType.<br></p><p>This is the code:</p>
<pre><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;
}
<br><br>Any ideas? Thanks in advance.<br></code></pre>
</div>
_____________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a><br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></blockquote></div><br></div></body></html>