ITK  5.0.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  using PixelType = typename Superclass::PixelType;
80  using IndexType = typename Superclass::IndexType;
81  using SizeType = typename Superclass::SizeType;
84 
86 
88  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
89 
92 
94  const char * GetNameOfClass() const override
95  {
96  return "itkConstantBoundaryCondition";
97  }
98 
100  void Print( std::ostream & os, Indent i = 0 ) const override;
101 
104  template < typename TPixel >
105  void Initialize( const VariableLengthVector< TPixel > * );
106 
109  OutputPixelType operator()(const OffsetType &,
110  const OffsetType &,
111  const NeighborhoodType *) const override;
112 
115  OutputPixelType operator()(
116  const OffsetType &,
117  const OffsetType &,
118  const NeighborhoodType *,
119  const NeighborhoodAccessorFunctorType &) const override;
120 
122  void SetConstant(const OutputPixelType & c);
123 
125  const OutputPixelType & GetConstant() const;
126 
130  bool RequiresCompleteNeighborhood() override { return false; }
131 
141  RegionType GetInputRequestedRegion( const RegionType & inputLargestPossibleRegion,
142  const RegionType & outputRequestedRegion ) const override;
143 
151  OutputPixelType GetPixel( const IndexType & index, const TInputImage * image ) const override;
152 
153 private:
155 };
156 } // end namespace itk
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 #include "itkConstantBoundaryCondition.hxx"
160 #endif
161 
162 #endif
A light-weight container object for storing an N-dimensional neighborhood of values.
This boundary condition returns a constant value for out-of-bounds image pixels.
typename Superclass::NeighborhoodType NeighborhoodType
Represents an array whose length can be defined at run-time.
const char * GetNameOfClass() const override
typename Superclass::PixelPointerType PixelPointerType
A virtual base object that defines an interface to a class of boundary condition objects for use by n...
typename InputImageType::InternalPixelType * PixelPointerType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::NeighborhoodAccessorFunctorType NeighborhoodAccessorFunctorType
typename InputImageType::NeighborhoodAccessorFunctorType NeighborhoodAccessorFunctorType