ITK  6.0.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
24
25namespace itk
26{
47template <typename TImage, typename TOperator = typename TImage::PixelType, typename TComputation = TOperator>
48class ITK_TEMPLATE_EXPORT NeighborhoodInnerProduct
49{
50public:
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
69 const OperatorType & op,
70 const unsigned int start = 0,
71 const unsigned int stride = 1);
72
73 static OutputPixelType
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
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Defines the inner product operation between an Neighborhood and a NeighborhoodOperator.
OutputPixelType operator()(const std::slice &s, const NeighborhoodType &N, const OperatorType &op) const
OutputPixelType operator()(const ConstNeighborhoodIterator< TImage > &it, const OperatorType &op) const
typename TImage::PixelType ImagePixelType
static OutputPixelType Compute(const NeighborhoodType &N, const OperatorType &op, const unsigned int start=0, const unsigned int stride=1)
OutputPixelType operator()(const NeighborhoodType &N, const OperatorType &op) const
OutputPixelType operator()(const std::slice &s, const ConstNeighborhoodIterator< TImage > &it, const OperatorType &op) const
static OutputPixelType Compute(const ConstNeighborhoodIterator< TImage > &it, const OperatorType &op, const unsigned int start=0, const unsigned int stride=1)
A light-weight container object for storing an N-dimensional neighborhood of values.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....