ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkNeighborhoodInnerProduct.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  Self::ImageDimension >;
65 
67  Self::ImageDimension >;
68 
69  static OutputPixelType Compute(
71  const OperatorType & op,
72  const unsigned start = 0,
73  const unsigned stride = 1);
74 
75  static OutputPixelType Compute(
76  const NeighborhoodType & N,
77  const OperatorType & op,
78  const unsigned start = 0,
79  const unsigned stride = 1);
80 
82  OutputPixelType operator()(const std::slice & s,
84  const OperatorType & op) const
85  {
86  return Self::Compute(it, op, s.start(), s.stride());
87  }
88 
90  const OperatorType & op) const
91  {
92  return Self::Compute(it, op);
93  }
94 
95  OutputPixelType operator()(const std::slice & s,
96  const NeighborhoodType & N,
97  const OperatorType & op) const
98  {
99  return Self::Compute(N, op, s.start(), s.stride());
100  }
101 
103  const OperatorType & op) const
104  {
105  return Self::Compute(N, op);
106  }
107 };
108 } // end namespace itk
109 
110 #ifndef ITK_MANUAL_INSTANTIATION
111 #include "itkNeighborhoodInnerProduct.hxx"
112 #endif
113 
114 /*
115 #ifndef ITK_MANUAL_INSTANTIATION
116 #include "itkNeighborhoodInnerProduct.hxx"
117 #endif
118 */
119 
120 #endif
Defines the inner product operation between an Neighborhood and a NeighborhoodOperator.
A light-weight container object for storing an N-dimensional neighborhood of values.
OutputPixelType operator()(const ConstNeighborhoodIterator< TImage > &it, const OperatorType &op) const
OutputPixelType operator()(const std::slice &s, const NeighborhoodType &N, const OperatorType &op) const
OutputPixelType operator()(const NeighborhoodType &N, const OperatorType &op) const
OutputPixelType operator()(const std::slice &s, const ConstNeighborhoodIterator< TImage > &it, const OperatorType &op) const