ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkConvolutionImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkConvolutionImageFilter_h
00019 #define __itkConvolutionImageFilter_h
00020 
00021 #include "itkConvolutionImageFilterBase.h"
00022 
00023 #include "itkProgressAccumulator.h"
00024 #include "itkZeroFluxNeumannBoundaryCondition.h"
00025 
00026 namespace itk
00027 {
00064 template< class TInputImage, class TKernelImage = TInputImage, class TOutputImage = TInputImage >
00065 class ITK_EXPORT ConvolutionImageFilter :
00066   public ConvolutionImageFilterBase< TInputImage, TKernelImage, TOutputImage >
00067 {
00068 public:
00069   typedef ConvolutionImageFilter                                  Self;
00070   typedef ConvolutionImageFilterBase< TInputImage, TOutputImage > Superclass;
00071   typedef SmartPointer< Self >                                    Pointer;
00072   typedef SmartPointer< const Self >                              ConstPointer;
00073 
00075   itkNewMacro(Self);
00076 
00078   itkTypeMacro(ConvolutionImageFilter, ConvolutionImageFilterBase);
00079 
00081   itkStaticConstMacro(ImageDimension, unsigned int,
00082                       TInputImage::ImageDimension);
00083 
00084   typedef TInputImage                          InputImageType;
00085   typedef TOutputImage                         OutputImageType;
00086   typedef TKernelImage                         KernelImageType;
00087   typedef typename InputImageType::PixelType   InputPixelType;
00088   typedef typename OutputImageType::PixelType  OutputPixelType;
00089   typedef typename KernelImageType::PixelType  KernelPixelType;
00090   typedef typename InputImageType::IndexType   InputIndexType;
00091   typedef typename OutputImageType::IndexType  OutputIndexType;
00092   typedef typename KernelImageType::IndexType  KernelIndexType;
00093   typedef typename InputImageType::SizeType    InputSizeType;
00094   typedef typename OutputImageType::SizeType   OutputSizeType;
00095   typedef typename KernelImageType::SizeType   KernelSizeType;
00096   typedef typename InputImageType::RegionType  InputRegionType;
00097   typedef typename OutputImageType::RegionType OutputRegionType;
00098   typedef typename KernelImageType::RegionType KernelRegionType;
00099 
00100 protected:
00101   ConvolutionImageFilter();
00102   ~ConvolutionImageFilter() {}
00103 
00111   virtual void GenerateInputRequestedRegion();
00112 
00114   void GenerateData();
00115 
00118   bool GetKernelNeedsPadding() const;
00119 
00121   KernelSizeType GetKernelPadSize() const;
00122 
00124   template< class TImage >
00125   KernelSizeType GetKernelRadius(const TImage *kernelImage) const;
00126 
00127 private:
00128   ConvolutionImageFilter(const Self &); //purposely not implemented
00129   void operator=(const Self &);         //purposely not implemented
00130 
00131   template< class TImage >
00132   void ComputeConvolution( const TImage *kernelImage,
00133                            ProgressAccumulator *progress );
00134 };
00135 }
00136 
00137 #ifndef ITK_MANUAL_INSTANTIATION
00138 #include "itkConvolutionImageFilter.hxx"
00139 #endif
00140 
00141 #endif
00142