<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 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 class="h5">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 class="h5">
<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 class="HOEnZb"><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>