ITK  4.9.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 >
50  public PadImageFilter< TInputImage, TOutputImage >
51 {
52 public:
58 
60  itkNewMacro(Self);
61 
64 
68 
72 
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:
117  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
118 
119 private:
120  ConstantPadImageFilter(const Self &) ITK_DELETE_FUNCTION;
121  void operator=(const Self &) ITK_DELETE_FUNCTION;
122 
124 };
125 } // end namespace itk
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "itkConstantPadImageFilter.hxx"
129 #endif
130 
131 #endif
TOutputImage::RegionType OutputImageRegionType
Increase the image size by padding with a constant value.
TInputImage::RegionType InputImageRegionType
This boundary condition returns a constant value for out-of-bounds image pixels.
TInputImage::PixelType InputImagePixelType
Superclass::InputImageRegionType InputImageRegionType
Base class for all process objects that output image data.
TInputImage::IndexType InputImageIndexType
void PrintSelf(std::ostream &os, Indent indent) const override
OutputImagePixelType GetConstant() const
static const unsigned int ImageDimension
static const unsigned int OutputImageDimension
Superclass::OutputImageSizeType OutputImageSizeType
TOutputImage::SizeType OutputImageSizeType
TOutputImage::PixelType OutputImagePixelType
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:676
virtual void Modified() const
void SetConstant(OutputImagePixelType constant)
Superclass::OutputImageRegionType OutputImageRegionType
TInputImage::SizeType InputImageSizeType
Superclass::InputImagePixelType InputImagePixelType
ConstantBoundaryCondition< TInputImage, TOutputImage > m_InternalBoundaryCondition
Control indentation during Print() invocation.
Definition: itkIndent.h:49
PadImageFilter< TInputImage, TOutputImage > Superclass
TOutputImage::IndexType OutputImageIndexType
Increase the image size by padding. Superclass for filters that fill in extra pixels.
#define itkConceptMacro(name, concept)
Superclass::OutputImageIndexType OutputImageIndexType