Loading...
Searching...
No Matches
itkBSplineInterpolationWeightFunctionBase.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkBSplineInterpolationWeightFunctionBase_h
#define itkBSplineInterpolationWeightFunctionBase_h
#include "itkFunctionBase.h"
#include "itkContinuousIndex.h"
#include "itkArray.h"
#include "itkArray2D.h"
#include "itkMath.h"
#include "itkMatrix.h"
#include "itkBSplineKernelFunction2.h"
#include "itkBSplineDerivativeKernelFunction.h"
#include "itkBSplineSecondOrderDerivativeKernelFunction2.h"
namespace itk
{
template <class TCoordRep = float, unsigned int VSpaceDimension = 2, unsigned int VSplineOrder = 3>
class ITK_TEMPLATE_EXPORT BSplineInterpolationWeightFunctionBase
: public FunctionBase<ContinuousIndex<TCoordRep, VSpaceDimension>,
FixedArray<double, Math::UnsignedPower(VSplineOrder + 1, VSpaceDimension)>>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(BSplineInterpolationWeightFunctionBase);
using Self = BSplineInterpolationWeightFunctionBase;
using Superclass = FunctionBase<ContinuousIndex<TCoordRep, VSpaceDimension>,
FixedArray<double, Math::UnsignedPower(VSplineOrder + 1, VSpaceDimension)>>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkTypeMacro(BSplineInterpolationWeightFunctionBase, FunctionBase);
itkStaticConstMacro(SpaceDimension, unsigned int, VSpaceDimension);
itkStaticConstMacro(SplineOrder, unsigned int, VSplineOrder);
static constexpr unsigned long NumberOfWeights = Math::UnsignedPower(VSplineOrder + 1, VSpaceDimension);
using WeightsType = FixedArray<double, NumberOfWeights>;
using IndexType = Index<VSpaceDimension>;
using SizeType = Size<VSpaceDimension>;
using ContinuousIndexType = ContinuousIndex<TCoordRep, VSpaceDimension>;
WeightsType
Evaluate(const ContinuousIndexType & index) const override;
virtual void
Evaluate(const ContinuousIndexType & cindex, const IndexType & startIndex, WeightsType & weights) const;
void
ComputeStartIndex(const ContinuousIndexType & index, IndexType & startIndex) const;
static constexpr SizeType SupportSize{ SizeType::Filled(VSplineOrder + 1) };
protected:
BSplineInterpolationWeightFunctionBase();
~BSplineInterpolationWeightFunctionBase() override = default;
using KernelType = BSplineKernelFunction2<VSplineOrder>;
using KernelPointer = typename KernelType::Pointer;
using DerivativeKernelType = BSplineDerivativeKernelFunction<VSplineOrder>;
using DerivativeKernelPointer = typename DerivativeKernelType::Pointer;
using SecondOrderDerivativeKernelType = BSplineSecondOrderDerivativeKernelFunction2<VSplineOrder>;
using SecondOrderDerivativeKernelPointer = typename SecondOrderDerivativeKernelType::Pointer;
using WeightArrayType = typename KernelType::WeightArrayType;
using OneDWeightsType = Matrix<double, Self::SpaceDimension, VSplineOrder + 1>;
virtual void
Compute1DWeights(const ContinuousIndexType & index,
const IndexType & startIndex,
OneDWeightsType & weights1D) const = 0;
void
PrintSelf(std::ostream & os, Indent indent) const override;
vnl_matrix<unsigned long> m_OffsetToIndexTable{};
private:
void
InitializeOffsetToIndexTable();
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkBSplineInterpolationWeightFunctionBase.hxx"
#endif
#endif
double
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::IndexType
Index< VSpaceDimension > IndexType
Definition itkBSplineInterpolationWeightFunctionBase.h:80
itk::BSplineInterpolationWeightFunctionBase::InitializeOffsetToIndexTable
void InitializeOffsetToIndexTable()
itk::BSplineInterpolationWeightFunctionBase::Evaluate
virtual void Evaluate(const ContinuousIndexType &cindex, const IndexType &startIndex, WeightsType &weights) const
itk::BSplineInterpolationWeightFunctionBase::itkStaticConstMacro
itkStaticConstMacro(SplineOrder, unsigned int, VSplineOrder)
itk::BSplineInterpolationWeightFunctionBase::~BSplineInterpolationWeightFunctionBase
~BSplineInterpolationWeightFunctionBase() override=default
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::SecondOrderDerivativeKernelType
BSplineSecondOrderDerivativeKernelFunction2< VSplineOrder > SecondOrderDerivativeKernelType
Definition itkBSplineInterpolationWeightFunctionBase.h:116
itk::BSplineInterpolationWeightFunctionBase::Evaluate
WeightsType Evaluate(const ContinuousIndexType &index) const override
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::Pointer
SmartPointer< Self > Pointer
Definition itkBSplineInterpolationWeightFunctionBase.h:61
itk::BSplineInterpolationWeightFunctionBase::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(BSplineInterpolationWeightFunctionBase)
itk::BSplineInterpolationWeightFunctionBase::Compute1DWeights
virtual void Compute1DWeights(const ContinuousIndexType &index, const IndexType &startIndex, OneDWeightsType &weights1D) const =0
itk::BSplineInterpolationWeightFunctionBase::itkStaticConstMacro
itkStaticConstMacro(SpaceDimension, unsigned int, VSpaceDimension)
itk::BSplineInterpolationWeightFunctionBase::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::BSplineInterpolationWeightFunctionBase::BSplineInterpolationWeightFunctionBase
BSplineInterpolationWeightFunctionBase()
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::DerivativeKernelType
BSplineDerivativeKernelFunction< VSplineOrder > DerivativeKernelType
Definition itkBSplineInterpolationWeightFunctionBase.h:114
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::SecondOrderDerivativeKernelPointer
typename SecondOrderDerivativeKernelType::Pointer SecondOrderDerivativeKernelPointer
Definition itkBSplineInterpolationWeightFunctionBase.h:117
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::NumberOfWeights
static constexpr unsigned long NumberOfWeights
Definition itkBSplineInterpolationWeightFunctionBase.h:74
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::SupportSize
static constexpr SizeType SupportSize
Definition itkBSplineInterpolationWeightFunctionBase.h:105
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::KernelPointer
typename KernelType::Pointer KernelPointer
Definition itkBSplineInterpolationWeightFunctionBase.h:113
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::WeightsType
FixedArray< double, NumberOfWeights > WeightsType
Definition itkBSplineInterpolationWeightFunctionBase.h:77
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::SizeType
Size< VSpaceDimension > SizeType
Definition itkBSplineInterpolationWeightFunctionBase.h:81
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkBSplineInterpolationWeightFunctionBase.h:62
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::OneDWeightsType
Matrix< double, Self::SpaceDimension, VSplineOrder+1 > OneDWeightsType
Definition itkBSplineInterpolationWeightFunctionBase.h:124
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::WeightArrayType
typename KernelType::WeightArrayType WeightArrayType
Definition itkBSplineInterpolationWeightFunctionBase.h:118
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::ContinuousIndexType
ContinuousIndex< TCoordRep, VSpaceDimension > ContinuousIndexType
Definition itkBSplineInterpolationWeightFunctionBase.h:84
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::Superclass
FunctionBase< ContinuousIndex< TCoordRep, VSpaceDimension >, FixedArray< double, Math::UnsignedPower(VSplineOrder+1, VSpaceDimension)> > Superclass
Definition itkBSplineInterpolationWeightFunctionBase.h:59
itk::BSplineInterpolationWeightFunctionBase::ComputeStartIndex
void ComputeStartIndex(const ContinuousIndexType &index, IndexType &startIndex) const
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::m_OffsetToIndexTable
vnl_matrix< unsigned long > m_OffsetToIndexTable
Definition itkBSplineInterpolationWeightFunctionBase.h:137
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::Self
BSplineInterpolationWeightFunctionBase Self
Definition itkBSplineInterpolationWeightFunctionBase.h:58
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::KernelType
BSplineKernelFunction2< VSplineOrder > KernelType
Definition itkBSplineInterpolationWeightFunctionBase.h:112
itk::BSplineInterpolationWeightFunctionBase< TCoordRep, VSpaceDimension, VSplineOrder >::DerivativeKernelPointer
typename DerivativeKernelType::Pointer DerivativeKernelPointer
Definition itkBSplineInterpolationWeightFunctionBase.h:115
itk::BSplineKernelFunction2
B-spline kernel used for density estimation and nonparameteric regression.
Definition itkBSplineKernelFunction2.h:59
itk::BSplineKernelFunction2< VSplineOrder >::WeightArrayType
FixedArray< double, VSplineOrder+1 > WeightArrayType
Definition itkBSplineKernelFunction2.h:78
itk::BSplineKernelFunction2< VSplineOrder >::Pointer
SmartPointer< Self > Pointer
Definition itkBSplineKernelFunction2.h:66
itk::BSplineSecondOrderDerivativeKernelFunction2
Derivative of a B-spline kernel used for density estimation and nonparametric regression.
Definition itkBSplineSecondOrderDerivativeKernelFunction2.h:45
itk::BSplineSecondOrderDerivativeKernelFunction2< VSplineOrder >::Pointer
SmartPointer< Self > Pointer
Definition itkBSplineSecondOrderDerivativeKernelFunction2.h:52
itkBSplineKernelFunction2.h
itkBSplineSecondOrderDerivativeKernelFunction2.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |