MantisBT - ITK
View Issue Details
0010135ITKpublic2010-01-13 09:072010-10-21 12:31
Robert Atwood 
Bradley Lowekamp 
normalmajoralways
closedfixed 
ITK-3-16 
ITK-3-18 
0010135: AnalyzeIO does not read files larger than 4Gb correctly
If an Analyze file greater than 2^32 bytes is read , the tail of the file is not read.
 

This is due to casting the required data size to (unsigned int) and using ::gzread() to read all Analyze files, even if not compressed. Since gzread() only accepts (unsigned int) for the required data size, a single operation cannot read a file greater than 2^32 - 2 correctly .



Observed by Oleksandr Dzyubak on the users' list .

Olexandr's programs ImageFill_cube.cxx and JustReadWrite.cxx (in the tgz file) provide a test. If
ImageFill_cube is used to create a test file in Analyze (.hdr) format, and JustReadWrite is used to read this and write either to Analyze or MetaImage format, the data with z>104 is all zeros. If the image is created in .mhd format, then JustReadWrite produces correct results in .hdr or .mhd format.



The attached itkAnalyzeImageIO.cxx (in the tgz file) contains my workaround for this , I've tested with uncompressed and compressed output from ImageFill_cube in Analyze format with correct results.
 


No tags attached.
tgz TestAnalyzeRead.tgz (13,308) 2010-01-13 09:07
https://public.kitware.com/Bug/file/2759/TestAnalyzeRead.tgz
Issue History
2010-01-13 09:07Robert AtwoodNew Issue
2010-01-13 09:07Robert AtwoodFile Added: TestAnalyzeRead.tgz
2010-01-15 09:55Bradley LowekampStatusnew => assigned
2010-01-15 09:55Bradley LowekampAssigned To => Bradley Lowekamp
2010-01-27 14:36Bradley LowekampNote Added: 0019338
2010-06-22 15:21Bradley LowekampNote Added: 0021132
2010-06-22 15:21Bradley LowekampStatusassigned => resolved
2010-06-22 15:21Bradley LowekampFixed in Version => ITK-3-18
2010-06-22 15:21Bradley LowekampResolutionopen => fixed
2010-10-21 12:31Gabe HartStatusresolved => closed

Notes
(0019338)
Bradley Lowekamp   
2010-01-27 14:36   
committed patch:
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/IO/itkAnalyzeImageIO.cxx.diff?cvsroot=Insight&r1=1.102&r2=1.103 [^]
(0021132)
Bradley Lowekamp   
2010-06-22 15:21   
The patch appears to have solve the issue.