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&lt; InternalPixelType, Dimension &gt;  InternalImageType;</div><div>    typedef unsigned char OutputPixelType;</div>
<div>    typedef itk::Image&lt; OutputPixelType, Dimension &gt; OutputImageType;</div></div><div><br></div><div> </div><div>   typedef  itk::ImageFileReader&lt; InternalImageType &gt; ReaderType; </div><div>   ReaderType::Pointer reader = ReaderType::New();<br>
   reader-&gt;SetFileName( &quot;input.hdr&quot; );<span class="Apple-tab-span" style="white-space:pre">                </span></div><div>   reader-&gt;Update();</div><div><br></div><div><div>   typedef  itk::CastImageFilter&lt; InternalImageType, OutputImageType &gt; CastingFilterType; </div>
<div>   CastingFilterType::Pointer caster = CastingFilterType::New();</div></div><div>   caster-&gt;SetInput( reader-&gt;GetOutput() );</div><div>   caster-&gt;Update();</div><div><br></div><div><br></div><div>   typedef itk::ImageFileWriter&lt;OutputImageType&gt;    WriterType; </div>
<div>   WriterType::Pointer writer = WriterType::New();</div><div>   writer-&gt;SetFileName( &quot;output.hdr&quot; );</div><div>   writer-&gt;SetInput( caster-&gt;GetOutput() );</div><div>   writer-&gt;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 &quot;Unknown image format, the file size is smaller than described in &quot;Header information&quot; panel. &quot; 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>