ITK  5.3.0
Insight Toolkit
itkNeighborhoodInnerProduct.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 itkNeighborhoodInnerProduct_h
19 #define itkNeighborhoodInnerProduct_h
20 
22 #include "itkConstSliceIterator.h"
24 
25 namespace itk
26 {
47 template <typename TImage, typename TOperator = typename TImage::PixelType, typename TComputation = TOperator>
48 class ITK_TEMPLATE_EXPORT NeighborhoodInnerProduct
49 {
50 public:
53 
55  using ImagePixelType = typename TImage::PixelType;
56  using OperatorPixelType = TOperator;
57  using OutputPixelType = TComputation;
58 
60  static constexpr unsigned int ImageDimension = TImage::ImageDimension;
61 
64 
66 
67  static OutputPixelType
68  Compute(const ConstNeighborhoodIterator<TImage> & it,
69  const OperatorType & op,
70  const unsigned start = 0,
71  const unsigned stride = 1);
72 
73  static OutputPixelType
74  Compute(const NeighborhoodType & N, const OperatorType & op, const unsigned start = 0, const unsigned stride = 1);
75 
78  operator()(const std::slice & s, const ConstNeighborhoodIterator<TImage> & it, const OperatorType & op) const
79  {
80  return Self::Compute(it, op, s.start(), s.stride());
81  }
82 
83  OutputPixelType
85  {
86  return Self::Compute(it, op);
87  }
88 
89  OutputPixelType
90  operator()(const std::slice & s, const NeighborhoodType & N, const OperatorType & op) const
91  {
92  return Self::Compute(N, op, s.start(), s.stride());
93  }
94 
95  OutputPixelType
96  operator()(const NeighborhoodType & N, const OperatorType & op) const
97  {
98  return Self::Compute(N, op);
99  }
100 };
101 } // end namespace itk
102 
103 #ifndef ITK_MANUAL_INSTANTIATION
104 # include "itkNeighborhoodInnerProduct.hxx"
105 #endif
106 
107 /*
108 #ifndef ITK_MANUAL_INSTANTIATION
109 #include "itkNeighborhoodInnerProduct.hxx"
110 #endif
111 */
112 
113 #endif
itkNeighborhoodIterator.h
itk::Neighborhood
A light-weight container object for storing an N-dimensional neighborhood of values.
Definition: itkNeighborhood.h:54
itkConstSliceIterator.h
itk::NeighborhoodInnerProduct< ImageType >::ImagePixelType
typename ImageType ::PixelType ImagePixelType
Definition: itkNeighborhoodInnerProduct.h:55
itkImageBoundaryCondition.h
itk::NeighborhoodInnerProduct< ImageType >::OperatorPixelType
typename ImageType ::PixelType OperatorPixelType
Definition: itkNeighborhoodInnerProduct.h:56
itk::NeighborhoodInnerProduct::operator()
OutputPixelType operator()(const std::slice &s, const ConstNeighborhoodIterator< TImage > &it, const OperatorType &op) const
Definition: itkNeighborhoodInnerProduct.h:78
itk::NeighborhoodInnerProduct< ImageType >::OutputPixelType
typename ImageType ::PixelType OutputPixelType
Definition: itkNeighborhoodInnerProduct.h:57
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConstNeighborhoodIterator< TImage >
itk::NeighborhoodInnerProduct
Defines the inner product operation between an Neighborhood and a NeighborhoodOperator.
Definition: itkNeighborhoodInnerProduct.h:48
itk::NeighborhoodInnerProduct::operator()
OutputPixelType operator()(const NeighborhoodType &N, const OperatorType &op) const
Definition: itkNeighborhoodInnerProduct.h:96
itk::NeighborhoodInnerProduct::operator()
OutputPixelType operator()(const std::slice &s, const NeighborhoodType &N, const OperatorType &op) const
Definition: itkNeighborhoodInnerProduct.h:90
itk::NeighborhoodInnerProduct::operator()
OutputPixelType operator()(const ConstNeighborhoodIterator< TImage > &it, const OperatorType &op) const
Definition: itkNeighborhoodInnerProduct.h:84