<div dir="ltr"><div>To register the i/o factories we registered them in source code:<br><br><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"itkNrrdImageIOFactory.h"<br>
</span></div><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">NrrdImageIOFactory</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(0,0,0)">RegisterOneFactory</span><span style="color:rgb(0,0,0)">();<br>
... <br></span><span style="color:rgb(128,128,0)">typedef</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)">Image</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(128,0,128)">TYPE</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span>DIM<span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ImageType</span><span style="color:rgb(0,0,0)">;</span>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">typedef</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)">ImageFileReader</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ImageType</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)">ReaderType</span><span style="color:rgb(0,0,0)">;</span></pre>
<pre style="margin:0px;text-indent: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)">typename</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ReaderType</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)">reader</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)">ReaderType</span><span style="color:rgb(0,0,0)">::</span>New<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)">reader</span><span style="color:rgb(0,0,0)">-></span>SetFileName<span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">fileName</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)">reader</span><span style="color:rgb(0,0,0)">-></span>Update<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)">typename</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ImageType</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)">image</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)">reader</span><span style="color:rgb(0,0,0)">-></span>GetOutput<span style="color:rgb(0,0,0)">();<br>
<br></span></pre><pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,0,0)">This worked for the reader but still failed when we tried to write a NRRD file.<br><br><br></span></pre><br><span style="color:rgb(0,0,0)"><br>
</span></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 10, 2013 at 3:21 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>If you do not use cmake, the i/o factories are not automatically registered.<br><br></div>I'll have to find the doc that describes what to do.<br>
<br></div>Or perhaps someone else will chime in...<br>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 9, 2013 at 4:50 PM, Karl Diedrich <span dir="ltr"><<a href="mailto:karl.diedrich@azeresearch.com" target="_blank">karl.diedrich@azeresearch.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">We are using another build system but we are calling other ITK functions and they are working.<div><br>
</div>
</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 9, 2013 at 12:11 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Are you building your app with CMake? If so, does, your CMakeLists.txt file contain<div><br><div><div> FIND_PACKAGE(ITK REQUIRED)</div>
<div> INCLUDE(${ITK_USE_FILE})</div></div><div><br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote"><div><div>On Thu, May 9, 2013 at 12:05 PM, Karl Diedrich <span dir="ltr"><<a href="mailto:karl.diedrich@azeresearch.com" target="_blank">karl.diedrich@azeresearch.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<div dir="ltr">I was writing NRRD images with code like this in an earlier version 3.20 of ITK<div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span>::</span><span style="color:rgb(128,0,128)">Image</span><span><</span><span style="color:rgb(128,0,128)">short</span><span>,</span><span style="color:rgb(192,192,192)"> </span>3<span>></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ImageType</span><span>;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span>::</span><span style="color:rgb(128,0,128)">ImageFileWriter</span><span><</span><span style="color:rgb(128,0,128)">ImageType</span><span>></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">WriterType</span><span>;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">typename</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">WriterType</span><span>::</span><span style="color:rgb(128,0,128)">Pointer</span><span style="color:rgb(192,192,192)"> </span><span>writer</span><span style="color:rgb(192,192,192)"> </span><span>=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">WriterType</span><span>::</span>New<span>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span>writer</span><span>-></span>SetInput<span>(</span><span>image</span><span>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span>writer</span><span>-></span>SetFileName<span>("output.nrrd"</span><span>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">try</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span>writer</span><span>-></span>Update<span>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">catch</span><span style="color:rgb(192,192,192)"> </span><span>(</span><span style="color:rgb(128,0,128)">itk</span><span>::</span><span style="color:rgb(128,0,128)">ExceptionObject</span><span style="color:rgb(192,192,192)"> </span><span>e</span><span>)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span>{</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)">std</span><span>::</span>cerr<span style="color:rgb(192,192,192)"> </span><span><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"Error writing file "</span><span style="color:rgb(192,192,192)"> </span><span><<</span><span style="color:rgb(192,192,192)"> "output.nrrd" </span><span><<</span><span style="color:rgb(192,192,192)"> </span><span>e</span><span style="color:rgb(192,192,192)"> </span><span><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">std</span><span>::</span>endl<span>;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span>}</span></pre><div><br></div><div>And in ITK 4.3.1 I get the error </div><div><br></div>
<div><div>Error writing file output.nrrd</div><div>itk::ExceptionObject (0x7fff106e2d00)</div><div>Location: "void itk::ImageFileWriter<TInputImage>::Write() [with TInputImage = itk::Image<short int, 2u>]" </div>
<div>File: ../../linux/include/ITK-4.3/itkImageFileWriter.hxx</div><div>Line: 152</div><div>Description: Could not create IO object for file centerdot.nrrd</div><div> Tried to create one of the following:</div><div> You probably failed to set a file suffix, or</div>
<div> set the suffix to an unsupported type.</div></div><div><br></div><div>I also tried writing a 2D image with the filename output.png and output.jpg but got the same error.</div><span><font color="#888888"><div>
<br></div><div>
Karl </div><div><br></div><div><br></div>-- <br><font color="#888888">Karl Diedrich, Ph.D.<br>Principal Engineer<br>----------------------------------------<br>
AZE Research and Development<br>1 Broadway, 14th floor<br>Cambridge, MA 02142<br>Tel: <a value="+16174751502">+1 (617) 475-1502</a><br><a href="http://www.azeofamerica.com/" target="_blank">http://www.azeresearch.com/</a></font>
</font></span></div></div>
<br></div></div>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">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" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><font color="#888888">Karl Diedrich, Ph.D.<br>Principal Engineer<br>----------------------------------------<br>
AZE Research and Development<br>1 Broadway, 14th floor<br>Cambridge, MA 02142<br>Tel: <a value="+16174751502">+1 (617) 475-1502</a><br><a href="http://www.azeofamerica.com/" target="_blank">http://www.azeresearch.com/</a></font>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><font color="#888888">Karl Diedrich, Ph.D.<br>Principal Engineer<br>----------------------------------------<br>
AZE Technology<br>1 Broadway, 14th floor<br>Cambridge, MA 02142<br>Tel: <a value="+16174751502">+1 (617) 475-1502</a><br><a href="http://www.azeofamerica.com/" target="_blank">http://www.azetech.com/</a></font></div>
</div>