ITK  6.0.0
Insight Toolkit
itkConstantPadImageFilter.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 itkConstantPadImageFilter_h
19#define itkConstantPadImageFilter_h
20
21#include "itkPadImageFilter.h"
22
23#include "itkMath.h"
25
26namespace itk
27{
48template <typename TInputImage, typename TOutputImage>
49class ITK_TEMPLATE_EXPORT ConstantPadImageFilter : public PadImageFilter<TInputImage, TOutputImage>
50{
51public:
52 ITK_DISALLOW_COPY_AND_MOVE(ConstantPadImageFilter);
53
59
61 itkNewMacro(Self);
62
64 itkOverrideGetNameOfClassMacro(ConstantPadImageFilter);
65
67 using typename Superclass::OutputImageRegionType;
68 using typename Superclass::InputImageRegionType;
69
71 using typename Superclass::OutputImagePixelType;
72 using typename Superclass::InputImagePixelType;
73
75 using typename Superclass::OutputImageIndexType;
76 using typename Superclass::InputImageIndexType;
77 using typename Superclass::OutputImageSizeType;
78 using typename Superclass::InputImageSizeType;
79
81 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
82 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
83
85 void
87 {
88 if (Math::NotExactlyEquals(constant, m_InternalBoundaryCondition.GetConstant()))
89 {
90 m_InternalBoundaryCondition.SetConstant(constant);
91 this->Modified();
92 }
93 }
94 OutputImagePixelType
96 {
97 return m_InternalBoundaryCondition.GetConstant();
98 }
101#ifdef ITK_USE_CONCEPT_CHECKING
102 // Begin concept checking
107 // End concept checking
108#endif
109
110protected:
112 ~ConstantPadImageFilter() override = default;
113 void
114 PrintSelf(std::ostream & os, Indent indent) const override;
115
116private:
118};
119} // end namespace itk
120
121#ifndef ITK_MANUAL_INSTANTIATION
122# include "itkConstantPadImageFilter.hxx"
123#endif
124
125#endif
Increase the image size by padding with a constant value.
void PrintSelf(std::ostream &os, Indent indent) const override
~ConstantPadImageFilter() override=default
OutputImagePixelType GetConstant() const
void SetConstant(OutputImagePixelType constant)
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Increase the image size by padding. Superclass for filters that fill in extra pixels.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
#define itkConceptMacro(name, concept)
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Definition: itkMath.h:737
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....