Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
camitk::Transformation Class Reference

Transformation represents a geometrical transformation between two FrameOfReferences. More...

#include <Transformation.h>

+ Inheritance diagram for camitk::Transformation:
+ Collaboration diagram for camitk::Transformation:

Public Member Functions

QString getDescription () const
 Get the description of the Transformation Description is used to provide more information than the name (e.g.
 
const FrameOfReferencegetFrom () const
 Get the FrameOfReference the Transformation starts from (origin)
 
vtkMatrix4x4 * getMatrix () const
 Get the internal 4x4 matrix if the Transformation is linear, otherwise nullptr.
 
QString getName () const
 Get the name of the Transformation.
 
const FrameOfReferencegetTo () const
 Get the FrameOfReference that the Transformation goes to (destination)
 
vtkSmartPointer< vtkTransform > getTransform () const
 Get the internal vtkTransform (linear transformation) or a nullptr.
 
void setDescription (QString desc)
 Set the description of the Transformation Description is used to provide more information than the name (e.g.
 
void setName (QString n)
 Set the name of the Transformation.
 
Implementation of InterfacePersistence
QVariant toVariant () const override
 Convert the Transformation to a QVariant (for serializing)
 
void fromVariant (const QVariant &v) override
 Fill the Transformation from a QVariant.
 
QUuid getUuid () const override
 Get the unique identifier of this Transformation.
 
bool setUuid (QUuid id) override
 Set the unique identifier of this transformation if the current one is Null.
 
- Public Member Functions inherited from camitk::InterfacePersistence
virtual ~InterfacePersistence ()=default
 

Detailed Description

Transformation represents a geometrical transformation between two FrameOfReferences.

It supports linear and non-linear transforms stored in a vtkTransform (linear) or any vtkAbstractTransform (non-linear)

It has a direction (from a FrameOfReference to another FrameOfReference)

Its constructor is private as Transformation objects must only be created through TransformationManager::getTransformationManager() (although it is possible to instantiate your own TransformationManager if you know what you're doing!)

Warning
Transformation are instantiated/stored/managed/destroyed by TransformationManager::getTransformationManager(), therefore you should not keep a pointer to any Transformation, just call TransformationManager::getTransformationOwnership(..) when you need to access it. This guarantees the coherence of the complete reference system and avoid dangling pointers and memory leaks.
...
...
t->setMatrix(...);
// note: t MUST not be a member
// call TransformationManager::getTransformationOwnership(from, to) to access it later on
FrameOfReference is only a label for an abstract coordinate system.
Definition FrameOfReference.h:71
static std::shared_ptr< Transformation > addTransformation(const QVariant &)
Create and register a new Transformation from a QVariant (usually from a JSON representation in a ....
Definition TransformationManager.cpp:533
static std::shared_ptr< FrameOfReference > addFrameOfReference(QString name, QString description="")
Add a FrameOfReference with a name and description This is the standard way to create a new FrameOfRe...
Definition TransformationManager.cpp:168
Transformation represents a geometrical transformation between two FrameOfReferences.
Definition Transformation.h:83
See also
TransformationManager

Member Function Documentation

◆ fromVariant()

void camitk::Transformation::fromVariant ( const QVariant &  v)
overridevirtual

Fill the Transformation from a QVariant.

Implements camitk::InterfacePersistence.

References CAMITK_INFO_ALT, CAMITK_WARNING_ALT, and description.

Referenced by camitk::TransformationManager::addTransformation().

+ Here is the caller graph for this function:

◆ getDescription()

QString camitk::Transformation::getDescription ( ) const
inline

Get the description of the Transformation Description is used to provide more information than the name (e.g.

method used to compute it)

◆ getFrom()

const FrameOfReference * camitk::Transformation::getFrom ( ) const
inline

Get the FrameOfReference the Transformation starts from (origin)

Referenced by camitk::TransformationManager::addTransformation(), camitk::TransformationManager::getInverseTransformation(), and camitk::TransformationManager::updateTransformation().

+ Here is the caller graph for this function:

◆ getMatrix()

vtkMatrix4x4 * camitk::Transformation::getMatrix ( ) const

Get the internal 4x4 matrix if the Transformation is linear, otherwise nullptr.

Note: this method should return a pointer to a const vtkMatrix4x4 Unfortunately, at some stage in some part of your VTK pipeline, you might need a non-const vtkMatrix4x4 (e.g. to setup a vtkActor).

Warning
You should only use this method to send the vtkMatrix4x4* to a vtk method.
NEVER use this method to modify the content of the matrix directly, as it might generate inconsistencies in the transformation management. If you need to change the values you MUST use TransformationManager::updateTransformation(..)

Referenced by camitk::ArbitrarySingleImageComponent::getArbitraryCenter(), camitk::ArbitrarySingleImageComponent::getArbitraryPlaneNormal(), camitk::InteractiveViewer::picked(), and VtkImageComponentExtension::save().

+ Here is the caller graph for this function:

◆ getName()

QString camitk::Transformation::getName ( ) const

Get the name of the Transformation.

Referenced by camitk::toString(), and camitk::TransformationManager::updateTransformation().

+ Here is the caller graph for this function:

◆ getTo()

const FrameOfReference * camitk::Transformation::getTo ( ) const
inline

Get the FrameOfReference that the Transformation goes to (destination)

Referenced by camitk::TransformationManager::addTransformation(), camitk::TransformationManager::getInverseTransformation(), and camitk::TransformationManager::updateTransformation().

+ Here is the caller graph for this function:

◆ getTransform()

vtkSmartPointer< vtkTransform > camitk::Transformation::getTransform ( ) const
inline

Get the internal vtkTransform (linear transformation) or a nullptr.

Note: this method should return a vtkSmartPointer to a const vtkTransform Unfortunately, at some stage in some part of your VTK pipeline, you might need a non-const vtkTransform.

Warning
You should only use this method to send the vtkTransform to a vtk method.
NEVER use this method to modify the content of the matrix directly, as it might generate inconsistencies in the transformation management. If you need to change the values you MUST use TransformationManager::updateTransformation(..)

Referenced by camitk::InteractiveViewer::addActor(), camitk::TransformationManager::addTransformation(), VolumeRenderingAction::createVolumeRendering(), camitk::ArbitrarySingleImageComponent::get3DCursor(), camitk::InteractiveViewer::picked(), camitk::ImageComponent::pixelPicked(), VtkImageComponentExtension::save(), camitk::toString(), and camitk::ArbitrarySingleImageComponent::updatePropertyFromTransformation().

+ Here is the caller graph for this function:

◆ getUuid()

QUuid camitk::Transformation::getUuid ( ) const
inlineoverridevirtual

Get the unique identifier of this Transformation.

Implements camitk::InterfacePersistence.

Referenced by camitk::TransformationManager::addTransformation().

+ Here is the caller graph for this function:

◆ setDescription()

void camitk::Transformation::setDescription ( QString  desc)
inline

Set the description of the Transformation Description is used to provide more information than the name (e.g.

method used to compute it)

◆ setName()

void camitk::Transformation::setName ( QString  n)
inline

Set the name of the Transformation.

◆ setUuid()

bool camitk::Transformation::setUuid ( QUuid  id)
overridevirtual

Set the unique identifier of this transformation if the current one is Null.

Warning
This should almost never be used except when loading a Transformation from a camitk file
Returns
true if the UUID was changed, false if it was not (because it already had a non-null value)

Implements camitk::InterfacePersistence.

◆ toVariant()

QVariant camitk::Transformation::toVariant ( ) const
overridevirtual

Convert the Transformation to a QVariant (for serializing)

Implements camitk::InterfacePersistence.

References description.


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