MantisBT - ITK
View Issue Details
0005710ITKpublic2007-09-14 09:032008-01-23 14:56
Luis Ibanez 
 
normalminoralways
closedfixed 
 
 
0005710: ImageIOBase doesn't support large files
ImageIOBase uses the type "unsigned int" in methods that manage file length.
http://www.itk.org/mailman/private/insight-developers/2007-September/009575.html [^]
http://www.itk.org/mailman/private/insight-developers/2007-September/009576.html [^]
No tags attached.
Issue History
2007-09-14 09:03Luis IbanezNew Issue
2007-09-15 18:46Luis IbanezNote Added: 0008993
2008-01-23 14:56Luis IbanezStatusnew => closed
2008-01-23 14:56Luis IbanezNote Added: 0010244
2008-01-23 14:56Luis IbanezResolutionopen => fixed

Notes
(0008993)
Luis Ibanez   
2007-09-15 18:46   
A fix attempt has been committed to the CVS repository:

http://www.itk.org/cgi-bin/viewcvs.cgi/Code/IO/itkImageIOBase.h?root=Insight&sortby=date&r2=1.47&r1=1.46 [^]
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/IO/itkImageIOBase.cxx?root=Insight&sortby=date&r2=1.70&r1=1.69 [^]
(0010244)
Luis Ibanez   
2008-01-23 14:56   
The issue of type was solved.

However, this didn't solved the original need of the user, since they
were actually needing to access a subregion of the image, not the entire
image:


email from Thomas Feuvrier: (9/19/07)

In fact, to do the streaming reading in the otb::ImageFileReader, we
must calcule the size in Byte of a specific region, not for all
dimension image.
So we can't use directly the ImageIOBase::GetImageSizeInBytes() method
because it call ImageIOBase::GetImageSizeInComponents() wich call
this->GetImageSizeInPixels().
And the ImageIOBase::GetComponentSize() method is protected, not public.
So we can't write the line :
   std::streamoff nbBytes;
   nbBytes = static_cast<std::streamoff>(region.GetNumberOfPixels())
* this->m_ImageIO->GetNumberOfComponents() * this->GetComponentSize()

To solve me problem, I find this solution :
   nbBytes = this->m_ImageIO->GetImageSizeInBytes() /
this->m_ImageIO->GetImageSizeInPixels() *
static_cast<std::streamoff>(region.GetNumberOfPixels());