[Insight-developers] Problem with large image file

Thomas Feuvrier thomas.feuvrier at c-s.cnes.fr
Fri Sep 14 05:14:45 EDT 2007


Dear ITK users

I am an OTB developer and I am trying to read very large image file with 
itk::ImageFileReader.
When I try to read such images, an error is generated at line 384 of the 
itk::ImageFileReader, in the instruction m_ImageIO->GetImageSizeInBytes().

Indeed, the itk::ImageIOBase::GetImageSizeInBytes() method (which calls 
this->GetImageSizeInComponents() * this->GetComponentSize(), ... ) 
returns an "unsigned int" value. For large image file, "unsigned int" is 
not well suited (4 bytes).
The solution would be to replace "unsigned int" by  std::streamoff (8 
bytes) or possibly std::streampos (16 bytes).
Is there a way to bypass this problem ?

Best regards,
Thomas



More information about the Insight-developers mailing list