SimpleITK
|
A simplified wrapper around a variety of ITK transforms. More...
#include <sitkTransform.h>
A simplified wrapper around a variety of ITK transforms.
The interface to ITK transform objects to be used with the ImageRegistrationMethod, ResampleImageFilter and other SimpleITK process objects. The transforms are designed to have a serialized array of parameters to facilitate optimization for registration.
Provides a base class interface to any type of ITK transform. Objects of this type may have their interface converted to a derived interface while keeping the same reference to the ITK object.
Additionally, this class provides a basic interface to a composite transforms.
Definition at line 86 of file sitkTransform.h.
Classes | |
struct | DisplacementInitializationMemberFunctionAddressor |
struct | TransformTryCastVisitor |
Public Types | |
using | Self = Transform |
Public Member Functions | |
unsigned int | GetDimension () const |
Transform | GetInverse () const |
Return a new inverse transform of the same type as this. | |
virtual std::string | GetName () const |
unsigned int | GetNumberOfFixedParameters () const |
unsigned int | GetNumberOfParameters () const |
TransformEnum | GetTransformEnum () const |
Get the TransformEnum of the underlying Transform. | |
virtual bool | IsLinear () const |
void | MakeUnique () |
Performs actually coping if needed to make object unique. | |
virtual void | SetIdentity () |
virtual bool | SetInverse () |
Try to change the current transform to it's inverse. | |
std::string | ToString () const |
Transform () | |
By default a 3-d identity transform is constructed. | |
Transform (Image &displacement, TransformEnum type=sitkDisplacementField) | |
Use an image to construct a transform. | |
template<unsigned int NDimension> | |
Transform (itk::CompositeTransform< double, NDimension > *compositeTransform) | |
Construct a SimpleITK Transform from a pointer to an ITK composite transform. | |
Transform (itk::TransformBase *transform) | |
Transform (unsigned int dimensions, TransformEnum type) | |
Construct a specific transformation. | |
std::vector< double > | TransformPoint (const std::vector< double > &point) const |
std::vector< double > | TransformVector (const std::vector< double > &vector, const std::vector< double > &point) const |
void | WriteTransform (const std::string &filename) const |
virtual | ~Transform () |
Transform & | operator= (const Transform &) |
Copy constructor and assignment operator. | |
Transform (const Transform &) | |
Copy constructor and assignment operator. | |
itk::TransformBase * | GetITKBase () |
const itk::TransformBase * | GetITKBase () const |
void | SetParameters (const std::vector< double > ¶meters) |
std::vector< double > | GetParameters () const |
void | SetFixedParameters (const std::vector< double > ¶meters) |
std::vector< double > | GetFixedParameters () const |
Protected Member Functions | |
virtual void | SetPimpleTransform (std::unique_ptr< PimpleTransformBase > &&pimpleTransform) |
Transform (PimpleTransformBase *pimpleTransform) | |
Private Member Functions | |
template<unsigned int> | |
void | InternalBSplineInitialization (Image &img) |
template<typename TDisplacementType> | |
void | InternalDisplacementInitialization (Image &img) |
void | InternalInitialization (itk::TransformBase *base) |
template<unsigned int VDimension> | |
void | InternalInitialization (TransformEnum type, itk::TransformBase *base=nullptr) |
template<class TransformType> | |
void | InternalInitialization (TransformType *t) |
Private Attributes | |
std::unique_ptr< PimpleTransformBase > | m_PimpleTransform |
Definition at line 89 of file sitkTransform.h.
itk::simple::Transform::Transform | ( | ) |
By default a 3-d identity transform is constructed.
Referenced by itk::simple::CompositeTransform::AddTransform(), itk::simple::AffineTransform::AffineTransform(), itk::simple::BSplineTransform::BSplineTransform(), itk::simple::ComposeScaleSkewVersor3DTransform::ComposeScaleSkewVersor3DTransform(), itk::simple::CompositeTransform::CompositeTransform(), itk::simple::DisplacementFieldTransform::DisplacementFieldTransform(), itk::simple::Euler2DTransform::Euler2DTransform(), itk::simple::Euler3DTransform::Euler3DTransform(), itk::simple::CompositeTransform::GetBackTransform(), operator=(), itk::simple::CompositeTransform::RemoveTransform(), itk::simple::ScaleSkewVersor3DTransform::ScaleSkewVersor3DTransform(), itk::simple::ScaleTransform::ScaleTransform(), itk::simple::ScaleVersor3DTransform::ScaleVersor3DTransform(), SetInverse(), itk::simple::Similarity2DTransform::Similarity2DTransform(), itk::simple::Similarity3DTransform::Similarity3DTransform(), Transform(), Transform(), itk::simple::TranslationTransform::TranslationTransform(), itk::simple::VersorRigid3DTransform::VersorRigid3DTransform(), itk::simple::VersorTransform::VersorTransform(), and ~Transform().
|
inlineexplicit |
Construct a SimpleITK Transform from a pointer to an ITK composite transform.
Definition at line 100 of file sitkTransform.h.
References InternalInitialization(), itk::simple::sitkComposite, sitkExceptionMacro, and Transform().
|
explicit |
itk::simple::Transform::Transform | ( | unsigned int | dimensions, |
TransformEnum | type ) |
Construct a specific transformation.
|
explicit |
Use an image to construct a transform.
The input displacement image is transferred to the constructed transform object. The input image is modified to be a default constructed Image object.
Only the sitkDisplacementField transformation type can currently be constructed this way. Image must be of sitkVectorFloat64 pixel type with the number of components equal to the image dimension.
References itk::simple::sitkDisplacementField.
|
virtual |
References Transform().
itk::simple::Transform::Transform | ( | const Transform & | ) |
Copy constructor and assignment operator.
Performs a shallow copy of the internal ITK transform. A deep copy will be done if the transform in modified.
References Transform().
|
explicitprotected |
unsigned int itk::simple::Transform::GetDimension | ( | ) | const |
Return the dimension of the Transform ( 2D or 3D )
std::vector< double > itk::simple::Transform::GetFixedParameters | ( | ) | const |
Set/Get Fixed Transform Parameter
Transform itk::simple::Transform::GetInverse | ( | ) | const |
Return a new inverse transform of the same type as this.
Creates a new transform object and tries to set the value to the inverse. As not all transform types have inverse and some transforms are not invertible, an exception will be throw is there is no inverse.
itk::TransformBase * itk::simple::Transform::GetITKBase | ( | ) |
Get access to internal ITK data object.
The return value should immediately be assigned to as itk::SmartPointer.
In many cases the value may need to be dynamically cast to the actual transform type.
const itk::TransformBase * itk::simple::Transform::GetITKBase | ( | ) | const |
Get access to internal ITK data object.
The return value should immediately be assigned to as itk::SmartPointer.
In many cases the value may need to be dynamically cast to the actual transform type.
|
virtual |
return user readable name for the SimpleITK transform
Reimplemented in itk::simple::AffineTransform, itk::simple::BSplineTransform, itk::simple::ComposeScaleSkewVersor3DTransform, itk::simple::CompositeTransform, itk::simple::DisplacementFieldTransform, itk::simple::Euler2DTransform, itk::simple::Euler3DTransform, itk::simple::ScaleSkewVersor3DTransform, itk::simple::ScaleTransform, itk::simple::ScaleVersor3DTransform, itk::simple::Similarity2DTransform, itk::simple::Similarity3DTransform, itk::simple::TranslationTransform, itk::simple::VersorRigid3DTransform, and itk::simple::VersorTransform.
unsigned int itk::simple::Transform::GetNumberOfFixedParameters | ( | ) | const |
Get the number of fixed parameters
unsigned int itk::simple::Transform::GetNumberOfParameters | ( | ) | const |
Return the number of optimizable parameters
std::vector< double > itk::simple::Transform::GetParameters | ( | ) | const |
Set/Get Transform Parameter
TransformEnum itk::simple::Transform::GetTransformEnum | ( | ) | const |
Get the TransformEnum of the underlying Transform.
A SimpleITK Transform object can internally hold any ITK transform. This method returns the TransformEnum representing the internal ITK transform. This value may be used to identify which SimpleITK class the transform can be converted to.
|
private |
|
private |
|
private |
|
private |
Referenced by Transform().
|
private |
|
virtual |
void itk::simple::Transform::MakeUnique | ( | ) |
Performs actually coping if needed to make object unique.
The Transform class by default performs lazy coping and assignment. This method make sure that coping actually happens to the itk::Transform pointed to is only pointed to by this object.
Copy constructor and assignment operator.
Performs a shallow copy of the internal ITK transform. A deep copy will be done if the transform in modified.
References Transform().
void itk::simple::Transform::SetFixedParameters | ( | const std::vector< double > & | parameters | ) |
Set/Get Fixed Transform Parameter
|
virtual |
|
virtual |
Try to change the current transform to it's inverse.
If the transform has an inverse, i.e. non-singular linear transforms, then a new ITK transform is created of the same type and this object is set to it.
However not all transform have a direct inverse, if the inverse does not exist or fails false will be returned and this transform will not be modified.
References Transform().
void itk::simple::Transform::SetParameters | ( | const std::vector< double > & | parameters | ) |
Set/Get Transform Parameter
|
protectedvirtual |
Reimplemented in itk::simple::AffineTransform, itk::simple::BSplineTransform, itk::simple::ComposeScaleSkewVersor3DTransform, itk::simple::CompositeTransform, itk::simple::DisplacementFieldTransform, itk::simple::Euler2DTransform, itk::simple::Euler3DTransform, itk::simple::ScaleSkewVersor3DTransform, itk::simple::ScaleTransform, itk::simple::ScaleVersor3DTransform, itk::simple::Similarity2DTransform, itk::simple::Similarity3DTransform, itk::simple::TranslationTransform, itk::simple::VersorRigid3DTransform, and itk::simple::VersorTransform.
std::string itk::simple::Transform::ToString | ( | ) | const |
std::vector< double > itk::simple::Transform::TransformPoint | ( | const std::vector< double > & | point | ) | const |
Apply transform to a point.
The dimension of the point must match the transform.
References itk::point().
std::vector< double > itk::simple::Transform::TransformVector | ( | const std::vector< double > & | vector, |
const std::vector< double > & | point ) const |
Apply transform to a vector at a point.
The ITK concept of a vector is a direction at a specific point, for example the difference between two points is a vector.
For linear transforms the point does not matter, in general the vector is transformed by the Jacobian with respect to point position.
The dimension of the vector and point must match the transform.
References itk::point().
void itk::simple::Transform::WriteTransform | ( | const std::string & | filename | ) | const |
|
private |
Definition at line 340 of file sitkTransform.h.