<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Nice work in tracking this down! I have done some similar 1GB reading chunks in MetaImageIO as well due the Apple OSX not being able to read more then 2GB with one call.<div><br></div><div>It looks like there may be some more subtle problems with large file in the ImageIO. There looks like there are some usages of type long, which is like incorrect, and there number of pixel is type int in some places too. A close review of the file with these issues in mind is needed.</div><div><br></div><div><div>Can you please log it into the bug tracker. Follow the instruction in the "Entering a bug" in the following document:</div><div><br></div><div><a href="http://www.itk.org/Wiki/ITK_Procedure_for_Contributing_Bug_Fixes">http://www.itk.org/Wiki/ITK_Procedure_for_Contributing_Bug_Fixes</a></div><div><br></div><div>Thanks,</div><div>Brad</div></div><div><div><br><div><div>On Jan 13, 2010, at 8:23 AM, <a href="mailto:Robert.Atwood@diamond.ac.uk">Robert.Atwood@diamond.ac.uk</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div> Hi Alex et. al:<br>I developed a fix for the problem in itkAnalyzeImageIO.cxx , it seems to<br>work for me both with compressed and uncompressed .img files<br><br><br>I'm not sure if it strictly satisfies code style requirements for itk<br>but if anyone could help it satisfy these then perhaps it could be<br>implemented? <br><br>The fixes:<br>1. Test the return value of gzread to ensure correct data amount is read<br>and no other error has occurred. Throws exception if the return value is<br>0 or -1.<br><br>2. Only read a chunk of size < (2^32 - 2 ) at a time (defined by a macro<br>.. ) . Loop through the chunks if the file is bigger than this.<br><br>I've tested this with small (10Mb) chunk size on compressed .img.gz and<br>uncompressed .img files of the 5Gb output (uncompressed) from Alex's<br>ImageFill_Cube and the results appear correct. <br><br>I hope this helps!<br><br>Robert <br><br><br><br>-- <br><br>This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.<br><br>Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. <br><br>Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.<br><br>Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom<br><br><br><br><br><br><br><br><br><br><span><itkAnalyzeImageIO.cxx></span><span><ATT00001..txt></span></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">========================================================</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Bradley Lowekamp<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="font-family: Arial; "><span class="Apple-style-span" style="font-family: Arial; ">Lockheed Martin </span></span></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Contractor for</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Office of High Performance Computing and Communications</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">National Library of Medicine<span class="Apple-converted-space"> </span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span></span>
</div>
<br></div></div></body></html>