X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FvvImageReader.txx;h=551e42626ba7313a84bb687f2fe8322c78d93962;hb=7d2e430f15406253a84dce12abb2c64643ebd79c;hp=02b2193367dd2d7b3107e286dfccc3d32fc946ee;hpb=ff84dae892027cd138b89b031c9d04eb520b2e51;p=clitk.git diff --git a/common/vvImageReader.txx b/common/vvImageReader.txx index 02b2193..551e426 100644 --- a/common/vvImageReader.txx +++ b/common/vvImageReader.txx @@ -86,6 +86,7 @@ void vvImageReader::UpdateWithDimAndInputPixelType() reader->SetFileName(*i); try { mImage->AddItkImage(reader->GetOutput()); + mImage->ComputeScalarRangeBase(reader->GetOutput()); } catch ( itk::ExceptionObject & err ) { std::cerr << "Error while reading " << mInputFilenames[0].c_str() << " " << err << std::endl; @@ -120,11 +121,10 @@ void vvImageReader::UpdateWithDimAndInputPixelType() filter->SetExtractionRegion(extractedRegion); filter->SetInput(reader->GetOutput()); filter->ReleaseDataFlagOn(); -#if ITK_VERSION_MAJOR == 4 filter->SetDirectionCollapseToSubmatrix(); -#endif try { mImage->AddItkImage(filter->GetOutput()); + mImage->ComputeScalarRangeBase(filter->GetOutput()); } catch ( itk::ExceptionObject & err ) { std::cerr << "Error while slicing " << mInputFilenames[0].c_str() << "(slice #" << mSlice << ") " << err << std::endl;