ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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
69
73
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 }
99
100
105
106protected:
108 ~ConstantPadImageFilter() override = default;
109 void
110 PrintSelf(std::ostream & os, Indent indent) const override;
111
112private:
114};
115} // end namespace itk
116
117#ifndef ITK_MANUAL_INSTANTIATION
118# include "itkConstantPadImageFilter.hxx"
119#endif
120
121#endif
This boundary condition returns a constant value for out-of-bounds image pixels.
void PrintSelf(std::ostream &os, Indent indent) const override
ConstantBoundaryCondition< TInputImage, TOutputImage > m_InternalBoundaryCondition
static constexpr unsigned int ImageDimension
SmartPointer< const Self > ConstPointer
~ConstantPadImageFilter() override=default
OutputImagePixelType GetConstant() const
static constexpr unsigned int OutputImageDimension
typename TOutputImage::PixelType OutputImagePixelType
PadImageFilter< TInputImage, TOutputImage > Superclass
void SetConstant(OutputImagePixelType constant)
Control indentation during Print() invocation.
Definition itkIndent.h:50
virtual void Modified() const
typename TOutputImage::IndexType OutputImageIndexType
typename TOutputImage::PixelType OutputImagePixelType
typename TInputImage::SizeType InputImageSizeType
typename TInputImage::IndexType InputImageIndexType
typename TOutputImage::SizeType OutputImageSizeType
typename TInputImage::PixelType InputImagePixelType
typename TOutputImage::RegionType OutputImageRegionType
typename TInputImage::RegionType InputImageRegionType
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Definition itkMath.h:731
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....