ITK  4.8.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< typename TInputImage, typename TOutputImage = TInputImage >
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 < typename 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
static const unsigned int ImageDimension
void SetConstant(const OutputPixelType &c)
Represent the offset between two n-dimensional indexes in a n-dimensional image.
Definition: itkOffset.h:55
virtual OutputPixelType operator()(const OffsetType &, const OffsetType &, const NeighborhoodType *) const
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
virtual void Print(std::ostream &os, Indent i=0) const
const OutputPixelType & GetConstant() const
void Initialize(const VariableLengthVector< TPixel > *)
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
virtual RegionType GetInputRequestedRegion(const RegionType &inputLargestPossibleRegion, const RegionType &outputRequestedRegion) const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
OutputPixelType GetPixel(const IndexType &index, const TInputImage *image) const