pub struct Transform { /* private fields */ }Expand description
\class Transform \brief 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.
\sa itk::CompositeTransform
Implementations§
Source§impl Transform
impl Transform
Sourcepub fn SetParameters(self: Pin<&mut Self>, parameters: &CxxVector<f64>)
pub fn SetParameters(self: Pin<&mut Self>, parameters: &CxxVector<f64>)
Set/Get Transform Parameter @{
Source§impl Transform
impl Transform
Sourcepub fn GetNumberOfParameters(&self) -> c_uint
pub fn GetNumberOfParameters(&self) -> c_uint
Return the number of optimizable parameters
Source§impl Transform
impl Transform
Sourcepub fn SetFixedParameters(self: Pin<&mut Self>, parameters: &CxxVector<f64>)
pub fn SetFixedParameters(self: Pin<&mut Self>, parameters: &CxxVector<f64>)
Set/Get Fixed Transform Parameter @{
Source§impl Transform
impl Transform
Sourcepub fn GetNumberOfFixedParameters(&self) -> c_uint
pub fn GetNumberOfFixedParameters(&self) -> c_uint
Get the number of fixed parameters
Source§impl Transform
impl Transform
Sourcepub fn GetTransformEnum(&self) -> TransformEnum
pub fn GetTransformEnum(&self) -> TransformEnum
\brief 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.
Source§impl Transform
impl Transform
Sourcepub fn GetITKBase(self: Pin<&mut Transform>) -> *mut TransformBase
pub fn GetITKBase(self: Pin<&mut Transform>) -> *mut TransformBase
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.
@{
pub fn GetITKBase1(self: &Transform) -> *const TransformBase
Sourcepub fn GetDimension(self: &Transform) -> c_uint
pub fn GetDimension(self: &Transform) -> c_uint
Return the dimension of the Transform ( 2D or 3D )
pub fn GetParameters(self: &Transform) -> UniquePtr<CxxVector<f64>> ⓘ
pub fn GetFixedParameters(self: &Transform) -> UniquePtr<CxxVector<f64>> ⓘ
Sourcepub fn TransformPoint(
self: &Transform,
point: &CxxVector<f64>,
) -> UniquePtr<CxxVector<f64>> ⓘ
pub fn TransformPoint( self: &Transform, point: &CxxVector<f64>, ) -> UniquePtr<CxxVector<f64>> ⓘ
Apply transform to a point.
The dimension of the point must match the transform.
Sourcepub fn TransformVector(
self: &Transform,
vector: &CxxVector<f64>,
point: &CxxVector<f64>,
) -> UniquePtr<CxxVector<f64>> ⓘ
pub fn TransformVector( self: &Transform, vector: &CxxVector<f64>, point: &CxxVector<f64>, ) -> UniquePtr<CxxVector<f64>> ⓘ
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.
Sourcepub fn GetInverse<'a>(self: &'a Transform) -> impl New<Output = Transform> + 'a
pub fn GetInverse<'a>(self: &'a Transform) -> impl New<Output = Transform> + 'a
\brief 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.
pub fn ToString(self: &Transform) -> UniquePtr<CxxString> ⓘ
Sourcepub fn MakeUnique(self: Pin<&mut Transform>)
pub fn MakeUnique(self: Pin<&mut Transform>)
\brief 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.
Sourcepub fn new() -> impl New<Output = Self>
pub fn new() -> impl New<Output = Self>
\brief By default a 3-d identity transform is constructed
pub unsafe fn new1(transform: *mut TransformBase) -> impl New<Output = Self>
Sourcepub fn new2(dimensions: c_uint, type_: TransformEnum) -> impl New<Output = Self>
pub fn new2(dimensions: c_uint, type_: TransformEnum) -> impl New<Output = Self>
\brief Construct a specific transformation
\deprecated This constructor will be removed in future releases.
Sourcepub fn new3<'a>(
displacement: Pin<&'a mut Image>,
type_: TransformEnum,
) -> impl New<Output = Self> + 'a
pub fn new3<'a>( displacement: Pin<&'a mut Image>, type_: TransformEnum, ) -> impl New<Output = Self> + 'a
\brief 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.
pub fn IsLinear(self: &Transform) -> bool
pub fn SetIdentity(self: Pin<&mut Transform>)
Sourcepub fn SetInverse(self: Pin<&mut Transform>) -> bool
pub fn SetInverse(self: Pin<&mut Transform>) -> bool
\brief 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.