ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkConvolutionImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkConvolutionImageFilter_h
19 #define itkConvolutionImageFilter_h
20 
22 
23 #include "itkProgressAccumulator.h"
25 
26 namespace itk
27 {
64 template< typename TInputImage, typename TKernelImage = TInputImage, typename TOutputImage = TInputImage >
65 class ITK_TEMPLATE_EXPORT ConvolutionImageFilter :
66  public ConvolutionImageFilterBase< TInputImage, TKernelImage, TOutputImage >
67 {
68 public:
69  ITK_DISALLOW_COPY_AND_ASSIGN(ConvolutionImageFilter);
70 
75 
77  itkNewMacro(Self);
78 
81 
83  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
84 
85  using InputImageType = TInputImage;
86  using OutputImageType = TOutputImage;
87  using KernelImageType = TKernelImage;
88  using InputPixelType = typename InputImageType::PixelType;
89  using OutputPixelType = typename OutputImageType::PixelType;
90  using KernelPixelType = typename KernelImageType::PixelType;
100 
101 protected:
102  ConvolutionImageFilter() = default;
103  ~ConvolutionImageFilter() override = default;
104 
112  void GenerateInputRequestedRegion() override;
113 
115  void GenerateData() override;
116 
119  bool GetKernelNeedsPadding() const;
120 
122  KernelSizeType GetKernelPadSize() const;
123 
125  template< typename TImage >
126  KernelSizeType GetKernelRadius(const TImage *kernelImage) const;
127 
128 private:
129  template< typename TImage >
130  void ComputeConvolution( const TImage *kernelImage,
131  ProgressAccumulator *progress );
132 };
133 }
134 
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "itkConvolutionImageFilter.hxx"
137 #endif
138 
139 #endif
typename KernelImageType::PixelType KernelPixelType
typename OutputImageType::IndexType OutputIndexType
typename KernelImageType::RegionType KernelRegionType
typename InputImageType::RegionType InputRegionType
typename KernelImageType::SizeType KernelSizeType
typename KernelImageType::IndexType KernelIndexType
Abstract base class for the convolution image filters.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
typename OutputImageType::PixelType OutputPixelType
Base class for all process objects that output image data.
typename OutputImageType::SizeType OutputSizeType
typename InputImageType::PixelType InputPixelType
TOutputImage OutputImageType
Facilitates progress reporting for filters that wrap around multiple other filters.
Convolve a given image with an arbitrary image kernel.
typename OutputImageType::RegionType OutputRegionType
typename InputImageType::IndexType InputIndexType
typename InputImageType::SizeType InputSizeType