Loading...
Searching...
No Matches
itkAdvancedMatrixOffsetTransformBase.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: itkAdvancedMatrixOffsetTransformBase.h,v $
Date: $Date: 2008-06-29 12:58:58 $
Version: $Revision: 1.20 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.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 itkAdvancedMatrixOffsetTransformBase_h
#define itkAdvancedMatrixOffsetTransformBase_h
#include <iostream>
#include "itkMatrix.h"
#include "itkAdvancedTransform.h"
#include "itkMacro.h"
#include "itkMacro.h"
namespace itk
{
template <class TScalarType = double, // Data type for scalars
unsigned int NInputDimensions = 3, // Number of dimensions in the input space
unsigned int NOutputDimensions = 3>
// Number of dimensions in the output space
class ITK_TEMPLATE_EXPORT AdvancedMatrixOffsetTransformBase
: public AdvancedTransform<TScalarType, NInputDimensions, NOutputDimensions>
{
public:
using Self = AdvancedMatrixOffsetTransformBase;
using Superclass = AdvancedTransform<TScalarType, NInputDimensions, NOutputDimensions>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkTypeMacro(AdvancedMatrixOffsetTransformBase, AdvancedTransform);
itkNewMacro(Self);
itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
itkStaticConstMacro(ParametersDimension, unsigned int, NOutputDimensions *(NInputDimensions + 1));
using typename Superclass::ScalarType;
using typename Superclass::ParametersType;
using typename Superclass::FixedParametersType;
using typename Superclass::NumberOfParametersType;
using typename Superclass::JacobianType;
using typename Superclass::InputVectorType;
using typename Superclass::OutputVectorType;
using typename Superclass::InputCovariantVectorType;
using typename Superclass::OutputCovariantVectorType;
using typename Superclass::InputVnlVectorType;
using typename Superclass::OutputVnlVectorType;
using typename Superclass::InputPointType;
using typename Superclass::OutputPointType;
using typename Superclass::TransformCategoryEnum;
using typename Superclass::NonZeroJacobianIndicesType;
using typename Superclass::SpatialJacobianType;
using typename Superclass::JacobianOfSpatialJacobianType;
using typename Superclass::SpatialHessianType;
using typename Superclass::JacobianOfSpatialHessianType;
using typename Superclass::InternalMatrixType;
using MatrixType = Matrix<TScalarType, Self::OutputSpaceDimension, Self::InputSpaceDimension>;
using InverseMatrixType = Matrix<TScalarType, Self::InputSpaceDimension, Self::OutputSpaceDimension>;
using CenterType = InputPointType;
using OffsetType = OutputVectorType;
using TranslationType = OutputVectorType;
virtual void
SetIdentity();
virtual void
SetMatrix(const MatrixType & matrix)
{
this->m_Matrix = matrix;
this->ComputeOffset();
this->ComputeMatrixParameters();
this->m_MatrixMTime.Modified();
this->Modified();
}
const MatrixType &
GetMatrix() const
{
return this->m_Matrix;
}
void
SetCenter(const InputPointType & center)
{
this->m_Center = center;
this->ComputeOffset();
this->Modified();
}
const InputPointType &
GetCenter() const
{
return this->m_Center;
}
void
SetTranslation(const OutputVectorType & translation)
{
this->m_Translation = translation;
this->ComputeOffset();
this->Modified();
}
const OutputVectorType &
GetTranslation() const
{
return this->m_Translation;
}
void
SetParameters(const ParametersType & parameters) override;
const ParametersType &
GetParameters() const override;
void
SetFixedParameters(const FixedParametersType &) override;
const FixedParametersType &
GetFixedParameters() const override;
OutputPointType
TransformPoint(const InputPointType & point) const override;
OutputVectorType
TransformVector(const InputVectorType & vector) const override;
OutputVnlVectorType
TransformVector(const InputVnlVectorType & vector) const override;
OutputCovariantVectorType
TransformCovariantVector(const InputCovariantVectorType & vector) const override;
bool
IsLinear() const override
{
return true;
}
TransformCategoryEnum
GetTransformCategory() const override
{
return TransformCategoryEnum::Linear;
}
void
GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const override;
void
GetSpatialJacobian(const InputPointType &, SpatialJacobianType &) const override;
void
GetSpatialHessian(const InputPointType &, SpatialHessianType &) const override;
void
GetJacobianOfSpatialJacobian(const InputPointType &,
JacobianOfSpatialJacobianType &,
NonZeroJacobianIndicesType &) const override;
void
GetJacobianOfSpatialJacobian(const InputPointType &,
SpatialJacobianType &,
JacobianOfSpatialJacobianType &,
NonZeroJacobianIndicesType &) const override;
void
GetJacobianOfSpatialHessian(const InputPointType &,
JacobianOfSpatialHessianType &,
NonZeroJacobianIndicesType &) const override;
void
GetJacobianOfSpatialHessian(const InputPointType & inputPoint,
SpatialHessianType & sh,
JacobianOfSpatialHessianType & jsh,
NonZeroJacobianIndicesType & nonZeroJacobianIndices) const override;
protected:
explicit AdvancedMatrixOffsetTransformBase(const unsigned int paramDims = ParametersDimension);
~AdvancedMatrixOffsetTransformBase() override = default;
void
PrintSelf(std::ostream & s, Indent indent) const override;
virtual void
ComputeMatrixParameters();
virtual void
ComputeMatrix();
void
SetVarMatrix(const MatrixType & matrix)
{
this->m_Matrix = matrix;
this->m_MatrixMTime.Modified();
}
void
ComputeTranslation();
void
SetVarTranslation(const OutputVectorType & translation)
{
this->m_Translation = translation;
}
virtual void
ComputeOffset();
const OutputVectorType &
GetOffset() const
{
return this->m_Offset;
}
NonZeroJacobianIndicesType m_NonZeroJacobianIndices{};
SpatialHessianType m_SpatialHessian{};
JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian{};
JacobianOfSpatialHessianType m_JacobianOfSpatialHessian{};
private:
// Private using-declarations, to avoid `-Woverloaded-virtual` warnings from GCC (GCC 11.4).
using Superclass::TransformCovariantVector;
using Superclass::TransformVector;
AdvancedMatrixOffsetTransformBase(const Self & other);
const Self &
operator=(const Self &);
void
PrecomputeJacobians(unsigned int paramDims);
const InverseMatrixType &
GetInverseMatrix() const;
MatrixType m_Matrix{ MatrixType::GetIdentity() }; // Matrix of the transformation
OutputVectorType m_Offset{}; // Offset of the transformation
mutable InverseMatrixType m_InverseMatrix{ InverseMatrixType::GetIdentity() }; // Inverse of the matrix
mutable bool m_Singular{ false }; // Is m_Inverse singular?
InputPointType m_Center{};
OutputVectorType m_Translation{};
TimeStamp m_MatrixMTime{};
mutable TimeStamp m_InverseMatrixMTime{};
};
} // namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkAdvancedMatrixOffsetTransformBase.hxx"
#endif
#endif /* itkAdvancedMatrixOffsetTransformBase_h */
TimeStamp
itk::AdvancedMatrixOffsetTransformBase::TransformVector
OutputVnlVectorType TransformVector(const InputVnlVectorType &vector) const override
itk::AdvancedMatrixOffsetTransformBase::GetJacobian
void GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const override
itk::AdvancedMatrixOffsetTransformBase::GetTranslation
const OutputVectorType & GetTranslation() const
Definition itkAdvancedMatrixOffsetTransformBase.h:264
itk::AdvancedMatrixOffsetTransformBase::SetCenter
void SetCenter(const InputPointType &center)
Definition itkAdvancedMatrixOffsetTransformBase.h:218
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_JacobianOfSpatialJacobian
JacobianOfSpatialJacobianType m_JacobianOfSpatialJacobian
Definition itkAdvancedMatrixOffsetTransformBase.h:431
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_JacobianOfSpatialHessian
JacobianOfSpatialHessianType m_JacobianOfSpatialHessian
Definition itkAdvancedMatrixOffsetTransformBase.h:432
itk::AdvancedMatrixOffsetTransformBase::GetOffset
const OutputVectorType & GetOffset() const
Definition itkAdvancedMatrixOffsetTransformBase.h:421
itk::AdvancedMatrixOffsetTransformBase::itkStaticConstMacro
itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions)
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::SpatialJacobianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_Offset
OutputVectorType m_Offset
Definition itkAdvancedMatrixOffsetTransformBase.h:453
itk::AdvancedMatrixOffsetTransformBase::GetJacobianOfSpatialHessian
void GetJacobianOfSpatialHessian(const InputPointType &inputPoint, SpatialHessianType &sh, JacobianOfSpatialHessianType &jsh, NonZeroJacobianIndicesType &nonZeroJacobianIndices) const override
itk::AdvancedMatrixOffsetTransformBase::GetMatrix
const MatrixType & GetMatrix() const
Definition itkAdvancedMatrixOffsetTransformBase.h:188
itk::AdvancedMatrixOffsetTransformBase::ComputeMatrix
virtual void ComputeMatrix()
itk::AdvancedMatrixOffsetTransformBase::Pointer
SmartPointer< Self > Pointer
Definition itkAdvancedMatrixOffsetTransformBase.h:102
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::JacobianOfSpatialHessianType
std::vector< SpatialHessianType > JacobianOfSpatialHessianType
itk::AdvancedMatrixOffsetTransformBase::SetFixedParameters
void SetFixedParameters(const FixedParametersType &) override
itk::AdvancedMatrixOffsetTransformBase::GetInverseMatrix
const InverseMatrixType & GetInverseMatrix() const
itk::AdvancedMatrixOffsetTransformBase::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkAdvancedMatrixOffsetTransformBase.h:103
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_MatrixMTime
TimeStamp m_MatrixMTime
Definition itkAdvancedMatrixOffsetTransformBase.h:461
itk::AdvancedMatrixOffsetTransformBase::GetJacobianOfSpatialHessian
void GetJacobianOfSpatialHessian(const InputPointType &, JacobianOfSpatialHessianType &, NonZeroJacobianIndicesType &) const override
itk::AdvancedMatrixOffsetTransformBase::GetTransformCategory
TransformCategoryEnum GetTransformCategory() const override
Definition itkAdvancedMatrixOffsetTransformBase.h:326
itk::AdvancedMatrixOffsetTransformBase::TransformPoint
OutputPointType TransformPoint(const InputPointType &point) const override
itk::AdvancedMatrixOffsetTransformBase::AdvancedMatrixOffsetTransformBase
AdvancedMatrixOffsetTransformBase(const Self &other)
itk::AdvancedMatrixOffsetTransformBase::GetSpatialJacobian
void GetSpatialJacobian(const InputPointType &, SpatialJacobianType &) const override
itk::AdvancedMatrixOffsetTransformBase::TranslationType
OutputVectorType TranslationType
Definition itkAdvancedMatrixOffsetTransformBase.h:149
itk::AdvancedMatrixOffsetTransformBase::GetSpatialHessian
void GetSpatialHessian(const InputPointType &, SpatialHessianType &) const override
itk::AdvancedMatrixOffsetTransformBase::TransformVector
OutputVectorType TransformVector(const InputVectorType &vector) const override
itk::AdvancedMatrixOffsetTransformBase::OffsetType
OutputVectorType OffsetType
Definition itkAdvancedMatrixOffsetTransformBase.h:148
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_InverseMatrix
InverseMatrixType m_InverseMatrix
Definition itkAdvancedMatrixOffsetTransformBase.h:454
itk::AdvancedMatrixOffsetTransformBase::CenterType
InputPointType CenterType
Definition itkAdvancedMatrixOffsetTransformBase.h:147
itk::AdvancedMatrixOffsetTransformBase::IsLinear
bool IsLinear() const override
Definition itkAdvancedMatrixOffsetTransformBase.h:316
itk::AdvancedMatrixOffsetTransformBase::TransformCovariantVector
OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &vector) const override
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_NonZeroJacobianIndices
NonZeroJacobianIndicesType m_NonZeroJacobianIndices
Definition itkAdvancedMatrixOffsetTransformBase.h:429
itk::AdvancedMatrixOffsetTransformBase::PrintSelf
void PrintSelf(std::ostream &s, Indent indent) const override
itk::AdvancedMatrixOffsetTransformBase::GetJacobianOfSpatialJacobian
void GetJacobianOfSpatialJacobian(const InputPointType &, SpatialJacobianType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::JacobianOfSpatialJacobianType
std::vector< SpatialJacobianType > JacobianOfSpatialJacobianType
itk::AdvancedMatrixOffsetTransformBase::GetParameters
const ParametersType & GetParameters() const override
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_Translation
OutputVectorType m_Translation
Definition itkAdvancedMatrixOffsetTransformBase.h:458
itk::AdvancedMatrixOffsetTransformBase::GetJacobianOfSpatialJacobian
void GetJacobianOfSpatialJacobian(const InputPointType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override
itk::AdvancedMatrixOffsetTransformBase::SetVarMatrix
void SetVarMatrix(const MatrixType &matrix)
Definition itkAdvancedMatrixOffsetTransformBase.h:396
itk::AdvancedMatrixOffsetTransformBase::Superclass
AdvancedTransform< TScalarType, NInputDimensions, NOutputDimensions > Superclass
Definition itkAdvancedMatrixOffsetTransformBase.h:101
itk::AdvancedMatrixOffsetTransformBase::PrecomputeJacobians
void PrecomputeJacobians(unsigned int paramDims)
itk::AdvancedMatrixOffsetTransformBase::~AdvancedMatrixOffsetTransformBase
~AdvancedMatrixOffsetTransformBase() override=default
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::SpatialHessianType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::ComputeMatrixParameters
virtual void ComputeMatrixParameters()
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::NonZeroJacobianIndicesType
std::vector< unsigned long > NonZeroJacobianIndicesType
itk::AdvancedMatrixOffsetTransformBase::SetMatrix
virtual void SetMatrix(const MatrixType &matrix)
Definition itkAdvancedMatrixOffsetTransformBase.h:170
itk::AdvancedMatrixOffsetTransformBase::SetTranslation
void SetTranslation(const OutputVectorType &translation)
Definition itkAdvancedMatrixOffsetTransformBase.h:248
itk::AdvancedMatrixOffsetTransformBase::GetCenter
const InputPointType & GetCenter() const
Definition itkAdvancedMatrixOffsetTransformBase.h:234
itk::AdvancedMatrixOffsetTransformBase::operator=
const Self & operator=(const Self &)
itk::AdvancedMatrixOffsetTransformBase::SetIdentity
virtual void SetIdentity()
itk::AdvancedMatrixOffsetTransformBase::GetFixedParameters
const FixedParametersType & GetFixedParameters() const override
itk::AdvancedMatrixOffsetTransformBase::InverseMatrixType
Matrix< TScalarType, Self::InputSpaceDimension, Self::OutputSpaceDimension > InverseMatrixType
Definition itkAdvancedMatrixOffsetTransformBase.h:144
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_Singular
bool m_Singular
Definition itkAdvancedMatrixOffsetTransformBase.h:455
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_Matrix
MatrixType m_Matrix
Definition itkAdvancedMatrixOffsetTransformBase.h:452
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_InverseMatrixMTime
TimeStamp m_InverseMatrixMTime
Definition itkAdvancedMatrixOffsetTransformBase.h:462
itk::AdvancedMatrixOffsetTransformBase::MatrixType
Matrix< TScalarType, Self::OutputSpaceDimension, Self::InputSpaceDimension > MatrixType
Definition itkAdvancedMatrixOffsetTransformBase.h:141
itk::AdvancedMatrixOffsetTransformBase::AdvancedMatrixOffsetTransformBase
AdvancedMatrixOffsetTransformBase(const unsigned int paramDims=ParametersDimension)
itk::AdvancedMatrixOffsetTransformBase::ComputeTranslation
void ComputeTranslation()
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_Center
InputPointType m_Center
Definition itkAdvancedMatrixOffsetTransformBase.h:457
itk::AdvancedMatrixOffsetTransformBase::Self
AdvancedMatrixOffsetTransformBase Self
Definition itkAdvancedMatrixOffsetTransformBase.h:100
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::m_SpatialHessian
SpatialHessianType m_SpatialHessian
Definition itkAdvancedMatrixOffsetTransformBase.h:430
itk::AdvancedMatrixOffsetTransformBase< TScalarType, 2, 2 >::ComputeOffset
virtual void ComputeOffset()
itk::AdvancedMatrixOffsetTransformBase::SetVarTranslation
void SetVarTranslation(const OutputVectorType &translation)
Definition itkAdvancedMatrixOffsetTransformBase.h:406
itk::AdvancedMatrixOffsetTransformBase::SetParameters
void SetParameters(const ParametersType &parameters) override
itk::AdvancedMatrixOffsetTransformBase::itkStaticConstMacro
itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions)
itk::AdvancedMatrixOffsetTransformBase::itkStaticConstMacro
itkStaticConstMacro(ParametersDimension, unsigned int, NOutputDimensions *(NInputDimensions+1))
itk::AdvancedTransform< TScalarType, NInputDimensions, NOutputDimensions >::InternalMatrixType
typename SpatialJacobianType::InternalMatrixType InternalMatrixType
Definition itkAdvancedTransform.h:140
itk::AdvancedTransform< TScalarType, NInputDimensions, NOutputDimensions >::SpatialHessianType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Definition itkAdvancedTransform.h:137
itk::AdvancedTransform< TScalarType, NInputDimensions, NOutputDimensions >::SpatialJacobianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
Definition itkAdvancedTransform.h:134
itk::AdvancedTransform< TScalarType, NInputDimensions, NOutputDimensions >::JacobianOfSpatialHessianType
std::vector< SpatialHessianType > JacobianOfSpatialHessianType
Definition itkAdvancedTransform.h:139
itk::AdvancedTransform< TScalarType, NInputDimensions, NOutputDimensions >::JacobianOfSpatialJacobianType
std::vector< SpatialJacobianType > JacobianOfSpatialJacobianType
Definition itkAdvancedTransform.h:135
itk::AdvancedTransform< double, 3, 3 >::AdvancedTransform
AdvancedTransform()=default
itk::AdvancedTransform< TScalarType, NInputDimensions, NOutputDimensions >::NonZeroJacobianIndicesType
std::vector< unsigned long > NonZeroJacobianIndicesType
Definition itkAdvancedTransform.h:133
itkAdvancedTransform.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |