ITK  4.13.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"
23 
24 namespace itk
25 {
26 // Forward reference for VariableLengthVector
27 template <typename TValue> class VariableLengthVector;
28 
66 template< typename TInputImage, typename TOutputImage = TInputImage >
67 class ITK_TEMPLATE_EXPORT ConstantBoundaryCondition:
68  public ImageBoundaryCondition< TInputImage, TOutputImage >
69 {
70 public:
74 
76  typedef typename Superclass::PixelType PixelType;
80  typedef typename Superclass::IndexType IndexType;
81  typedef typename Superclass::SizeType SizeType;
84 
87 
89  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
90 
93 
95  virtual const char * GetNameOfClass() const
96  {
97  return "itkConstantBoundaryCondition";
98  }
99 
101  virtual void Print( std::ostream & os, Indent i = 0 ) const;
102 
105  template < typename TPixel >
106  void Initialize( const VariableLengthVector< TPixel > * );
107 
110  virtual OutputPixelType operator()(const OffsetType &,
111  const OffsetType &,
112  const NeighborhoodType *) const;
113 
116  virtual OutputPixelType operator()(
117  const OffsetType &,
118  const OffsetType &,
119  const NeighborhoodType *,
120  const NeighborhoodAccessorFunctorType &) const;
121 
123  void SetConstant(const OutputPixelType & c);
124 
126  const OutputPixelType & GetConstant() const;
127 
131  bool RequiresCompleteNeighborhood() { return false; }
132 
142  virtual RegionType GetInputRequestedRegion( const RegionType & inputLargestPossibleRegion,
143  const RegionType & outputRequestedRegion ) const;
144 
152  OutputPixelType GetPixel( const IndexType & index, const TInputImage * image ) const;
153 
154 private:
156 };
157 } // end namespace itk
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 #include "itkConstantBoundaryCondition.hxx"
161 #endif
162 
163 #endif
Represent the offset between two n-dimensional indexes in a n-dimensional image.
Definition: itkOffset.h:56
virtual const char * GetNameOfClass() const
A light-weight container object for storing an N-dimensional neighborhood of values.
Superclass::NeighborhoodAccessorFunctorType NeighborhoodAccessorFunctorType
This boundary condition returns a constant value for out-of-bounds image pixels.
An image region represents a structured region of data.
InputImageType::NeighborhoodAccessorFunctorType NeighborhoodAccessorFunctorType
Represents an array whose length can be defined at run-time.
ImageBoundaryCondition< TInputImage, TOutputImage > Superclass
Superclass::PixelPointerType PixelPointerType
A virtual base object that defines an interface to a class of boundary condition objects for use by n...
Superclass::OutputPixelType OutputPixelType
Superclass::NeighborhoodType NeighborhoodType
Control indentation during Print() invocation.
Definition: itkIndent.h:49