ITK  4.3.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 
24 
25 namespace itk
26 {
47 template< class TInputImage, class TOutputImage >
48 class ITK_EXPORT ConstantPadImageFilter:
49  public PadImageFilter< TInputImage, TOutputImage >
50 {
51 public:
57 
59  itkNewMacro(Self);
60 
63 
65  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
66  typedef typename Superclass::InputImageRegionType InputImageRegionType;
67 
69  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
70  typedef typename Superclass::InputImagePixelType InputImagePixelType;
71 
73  typedef typename Superclass::OutputImageIndexType OutputImageIndexType;
74  typedef typename Superclass::InputImageIndexType InputImageIndexType;
75  typedef typename Superclass::OutputImageSizeType OutputImageSizeType;
76  typedef typename Superclass::InputImageSizeType InputImageSizeType;
77 
79  itkStaticConstMacro(ImageDimension, unsigned int,
80  TInputImage::ImageDimension);
81  itkStaticConstMacro(OutputImageDimension, unsigned int,
82  TOutputImage::ImageDimension);
84 
86  void SetConstant( OutputImagePixelType constant )
87  {
88  if ( constant != m_InternalBoundaryCondition.GetConstant() )
89  {
90  m_InternalBoundaryCondition.SetConstant( constant );
91  this->Modified();
92  }
93  }
94  OutputImagePixelType GetConstant() const
95  {
96  return m_InternalBoundaryCondition.GetConstant();
97  }
99 
100 #ifdef ITK_USE_CONCEPT_CHECKING
101 
102  itkConceptMacro( OutputEqualityComparableCheck,
104  itkConceptMacro( InputConvertibleToOutputCheck,
106  itkConceptMacro( SameDimensionCheck,
108  itkConceptMacro( OutputOStreamWritableCheck,
110 
112 #endif
113 
114 protected:
117  void PrintSelf(std::ostream & os, Indent indent) const;
118 
119 private:
120  ConstantPadImageFilter(const Self &); //purposely not implemented
121  void operator=(const Self &); //purposely not implemented
122 
124 };
125 } // end namespace itk
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "itkConstantPadImageFilter.hxx"
129 #endif
130 
131 #endif
132