Skip to content
Snippets Groups Projects
Commit db841d16 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Adding a TFilterPrecision template parameter so that the type of the...

BUG: Adding a TFilterPrecision template parameter so that the type of the convolution filter does not depend on the type of the input pixel real numeric traits
parent da3ac234
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,8 @@ namespace otb
* \ingroup MultiThreaded
*/
template <class TInputImage, class TOutputImage, class TBoundaryCondition =
itk::ZeroFluxNeumannBoundaryCondition<TInputImage> >
itk::ZeroFluxNeumannBoundaryCondition<TInputImage>,
class TFilterPrecision = typename itk::NumericTraits<typename TInputImage::InternalPixelType>::RealType >
class ITK_EXPORT ConvolutionImageFilter :
public itk::ImageToImageFilter<TInputImage, TOutputImage>
{
......@@ -93,7 +94,8 @@ public:
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename OutputImageType::RegionType OutputImageRegionType;
typedef typename InputImageType::SizeType InputSizeType;
typedef typename itk::Array<InputRealType> ArrayType;
typedef TFilterPrecision FilterPrecisionType;
typedef typename itk::Array<FilterPrecisionType> ArrayType;
typedef TBoundaryCondition BoundaryConditionType;
/** Set the radius of the neighborhood of the filter */
......
......@@ -32,8 +32,8 @@
namespace otb
{
template <class TInputImage, class TOutputImage, class TBoundaryCondition>
ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>
template <class TInputImage, class TOutputImage, class TBoundaryCondition, class TFilterPrecision>
ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition, TFilterPrecision>
::ConvolutionImageFilter()
{
m_Radius.Fill(1);
......@@ -42,9 +42,9 @@ ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>
m_NormalizeFilter = false;
}
template <class TInputImage, class TOutputImage, class TBoundaryCondition>
template <class TInputImage, class TOutputImage, class TBoundaryCondition, class TFilterPrecision>
void
ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>
ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition, TFilterPrecision>
::GenerateInputRequestedRegion() throw (itk::InvalidRequestedRegionError)
{
// call the superclass' implementation of this method
......@@ -93,9 +93,9 @@ ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>
}
}
template<class TInputImage, class TOutputImage, class TBoundaryCondition>
template<class TInputImage, class TOutputImage, class TBoundaryCondition, class TFilterPrecision>
void
ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>
ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition, TFilterPrecision>
::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
int threadId)
{
......@@ -158,9 +158,9 @@ ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>
/**
* Standard "PrintSelf" method
*/
template <class TInputImage, class TOutput, class TBoundaryCondition>
template <class TInputImage, class TOutput, class TBoundaryCondition, class TFilterPrecision>
void
ConvolutionImageFilter<TInputImage, TOutput, TBoundaryCondition>
ConvolutionImageFilter<TInputImage, TOutput, TBoundaryCondition, TFilterPrecision>
::PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os, indent);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment