ITK  6.0.0
Insight Toolkit
itkNeighborhoodAccessorFunctor.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 itkNeighborhoodAccessorFunctor_h
19 #define itkNeighborhoodAccessorFunctor_h
20 
22 #include "itkImageBase.h"
23 
24 namespace itk
25 {
40 template <typename TImage>
41 class ITK_TEMPLATE_EXPORT NeighborhoodAccessorFunctor final
42 {
43 public:
45  using ImageType = TImage;
46  using PixelType = typename ImageType::PixelType;
47  using InternalPixelType = typename ImageType::InternalPixelType;
48  using VectorLengthType = unsigned int;
49  using OffsetType = typename ImageType::OffsetType;
50 
51  static constexpr unsigned int ImageDimension = TImage::ImageDimension;
53 
54  template <typename TOutput = ImageType>
56 
58  inline void
60  {}
61 
68  inline PixelType
69  Get(const InternalPixelType * pixelPointer) const
70  {
71  return (*pixelPointer);
72  }
73 
75  inline void
76  Set(InternalPixelType * const pixelPointer, const PixelType & p) const
77  {
78  *pixelPointer = p;
79  }
80 
81  template <typename TOutput>
82  inline typename ImageBoundaryConditionType<TOutput>::OutputPixelType
83  BoundaryCondition(const OffsetType & point_index,
84  const OffsetType & boundary_offset,
85  const NeighborhoodType * data,
86  const ImageBoundaryConditionType<TOutput> * boundaryCondition) const
87  {
88  return boundaryCondition->operator()(point_index, boundary_offset, data);
89  }
90 
92  VectorLengthType
94  {
95  return 0;
96  }
97 };
98 } // end namespace itk
99 
100 // template< typename TImage > const unsigned int
101 // itk::NeighborhoodAccessorFunctor<TImage>::ImageDimension;
102 
103 #endif
itk::NeighborhoodAccessorFunctor::SetBegin
void SetBegin(const InternalPixelType *)
Definition: itkNeighborhoodAccessorFunctor.h:59
itk::NeighborhoodAccessorFunctor::VectorLengthType
unsigned int VectorLengthType
Definition: itkNeighborhoodAccessorFunctor.h:48
itk::NeighborhoodAccessorFunctor::Set
void Set(InternalPixelType *const pixelPointer, const PixelType &p) const
Definition: itkNeighborhoodAccessorFunctor.h:76
itk::Neighborhood
A light-weight container object for storing an N-dimensional neighborhood of values.
Definition: itkNeighborhood.h:54
itk::NeighborhoodAccessorFunctor::SetVectorLength
VectorLengthType SetVectorLength()
Definition: itkNeighborhoodAccessorFunctor.h:93
itk::NeighborhoodAccessorFunctor::SetVectorLength
void SetVectorLength(VectorLengthType)
Definition: itkNeighborhoodAccessorFunctor.h:91
itk::NeighborhoodAccessorFunctor
Provides accessor interfaces to Get pixels and is meant to be used on pointers contained within Neigh...
Definition: itkNeighborhoodAccessorFunctor.h:41
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
itkImageBoundaryCondition.h
itk::NeighborhoodAccessorFunctor::BoundaryCondition
ImageBoundaryConditionType< TOutput >::OutputPixelType BoundaryCondition(const OffsetType &point_index, const OffsetType &boundary_offset, const NeighborhoodType *data, const ImageBoundaryConditionType< TOutput > *boundaryCondition) const
Definition: itkNeighborhoodAccessorFunctor.h:83
itk::NeighborhoodAccessorFunctor::PixelType
typename ImageType::PixelType PixelType
Definition: itkNeighborhoodAccessorFunctor.h:46
itk::NeighborhoodAccessorFunctor::OffsetType
typename ImageType::OffsetType OffsetType
Definition: itkNeighborhoodAccessorFunctor.h:49
itk::NeighborhoodAccessorFunctor::Get
PixelType Get(const InternalPixelType *pixelPointer) const
Definition: itkNeighborhoodAccessorFunctor.h:69
itk::NeighborhoodAccessorFunctor::ImageType
TImage ImageType
Definition: itkNeighborhoodAccessorFunctor.h:45
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::NeighborhoodAccessorFunctor::InternalPixelType
typename ImageType::InternalPixelType InternalPixelType
Definition: itkNeighborhoodAccessorFunctor.h:47
itkImageBase.h