ITK  5.4.0
Insight Toolkit
itkImageBoundaryCondition.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 itkImageBoundaryCondition_h
19 #define itkImageBoundaryCondition_h
20 
21 #include "itkIndex.h"
22 #include "itkNeighborhood.h"
23 #include "itkImageRegion.h"
24 
25 namespace itk
26 {
51 template <typename TInputImage, typename TOutputImage = TInputImage>
52 class ITK_TEMPLATE_EXPORT ImageBoundaryCondition
53 {
54 public:
55 
57  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
58 
61 
63  using InputImageType = TInputImage;
64  using OutputImageType = TOutputImage;
65  using PixelType = typename TInputImage::PixelType;
66  using PixelPointerType = typename TInputImage::InternalPixelType *;
67  using OutputPixelType = typename TOutputImage::PixelType;
72 
75 
77  using NeighborhoodAccessorFunctorType = typename TInputImage::NeighborhoodAccessorFunctorType;
78 
80  ImageBoundaryCondition() = default;
81 
83  itkVirtualGetNameOfClassMacro(ImageBoundaryCondition);
84 
86  virtual void
87  Print(std::ostream & os, Indent i = 0) const
88  {
89  os << i << this->GetNameOfClass() << " (" << this << ')' << std::endl;
90  }
91 
96  virtual OutputPixelType
97  operator()(const OffsetType & point_index,
98  const OffsetType & boundary_offset,
99  const NeighborhoodType * data) const = 0;
100 
103  virtual OutputPixelType
104  operator()(const OffsetType & point_index,
105  const OffsetType & boundary_offset,
106  const NeighborhoodType * data,
107  const NeighborhoodAccessorFunctorType & neighborhoodAccessorFunctor) const = 0;
108 
109  virtual ~ImageBoundaryCondition() = default;
110 
117  virtual bool
119  {
120  return true;
121  }
122 
132  virtual RegionType
133  GetInputRequestedRegion(const RegionType & inputLargestPossibleRegion, const RegionType & outputRequestedRegion) const
134  {
135  (void)outputRequestedRegion;
136  return inputLargestPossibleRegion;
137  }
148  virtual OutputPixelType
149  GetPixel(const IndexType & index, const TInputImage * image) const = 0;
150 };
151 } // end namespace itk
152 
153 #endif
itk::ImageBoundaryCondition< TSparseImageType, TSparseImageType >::OutputPixelType
typename TSparseImageType ::PixelType OutputPixelType
Definition: itkImageBoundaryCondition.h:67
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:70
GetNameOfClass
const char * GetNameOfClass() const override
itk::ImageBoundaryCondition< TSparseImageType, TSparseImageType >::PixelType
typename TSparseImageType ::PixelType PixelType
Definition: itkImageBoundaryCondition.h:65
itk::Size< ImageDimension >
itk::ImageRegion
An image region represents a structured region of data.
Definition: itkImageRegion.h:80
itk::ImageBoundaryCondition::GetInputRequestedRegion
virtual RegionType GetInputRequestedRegion(const RegionType &inputLargestPossibleRegion, const RegionType &outputRequestedRegion) const
Definition: itkImageBoundaryCondition.h:133
itk::Neighborhood
A light-weight container object for storing an N-dimensional neighborhood of values.
Definition: itkNeighborhood.h:54
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkNeighborhood.h
itkImageRegion.h
itk::ImageBoundaryCondition
A virtual base object that defines an interface to a class of boundary condition objects for use by n...
Definition: itkImageBoundaryCondition.h:52
itk::ImageBoundaryCondition< TSparseImageType, TSparseImageType >::NeighborhoodAccessorFunctorType
typename TSparseImageType ::NeighborhoodAccessorFunctorType NeighborhoodAccessorFunctorType
Definition: itkImageBoundaryCondition.h:77
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageBoundaryCondition::RequiresCompleteNeighborhood
virtual bool RequiresCompleteNeighborhood()
Definition: itkImageBoundaryCondition.h:118
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkIndex.h
itk::Offset< ImageDimension >
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ImageBoundaryCondition::Print
virtual void Print(std::ostream &os, Indent i=0) const
Definition: itkImageBoundaryCondition.h:87
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::ImageBoundaryCondition< TSparseImageType, TSparseImageType >::PixelPointerType
typename TSparseImageType ::InternalPixelType * PixelPointerType
Definition: itkImageBoundaryCondition.h:66