ITK  5.2.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  * 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 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  virtual const char *
85  {
86  return "itkImageBoundaryCondition";
87  }
88 
90  virtual void
91  Print(std::ostream & os, Indent i = 0) const
92  {
93  os << i << this->GetNameOfClass() << " (" << this << ")" << std::endl;
94  }
95 
100  virtual OutputPixelType
101  operator()(const OffsetType & point_index,
102  const OffsetType & boundary_offset,
103  const NeighborhoodType * data) const = 0;
104 
107  virtual OutputPixelType
108  operator()(const OffsetType & point_index,
109  const OffsetType & boundary_offset,
110  const NeighborhoodType * data,
111  const NeighborhoodAccessorFunctorType & neighborhoodAccessorFunctor) const = 0;
112 
113  virtual ~ImageBoundaryCondition() = default;
114 
121  virtual bool
123  {
124  return true;
125  }
126 
136  virtual RegionType
137  GetInputRequestedRegion(const RegionType & inputLargestPossibleRegion, const RegionType & outputRequestedRegion) const
138  {
139  (void)outputRequestedRegion;
140  return inputLargestPossibleRegion;
141  }
143 
152  virtual OutputPixelType
153  GetPixel(const IndexType & index, const TInputImage * image) const = 0;
154 };
155 } // end namespace itk
156 
157 #endif
itk::ImageBoundaryCondition< itk::Image, itk::Image >::OutputPixelType
typename itk::Image ::PixelType OutputPixelType
Definition: itkImageBoundaryCondition.h:67
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
itk::ImageBoundaryCondition< itk::Image, itk::Image >::PixelType
typename itk::Image ::PixelType PixelType
Definition: itkImageBoundaryCondition.h:65
itk::Size< ImageDimension >
itk::ImageRegion
An image region represents a structured region of data.
Definition: itkImageRegion.h:69
itk::ImageBoundaryCondition::GetInputRequestedRegion
virtual RegionType GetInputRequestedRegion(const RegionType &inputLargestPossibleRegion, const RegionType &outputRequestedRegion) const
Definition: itkImageBoundaryCondition.h:137
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< itk::Image, itk::Image >::NeighborhoodAccessorFunctorType
typename itk::Image ::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:122
itk::ImageBoundaryCondition::GetNameOfClass
virtual const char * GetNameOfClass() const
Definition: itkImageBoundaryCondition.h:84
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:91
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::ImageBoundaryCondition< itk::Image, itk::Image >::PixelPointerType
typename itk::Image ::InternalPixelType * PixelPointerType
Definition: itkImageBoundaryCondition.h:66