I don't think HDR (high dynamic range) image format is directly supported in ITK yet.<div><div>You might need to some image format conversions in your code.</div><div>Or if you find a good way to import the HDR IO into ITK, that will be great.</div>
<div><br></div><div>-Xiaoxiao<br><br><div class="gmail_quote">On Fri, Oct 26, 2012 at 5:08 PM, Jianxu Chen <span dir="ltr"><<a href="mailto:jchen16@nd.edu" target="_blank">jchen16@nd.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<div><br></div><div>I have another question about the HDR file. The following code implements a simple operation, reading an HDR image file and writing it exactly to a new HDR image file.</div><div><br></div><div><div>
typedef int InternalPixelType;</div><div> const unsigned int Dimension = 3;</div><div> typedef itk::Image< InternalPixelType, Dimension > InternalImageType;</div><div> typedef unsigned char OutputPixelType;</div>
<div> typedef itk::Image< OutputPixelType, Dimension > OutputImageType;</div></div><div><br></div><div> </div><div> typedef itk::ImageFileReader< InternalImageType > ReaderType; </div><div> ReaderType::Pointer reader = ReaderType::New();<br>
reader->SetFileName( "input.hdr" );<span style="white-space:pre-wrap">                </span></div><div> reader->Update();</div><div><br></div><div><div> typedef itk::CastImageFilter< InternalImageType, OutputImageType > CastingFilterType; </div>
<div> CastingFilterType::Pointer caster = CastingFilterType::New();</div></div><div> caster->SetInput( reader->GetOutput() );</div><div> caster->Update();</div><div><br></div><div><br></div><div> typedef itk::ImageFileWriter<OutputImageType> WriterType; </div>
<div> WriterType::Pointer writer = WriterType::New();</div><div> writer->SetFileName( "output.hdr" );</div><div> writer->SetInput( caster->GetOutput() );</div><div> writer->Update();</div><div>
<br></div><div><br></div><div>However, the result HDR file is damaged, while the associated IMG file is fine. When I tried to open the HDR file in MRIcro, it showed that "Unknown image format, the file size is smaller than described in "Header information" panel. " If the result is written in TIFF format, it would be fine. Only the HDR file works incorrectly.</div>
<div><br></div><div>Could you give me some suggestion of how to fix this error? </div><div><br></div><div>Sincerely,</div><div>Jianxu Chen</div>
<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.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><br><br clear="all"><div><br></div>-- <br><div><br></div><div><br></div>---------------------------------------------<br><b>Xiaoxiao Liu</b>, Ph.D.<div><div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">R & D Engineer</span></font></div>
<div><div><a href="http://www.kitware.com/" target="_blank">Kitware Inc</a>.</div></div><div><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">Clifton Park, NY</span><div><div>Phone: (518) 881-4924 or <span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px">(518) 371-3971 x124</span></div>
<div><font face="Verdana, Arial, Helvetica, sans-serif"><span style="line-height:31px;font-size:x-small"><br></span></font></div></div></div></div></div><br>
</div></div>