SIRF  3.5.0
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
sirf::AffineTransformation< dataType > Class Template Reference

Class for affine transformations. More...

#include "AffineTransformation.h"

Inheritance diagram for sirf::AffineTransformation< dataType >:
sirf::Transformation< dataType >

Public Member Functions

 AffineTransformation ()
 Default constructor - identity matrix.
 
 AffineTransformation (const dataType tm[4][4])
 Constructor.
 
 AffineTransformation (const std::string &filename)
 Construct from file.
 
 AffineTransformation (const mat44 &tm)
 Construct from mat44.
 
 AffineTransformation (const std::array< dataType, 3 > &trans, const Quaternion< dataType > &quat)
 
 AffineTransformation (const std::array< dataType, 3 > &trans, const std::array< dataType, 3 > &euler, const bool degrees=true)
 Construct from translation and euler angles (XYZ order)
 
 AffineTransformation (const AffineTransformation &to_copy)
 Copy constructor.
 
AffineTransformationoperator= (const AffineTransformation &to_copy)
 Assignment.
 
bool operator== (const AffineTransformation &other) const
 Equality operator.
 
bool operator!= (const AffineTransformation &other) const
 Equality operator.
 
AffineTransformation operator* (const AffineTransformation &other) const
 Multiplication operator. More...
 
dataType const * operator[] (unsigned i) const
 Overload [] operator (const)
 
dataType * operator[] (unsigned i)
 Overload [] operator.
 
mat44 get_as_mat44 () const
 Get raw mat44.
 
virtual ~AffineTransformation ()
 Destructor.
 
virtual NiftiImageData3DDeformation< dataType > get_as_deformation_field (const NiftiImageData< dataType > &ref, const bool use_ref=true) const
 
virtual AffineTransformation deep_copy () const
 Deep copy.
 
virtual void write (const std::string &filename) const
 Save to file. More...
 
dataType get_determinant () const
 Get determinant.
 
void print () const
 Print.
 
AffineTransformation get_inverse () const
 Get inverse.
 
const std::array< dataType, 3 > get_Euler_angles () const
 Get Euler angles (XYZ)
 
Quaternion< dataType > get_quaternion () const
 Get quaternion.
 
bool is_rigid () const
 Is rigid? If so, determinant will be +/- 1.
 
- Public Member Functions inherited from sirf::Transformation< dataType >
 Transformation ()
 Constructor.
 
virtual ~Transformation ()
 Destructor.
 

Static Public Member Functions

static void print (const std::vector< AffineTransformation< dataType > > &mats)
 Print multiple AffineTransformation.
 
static std::string get (const std::vector< AffineTransformation< dataType > > &mats)
 
static AffineTransformation get_average (const std::vector< AffineTransformation< dataType > > &mats)
 Average transformation matrices (using quaternions for rotation component)
 

Protected Attributes

dataType _tm [4][4]
 

Additional Inherited Members

- Static Protected Member Functions inherited from sirf::Transformation< dataType >
static void check_ref_and_def (const NiftiImageData< dataType > &ref, const NiftiImageData3DDeformation< dataType > &def)
 Check that the deformation field image matches the reference image.
 

Detailed Description

template<class dataType>
class sirf::AffineTransformation< dataType >

Class for affine transformations.

Forward declarations.

Author
Richard Brown
SyneRBI

Constructor & Destructor Documentation

◆ AffineTransformation()

template<class dataType >
AffineTransformation::AffineTransformation ( const std::array< dataType, 3 > &  trans,
const Quaternion< dataType > &  quat 
)

Construct from translation and quaternion Code from here: https://uk.mathworks.com/help/robotics/ref/quaternion.rotmat.html

Member Function Documentation

◆ get_as_deformation_field()

template<class dataType >
NiftiImageData3DDeformation< dataType > AffineTransformation::get_as_deformation_field ( const NiftiImageData< dataType > &  ref,
const bool  use_ref = true 
) const
virtual

Get as deformation field.

Reference image must be used when converting a transformation matrix to a deformation. For displacements and deformations, the reference can be used optionally. It should be used when composing transformations to be used for resampling But is probably unnecessary for simply concatenating deformations.

Implements sirf::Transformation< dataType >.

◆ operator*()

template<class dataType >
AffineTransformation< dataType > AffineTransformation::operator* ( const AffineTransformation< dataType > &  other) const

Multiplication operator.

Multiply matrices.

◆ write()

template<class dataType >
void AffineTransformation::write ( const std::string &  filename) const
virtual

Save to file.

Save transformation matrix to file.

Implements sirf::Transformation< dataType >.


The documentation for this class was generated from the following files: