ITK  4.13.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:
73 
75  itkNewMacro(Self);
76 
79 
81  itkStaticConstMacro(ImageDimension, unsigned int,
82  TInputImage::ImageDimension);
83 
84  typedef TInputImage InputImageType;
85  typedef TOutputImage OutputImageType;
86  typedef TKernelImage KernelImageType;
87  typedef typename InputImageType::PixelType InputPixelType;
88  typedef typename OutputImageType::PixelType OutputPixelType;
89  typedef typename KernelImageType::PixelType KernelPixelType;
96  typedef typename InputImageType::RegionType InputRegionType;
97  typedef typename OutputImageType::RegionType OutputRegionType;
98  typedef typename KernelImageType::RegionType KernelRegionType;
99 
100 protected:
102  ~ConvolutionImageFilter() ITK_OVERRIDE {}
103 
111  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
112 
114  void GenerateData() ITK_OVERRIDE;
115 
118  bool GetKernelNeedsPadding() const;
119 
121  KernelSizeType GetKernelPadSize() const;
122 
124  template< typename TImage >
125  KernelSizeType GetKernelRadius(const TImage *kernelImage) const;
126 
127 private:
128  ITK_DISALLOW_COPY_AND_ASSIGN(ConvolutionImageFilter);
129 
130  template< typename TImage >
131  void ComputeConvolution( const TImage *kernelImage,
132  ProgressAccumulator *progress );
133 };
134 }
135 
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "itkConvolutionImageFilter.hxx"
138 #endif
139 
140 #endif
SmartPointer< const Self > ConstPointer
KernelImageType::PixelType KernelPixelType
KernelImageType::SizeType KernelSizeType
OutputImageType::IndexType OutputIndexType
OutputImageType::RegionType OutputRegionType
KernelImageType::IndexType KernelIndexType
ConvolutionImageFilterBase< TInputImage, TOutputImage > Superclass
Abstract base class for the convolution image filters.
Base class for all process objects that output image data.
InputImageType::RegionType InputRegionType
OutputImageType::PixelType OutputPixelType
OutputImageType::SizeType OutputSizeType
KernelImageType::RegionType KernelRegionType
InputImageType::PixelType InputPixelType
InputImageType::IndexType InputIndexType
Facilitates progress reporting for filters that wrap around multiple other filters.
InputImageType::SizeType InputSizeType
Convolve a given image with an arbitrary image kernel.