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"><<a href="mailto:daviddoria@gmail.com">daviddoria@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>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 "itkImage.h"</div><div>#include "itkImageFileReader.h"</div><div>#include "itkImageFileWriter.h"</div><div><br></div><div>int main(int argc, char *argv[])</div><div>
{</div><div> if(argc < 2)</div><div> {</div><div> std::cerr << "Required: filename" << 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< unsigned char, 2 > ImageType;</div><div><br></div><div> typedef itk::ImageFileReader<ImageType> ReaderType;</div><div> ReaderType::Pointer reader = ReaderType::New();</div>
<div> reader->SetFileName(inputFilename.c_str());</div><div> reader->Update();</div><div><br></div><div> typedef itk::ImageFileWriter<ImageType> WriterType;</div><div> WriterType::Pointer writer = WriterType::New();</div>
<div> writer->SetInput(reader->GetOutput());</div><div> writer->SetFileName("output.png");</div><div> writer->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>