diff --git a/Code/BasicFilters/otbImageToPointSetFilter.txx b/Code/BasicFilters/otbImageToPointSetFilter.txx index 066d3d696537bb62f88cbefad5d66679c15a466d..ab22fa25c7006ba0dd960e4b783e430e5899414a 100644 --- a/Code/BasicFilters/otbImageToPointSetFilter.txx +++ b/Code/BasicFilters/otbImageToPointSetFilter.txx @@ -87,6 +87,7 @@ const typename ImageToPointSetFilter<TInputImage,TOutputPointSet>::InputImageTyp ImageToPointSetFilter<TInputImage,TOutputPointSet> ::GetInput(unsigned int idx) { + return dynamic_cast<const InputImageType*> (this->ProcessObjectType::GetInput(idx)); } @@ -97,8 +98,11 @@ ImageToPointSetFilter<TInputImage,TOutputPointSet> template <class TInputImage, class TOutputPointSet> const typename ImageToPointSetFilter<TInputImage,TOutputPointSet>::InputImageType * ImageToPointSetFilter<TInputImage,TOutputPointSet> -::GetInput() +::GetInput(void) { + if(this->GetNumberOfInputs() < 1) + return 0; + return dynamic_cast<const InputImageType*> (this->ProcessObjectType::GetInput(0)); }