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
Branches
Tags
No related merge requests found
...@@ -59,7 +59,8 @@ namespace otb ...@@ -59,7 +59,8 @@ namespace otb
* \ingroup MultiThreaded * \ingroup MultiThreaded
*/ */
template <class TInputImage, class TOutputImage, class TBoundaryCondition = 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 : class ITK_EXPORT ConvolutionImageFilter :
public itk::ImageToImageFilter<TInputImage, TOutputImage> public itk::ImageToImageFilter<TInputImage, TOutputImage>
{ {
...@@ -93,7 +94,8 @@ public: ...@@ -93,7 +94,8 @@ public:
typedef typename InputImageType::RegionType InputImageRegionType; typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename OutputImageType::RegionType OutputImageRegionType; typedef typename OutputImageType::RegionType OutputImageRegionType;
typedef typename InputImageType::SizeType InputSizeType; typedef typename InputImageType::SizeType InputSizeType;
typedef typename itk::Array<InputRealType> ArrayType; typedef TFilterPrecision FilterPrecisionType;
typedef typename itk::Array<FilterPrecisionType> ArrayType;
typedef TBoundaryCondition BoundaryConditionType; typedef TBoundaryCondition BoundaryConditionType;
/** Set the radius of the neighborhood of the filter */ /** Set the radius of the neighborhood of the filter */
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
namespace otb namespace otb
{ {
template <class TInputImage, class TOutputImage, class TBoundaryCondition> template <class TInputImage, class TOutputImage, class TBoundaryCondition, class TFilterPrecision>
ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition> ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition, TFilterPrecision>
::ConvolutionImageFilter() ::ConvolutionImageFilter()
{ {
m_Radius.Fill(1); m_Radius.Fill(1);
...@@ -42,9 +42,9 @@ ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition> ...@@ -42,9 +42,9 @@ ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>
m_NormalizeFilter = false; m_NormalizeFilter = false;
} }
template <class TInputImage, class TOutputImage, class TBoundaryCondition> template <class TInputImage, class TOutputImage, class TBoundaryCondition, class TFilterPrecision>
void void
ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition> ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition, TFilterPrecision>
::GenerateInputRequestedRegion() throw (itk::InvalidRequestedRegionError) ::GenerateInputRequestedRegion() throw (itk::InvalidRequestedRegionError)
{ {
// call the superclass' implementation of this method // call the superclass' implementation of this method
...@@ -93,9 +93,9 @@ ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition> ...@@ -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 void
ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition> ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition, TFilterPrecision>
::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, ::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
int threadId) int threadId)
{ {
...@@ -158,9 +158,9 @@ ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition> ...@@ -158,9 +158,9 @@ ConvolutionImageFilter<TInputImage, TOutputImage, TBoundaryCondition>
/** /**
* Standard "PrintSelf" method * Standard "PrintSelf" method
*/ */
template <class TInputImage, class TOutput, class TBoundaryCondition> template <class TInputImage, class TOutput, class TBoundaryCondition, class TFilterPrecision>
void void
ConvolutionImageFilter<TInputImage, TOutput, TBoundaryCondition> ConvolutionImageFilter<TInputImage, TOutput, TBoundaryCondition, TFilterPrecision>
::PrintSelf(std::ostream& os, itk::Indent indent) const ::PrintSelf(std::ostream& os, itk::Indent indent) const
{ {
Superclass::PrintSelf(os, indent); 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