ITK  6.0.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  * https://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:
39  {
40  SAME = 0,
41  VALID
42  };
43 };
44 
46 extern ITKConvolution_EXPORT std::ostream &
48 
56 template <typename TInputImage, typename TKernelImage = TInputImage, typename TOutputImage = TInputImage>
57 class ITK_TEMPLATE_EXPORT ConvolutionImageFilterBase : public ImageToImageFilter<TInputImage, TOutputImage>
58 {
59 public:
60  ITK_DISALLOW_COPY_AND_MOVE(ConvolutionImageFilterBase);
61 
66 
68  itkOverrideGetNameOfClassMacro(ConvolutionImageFilterBase);
69 
71  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
72 
73  using InputImageType = TInputImage;
74  using OutputImageType = TOutputImage;
75  using KernelImageType = TKernelImage;
76  using InputPixelType = typename InputImageType::PixelType;
77  using OutputPixelType = typename OutputImageType::PixelType;
78  using KernelPixelType = typename KernelImageType::PixelType;
89 
92 #ifndef ITK_FUTURE_LEGACY_REMOVE
93  using BoundaryConditionPointerType [[deprecated("Please just use `BoundaryConditionType *` instead!")]] =
95 #endif
97 
99  itkSetMacro(BoundaryCondition, BoundaryConditionType *);
100  itkGetConstMacro(BoundaryCondition, BoundaryConditionType *);
104  itkSetInputMacro(KernelImage, KernelImageType);
105  itkGetInputMacro(KernelImage, KernelImageType);
110  itkSetMacro(Normalize, bool);
111  itkGetConstMacro(Normalize, bool);
112  itkBooleanMacro(Normalize);
117 #if !defined(ITK_LEGACY_REMOVE)
119  // We need to expose the enum values at the class level
120  // for backwards compatibility
121  static constexpr OutputRegionModeEnum SAME = OutputRegionModeEnum::SAME;
122  static constexpr OutputRegionModeEnum VALID = OutputRegionModeEnum::VALID;
123 #endif
124 
134  itkSetEnumMacro(OutputRegionMode, OutputRegionModeEnum);
135  itkGetEnumMacro(OutputRegionMode, OutputRegionModeEnum);
136  virtual void
137  SetOutputRegionModeToSame();
138  virtual void
139  SetOutputRegionModeToValid();
142 protected:
144  ~ConvolutionImageFilterBase() override = default;
145 
146  void
147  PrintSelf(std::ostream & os, Indent indent) const override;
148 
151  void
152  GenerateOutputInformation() override;
153 
156  GetValidRegion() const;
157 
160  void
161  VerifyInputInformation() const override
162  {}
163 
164 private:
165  bool m_Normalize{ false };
166 
167  DefaultBoundaryConditionType m_DefaultBoundaryCondition{};
168  BoundaryConditionType * m_BoundaryCondition{};
169 
171 };
172 } // end namespace itk
173 
174 #ifndef ITK_MANUAL_INSTANTIATION
175 # include "itkConvolutionImageFilterBase.hxx"
176 #endif
177 
178 #endif
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:87
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::KernelImageType
TKernelSource::OutputImageType KernelImageType
Definition: itkConvolutionImageFilterBase.h:75
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::SizeValueType
typename InputSizeType::SizeValueType SizeValueType
Definition: itkConvolutionImageFilterBase.h:85
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::OutputIndexType
typename OutputImageType::IndexType OutputIndexType
Definition: itkConvolutionImageFilterBase.h:80
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::InputIndexType
typename InputImageType::IndexType InputIndexType
Definition: itkConvolutionImageFilterBase.h:79
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::KernelPixelType
typename KernelImageType::PixelType KernelPixelType
Definition: itkConvolutionImageFilterBase.h:78
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::operator<<
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ConvolutionImageFilterBaseEnums::ConvolutionImageFilterOutputRegion::VALID
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::OutputSizeType
typename OutputImageType::SizeType OutputSizeType
Definition: itkConvolutionImageFilterBase.h:83
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkConvolutionImageFilterBase.h:76
itk::ConvolutionImageFilterBaseEnums::ConvolutionImageFilterOutputRegion
ConvolutionImageFilterOutputRegion
Definition: itkConvolutionImageFilterBase.h:38
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::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:81
itk::ConvolutionImageFilterBaseEnums::ConvolutionImageFilterOutputRegion::SAME
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:77
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ConvolutionImageFilterBase::VerifyInputInformation
void VerifyInputInformation() const override
Definition: itkConvolutionImageFilterBase.h:161
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::InputRegionType
typename InputImageType::RegionType InputRegionType
Definition: itkConvolutionImageFilterBase.h:86
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition: itkConvolutionImageFilterBase.h:82
itk::ZeroFluxNeumannBoundaryCondition< TInputImage >
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::KernelRegionType
typename KernelImageType::RegionType KernelRegionType
Definition: itkConvolutionImageFilterBase.h:88
itkZeroFluxNeumannBoundaryCondition.h
itk::ConvolutionImageFilterBase
Abstract base class for the convolution image filters.
Definition: itkConvolutionImageFilterBase.h:57
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:86
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::ConvolutionImageFilterBase< TInputImage, TKernelSource::OutputImageType, TOutputImage >::KernelSizeType
typename KernelImageType::SizeType KernelSizeType
Definition: itkConvolutionImageFilterBase.h:84