ITK  4.6.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 >
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;
90  typedef typename InputImageType::IndexType InputIndexType;
91  typedef typename OutputImageType::IndexType OutputIndexType;
92  typedef typename KernelImageType::IndexType KernelIndexType;
93  typedef typename InputImageType::SizeType InputSizeType;
94  typedef typename OutputImageType::SizeType OutputSizeType;
95  typedef typename KernelImageType::SizeType KernelSizeType;
96  typedef typename InputImageType::RegionType InputRegionType;
97  typedef typename OutputImageType::RegionType OutputRegionType;
98  typedef typename KernelImageType::RegionType KernelRegionType;
99 
100 protected:
103 
111  virtual void GenerateInputRequestedRegion();
112 
114  void GenerateData();
115 
118  bool GetKernelNeedsPadding() const;
119 
122 
124  template< typename TImage >
125  KernelSizeType GetKernelRadius(const TImage *kernelImage) const;
126 
127 private:
128  ConvolutionImageFilter(const Self &); //purposely not implemented
129  void operator=(const Self &); //purposely not implemented
130 
131  template< typename TImage >
132  void ComputeConvolution( const TImage *kernelImage,
133  ProgressAccumulator *progress );
134 };
135 }
136 
137 #ifndef ITK_MANUAL_INSTANTIATION
138 #include "itkConvolutionImageFilter.hxx"
139 #endif
140 
141 #endif
bool GetKernelNeedsPadding() const
SmartPointer< const Self > ConstPointer
KernelImageType::PixelType KernelPixelType
KernelImageType::SizeType KernelSizeType
void ComputeConvolution(const TImage *kernelImage, ProgressAccumulator *progress)
virtual void GenerateInputRequestedRegion()
OutputImageType::IndexType OutputIndexType
OutputImageType::RegionType OutputRegionType
KernelImageType::IndexType KernelIndexType
ConvolutionImageFilterBase< TInputImage, TOutputImage > Superclass
static const unsigned int ImageDimension
Abstract base class for the convolution image filters.
void operator=(const Self &)
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
KernelSizeType GetKernelPadSize() const
Facilitates progress reporting for filters that wrap around multiple other filters.
InputImageType::SizeType InputSizeType
Convolve a given image with an arbitrary image kernel.
KernelSizeType GetKernelRadius(const TImage *kernelImage) const