Skip to content
Snippets Groups Projects
Commit fba32fa2 authored by Thomas Feuvrier's avatar Thomas Feuvrier
Browse files

Mise a jour calcule compoentsize.

parent 459ee8f2
No related branches found
No related tags found
No related merge requests found
...@@ -169,19 +169,12 @@ ImageFileReader<TOutputImage> ...@@ -169,19 +169,12 @@ ImageFileReader<TOutputImage>
// itkImageIOBase are protected. // itkImageIOBase are protected.
//THOMAS : PB with big file : "unsigned int" is not adapted. We use streamoff type. //THOMAS : PB with big file : "unsigned int" is not adapted. We use streamoff type.
// unsigned int componentSize = this->m_ImageIO->GetImageSizeInBytes(); // unsigned int componentSize = this->m_ImageIO->GetImageSizeInBytes();
std::streamoff componentSize; /* componentSize = static_cast<std::streamoff>(this->m_ImageIO->GetImageSizeInPixels());
componentSize = static_cast<std::streamoff>(this->m_ImageIO->GetImageSizeInPixels()); componentSize = componentSize * static_cast<std::streamoff>(this->m_ImageIO->GetNumberOfComponents()); */
componentSize = componentSize * static_cast<std::streamoff>(this->m_ImageIO->GetNumberOfComponents());
// PB : the GetComponentSize() method of the itkImageIOBase class is protected. // PB : the GetComponentSize() method of the itkImageIOBase class is protected.
// duplicated this method in this class (very BAD) // duplicated this method in this class (very BAD)
componentSize = componentSize * static_cast<std::streamoff>(this->GetComponentSize());
for(std::streamoff i=0;i<static_cast<std::streamoff>(this->m_ImageIO->GetNumberOfDimensions());++i) std::streamoff nbBytes = static_cast<std::streamoff>(this->GetComponentSize())*static_cast<std::streamoff>(region.GetNumberOfPixels());
{
componentSize = componentSize/static_cast<std::streamoff>(this->m_ImageIO->GetDimensions(i));
}
std::streamoff nbBytes = componentSize*static_cast<std::streamoff>(region.GetNumberOfPixels());
otbMsgDevMacro(<<"NbBytes "<<nbBytes); otbMsgDevMacro(<<"NbBytes "<<nbBytes);
otbMsgDevMacro(<< "Buffer conversion required from: " otbMsgDevMacro(<< "Buffer conversion required from: "
...@@ -191,8 +184,6 @@ ImageFileReader<TOutputImage> ...@@ -191,8 +184,6 @@ ImageFileReader<TOutputImage>
char * loadBuffer = new char[nbBytes]; char * loadBuffer = new char[nbBytes];
this->m_ImageIO->Read(loadBuffer); this->m_ImageIO->Read(loadBuffer);
this->DoConvertBuffer(loadBuffer, region.GetNumberOfPixels()); this->DoConvertBuffer(loadBuffer, region.GetNumberOfPixels());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment