Skip to content
Snippets Groups Projects
Commit ad5a183b authored by Patrick Imbo's avatar Patrick Imbo
Browse files

ENH: template the SetOutputParametersFromImage method for GenericRSResampleImageFilter

parent 3e569b4f
Branches
Tags
No related merge requests found
......@@ -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);
......
......@@ -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
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment