diff --git a/Code/Common/otbImageList.txx b/Code/Common/otbImageList.txx index c83357d5943b55010a021aed1fbc9e3bc429909b..ae031df8b7c284a7f3c5e39487be6b8ece1569ff 100755 --- a/Code/Common/otbImageList.txx +++ b/Code/Common/otbImageList.txx @@ -37,7 +37,21 @@ ImageList<TImage> { if (it.Get()->GetSource()) { - it.Get()->GetSource()->UpdateOutputData(it.Get()); + it.Get()->GetSource()->PropagateRequestedRegion(it.Get()); + + // Check that the requested region lies within the largest possible region + if ( ! it.Get()->VerifyRequestedRegion() ) + { + // invalid requested region, throw an exception + itk::InvalidRequestedRegionError e(__FILE__, __LINE__); + e.SetLocation(ITK_LOCATION); + e.SetDataObject(it.Get()); + e.SetDescription("Requested region is (at least partially) outside the largest possible region."); + + throw e; + } + + it.Get()->GetSource()->UpdateOutputData(it.Get()); } } } @@ -49,30 +63,6 @@ ImageList<TImage> ::PropagateRequestedRegion() throw (itk::InvalidRequestedRegionError) { Superclass::PropagateRequestedRegion(); - for (ConstIterator it = this->Begin(); it!=this->End();++it) - { - if (it.Get()->GetUpdateMTime() < it.Get()->GetPipelineMTime() - || it.Get()->GetDataReleased() - || it.Get()->RequestedRegionIsOutsideOfTheBufferedRegion()) - { - if (it.Get()->GetSource()) - { - it.Get()->GetSource()->PropagateRequestedRegion(it.Get()); - } - } - - // Check that the requested region lies within the largest possible region - if ( ! it.Get()->VerifyRequestedRegion() ) - { - // invalid requested region, throw an exception - itk::InvalidRequestedRegionError e(__FILE__, __LINE__); - e.SetLocation(ITK_LOCATION); - e.SetDataObject(it.Get()); - e.SetDescription("Requested region is (at least partially) outside the largest possible region."); - - throw e; - } - } } template <class TImage>