ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkConstantBoundaryCondition.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 __itkConstantBoundaryCondition_h
19 #define __itkConstantBoundaryCondition_h
20 
21 #include "itkNumericTraits.h"
24 
25 namespace itk
26 {
64 template< class TInputImage, class TOutputImage = TInputImage >
65 class ITK_EXPORT ConstantBoundaryCondition:
66  public ImageBoundaryCondition< TInputImage, TOutputImage >
67 {
68 public:
72 
74  typedef typename Superclass::PixelType PixelType;
78  typedef typename Superclass::IndexType IndexType;
79  typedef typename Superclass::SizeType SizeType;
82 
85 
87  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
88 
91 
93  virtual const char * GetNameOfClass() const
94  {
95  return "itkConstantBoundaryCondition";
96  }
97 
99  virtual void Print( std::ostream & os, Indent i = 0 ) const;
100 
103  template < class TPixel >
104  void Initialize( const VariableLengthVector< TPixel > * );
105 
108  virtual OutputPixelType operator()(const OffsetType &,
109  const OffsetType &,
110  const NeighborhoodType *) const;
111 
114  virtual OutputPixelType operator()(
115  const OffsetType &,
116  const OffsetType &,
117  const NeighborhoodType *,
118  const NeighborhoodAccessorFunctorType &) const;
119 
121  void SetConstant(const OutputPixelType & c);
122 
124  const OutputPixelType & GetConstant() const;
125 
129  bool RequiresCompleteNeighborhood() { return false; }
130 
140  virtual RegionType GetInputRequestedRegion( const RegionType & inputLargestPossibleRegion,
141  const RegionType & outputRequestedRegion ) const;
142 
150  OutputPixelType GetPixel( const IndexType & index, const TInputImage * image ) const;
151 
152 private:
154 };
155 } // end namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 #include "itkConstantBoundaryCondition.hxx"
159 #endif
160 
161 #endif
162