Hi Dan,<br><br>After changing hdr to png, the following is the feedback I get. <br><br>"This application has requested the <span class="il">Runtime</span> to terminate it in an unusual way. Please contact the application's support team for more information." <br>
<br>My inputs are png files. I have no idea how to change the file type of the outputs since I am following the examples (DeformableRegistration1.cxx).<br><br>Thanks,<br>Stephen<br><br><div class="gmail_quote">On Wed, Mar 31, 2010 at 10:53 PM, Dan Mueller <span dir="ltr"><<a href="mailto:dan.muel@gmail.com">dan.muel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Stephen,<br>
<br>
The error may be caused because the PNG file format does not support<br>
your image type. What is the pixel type of your output image?<br>
<br>
As can be seen here<br>
<a href="http://www.itk.org/Wiki/ITK_File_Formats" target="_blank">http://www.itk.org/Wiki/ITK_File_Formats</a><br>
PNG supports unsigned char, unsigned short, RGB, and RGBA.<br>
<br>
If your image type is float or signed short, you will need to cast/rescale.<br>
<br>
In the future, consider posting the exact error message you receive.<br>
Statements like "the program won't run" are not very helpful for<br>
diagnosing the issue :P As shown in many of the ITK examples, you can<br>
print exception messages like this:<br>
<br>
try<br>
{<br>
myFilter->Update();<br>
}<br>
catch( itk::ExceptionObject & err )<br>
{<br>
std::cout << "ExceptionObject caught !" << std::endl;<br>
std::cout << err << std::endl;<br>
return EXIT_FAILURE;<br>
}<br>
<br>
HTH<br>
<br>
Cheers, Dan<br>
<div><div></div><div class="h5"><br>
On 31 March 2010 22:46, Stephen Yip <<a href="mailto:stephen.fyip1@gmail.com">stephen.fyip1@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I know I have asked the similar question before.<br>
><br>
> I tried to change "hdr" to "png" or some other file type. But the program<br>
> wouldn't run at all. I am not an expert of c++. I wonder how I may change<br>
> the output file in the DeformableRegistration1.cxx code.<br>
><br>
> I did change "hdr" to "png"...the program wouldn't run...<br>
><br>
> writer = itk::ImageFileWriter<ImageType>::New();<br>
> std::string ofn="fixed.hdr";<br>
> writer->SetFileName(ofn.c_str());<br>
> writer->SetInput(registrationFilter->GetFixedImage() );<br>
> writer->Write();<br>
><br>
> ofn="moving.hdr";<br>
> itk::ImageFileWriter<ImageType>::Pointer writer2;<br>
> writer2 = itk::ImageFileWriter<ImageType>::New();<br>
><br>
> Thank you,<br>
> stephen<br>
</div></div></blockquote></div><br>