<div dir="ltr">
<p style="margin:0px">Hi,</p><p style="margin:0px"> I gave problems getting <span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ImageIOFactory </span>to return a valid pointer.</p><p style="margin:0px"><span style="color:rgb(128,128,0)"><br></span></p>I am trying this:<p style="margin:0px"><br><span style="color:rgb(192,192,192)"></span></p>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ImageIOBase</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">Pointer</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">imageIO</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ImageIOFactory</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(0,0,0)">CreateImageIO</span><span style="color:rgb(0,0,0)">(</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">               </span><span style="color:rgb(0,0,0)">testfile</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ImageIOFactory</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ReadMode</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">!</span><span style="color:rgb(0,0,0)">imageIO</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">)</span></pre><pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,0)">{</span></pre><pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,0,128)">std</span><span style="color:rgb(0,0,0)">::</span>cerr<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"Could</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">not</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">CreateImageIO</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">for:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">fn</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,0,0)">toStdString</span><span style="color:rgb(0,0,0)">().</span><span style="color:rgb(0,0,0)">c_str</span><span style="color:rgb(0,0,0)">()</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style="color:rgb(0,0,0)">::</span>endl<span style="color:rgb(0,0,0)">;</span></pre><pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">;</span></pre><p style="margin:0px">




</p><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,0)">}</span></pre><p style="margin:0px"><br></p><p style="margin:0px"><br></p><p style="margin:0px">I get:</p><p style="margin:0px"> Could not CreateImageIO for:  /tmp/<span style="color:rgb(60,60,60);font-family:monospace;font-size:9pt">itk1_014_000.mhd</span></p>
<p style="margin:0px"><br></p><p style="margin:0px">I can open this file with ITK snap without issues.</p><p style="margin:0px"><br></p><p style="margin:0px">When I do this:</p><p style="margin:0px"><br></p>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,0,128)">RegisteredObjectsContainerType</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">registeredIOs</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ObjectFactoryBase</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(0,0,0)">CreateAllInstance</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkImageIOBase"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">              </span><span style="color:rgb(0,0,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">registeredIOs</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,0,0)">size</span><span style="color:rgb(0,0,0)">()</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">              </span><span style="color:rgb(0,0,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">IO</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">objects</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">available</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">to</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">the</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">ImageFileReader.\n"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span style="color:rgb(0,0,0)">::</span>endl<span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">I get:</pre><pre style="margin-top:0px;margin-bottom:0px"><p style="margin:0px"><span style="font-family:monospace;font-size:9pt;color:rgb(60,60,60)">16 IO objects available to the ImageFileReader. </span></p><p style="margin:0px"><span style="font-family:monospace;font-size:9pt;color:rgb(60,60,60)"><br></span></p><p style="margin:0px"><span style="font-family:monospace;font-size:9pt;color:rgb(60,60,60)">I build with Qt/CMake</span></p><p style="margin:0px"><br></p><p style="margin:0px"><span style="font-family:monospace;font-size:9pt;color:rgb(60,60,60)">So what am I missing here?</span></p><p style="margin:0px">Thanks in advance!</p><p style="margin:0px">Soren</p><p style="margin:0px"><br></p><p style="margin:0px"><span style="font-family:monospace;font-size:9pt;color:rgb(60,60,60)"><br></span></p></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre></div>