Loading...
Searching...
No Matches
itkReducedDimensionBSplineInterpolateImageFunction.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.
*
*=========================================================================*/
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkReducedDimBSplineInterpolateImageFunction.h,v $
Date: $Date: 2009-04-25 12:27:05 $
Version: $Revision: 1.24 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
Portions of this code are covered under the VTK copyright.
See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef itkReducedDimensionBSplineInterpolateImageFunction_h
#define itkReducedDimensionBSplineInterpolateImageFunction_h
#include <vector>
#include "itkInterpolateImageFunction.h"
#include <vnl/vnl_matrix.h>
#include "itkMultiOrderBSplineDecompositionImageFilter.h"
#include "itkConceptChecking.h"
#include "itkCovariantVector.h"
namespace itk
{
template <class TImageType, class TCoordRep = double, class TCoefficientType = double>
class ITK_TEMPLATE_EXPORT ReducedDimensionBSplineInterpolateImageFunction
: public InterpolateImageFunction<TImageType, TCoordRep>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(ReducedDimensionBSplineInterpolateImageFunction);
using Self = ReducedDimensionBSplineInterpolateImageFunction;
using Superclass = InterpolateImageFunction<TImageType, TCoordRep>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkTypeMacro(ReducedDimensionBSplineInterpolateImageFunction, InterpolateImageFunction);
itkNewMacro(Self);
using typename Superclass::OutputType;
using SizeType = typename TImageType::SizeType;
using typename Superclass::InputImageType;
itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
using typename Superclass::IndexType;
using typename Superclass::ContinuousIndexType;
using typename Superclass::PointType;
using CoefficientDataType = TCoefficientType;
using CoefficientImageType = Image<CoefficientDataType, Self::ImageDimension>;
using CoefficientFilter = MultiOrderBSplineDecompositionImageFilter<TImageType, CoefficientImageType>;
using CoefficientFilterPointer = typename CoefficientFilter::Pointer;
OutputType
EvaluateAtContinuousIndex(const ContinuousIndexType & index) const override;
using CovariantVectorType = CovariantVector<OutputType, Self::ImageDimension>;
CovariantVectorType
EvaluateDerivative(const PointType & point) const
{
const auto index = this->GetInputImage()->template TransformPhysicalPointToContinuousIndex<TCoordRep>(point);
return (this->EvaluateDerivativeAtContinuousIndex(index));
}
CovariantVectorType
EvaluateDerivativeAtContinuousIndex(const ContinuousIndexType & x) const;
void
SetSplineOrder(unsigned int SplineOrder);
itkGetConstMacro(SplineOrder, int);
void
SetInputImage(const TImageType * inputData) override;
itkSetMacro(UseImageDirection, bool);
itkGetConstMacro(UseImageDirection, bool);
itkBooleanMacro(UseImageDirection);
protected:
ReducedDimensionBSplineInterpolateImageFunction();
~ReducedDimensionBSplineInterpolateImageFunction() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
// These are needed by the smoothing spline routine.
typename TImageType::SizeType m_DataLength{}; // Image size
unsigned int m_SplineOrder{}; // User specified spline order (3rd or cubic is the default)
typename CoefficientImageType::ConstPointer m_Coefficients{}; // Spline coefficients
private:
SizeType
GetRadius() const override
{
return SizeType::Filled(m_SplineOrder + 1);
}
void
SetInterpolationWeights(const ContinuousIndexType & x,
const vnl_matrix<long> & EvaluateIndex,
vnl_matrix<double> & weights,
unsigned int splineOrder) const;
void
SetDerivativeWeights(const ContinuousIndexType & x,
const vnl_matrix<long> & EvaluateIndex,
vnl_matrix<double> & weights,
unsigned int splineOrder) const;
void
GeneratePointsToIndex();
void
DetermineRegionOfSupport(vnl_matrix<long> & evaluateIndex,
const ContinuousIndexType & x,
unsigned int splineOrder) const;
void
ApplyMirrorBoundaryConditions(vnl_matrix<long> & evaluateIndex, unsigned int splineOrder) const;
std::vector<IndexType> m_PointsToIndex{}; // Preallocation of interpolation neighborhood indicies
CoefficientFilterPointer m_CoefficientFilter{};
// flag to take or not the image direction into account when computing the
// derivatives.
bool m_UseImageDirection{};
};
} // namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkReducedDimensionBSplineInterpolateImageFunction.hxx"
#endif
#endif
itk::MultiOrderBSplineDecompositionImageFilter
Calculates the B-Spline coefficients of an image. Spline order may be per dimension from 0 to 5 per.
Definition itkMultiOrderBSplineDecompositionImageFilter.h:83
itk::MultiOrderBSplineDecompositionImageFilter::Pointer
SmartPointer< Self > Pointer
Definition itkMultiOrderBSplineDecompositionImageFilter.h:90
itk::ReducedDimensionBSplineInterpolateImageFunction::EvaluateAtContinuousIndex
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
itk::ReducedDimensionBSplineInterpolateImageFunction::EvaluateDerivative
CovariantVectorType EvaluateDerivative(const PointType &point) const
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:147
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:95
itk::ReducedDimensionBSplineInterpolateImageFunction::~ReducedDimensionBSplineInterpolateImageFunction
~ReducedDimensionBSplineInterpolateImageFunction() override=default
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::SizeType
typename MovingImageType::SizeType SizeType
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:106
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::Self
ReducedDimensionBSplineInterpolateImageFunction Self
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:92
itk::ReducedDimensionBSplineInterpolateImageFunction::GetRadius
SizeType GetRadius() const override
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:198
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::m_DataLength
MovingImageType::SizeType m_DataLength
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:191
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::m_UseImageDirection
bool m_UseImageDirection
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:239
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::CoefficientDataType
double CoefficientDataType
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:124
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::Pointer
SmartPointer< Self > Pointer
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:94
itk::ReducedDimensionBSplineInterpolateImageFunction::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(ReducedDimensionBSplineInterpolateImageFunction)
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::CovariantVectorType
CovariantVector< OutputType, Self::ImageDimension > CovariantVectorType
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:144
itk::ReducedDimensionBSplineInterpolateImageFunction::SetInputImage
void SetInputImage(const TImageType *inputData) override
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::Superclass
InterpolateImageFunction< MovingImageType, CoordinateRepresentationType > Superclass
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:93
itk::ReducedDimensionBSplineInterpolateImageFunction::GeneratePointsToIndex
void GeneratePointsToIndex()
itk::ReducedDimensionBSplineInterpolateImageFunction::SetDerivativeWeights
void SetDerivativeWeights(const ContinuousIndexType &x, const vnl_matrix< long > &EvaluateIndex, vnl_matrix< double > &weights, unsigned int splineOrder) const
itk::ReducedDimensionBSplineInterpolateImageFunction::DetermineRegionOfSupport
void DetermineRegionOfSupport(vnl_matrix< long > &evaluateIndex, const ContinuousIndexType &x, unsigned int splineOrder) const
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::m_PointsToIndex
std::vector< IndexType > m_PointsToIndex
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:233
itk::ReducedDimensionBSplineInterpolateImageFunction::ApplyMirrorBoundaryConditions
void ApplyMirrorBoundaryConditions(vnl_matrix< long > &evaluateIndex, unsigned int splineOrder) const
itk::ReducedDimensionBSplineInterpolateImageFunction::itkStaticConstMacro
itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension)
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::EvaluateDerivativeAtContinuousIndex
CovariantVectorType EvaluateDerivativeAtContinuousIndex(const ContinuousIndexType &x) const
itk::ReducedDimensionBSplineInterpolateImageFunction::SetInterpolationWeights
void SetInterpolationWeights(const ContinuousIndexType &x, const vnl_matrix< long > &EvaluateIndex, vnl_matrix< double > &weights, unsigned int splineOrder) const
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::m_SplineOrder
unsigned int m_SplineOrder
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:192
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::CoefficientImageType
Image< CoefficientDataType, Self::ImageDimension > CoefficientImageType
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:125
itk::ReducedDimensionBSplineInterpolateImageFunction::ReducedDimensionBSplineInterpolateImageFunction
ReducedDimensionBSplineInterpolateImageFunction()
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::CoefficientFilterPointer
typename CoefficientFilter::Pointer CoefficientFilterPointer
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:130
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::CoefficientFilter
MultiOrderBSplineDecompositionImageFilter< MovingImageType, CoefficientImageType > CoefficientFilter
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:128
itk::ReducedDimensionBSplineInterpolateImageFunction::SetSplineOrder
void SetSplineOrder(unsigned int SplineOrder)
itk::ReducedDimensionBSplineInterpolateImageFunction::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::m_Coefficients
CoefficientImageType::ConstPointer m_Coefficients
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:194
itk::ReducedDimensionBSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double >::m_CoefficientFilter
CoefficientFilterPointer m_CoefficientFilter
Definition itkReducedDimensionBSplineInterpolateImageFunction.h:235
itkMultiOrderBSplineDecompositionImageFilter.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |