<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 &lt;<a href="mailto:fotosentido@gmail.com">fotosentido@gmail.com</a>&gt; 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-&gt;SetFileName(fileName);
reader-&gt;Update();
vtkImageData* imageData = reader-&gt;GetOutput();
cout &lt;&lt; "imageData-&gt;GetScalarTypeAsString(): " &lt;&lt; imageData-&gt;GetScalarTypeAsString() &lt;&lt; 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 &lt;unsigned short&gt; ImageType;
typedef itk::ImageFileReader&lt;ImageType&gt; ReaderType;
ReaderType::Pointer reader = ReaderType::New();
try
{
    reader-&gt;SetFileName(nombreFichero);
}
catch (itk::ExceptionObject&amp; excep)
{
    cerr &lt;&lt; excep &lt;&lt; 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>