diff --git a/Code/Common/otbImageList.h b/Code/Common/otbImageList.h old mode 100755 new mode 100644 index 287eb4e75efa60a9c6fc3c54fa653e8d2bf26f23..6b46f9a8c1ba2aa21decfa4c4811233702da4385 --- a/Code/Common/otbImageList.h +++ b/Code/Common/otbImageList.h @@ -59,6 +59,7 @@ public: * Update images in the list. */ virtual void UpdateOutputInformation(void); + virtual void PropagateRequestedRegion(void) throw (itk::InvalidRequestedRegionError); virtual void UpdateOutputData(void); diff --git a/Code/Common/otbImageList.txx b/Code/Common/otbImageList.txx old mode 100755 new mode 100644 index 6beb48ec474e6ea7a9d94557c6ef25ca836e3cf6..c83357d5943b55010a021aed1fbc9e3bc429909b --- a/Code/Common/otbImageList.txx +++ b/Code/Common/otbImageList.txx @@ -29,7 +29,6 @@ ImageList<TImage> ::UpdateOutputData() { Superclass::UpdateOutputData(); - for (ConstIterator it = this->Begin(); it!=this->End();++it) { if (it.Get()->GetUpdateMTime() < it.Get()->GetPipelineMTime() @@ -44,6 +43,37 @@ ImageList<TImage> } } +template <class TImage> +void +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> void