ITK  6.0.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
25namespace itk
26{
51template <typename TInputImage, typename TOutputImage = TInputImage>
52class ITK_TEMPLATE_EXPORT ImageBoundaryCondition
53{
54public:
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
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,
134 [[maybe_unused]] const RegionType & itkNotUsed(outputRequestedRegion)) const
135 {
136 return inputLargestPossibleRegion;
137 }
138
147 virtual OutputPixelType
148 GetPixel(const IndexType & index, const TInputImage * image) const = 0;
149};
150} // end namespace itk
151
152#endif
A virtual base object that defines an interface to a class of boundary condition objects for use by n...
typename TInputImage::PixelType PixelType
typename TInputImage::NeighborhoodAccessorFunctorType NeighborhoodAccessorFunctorType
typename TInputImage::InternalPixelType * PixelPointerType
virtual void Print(std::ostream &os, Indent i=0) const
virtual OutputPixelType GetPixel(const IndexType &index, const TInputImage *image) const =0
virtual OutputPixelType operator()(const OffsetType &point_index, const OffsetType &boundary_offset, const NeighborhoodType *data) const =0
virtual OutputPixelType operator()(const OffsetType &point_index, const OffsetType &boundary_offset, const NeighborhoodType *data, const NeighborhoodAccessorFunctorType &neighborhoodAccessorFunctor) const =0
typename TOutputImage::PixelType OutputPixelType
virtual ~ImageBoundaryCondition()=default
virtual RegionType GetInputRequestedRegion(const RegionType &inputLargestPossibleRegion, const RegionType &) const
An image region represents a structured region of data.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
A light-weight container object for storing an N-dimensional neighborhood of values.
const char * GetNameOfClass() const override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:69