Transform

Struct Transform 

Source
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

Source

pub fn SetParameters(self: Pin<&mut Self>, parameters: &CxxVector<f64>)

Set/Get Transform Parameter @{

Source§

impl Transform

Source

pub fn GetNumberOfParameters(&self) -> c_uint

Return the number of optimizable parameters

Source§

impl Transform

Source

pub fn SetFixedParameters(self: Pin<&mut Self>, parameters: &CxxVector<f64>)

Set/Get Fixed Transform Parameter @{

Source§

impl Transform

Source

pub fn GetNumberOfFixedParameters(&self) -> c_uint

Get the number of fixed parameters

Source§

impl Transform

Source

pub fn WriteTransform(&self, filename: &CxxString)

Source§

impl Transform

Source

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

Source

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.

@{

Source

pub fn GetITKBase1(self: &Transform) -> *const TransformBase

Source

pub fn GetDimension(self: &Transform) -> c_uint

Return the dimension of the Transform ( 2D or 3D )

Source

pub fn GetParameters(self: &Transform) -> UniquePtr<CxxVector<f64>>

Source

pub fn GetFixedParameters(self: &Transform) -> UniquePtr<CxxVector<f64>>

Source

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.

Source

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.

Source

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.

Source

pub fn ToString(self: &Transform) -> UniquePtr<CxxString>

Source

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.

Source

pub fn new() -> impl New<Output = Self>

\brief By default a 3-d identity transform is constructed

Source

pub unsafe fn new1(transform: *mut TransformBase) -> impl New<Output = Self>

Source

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.

Source

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.

Source

pub fn IsLinear(self: &Transform) -> bool

Source

pub fn SetIdentity(self: Pin<&mut Transform>)

Source

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.

Source

pub fn GetName(self: &Transform) -> UniquePtr<CxxString>

return user readable name for the SimpleITK transform

Trait Implementations§

Source§

impl AsRef<Transform> for AffineTransform

Source§

fn as_ref(self: &AffineTransform) -> &Transform

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl CopyNew for Transform

Source§

unsafe fn copy_new(arg1: &Transform, this: Pin<&mut MaybeUninit<Transform>>)

Copy-construct src into this, effectively re-pinning it at a new location. Read more
Source§

impl Drop for Transform

Source§

fn drop(self: &mut Transform)

Executes the destructor for this type. Read more
Source§

impl ExternType for Transform

Source§

type Id = (i, t, k, (), s, i, m, p, l, e, (), T, r, a, n, s, f, o, r, m)

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

type Kind = Opaque

Source§

impl MakeCppStorage for Transform

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut Transform

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
Source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut Transform)

Frees a C++ allocation which has not yet had a constructor called. Read more
Source§

impl SharedPtrTarget for Transform

Source§

impl UniquePtrTarget for Transform

Source§

impl WeakPtrTarget for Transform

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.