MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitk::Transform Class Reference

class representing a transfrom in 3D More...

#include <mitkTransform.h>

Inheritance diagram for mitk::Transform:
mitk::XMLSerializable

Public Member Functions

 mitkClassMacroItkParent (Transform, itk::Object)
 
 itkFactorylessNewMacro (Transform)
 
 mitkNewMacro1Param (Transform, const mitk::NavigationData *)
 
 mitkNewMacro1Param (Transform, const std::string &)
 
 itkGetConstMacro (Type, std::string)
 
 itkSetMacro (Type, std::string &)
 
void Copy (const mitk::Transform *transform)
 
void Copy (const mitk::NavigationData *transform)
 
void TransposeRotation ()
 
mitk::Transform::Pointer Clone () const
 
void Concatenate (mitk::Transform *transform)
 
void Concatenate (const vnl_matrix_fixed< mitk::ScalarType, 4, 4 > &transform)
 
void Concatenate (const vtkMatrix4x4 *transform)
 
void Invert ()
 
void Reset ()
 
void FromXML (const tinyxml2::XMLElement *elem) override
 
void FromCSVFile (const std::string &file)
 
void SetNavigationData (const mitk::NavigationData *naviData)
 
void SetOrientation (const vnl_quaternion< mitk::ScalarType > &orientation)
 
void SetOrientation (const vnl_quaternion< float > &orientation)
 
void SetTranslation (const vnl_vector_fixed< mitk::ScalarType, 3 > &transl)
 
void SetTranslation (const vnl_vector< double > &transl)
 
void SetPosition (const mitk::Point3D &transl)
 
void SetRotation (vnl_matrix_fixed< mitk::ScalarType, 3, 3 > &mat)
 
void SetRotation (vnl_matrix< mitk::ScalarType > &mat)
 
void SetMatrix (const vnl_matrix_fixed< mitk::ScalarType, 4, 4 > &mat)
 
void SetMatrix (const vtkMatrix4x4 *mat)
 
void SetTranslation (float *array)
 
void SetRotation (float *array)
 
void SetTranslation (double array[3])
 
void SetRotation (double array[3][3])
 
void SetTranslation (const cv::Mat &transl)
 
void SetRotation (const cv::Mat &mat)
 
void SetRotationVector (const cv::Mat &rotVec)
 
mitk::NavigationData::Pointer GetNavigationData () const
 
mitk::Point3D GetPosition () const
 
mitk::Point3D GetTranslation () const
 
bool IsValid () const
 
void SetValid (bool valid)
 
mitk::Quaternion GetOrientation () const
 
vnl_matrix_fixed< mitk::ScalarType, 4, 4 > GetMatrix () const
 
void GetMatrix (vtkMatrix4x4 *matrix) const
 
void GetVtkOpenGlMatrix (vtkMatrix4x4 *matrix) const
 
mitk::Point3D TransformPoint (mitk::Point3D point) const
 
void ToXML (tinyxml2::XMLElement *elem) const override
 
std::string ToString () const
 
std::string ToCSVString () const
 
std::string ToMatlabString (const std::string &varname="transform", bool printLastRow=true) const
 
void ToCSVFile (const std::string &file) const
 
void ToMatlabFile (const std::string &file, const std::string &varname="transform") const
 
cv::Mat GetCvTranslation () const
 
cv::Mat GetCvRotationVector () const
 
cv::Mat GetCvRotationMatrix () const
 
cv::Mat GetCvMatrix () const
 
vnl_vector_fixed< mitk::ScalarType, 3 > GetVnlTranslation () const
 
vnl_vector_fixed< double, 3 > GetVnlDoubleTranslation () const
 
vnl_quaternion< double > GetVnlDoubleQuaternion () const
 
vnl_matrix_fixed< mitk::ScalarType, 3, 3 > GetVnlRotationMatrix () const
 
vnl_matrix_fixed< double, 4, 4 > GetVnlDoubleMatrix () const
 
- Public Member Functions inherited from mitk::XMLSerializable
virtual const char * GetNameOfClass () const =0
 
virtual void ToXMLFile (const std::string &file, const std::string &elemName="")
 
virtual void FromXMLFile (const std::string &file, const std::string &elemName="")
 
std::string GetXMLFileName () const
 

Static Public Attributes

static const std::string UNKNOWN_TYPE = "Unknown type"
 
static const std::string ENDOSCOPE_SCOPE_TOOL = "Endoscope scope tool"
 
static const std::string ENDOSCOPE_CAM_TOOL = "Endoscope camera tool"
 
static const std::string CHESSBOARD_TOOL = "Chessboard tool"
 
static const std::string POINTER_TOOL = "Pointer tool"
 
static const std::string POINTER_TO_CHESSBOARD_ORIGIN = "Pointer to chessboard origin"
 
static const std::string POINTER_TO_CHESSBOARD_X_SUPPORT_POINT = "Pointer to chessboard X support origin"
 
static const std::string POINTER_TO_CHESSBOARD_Y_SUPPORT_POINT = "Pointer to chessboard Y support origin"
 
static const std::string BOARD_TO_BOARD_TOOL = "Board to board tool"
 
static const std::string REFERENCE_CAMERA_TRANSFORM = "Reference camera transform"
 
static const std::string REFERENCE_SCOPE_TRANSFORM = "Reference scope transform"
 
static const std::string EYE_TO_HAND_TRANSFORM = "Eye to hand transform"
 
static const std::string CAMERA_EXTRINSICS = "Camera extrinsics"
 
- Static Public Attributes inherited from mitk::XMLSerializable
static const std::string FILE_REFERENCE_ATTRIBUTE_NAME = "fileRef"
 
static const std::string ROOT_NAME = "data"
 

Protected Member Functions

 Transform ()
 
 Transform (const mitk::NavigationData *nd)
 
 Transform (const std::string &s)
 

Protected Attributes

mitk::NavigationData::Pointer m_NavData
 
std::string m_Type
 

Detailed Description

class representing a transfrom in 3D

internally it stores a mitk navigation data. this is more or less a wrapper for navigation data for easy casting between opencv/vnl/mitk/xml representations of transform data

Definition at line 35 of file mitkTransform.h.

Constructor & Destructor Documentation

◆ Transform() [1/3]

mitk::Transform::Transform ( )
protected

Definition at line 38 of file mitkTransform.cpp.

◆ Transform() [2/3]

mitk::Transform::Transform ( const mitk::NavigationData * nd)
protected

Definition at line 46 of file mitkTransform.cpp.

◆ Transform() [3/3]

mitk::Transform::Transform ( const std::string & s)
protected

Definition at line 52 of file mitkTransform.cpp.

Member Function Documentation

◆ Clone()

mitk::Transform::Pointer mitk::Transform::Clone ( ) const

get a copy of this transform

Definition at line 268 of file mitkTransform.cpp.

◆ Concatenate() [1/3]

void mitk::Transform::Concatenate ( const vnl_matrix_fixed< mitk::ScalarType, 4, 4 > & transform)

same as above with vnl mat argument

Definition at line 73 of file mitkTransform.cpp.

◆ Concatenate() [2/3]

void mitk::Transform::Concatenate ( const vtkMatrix4x4 * transform)

same as above with vtk mat argument

Definition at line 81 of file mitkTransform.cpp.

◆ Concatenate() [3/3]

void mitk::Transform::Concatenate ( mitk::Transform * transform)

concatenate this transform with the given one, i.e. this transform is done first, then transform ( if x is this transform, y is transform, then this will be y*x) post multiply semantics!

See also
vtkTransform

Definition at line 65 of file mitkTransform.cpp.

◆ Copy() [1/2]

void mitk::Transform::Copy ( const mitk::NavigationData * transform)

Copies the content of transform to this instance

Definition at line 60 of file mitkTransform.cpp.

◆ Copy() [2/2]

void mitk::Transform::Copy ( const mitk::Transform * transform)

Copies the content of transform to this instance

Definition at line 262 of file mitkTransform.cpp.

◆ FromCSVFile()

void mitk::Transform::FromCSVFile ( const std::string & file)

read csv file

Definition at line 182 of file mitkTransform.cpp.

◆ FromXML()

void mitk::Transform::FromXML ( const tinyxml2::XMLElement * elem)
overridevirtual

read from xml

Implements mitk::XMLSerializable.

Definition at line 655 of file mitkTransform.cpp.

◆ GetCvMatrix()

cv::Mat mitk::Transform::GetCvMatrix ( ) const

Definition at line 495 of file mitkTransform.cpp.

◆ GetCvRotationMatrix()

cv::Mat mitk::Transform::GetCvRotationMatrix ( ) const

Definition at line 485 of file mitkTransform.cpp.

◆ GetCvRotationVector()

cv::Mat mitk::Transform::GetCvRotationVector ( ) const

Definition at line 504 of file mitkTransform.cpp.

◆ GetCvTranslation()

cv::Mat mitk::Transform::GetCvTranslation ( ) const

conversion to cv types

Definition at line 475 of file mitkTransform.cpp.

◆ GetMatrix() [1/2]

vnl_matrix_fixed< mitk::ScalarType, 4, 4 > mitk::Transform::GetMatrix ( ) const
Returns
the homogeneous matrix representing this transform

Definition at line 537 of file mitkTransform.cpp.

◆ GetMatrix() [2/2]

void mitk::Transform::GetMatrix ( vtkMatrix4x4 * matrix) const

returns the homogeneous vtk matrix representing this transform

Definition at line 429 of file mitkTransform.cpp.

◆ GetNavigationData()

mitk::NavigationData::Pointer mitk::Transform::GetNavigationData ( ) const
Returns
the navigation data that stores all information

Definition at line 409 of file mitkTransform.cpp.

◆ GetOrientation()

mitk::Quaternion mitk::Transform::GetOrientation ( ) const

calls navigationdata::GetOrientation()

Definition at line 424 of file mitkTransform.cpp.

◆ GetPosition()

mitk::Point3D mitk::Transform::GetPosition ( ) const

calls navigationdata::GetPosition()

Definition at line 419 of file mitkTransform.cpp.

◆ GetTranslation()

mitk::Point3D mitk::Transform::GetTranslation ( ) const

same as GetPosition

Definition at line 414 of file mitkTransform.cpp.

◆ GetVnlDoubleMatrix()

vnl_matrix_fixed< double, 4, 4 > mitk::Transform::GetVnlDoubleMatrix ( ) const

Definition at line 524 of file mitkTransform.cpp.

◆ GetVnlDoubleQuaternion()

vnl_quaternion< double > mitk::Transform::GetVnlDoubleQuaternion ( ) const

Definition at line 172 of file mitkTransform.cpp.

◆ GetVnlDoubleTranslation()

vnl_vector_fixed< double, 3 > mitk::Transform::GetVnlDoubleTranslation ( ) const

Definition at line 152 of file mitkTransform.cpp.

◆ GetVnlRotationMatrix()

vnl_matrix_fixed< mitk::ScalarType, 3, 3 > mitk::Transform::GetVnlRotationMatrix ( ) const

Definition at line 519 of file mitkTransform.cpp.

◆ GetVnlTranslation()

vnl_vector_fixed< mitk::ScalarType, 3 > mitk::Transform::GetVnlTranslation ( ) const

conversion to vnl types

Definition at line 512 of file mitkTransform.cpp.

◆ GetVtkOpenGlMatrix()

void mitk::Transform::GetVtkOpenGlMatrix ( vtkMatrix4x4 * matrix) const

returns the homogeneous vtk matrix representing this transform in !OpenGL! left handed coordinate system

Definition at line 437 of file mitkTransform.cpp.

◆ Invert()

void mitk::Transform::Invert ( )

invert this transform

Definition at line 347 of file mitkTransform.cpp.

◆ IsValid()

bool mitk::Transform::IsValid ( ) const

calls navigationdata::IsValid()

Definition at line 370 of file mitkTransform.cpp.

◆ itkFactorylessNewMacro()

mitk::Transform::itkFactorylessNewMacro ( Transform )

◆ itkGetConstMacro()

mitk::Transform::itkGetConstMacro ( Type ,
std::string  )

◆ itkSetMacro()

mitk::Transform::itkSetMacro ( Type ,
std::string &  )

◆ mitkClassMacroItkParent()

mitk::Transform::mitkClassMacroItkParent ( Transform ,
itk::Object  )

◆ mitkNewMacro1Param() [1/2]

mitk::Transform::mitkNewMacro1Param ( Transform ,
const mitk::NavigationData *  )

◆ mitkNewMacro1Param() [2/2]

mitk::Transform::mitkNewMacro1Param ( Transform ,
const std::string &  )

◆ Reset()

void mitk::Transform::Reset ( )

resets the internal variables except type

Definition at line 88 of file mitkTransform.cpp.

◆ SetMatrix() [1/2]

void mitk::Transform::SetMatrix ( const vnl_matrix_fixed< mitk::ScalarType, 4, 4 > & mat)

sets rotation and translation with a transformation matrix

Definition at line 353 of file mitkTransform.cpp.

◆ SetMatrix() [2/2]

void mitk::Transform::SetMatrix ( const vtkMatrix4x4 * mat)

sets rotation and translation with a vtk transformation matrix

Definition at line 275 of file mitkTransform.cpp.

◆ SetNavigationData()

void mitk::Transform::SetNavigationData ( const mitk::NavigationData * naviData)

grafts the data from naviData to this transform

Definition at line 304 of file mitkTransform.cpp.

◆ SetOrientation() [1/2]

void mitk::Transform::SetOrientation ( const vnl_quaternion< float > & orientation)

method to set float valued orientation quat

Definition at line 141 of file mitkTransform.cpp.

◆ SetOrientation() [2/2]

void mitk::Transform::SetOrientation ( const vnl_quaternion< mitk::ScalarType > & orientation)

method to set orientation quat

Definition at line 94 of file mitkTransform.cpp.

◆ SetPosition()

void mitk::Transform::SetPosition ( const mitk::Point3D & transl)

method to set a mitk::Point3D as position

Definition at line 323 of file mitkTransform.cpp.

◆ SetRotation() [1/5]

void mitk::Transform::SetRotation ( const cv::Mat & mat)

sets rotation with a rotation matrix

Definition at line 383 of file mitkTransform.cpp.

◆ SetRotation() [2/5]

void mitk::Transform::SetRotation ( double array[3][3])

sets translation from a POD vector

Definition at line 337 of file mitkTransform.cpp.

◆ SetRotation() [3/5]

void mitk::Transform::SetRotation ( float * array)

sets translation from a POD vector. this must be a 3x3=9 sized vector in row major format (first row = first three elements)

Definition at line 120 of file mitkTransform.cpp.

◆ SetRotation() [4/5]

void mitk::Transform::SetRotation ( vnl_matrix< mitk::ScalarType > & mat)

sets rotation with a non fixed rotation matrix

Definition at line 317 of file mitkTransform.cpp.

◆ SetRotation() [5/5]

void mitk::Transform::SetRotation ( vnl_matrix_fixed< mitk::ScalarType, 3, 3 > & mat)

sets rotation with a rotation matrix

Definition at line 311 of file mitkTransform.cpp.

◆ SetRotationVector()

void mitk::Transform::SetRotationVector ( const cv::Mat & rotVec)

sets rotation with a rodrigues rotation vector

Definition at line 393 of file mitkTransform.cpp.

◆ SetTranslation() [1/5]

void mitk::Transform::SetTranslation ( const cv::Mat & transl)

method to set translation by cv vector

Definition at line 375 of file mitkTransform.cpp.

◆ SetTranslation() [2/5]

void mitk::Transform::SetTranslation ( const vnl_vector< double > & transl)

method to set a vector of doubles as translation

Definition at line 162 of file mitkTransform.cpp.

◆ SetTranslation() [3/5]

void mitk::Transform::SetTranslation ( const vnl_vector_fixed< mitk::ScalarType, 3 > & transl)

method to set translation

Definition at line 101 of file mitkTransform.cpp.

◆ SetTranslation() [4/5]

void mitk::Transform::SetTranslation ( double array[3])

sets translation from a POD vector

Definition at line 328 of file mitkTransform.cpp.

◆ SetTranslation() [5/5]

void mitk::Transform::SetTranslation ( float * array)

sets translation from a POD vector

Definition at line 112 of file mitkTransform.cpp.

◆ SetValid()

void mitk::Transform::SetValid ( bool valid)

calls navigationdata::SetValid()

Definition at line 561 of file mitkTransform.cpp.

◆ ToCSVFile()

void mitk::Transform::ToCSVFile ( const std::string & file) const

write csv representation to file (only the transformation values!!!!)

Definition at line 285 of file mitkTransform.cpp.

◆ ToCSVString()

std::string mitk::Transform::ToCSVString ( ) const

create string csv representation (only the transformation values!!!!)

Definition at line 215 of file mitkTransform.cpp.

◆ ToMatlabFile()

void mitk::Transform::ToMatlabFile ( const std::string & file,
const std::string & varname = "transform" ) const

write matlab representation to file

Definition at line 294 of file mitkTransform.cpp.

◆ ToMatlabString()

std::string mitk::Transform::ToMatlabString ( const std::string & varname = "transform",
bool printLastRow = true ) const

create matlab representation

Definition at line 238 of file mitkTransform.cpp.

◆ ToString()

std::string mitk::Transform::ToString ( ) const

create string representation

Definition at line 570 of file mitkTransform.cpp.

◆ ToXML()

void mitk::Transform::ToXML ( tinyxml2::XMLElement * elem) const
overridevirtual

create xml representation

Implements mitk::XMLSerializable.

Definition at line 590 of file mitkTransform.cpp.

◆ TransformPoint()

mitk::Point3D mitk::Transform::TransformPoint ( mitk::Point3D point) const

Definition at line 463 of file mitkTransform.cpp.

◆ TransposeRotation()

void mitk::Transform::TransposeRotation ( )

Inverts the rotation of this transform (Polaris navigation Data have inverted rotation so you may want to call this function when using polaris data)

Definition at line 555 of file mitkTransform.cpp.

Member Data Documentation

◆ BOARD_TO_BOARD_TOOL

const std::string mitk::Transform::BOARD_TO_BOARD_TOOL = "Board to board tool"
static

Definition at line 56 of file mitkTransform.h.

◆ CAMERA_EXTRINSICS

const std::string mitk::Transform::CAMERA_EXTRINSICS = "Camera extrinsics"
static

Definition at line 60 of file mitkTransform.h.

◆ CHESSBOARD_TOOL

const std::string mitk::Transform::CHESSBOARD_TOOL = "Chessboard tool"
static

Definition at line 51 of file mitkTransform.h.

◆ ENDOSCOPE_CAM_TOOL

const std::string mitk::Transform::ENDOSCOPE_CAM_TOOL = "Endoscope camera tool"
static

Definition at line 50 of file mitkTransform.h.

◆ ENDOSCOPE_SCOPE_TOOL

const std::string mitk::Transform::ENDOSCOPE_SCOPE_TOOL = "Endoscope scope tool"
static

Definition at line 49 of file mitkTransform.h.

◆ EYE_TO_HAND_TRANSFORM

const std::string mitk::Transform::EYE_TO_HAND_TRANSFORM = "Eye to hand transform"
static

Definition at line 59 of file mitkTransform.h.

◆ m_NavData

mitk::NavigationData::Pointer mitk::Transform::m_NavData
protected

Definition at line 287 of file mitkTransform.h.

◆ m_Type

std::string mitk::Transform::m_Type
protected

saves the type of the transform (Default is UNKNOWN_TYPE)

Definition at line 292 of file mitkTransform.h.

◆ POINTER_TO_CHESSBOARD_ORIGIN

const std::string mitk::Transform::POINTER_TO_CHESSBOARD_ORIGIN = "Pointer to chessboard origin"
static

Definition at line 53 of file mitkTransform.h.

◆ POINTER_TO_CHESSBOARD_X_SUPPORT_POINT

const std::string mitk::Transform::POINTER_TO_CHESSBOARD_X_SUPPORT_POINT = "Pointer to chessboard X support origin"
static

Definition at line 54 of file mitkTransform.h.

◆ POINTER_TO_CHESSBOARD_Y_SUPPORT_POINT

const std::string mitk::Transform::POINTER_TO_CHESSBOARD_Y_SUPPORT_POINT = "Pointer to chessboard Y support origin"
static

Definition at line 55 of file mitkTransform.h.

◆ POINTER_TOOL

const std::string mitk::Transform::POINTER_TOOL = "Pointer tool"
static

Definition at line 52 of file mitkTransform.h.

◆ REFERENCE_CAMERA_TRANSFORM

const std::string mitk::Transform::REFERENCE_CAMERA_TRANSFORM = "Reference camera transform"
static

Definition at line 57 of file mitkTransform.h.

◆ REFERENCE_SCOPE_TRANSFORM

const std::string mitk::Transform::REFERENCE_SCOPE_TRANSFORM = "Reference scope transform"
static

Definition at line 58 of file mitkTransform.h.

◆ UNKNOWN_TYPE

const std::string mitk::Transform::UNKNOWN_TYPE = "Unknown type"
static

constants describing the type of transform represented here

Definition at line 48 of file mitkTransform.h.


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