ITK  5.4.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:
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 
69  itkOverrideGetNameOfClassMacro(ConvolutionImageFilterBase);
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 
93 #ifndef ITK_FUTURE_LEGACY_REMOVE
94  using BoundaryConditionPointerType [[deprecated("Please just use `BoundaryConditionType *` instead!")]] =
96 #endif
98 
100  itkSetMacro(BoundaryCondition, BoundaryConditionType *);
101  itkGetConstMacro(BoundaryCondition, BoundaryConditionType *);
105  itkSetInputMacro(KernelImage, KernelImageType);
106  itkGetInputMacro(KernelImage, KernelImageType);
111  itkSetMacro(Normalize, bool);
112  itkGetConstMacro(Normalize, bool);
113  itkBooleanMacro(Normalize);
118 #if !defined(ITK_LEGACY_REMOVE)
120  // We need to expose the enum values at the class level
121  // for backwards compatibility
122  static constexpr OutputRegionModeEnum SAME = OutputRegionModeEnum::SAME;
123  static constexpr OutputRegionModeEnum VALID = OutputRegionModeEnum::VALID;
124 #endif
125 
135  itkSetEnumMacro(OutputRegionMode, OutputRegionModeEnum);
136  itkGetEnumMacro(OutputRegionMode, OutputRegionModeEnum);
137  virtual void
138  SetOutputRegionModeToSame();
139  virtual void
140  SetOutputRegionModeToValid();
143 protected:
145  ~ConvolutionImageFilterBase() override = default;
146 
147  void
148  PrintSelf(std::ostream & os, Indent indent) const override;
149 
152  void
153  GenerateOutputInformation() override;
154 
157  GetValidRegion() const;
158 
161  void
162  VerifyInputInformation() ITKv5_CONST override{};
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::ConvolutionImageFilterOutputRegion::VALID
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:216
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:162
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:139
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