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.
- See also
- itk::CompositeTransform
- Examples:
- DemonsRegistration2/DemonsRegistration2.cxx, ImageRegistrationMethod1/ImageRegistrationMethod1.cxx, ImageRegistrationMethod2/ImageRegistrationMethod2.cxx, ImageRegistrationMethodBSpline1/ImageRegistrationMethodBSpline1.cxx, ImageRegistrationMethodBSpline3/ImageRegistrationMethodBSpline3.cxx, and ImageRegistrationMethodDisplacement1/ImageRegistrationMethodDisplacement1.cxx.
Definition at line 84 of file sitkTransform.h.
itk::simple::Transform::Transform |
( |
void |
| ) |
|
By default a 3-d identity transform is constructed.
template<unsigned int NDimension>
itk::simple::Transform::Transform |
( |
unsigned int |
dimensions, |
|
|
TransformEnum |
type |
|
) |
| |
Construct a specific transformation.
- Deprecated:
- This constructor will be removed in future releases.
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.
- Deprecated:
- This constructor will be removed in future releases.
virtual itk::simple::Transform::~Transform |
( |
void |
| ) |
|
|
virtual |
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.
itk::simple::Transform::Transform |
( |
PimpleTransformBase * |
pimpleTransform | ) |
|
|
explicitprotected |
Self& itk::simple::Transform::FlattenTransform |
( |
| ) |
|
Remove nested composite transforms.
This method has no effect on non-composite transforms.
If this transform is a composite which contains another nested composite transform, then the nested composite's transforms are placed into this transform. Nested composite transform may not be written to a file.
unsigned int itk::simple::Transform::GetDimension |
( |
void |
| ) |
const |
Return the dimension of the Transform ( 2D or 3D )
std::vector<double> itk::simple::Transform::GetFixedParameters |
( |
void |
| ) |
const |
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 invertable, an exception will be throw is there is no inverse.
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.
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 std::string itk::simple::Transform::GetName |
( |
| ) |
const |
|
virtual |
unsigned int itk::simple::Transform::GetNumberOfFixedParameters |
( |
void |
| ) |
const |
Get the number of fixed parameters
unsigned int itk::simple::Transform::GetNumberOfParameters |
( |
void |
| ) |
const |
Return the number of optimizable parameters
std::vector<double> itk::simple::Transform::GetParameters |
( |
void |
| ) |
const |
template<unsigned int>
void itk::simple::Transform::InternalBSplineInitialization |
( |
Image & |
img | ) |
|
|
private |
template<typename TDisplacementType >
void itk::simple::Transform::InternalDisplacementInitialization |
( |
Image & |
img | ) |
|
|
private |
template<unsigned int VDimension>
template<class TransformType >
void itk::simple::Transform::InternalInitialization |
( |
TransformType * |
t | ) |
|
|
private |
virtual bool itk::simple::Transform::IsLinear |
( |
| ) |
const |
|
virtual |
void itk::simple::Transform::MakeUnique |
( |
void |
| ) |
|
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.
void itk::simple::Transform::SetFixedParameters |
( |
const std::vector< double > & |
parameters | ) |
|
virtual void itk::simple::Transform::SetIdentity |
( |
| ) |
|
|
virtual |
virtual bool itk::simple::Transform::SetInverse |
( |
| ) |
|
|
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.
void itk::simple::Transform::SetParameters |
( |
const std::vector< double > & |
parameters | ) |
|
virtual void itk::simple::Transform::SetPimpleTransform |
( |
PimpleTransformBase * |
pimpleTransform | ) |
|
|
protectedvirtual |
Reimplemented in itk::simple::DisplacementFieldTransform, itk::simple::ScaleSkewVersor3DTransform, itk::simple::BSplineTransform, itk::simple::ScaleVersor3DTransform, itk::simple::Euler3DTransform, itk::simple::Similarity3DTransform, itk::simple::AffineTransform, itk::simple::VersorRigid3DTransform, itk::simple::Similarity2DTransform, itk::simple::VersorTransform, itk::simple::Euler2DTransform, itk::simple::ScaleTransform, and itk::simple::TranslationTransform.
std::string itk::simple::Transform::ToString |
( |
void |
| ) |
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.
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.
void itk::simple::Transform::WriteTransform |
( |
const std::string & |
filename | ) |
const |
PimpleTransformBase* itk::simple::Transform::m_PimpleTransform |
|
private |
The documentation for this class was generated from the following file: