ITK  5.4.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  * 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 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 int start = 0,
71  const unsigned int stride = 1);
72 
73  static OutputPixelType
74  Compute(const NeighborhoodType & N,
75  const OperatorType & op,
76  const unsigned int start = 0,
77  const unsigned int stride = 1);
78 
81  operator()(const std::slice & s, const ConstNeighborhoodIterator<TImage> & it, const OperatorType & op) const
82  {
83  return Self::Compute(it, op, s.start(), s.stride());
84  }
85 
86  OutputPixelType
88  {
89  return Self::Compute(it, op);
90  }
91 
92  OutputPixelType
93  operator()(const std::slice & s, const NeighborhoodType & N, const OperatorType & op) const
94  {
95  return Self::Compute(N, op, s.start(), s.stride());
96  }
97 
98  OutputPixelType
99  operator()(const NeighborhoodType & N, const OperatorType & op) const
100  {
101  return Self::Compute(N, op);
102  }
103 };
104 } // end namespace itk
105 
106 #ifndef ITK_MANUAL_INSTANTIATION
107 # include "itkNeighborhoodInnerProduct.hxx"
108 #endif
109 
110 /*
111 #ifndef ITK_MANUAL_INSTANTIATION
112 #include "itkNeighborhoodInnerProduct.hxx"
113 #endif
114 */
115 
116 #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:81
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:99
itk::NeighborhoodInnerProduct::operator()
OutputPixelType operator()(const std::slice &s, const NeighborhoodType &N, const OperatorType &op) const
Definition: itkNeighborhoodInnerProduct.h:93
itk::NeighborhoodInnerProduct::operator()
OutputPixelType operator()(const ConstNeighborhoodIterator< TImage > &it, const OperatorType &op) const
Definition: itkNeighborhoodInnerProduct.h:87