diff --git a/Modules/Core/ObjectList/include/otbImageList.h b/Modules/Core/ObjectList/include/otbImageList.h index 611d84a47a18efdb93a79085fa4a764968338ddf..4cb77bddec306437bccb05b45b81bdf71c9b9610 100644 --- a/Modules/Core/ObjectList/include/otbImageList.h +++ b/Modules/Core/ObjectList/include/otbImageList.h @@ -68,6 +68,8 @@ public: throw (itk::InvalidRequestedRegionError) ITK_OVERRIDE; void UpdateOutputData(void) ITK_OVERRIDE; + void SetRequestedRegion(const itk::DataObject * source); + protected: /** Constructor */ ImageList() {}; diff --git a/Modules/Core/ObjectList/include/otbImageList.txx b/Modules/Core/ObjectList/include/otbImageList.txx index 80b7276454eeabd2c2228857162e1e26a521a5f2..426a594027aee6a61bc0d529acde1f300d71b487 100644 --- a/Modules/Core/ObjectList/include/otbImageList.txx +++ b/Modules/Core/ObjectList/include/otbImageList.txx @@ -35,7 +35,15 @@ ImageList<TImage> Superclass::UpdateOutputData(); 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()->UpdateOutputData(it.Get()); + } + } } } @@ -52,6 +60,8 @@ ImageList<TImage> || it.Get()->GetDataReleased() || it.Get()->RequestedRegionIsOutsideOfTheBufferedRegion()) { + + std::cout<<"Requested region: "<<it.Get()<<" "<<it.Get()->GetRequestedRegion()<<std::endl; if (it.Get()->GetSource()) { it.Get()->GetSource()->PropagateRequestedRegion(it.Get()); @@ -72,6 +82,17 @@ ImageList<TImage> } } +template<class TImage> +void +ImageList<TImage> +::SetRequestedRegion(const itk::DataObject * source) +{ + for (ConstIterator it = this->Begin(); it != this->End(); ++it) + { + it.Get()->SetRequestedRegion(source); + } +} + template <class TImage> void ImageList<TImage>