ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkConvolutionImageFilterBase.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 __itkConvolutionImageFilterBase_h
00019 #define __itkConvolutionImageFilterBase_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkZeroFluxNeumannBoundaryCondition.h"
00023 
00024 namespace itk
00025 {
00032 template< class TInputImage,
00033           class TKernelImage = TInputImage,
00034           class TOutputImage = TInputImage >
00035 class ITK_EXPORT ConvolutionImageFilterBase :
00036   public ImageToImageFilter< TInputImage, TOutputImage >
00037 {
00038 public:
00039   typedef ConvolutionImageFilterBase                      Self;
00040   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00041   typedef SmartPointer< Self >                            Pointer;
00042   typedef SmartPointer< const Self >                      ConstPointer;
00043 
00045   itkTypeMacro(FFTConvolutionImageFilter, ImageToImageFilter);
00046 
00048   itkStaticConstMacro(ImageDimension, unsigned int,
00049                       TInputImage::ImageDimension);
00050 
00051   typedef TInputImage                           InputImageType;
00052   typedef TOutputImage                          OutputImageType;
00053   typedef TKernelImage                          KernelImageType;
00054   typedef typename InputImageType::PixelType    InputPixelType;
00055   typedef typename OutputImageType::PixelType   OutputPixelType;
00056   typedef typename KernelImageType::PixelType   KernelPixelType;
00057   typedef typename InputImageType::IndexType    InputIndexType;
00058   typedef typename OutputImageType::IndexType   OutputIndexType;
00059   typedef typename KernelImageType::IndexType   KernelIndexType;
00060   typedef typename InputImageType::SizeType     InputSizeType;
00061   typedef typename OutputImageType::SizeType    OutputSizeType;
00062   typedef typename KernelImageType::SizeType    KernelSizeType;
00063   typedef typename InputSizeType::SizeValueType SizeValueType;
00064   typedef typename InputImageType::RegionType   InputRegionType;
00065   typedef typename OutputImageType::RegionType  OutputRegionType;
00066   typedef typename KernelImageType::RegionType  KernelRegionType;
00067 
00069   typedef ImageBoundaryCondition< TInputImage >           BoundaryConditionType;
00070   typedef BoundaryConditionType *                         BoundaryConditionPointerType;
00071   typedef ZeroFluxNeumannBoundaryCondition< TInputImage > DefaultBoundaryConditionType;
00072 
00074   itkSetMacro(BoundaryCondition, BoundaryConditionPointerType);
00075   itkGetConstMacro(BoundaryCondition, BoundaryConditionPointerType);
00077 
00079   itkSetInputMacro(KernelImage, KernelImageType);
00080   itkGetInputMacro(KernelImage, KernelImageType);
00082 
00085   itkSetMacro(Normalize, bool);
00086   itkGetConstMacro(Normalize, bool);
00087   itkBooleanMacro(Normalize);
00089 
00090   typedef enum
00091   {
00092     SAME = 0,
00093     VALID
00094   } OutputRegionModeType;
00095 
00105   itkSetEnumMacro(OutputRegionMode, OutputRegionModeType);
00106   itkGetEnumMacro(OutputRegionMode, OutputRegionModeType);
00107   virtual void SetOutputRegionModeToSame();
00108   virtual void SetOutputRegionModeToValid();
00110 
00111 protected:
00112   ConvolutionImageFilterBase();
00113   ~ConvolutionImageFilterBase() {}
00114 
00115   void PrintSelf(std::ostream & os, Indent indent) const;
00116 
00119   void GenerateOutputInformation();
00120 
00122   OutputRegionType GetValidRegion() const;
00123 
00126   virtual void VerifyInputInformation() {};
00127 
00128 private:
00129   ConvolutionImageFilterBase(const Self &); //purposely not implemented
00130   void operator=(const Self &);             //purposely not implemented
00131 
00132   bool m_Normalize;
00133 
00134   DefaultBoundaryConditionType m_DefaultBoundaryCondition;
00135   BoundaryConditionPointerType m_BoundaryCondition;
00136 
00137   OutputRegionModeType m_OutputRegionMode;
00138 };
00139 } // end namespace itk
00140 
00141 #ifndef ITK_MANUAL_INSTANTIATION
00142 #include "itkConvolutionImageFilterBase.hxx"
00143 #endif
00144 
00145 #endif
00146