ITK  5.2.0
Insight Toolkit
itkConvolutionImageFilterBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 itkConvolutionImageFilterBase_h
19 #define itkConvolutionImageFilterBase_h
20 
21 #include "itkImageToImageFilter.h"
23 #include "ITKConvolutionExport.h"
24 
25 namespace itk
26 {
32 {
33 public:
40  {
41  SAME = 0,
42  VALID
43  };
44 };
45 
47 extern ITKConvolution_EXPORT std::ostream &
49 
57 template <typename TInputImage, typename TKernelImage = TInputImage, typename TOutputImage = TInputImage>
58 class ITK_TEMPLATE_EXPORT ConvolutionImageFilterBase : public ImageToImageFilter<TInputImage, TOutputImage>
59 {
60 public:
61  ITK_DISALLOW_COPY_AND_MOVE(ConvolutionImageFilterBase);
62 
67 
70 
72  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
73 
74  using InputImageType = TInputImage;
75  using OutputImageType = TOutputImage;
76  using KernelImageType = TKernelImage;
77  using InputPixelType = typename InputImageType::PixelType;
78  using OutputPixelType = typename OutputImageType::PixelType;
79  using KernelPixelType = typename KernelImageType::PixelType;
90 
95 
97  itkSetMacro(BoundaryCondition, BoundaryConditionPointerType);
98  itkGetConstMacro(BoundaryCondition, BoundaryConditionPointerType);
100 
102  itkSetInputMacro(KernelImage, KernelImageType);
103  itkGetInputMacro(KernelImage, KernelImageType);
105 
108  itkSetMacro(Normalize, bool);
109  itkGetConstMacro(Normalize, bool);
110  itkBooleanMacro(Normalize);
112 
115 #if !defined(ITK_LEGACY_REMOVE)
117  // We need to expose the enum values at the class level
118  // for backwards compatibility
119  static constexpr OutputRegionModeEnum SAME = OutputRegionModeEnum::SAME;
120  static constexpr OutputRegionModeEnum VALID = OutputRegionModeEnum::VALID;
121 #endif
122 
132  itkSetEnumMacro(OutputRegionMode, OutputRegionModeEnum);
133  itkGetEnumMacro(OutputRegionMode, OutputRegionModeEnum);
134  virtual void
135  SetOutputRegionModeToSame();
136  virtual void
137  SetOutputRegionModeToValid();
139 
140 protected:
142  ~ConvolutionImageFilterBase() override = default;
143 
144  void
145  PrintSelf(std::ostream & os, Indent indent) const override;
146 
149  void
150  GenerateOutputInformation() override;
151 
154  GetValidRegion() const;
155 
158  void
159  VerifyInputInformation() ITKv5_CONST override{};
160 
161 private:
162  bool m_Normalize{ false };
163 
166 
168 };
169 } // end namespace itk
170 
171 #ifndef ITK_MANUAL_INSTANTIATION
172 # include "itkConvolutionImageFilterBase.hxx"
173 #endif
174 
175 #endif
itk::ConvolutionImageFilterBaseEnums::ConvolutionImageFilterOutputRegion::VALID
itk::uint8_t
::uint8_t uint8_t
Definition: itkIntTypes.h:29
itk::ConvolutionImageFilterBaseEnums::ConvolutionImageFilterOutputRegion::SAME
ConvolutionImageFilterOutputRegion
itk::ConvolutionImageFilterBaseEnums
Contains all enum classes used by ConvolutionImageFilterBase class.
Definition: itkConvolutionImageFilterBase.h:31
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::OutputRegionType
typename OutputImageType::RegionType OutputRegionType
Definition: itkConvolutionImageFilterBase.h:88
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::KernelImageType
TKernelSource::OutputImageType KernelImageType
Definition: itkConvolutionImageFilterBase.h:76
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::SizeValueType
typename InputSizeType::SizeValueType SizeValueType
Definition: itkConvolutionImageFilterBase.h:86
itk::operator<<
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
Definition: itkArray.h:218
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::OutputIndexType
typename OutputImageType::IndexType OutputIndexType
Definition: itkConvolutionImageFilterBase.h:81
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::InputIndexType
typename InputImageType::IndexType InputIndexType
Definition: itkConvolutionImageFilterBase.h:80
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::KernelPixelType
typename KernelImageType::PixelType KernelPixelType
Definition: itkConvolutionImageFilterBase.h:79
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::OutputSizeType
typename OutputImageType::SizeType OutputSizeType
Definition: itkConvolutionImageFilterBase.h:84
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkConvolutionImageFilterBase.h:77
itk::ImageBoundaryCondition
A virtual base object that defines an interface to a class of boundary condition objects for use by n...
Definition: itkImageBoundaryCondition.h:52
itk::ConvolutionImageFilterBaseEnums::ConvolutionImageFilterOutputRegion
ConvolutionImageFilterOutputRegion
Definition: itkConvolutionImageFilterBase.h:39
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::KernelIndexType
typename KernelImageType::IndexType KernelIndexType
Definition: itkConvolutionImageFilterBase.h:82
itk::ConvolutionImageFilterBase::VerifyInputInformation
void VerifyInputInformation() ITKv5_CONST override
Definition: itkConvolutionImageFilterBase.h:159
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkConvolutionImageFilterBase.h:78
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::InputRegionType
typename InputImageType::RegionType InputRegionType
Definition: itkConvolutionImageFilterBase.h:87
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::ConvolutionImageFilterBase::m_DefaultBoundaryCondition
DefaultBoundaryConditionType m_DefaultBoundaryCondition
Definition: itkConvolutionImageFilterBase.h:164
itk::ConvolutionImageFilterBase::m_BoundaryCondition
BoundaryConditionPointerType m_BoundaryCondition
Definition: itkConvolutionImageFilterBase.h:165
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition: itkConvolutionImageFilterBase.h:83
itk::ZeroFluxNeumannBoundaryCondition< TInputImage >
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::KernelRegionType
typename KernelImageType::RegionType KernelRegionType
Definition: itkConvolutionImageFilterBase.h:89
itkZeroFluxNeumannBoundaryCondition.h
itk::ConvolutionImageFilterBase
Abstract base class for the convolution image filters.
Definition: itkConvolutionImageFilterBase.h:58
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::KernelSizeType
typename KernelImageType::SizeType KernelSizeType
Definition: itkConvolutionImageFilterBase.h:85