ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkConstantPadImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkConstantPadImageFilter_h
19 #define itkConstantPadImageFilter_h
20 
21 #include "itkPadImageFilter.h"
22 
23 #include "itkMath.h"
25 
26 namespace itk
27 {
48 template< typename TInputImage, typename TOutputImage >
49 class ITK_TEMPLATE_EXPORT ConstantPadImageFilter:
50  public PadImageFilter< TInputImage, TOutputImage >
51 {
52 public:
58 
60  itkNewMacro(Self);
61 
64 
66  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
67  typedef typename Superclass::InputImageRegionType InputImageRegionType;
68 
70  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
71  typedef typename Superclass::InputImagePixelType InputImagePixelType;
72 
74  typedef typename Superclass::OutputImageIndexType OutputImageIndexType;
75  typedef typename Superclass::InputImageIndexType InputImageIndexType;
76  typedef typename Superclass::OutputImageSizeType OutputImageSizeType;
77  typedef typename Superclass::InputImageSizeType InputImageSizeType;
78 
80  itkStaticConstMacro(ImageDimension, unsigned int,
81  TInputImage::ImageDimension);
82  itkStaticConstMacro(OutputImageDimension, unsigned int,
83  TOutputImage::ImageDimension);
85 
88  {
89  if ( Math::NotExactlyEquals(constant, m_InternalBoundaryCondition.GetConstant()) )
90  {
91  m_InternalBoundaryCondition.SetConstant( constant );
92  this->Modified();
93  }
94  }
96  {
97  return m_InternalBoundaryCondition.GetConstant();
98  }
100 
101 #ifdef ITK_USE_CONCEPT_CHECKING
102  // Begin concept checking
103  itkConceptMacro( OutputEqualityComparableCheck,
105  itkConceptMacro( InputConvertibleToOutputCheck,
107  itkConceptMacro( SameDimensionCheck,
109  itkConceptMacro( OutputOStreamWritableCheck,
111  // End concept checking
112 #endif
113 
114 protected:
116  ~ConstantPadImageFilter() ITK_OVERRIDE {}
117  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
118 
119 private:
120  ITK_DISALLOW_COPY_AND_ASSIGN(ConstantPadImageFilter);
121 
123 };
124 } // end namespace itk
125 
126 #ifndef ITK_MANUAL_INSTANTIATION
127 #include "itkConstantPadImageFilter.hxx"
128 #endif
129 
130 #endif
Increase the image size by padding with a constant value.
This boundary condition returns a constant value for out-of-bounds image pixels.
Superclass::InputImageRegionType InputImageRegionType
Base class for all process objects that output image data.
OutputImagePixelType GetConstant() const
Superclass::OutputImageSizeType OutputImageSizeType
Superclass::OutputImagePixelType OutputImagePixelType
Superclass::InputImageSizeType InputImageSizeType
Superclass::InputImageIndexType InputImageIndexType
OutputImageType::PixelType OutputImagePixelType
SmartPointer< const Self > ConstPointer
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Definition: itkMath.h:721
void SetConstant(OutputImagePixelType constant)
Superclass::OutputImageRegionType OutputImageRegionType
Superclass::InputImagePixelType InputImagePixelType
ConstantBoundaryCondition< TInputImage, TOutputImage > m_InternalBoundaryCondition
Control indentation during Print() invocation.
Definition: itkIndent.h:49
PadImageFilter< TInputImage, TOutputImage > Superclass
Increase the image size by padding. Superclass for filters that fill in extra pixels.
#define itkConceptMacro(name, concept)
Superclass::OutputImageIndexType OutputImageIndexType