ITK  6.0.0
Insight Toolkit
itkBSplineInterpolationWeightFunction.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 itkBSplineInterpolationWeightFunction_h
19 #define itkBSplineInterpolationWeightFunction_h
20 
21 #include "itkFunctionBase.h"
22 #include "itkContinuousIndex.h"
23 #include "itkArray.h"
24 #include "itkArray2D.h"
25 #include "itkIndexRange.h"
26 #include "itkMath.h"
27 
28 namespace itk
29 {
47 template <typename TCoordRep = float, unsigned int VSpaceDimension = 2, unsigned int VSplineOrder = 3>
48 class ITK_TEMPLATE_EXPORT BSplineInterpolationWeightFunction
49  : public FunctionBase<ContinuousIndex<TCoordRep, VSpaceDimension>,
50  FixedArray<double, Math::UnsignedPower(VSplineOrder + 1, VSpaceDimension)>>
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_MOVE(BSplineInterpolationWeightFunction);
54 
58  FixedArray<double, Math::UnsignedPower(VSplineOrder + 1, VSpaceDimension)>>;
59 
62 
64  itkNewMacro(Self);
65 
67  itkOverrideGetNameOfClassMacro(BSplineInterpolationWeightFunction);
68 
70  static constexpr unsigned int SpaceDimension = VSpaceDimension;
71 
73  static constexpr unsigned int SplineOrder = VSplineOrder;
74 
77 
79  static constexpr unsigned int NumberOfWeights{ WeightsType::Length };
80 
84 
87 
89  static constexpr SizeType SupportSize{ SizeType::Filled(VSplineOrder + 1) };
90 
93  WeightsType
94  Evaluate(const ContinuousIndexType & index) const override;
95 
104  virtual void
105  Evaluate(const ContinuousIndexType & index, WeightsType & weights, IndexType & startIndex) const;
106 
107 #if !defined(ITK_LEGACY_REMOVE)
108 
109  itkLegacyMacro(SizeType GetSupportSize() const)
110  {
111  return Self::SupportSize;
112  }
113 
115  itkLegacyMacro(unsigned int GetNumberOfWeights() const)
116  {
117  return Self::NumberOfWeights;
118  }
119 #endif
120 
121 protected:
122  BSplineInterpolationWeightFunction() = default;
123  ~BSplineInterpolationWeightFunction() override = default;
124 };
125 } // end namespace itk
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 # include "itkBSplineInterpolationWeightFunction.hxx"
129 #endif
130 
131 #endif
itk::BSplineInterpolationWeightFunction
Returns the weights over the support region used for B-spline interpolation/reconstruction.
Definition: itkBSplineInterpolationWeightFunction.h:48
itkIndexRange.h
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:68
itkContinuousIndex.h
itk::Size
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:69
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itkFunctionBase.h
itk::BSplineInterpolationWeightFunction::WeightsType
typename Superclass::OutputType WeightsType
Definition: itkBSplineInterpolationWeightFunction.h:76
itk::Math::UnsignedPower
constexpr TReturnType UnsignedPower(const uintmax_t base, const uintmax_t exponent) noexcept
Definition: itkMath.h:793
itk::FixedArray
Simulate a standard C array with copy semantics.
Definition: itkFixedArray.h:53
itkArray.h
itk::FunctionBase
Base class for all ITK function objects.
Definition: itkFunctionBase.h:44
itkArray2D.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ContinuousIndex
A templated class holding a point in n-Dimensional image space.
Definition: itkContinuousIndex.h:46
itkMath.h