diff --git a/Code/Projections/otbGenericRSResampleImageFilter.h b/Code/Projections/otbGenericRSResampleImageFilter.h index eeb8646556bc43b35598f8e1bac0be7bb257b59b..abd3dc85e6678266aeb309637df6bf76c0daf343 100644 --- a/Code/Projections/otbGenericRSResampleImageFilter.h +++ b/Code/Projections/otbGenericRSResampleImageFilter.h @@ -213,7 +213,16 @@ public: otbGetObjectMemberConstMacro(Transform,AverageElevation,double); /** Useful to set the output parameters from an existing image*/ - void SetOutputParametersFromImage(const ImageBaseType * image); + template <class TImageType> void SetOutputParametersFromImage(const TImageType * image) + { + this->SetOutputOrigin ( image->GetOrigin() ); + this->SetOutputSpacing ( image->GetSpacing() ); + this->SetOutputStartIndex ( image->GetLargestPossibleRegion().GetIndex() ); + this->SetOutputSize ( image->GetLargestPossibleRegion().GetSize() ); + this->SetOutputProjectionRef(image->GetProjectionRef()); + this->SetOutputKeywordList(image->GetImageKeywordlist()); + } + /** Useful to set the output parameters from an existing image*/ void SetOutputParametersFromMap(const std::string map, const SpacingType& spacing); diff --git a/Code/Projections/otbGenericRSResampleImageFilter.txx b/Code/Projections/otbGenericRSResampleImageFilter.txx index a668047ffaee7c75999e85f6130e86d04d4fad96..8846e140e8ac3fb4ef7274b0e5a1ba38ce2b67bb 100644 --- a/Code/Projections/otbGenericRSResampleImageFilter.txx +++ b/Code/Projections/otbGenericRSResampleImageFilter.txx @@ -222,24 +222,6 @@ GenericRSResampleImageFilter<TInputImage, TOutputImage> m_RpcEstimationUpdated = true; } -/** - * Method used to copy the parameters of the input image - * - */ -template <class TInputImage, class TOutputImage> -void -GenericRSResampleImageFilter<TInputImage, TOutputImage> -::SetOutputParametersFromImage(const ImageBaseType * image) -{ - const InputImageType * src = dynamic_cast<const InputImageType*>(image); - - this->SetOutputOrigin ( src->GetOrigin() ); - this->SetOutputSpacing ( src->GetSpacing() ); - this->SetOutputStartIndex ( src->GetLargestPossibleRegion().GetIndex() ); - this->SetOutputSize ( src->GetLargestPossibleRegion().GetSize() ); - this->SetOutputProjectionRef(src->GetProjectionRef()); - this->SetOutputKeywordList(src->GetImageKeywordlist()); -} /** * Method used to copy the parameters of the input image *