Code looks fine to me. Could be some pixel type issues. Try putting the Update calls in try/catch blocks to catch any exceptions. <div><br></div><div><br><div class="gmail_quote">On Wed, Mar 16, 2011 at 8:47 AM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>I recently switched to ITK 3.2 while waiting for some problems with master to be resolved. With this very simple example, 3.2 seems to produce an all black image, where I would expect the output to be the same as the input (at least the first channel). There are no errors or warnings. Are there any known problems with this?</div>

<div><br></div><div>#include &quot;itkImage.h&quot;</div><div>#include &quot;itkImageFileReader.h&quot;</div><div>#include &quot;itkImageFileWriter.h&quot;</div><div><br></div><div>int main(int argc, char *argv[])</div><div>

{</div><div>  if(argc &lt; 2)</div><div>    {</div><div>    std::cerr &lt;&lt; &quot;Required: filename&quot; &lt;&lt; std::endl;</div><div><br></div><div>    return EXIT_FAILURE;</div><div>    }</div><div>  std::string inputFilename = argv[1];</div>

<div><br></div><div>  typedef itk::Image&lt; unsigned char, 2 &gt;  ImageType;</div><div><br></div><div>  typedef itk::ImageFileReader&lt;ImageType&gt; ReaderType;</div><div>  ReaderType::Pointer reader = ReaderType::New();</div>

<div>  reader-&gt;SetFileName(inputFilename.c_str());</div><div>  reader-&gt;Update();</div><div><br></div><div>  typedef itk::ImageFileWriter&lt;ImageType&gt; WriterType;</div><div>  WriterType::Pointer writer = WriterType::New();</div>

<div>  writer-&gt;SetInput(reader-&gt;GetOutput());</div><div>  writer-&gt;SetFileName(&quot;output.png&quot;);</div><div>  writer-&gt;Update();</div><div><br></div><div>  return EXIT_SUCCESS;</div><div>}</div><div><br></div>

Thanks,<br><font color="#888888"><br>David<br>
</font><br>_____________________________________<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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><br></div>