Loading...
Searching...
No Matches
elxAdvancedTransformAdapter.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 itkAdvancedTransformAdapter_h
#define itkAdvancedTransformAdapter_h
#include "itkAdvancedTransform.h"
#include "itkMacro.h"
#include <itkDeref.h>
namespace elastix
{
template <class TScalarType, unsigned int NDimensions>
class ITK_TEMPLATE_EXPORT AdvancedTransformAdapter
: public itk::AdvancedTransform<TScalarType, NDimensions, NDimensions>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(AdvancedTransformAdapter);
using Self = AdvancedTransformAdapter;
using Superclass = itk::AdvancedTransform<TScalarType, NDimensions, NDimensions>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(AdvancedTransformAdapter, AdvancedTransform);
itkStaticConstMacro(InputSpaceDimension, unsigned int, Superclass::InputSpaceDimension);
itkStaticConstMacro(OutputSpaceDimension, unsigned int, Superclass::OutputSpaceDimension);
using typename Superclass::ParametersType;
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::NonZeroJacobianIndicesType;
using typename Superclass::SpatialHessianType;
using typename Superclass::SpatialJacobianType;
using typename Superclass::JacobianOfSpatialHessianType;
using typename Superclass::JacobianOfSpatialJacobianType;
void
SetParameters(const ParametersType & parameters) override
{
// SetParameters may be called by elx::TransformBase<TElastix>::ReadFromFile(), but only for an empty list of
// parameters _and_ an unspecified (null) m_ExternalTransform.
if (m_ExternalTransform || !parameters.empty())
{
itkExceptionMacro("The parameters of an external transform cannot be set! Only the trivial case of setting an "
"empty parameters to an unspecified (null) external transform is supported!");
}
}
void
SetFixedParameters(const ParametersType &) override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
const ParametersType &
GetFixedParameters() const override
{
return itk::Deref(m_ExternalTransform.GetPointer()).GetFixedParameters();
}
OutputPointType
TransformPoint(const InputPointType & point) const override
{
return itk::Deref(m_ExternalTransform.GetPointer()).TransformPoint(point);
}
OutputVectorType
TransformVector(const InputVectorType &) const override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
OutputVnlVectorType
TransformVector(const InputVnlVectorType &) const override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
OutputCovariantVectorType
TransformCovariantVector(const InputCovariantVectorType &) const override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
bool
IsLinear() const override
{
return itk::Deref(m_ExternalTransform.GetPointer()).IsLinear();
}
void
GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
void
GetSpatialJacobian(const InputPointType &, SpatialJacobianType &) const override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
void
GetSpatialHessian(const InputPointType &, SpatialHessianType &) const override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
void
GetJacobianOfSpatialJacobian(const InputPointType &,
JacobianOfSpatialJacobianType &,
NonZeroJacobianIndicesType &) const override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
void
GetJacobianOfSpatialJacobian(const InputPointType &,
SpatialJacobianType &,
JacobianOfSpatialJacobianType &,
NonZeroJacobianIndicesType &) const override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
void
GetJacobianOfSpatialHessian(const InputPointType &,
JacobianOfSpatialHessianType &,
NonZeroJacobianIndicesType &) const override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
void
GetJacobianOfSpatialHessian(const InputPointType &,
SpatialHessianType &,
JacobianOfSpatialHessianType &,
NonZeroJacobianIndicesType &) const override
{
itkExceptionMacro(<< unimplementedOverrideMessage);
}
using typename Superclass::TransformType;
itkSetObjectMacro(ExternalTransform, TransformType);
TransformType *
GetModifiableExternalTransform() const
{
return m_ExternalTransform.GetPointer();
}
protected:
AdvancedTransformAdapter() = default;
~AdvancedTransformAdapter() override = default;
void
PrintSelf(std::ostream & os, itk::Indent indent) const override
{
Superclass::PrintSelf(os, indent);
os << indent << "ExternalTransform: ";
if (m_ExternalTransform)
{
os << *m_ExternalTransform << std::endl;
}
else
{
os << indent << "null" << std::endl;
}
}
private:
// Private using-declarations, to avoid `-Woverloaded-virtual` warnings from GCC (GCC 11.4).
using Superclass::TransformCovariantVector;
using Superclass::TransformVector;
static constexpr const char * unimplementedOverrideMessage = "Not implemented for AdvancedTransformAdapter";
itk::SmartPointer<TransformType> m_ExternalTransform{};
};
} // namespace elastix
#endif /* itkAdvancedTransformAdapter_h */
elastix::AdvancedTransformAdapter::Superclass
itk::AdvancedTransform< TScalarType, NDimensions, NDimensions > Superclass
Definition elxAdvancedTransformAdapter.h:46
elastix::AdvancedTransformAdapter::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition elxAdvancedTransformAdapter.h:208
elastix::AdvancedTransformAdapter< CoordRepType, Superclass2::FixedImageDimension >::SpatialJacobianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
elastix::AdvancedTransformAdapter::GetJacobianOfSpatialHessian
void GetJacobianOfSpatialHessian(const InputPointType &, JacobianOfSpatialHessianType &, NonZeroJacobianIndicesType &) const override
Definition elxAdvancedTransformAdapter.h:173
elastix::AdvancedTransformAdapter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition elxAdvancedTransformAdapter.h:48
elastix::AdvancedTransformAdapter::GetJacobianOfSpatialJacobian
void GetJacobianOfSpatialJacobian(const InputPointType &, SpatialJacobianType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override
Definition elxAdvancedTransformAdapter.h:164
elastix::AdvancedTransformAdapter::GetSpatialJacobian
void GetSpatialJacobian(const InputPointType &, SpatialJacobianType &) const override
Definition elxAdvancedTransformAdapter.h:144
elastix::AdvancedTransformAdapter::Pointer
itk::SmartPointer< Self > Pointer
Definition elxAdvancedTransformAdapter.h:47
elastix::AdvancedTransformAdapter< CoordRepType, Superclass2::FixedImageDimension >::JacobianOfSpatialHessianType
std::vector< SpatialHessianType > JacobianOfSpatialHessianType
elastix::AdvancedTransformAdapter::SetParameters
void SetParameters(const ParametersType &parameters) override
Definition elxAdvancedTransformAdapter.h:79
elastix::AdvancedTransformAdapter::GetJacobian
void GetJacobian(const InputPointType &, JacobianType &, NonZeroJacobianIndicesType &) const override
Definition elxAdvancedTransformAdapter.h:138
elastix::AdvancedTransformAdapter::TransformPoint
OutputPointType TransformPoint(const InputPointType &point) const override
Definition elxAdvancedTransformAdapter.h:106
elastix::AdvancedTransformAdapter::SetFixedParameters
void SetFixedParameters(const ParametersType &) override
Definition elxAdvancedTransformAdapter.h:92
elastix::AdvancedTransformAdapter::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(AdvancedTransformAdapter)
elastix::AdvancedTransformAdapter::IsLinear
bool IsLinear() const override
Definition elxAdvancedTransformAdapter.h:131
elastix::AdvancedTransformAdapter::AdvancedTransformAdapter
AdvancedTransformAdapter()=default
elastix::AdvancedTransformAdapter::itkStaticConstMacro
itkStaticConstMacro(InputSpaceDimension, unsigned int, Superclass::InputSpaceDimension)
elastix::AdvancedTransformAdapter::TransformVector
OutputVnlVectorType TransformVector(const InputVnlVectorType &) const override
Definition elxAdvancedTransformAdapter.h:119
elastix::AdvancedTransformAdapter::GetSpatialHessian
void GetSpatialHessian(const InputPointType &, SpatialHessianType &) const override
Definition elxAdvancedTransformAdapter.h:150
elastix::AdvancedTransformAdapter< CoordRepType, Superclass2::FixedImageDimension >::TransformType
Transform< CoordRepType, NInputDimensions, NOutputDimensions > TransformType
elastix::AdvancedTransformAdapter::TransformCovariantVector
OutputCovariantVectorType TransformCovariantVector(const InputCovariantVectorType &) const override
Definition elxAdvancedTransformAdapter.h:125
elastix::AdvancedTransformAdapter< CoordRepType, Superclass2::FixedImageDimension >::JacobianOfSpatialJacobianType
std::vector< SpatialJacobianType > JacobianOfSpatialJacobianType
elastix::AdvancedTransformAdapter::GetModifiableExternalTransform
TransformType * GetModifiableExternalTransform() const
Definition elxAdvancedTransformAdapter.h:194
elastix::AdvancedTransformAdapter< CoordRepType, Superclass2::FixedImageDimension >::unimplementedOverrideMessage
static constexpr const char * unimplementedOverrideMessage
Definition elxAdvancedTransformAdapter.h:229
elastix::AdvancedTransformAdapter< CoordRepType, Superclass2::FixedImageDimension >::m_ExternalTransform
itk::SmartPointer< TransformType > m_ExternalTransform
Definition elxAdvancedTransformAdapter.h:231
elastix::AdvancedTransformAdapter< CoordRepType, Superclass2::FixedImageDimension >::SpatialHessianType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
elastix::AdvancedTransformAdapter< CoordRepType, Superclass2::FixedImageDimension >::NonZeroJacobianIndicesType
std::vector< unsigned long > NonZeroJacobianIndicesType
elastix::AdvancedTransformAdapter::GetFixedParameters
const ParametersType & GetFixedParameters() const override
Definition elxAdvancedTransformAdapter.h:99
elastix::AdvancedTransformAdapter::itkStaticConstMacro
itkStaticConstMacro(OutputSpaceDimension, unsigned int, Superclass::OutputSpaceDimension)
elastix::AdvancedTransformAdapter::TransformVector
OutputVectorType TransformVector(const InputVectorType &) const override
Definition elxAdvancedTransformAdapter.h:113
elastix::AdvancedTransformAdapter::GetJacobianOfSpatialHessian
void GetJacobianOfSpatialHessian(const InputPointType &, SpatialHessianType &, JacobianOfSpatialHessianType &, NonZeroJacobianIndicesType &) const override
Definition elxAdvancedTransformAdapter.h:181
elastix::AdvancedTransformAdapter::Self
AdvancedTransformAdapter Self
Definition elxAdvancedTransformAdapter.h:45
elastix::AdvancedTransformAdapter::GetJacobianOfSpatialJacobian
void GetJacobianOfSpatialJacobian(const InputPointType &, JacobianOfSpatialJacobianType &, NonZeroJacobianIndicesType &) const override
Definition elxAdvancedTransformAdapter.h:156
elastix::AdvancedTransformAdapter::~AdvancedTransformAdapter
~AdvancedTransformAdapter() override=default
elastix::ExternalTransform
An external transform.
Definition elxExternalTransform.h:52
itk::AdvancedTransform
Transform maps points, vectors and covariant vectors from an input space to an output space.
Definition itkAdvancedTransform.h:84
itk::AdvancedTransform::SpatialHessianType
FixedArray< Matrix< ScalarType, InputSpaceDimension, InputSpaceDimension >, OutputSpaceDimension > SpatialHessianType
Definition itkAdvancedTransform.h:137
itk::AdvancedTransform::SpatialJacobianType
Matrix< ScalarType, OutputSpaceDimension, InputSpaceDimension > SpatialJacobianType
Definition itkAdvancedTransform.h:134
itk::AdvancedTransform::JacobianOfSpatialHessianType
std::vector< SpatialHessianType > JacobianOfSpatialHessianType
Definition itkAdvancedTransform.h:139
itk::AdvancedTransform::JacobianOfSpatialJacobianType
std::vector< SpatialJacobianType > JacobianOfSpatialJacobianType
Definition itkAdvancedTransform.h:135
itk::AdvancedTransform::AdvancedTransform
AdvancedTransform()=default
itk::AdvancedTransform::NonZeroJacobianIndicesType
std::vector< unsigned long > NonZeroJacobianIndicesType
Definition itkAdvancedTransform.h:133
itkAdvancedTransform.h
elastix
Definition elxDefaultConstruct.h:25

Generated on 1768596610 for elastix by 1.15.0 |