<div class="">
        <p>I&#39;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: &quot;void itk::ImageFileReader::GenerateOutputInformation() 
[with TOutputImage = itk::Image; ConvertPixelTraits = 
itk::DefaultConvertPixelTraits]&quot; </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&#39;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; &quot;imageData-&gt;GetScalarTypeAsString(): &quot; &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>