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

AnatomicalOrientation describes the relationship between 3D axes of a FrameOfReference and medical image anatomical orientation labels. More...

#include <AnatomicalOrientation.h>

+ Inheritance diagram for camitk::AnatomicalOrientation:
+ Collaboration diagram for camitk::AnatomicalOrientation:

Public Member Functions

 AnatomicalOrientation ()
 Default constructor.
 
 AnatomicalOrientation (QString minXLabel, QString maxXLabel, QString minYLabel, QString maxYLabel, QString minZLabel, QString maxZLabel)
 Constructor setting a custom label for each axis negative and positive directions.
 
 AnatomicalOrientation (QString threeLetterCode)
 Constructor from a 3-letter code (e.g.
 
QString get3LetterCode (bool plus=false) const
 Return the current 3 letter code or an empty string if it is unknown or custom.
 
std::pair< int, bool > getAxisFromName (QString name) const
 
QString getLabel (int axis, bool minDirection) const
 Returns the label of the corresponding axis/direction (or empty string if there is no label)
 
QString getMaxLabel (int axis) const
 Get the label of the positive/maximum direction of the specified axis.
 
QString getMinLabel (int axis) const
 Get the label of the negative/minimum direction of the specified axis.
 
bool isUnknown () const
 Check if anatomical information is unknown.
 
void setLabels (int axis, QString minLabel, QString maxLabel)
 Set both negative and positive direction labels for an axis.
 
void setMaxLabel (int axis, QString maxLabel)
 Set the label of the corresponding axis positive direction.
 
void setMinLabel (int axis, QString minLabel)
 Set the label of the corresponding axis negative direction.
 
void setOrientation (QString minXLabel, QString maxXLabel, QString minYLabel, QString maxYLabel, QString minZLabel, QString maxZLabel)
 Set a custom label for the negative and positive directions of all axes.
 
void setOrientation (QString threeLetterCode)
 Sets the orientation using the standard 3-letter code.
 
void setUnkown ()
 Reset anatomical information to unknown.
 
InterfacePersistence implementation
QVariant toVariant () const override
 Convert all data from the object to a QVariantMap.
 
void fromVariant (const QVariant &variant) override
 Load data from a QVariant to initialize the current object.
 
bool setUuid (QUuid newid) override
 SetUuid does nothing It does not store the uuid, but is needed to implement InterfacePersistence.
 
QUuid getUuid () const override
 Returns an invalid uuid because AnatomicalOrientation is part of a FrameOfReference which has its own uuid, but this method is needed to implement InterfacePersistence.
 
- Public Member Functions inherited from camitk::InterfacePersistence
virtual ~InterfacePersistence ()=default
 

Static Public Member Functions

static QString invert3LetterCode (const QString &code)
 Returns the inverted 3-letter code (e.g.
 

Detailed Description

AnatomicalOrientation describes the relationship between 3D axes of a FrameOfReference and medical image anatomical orientation labels.

For most methods, each axis is referred to by its index:

  • 0 corresponds to the x-axis
  • 1 corresponds to the y-axis
  • 2 corresponds to the z-axis

For each axis, the two possible directions are

  • positive direction points towards increasing/maximum values
  • negative direction points towards decreasing/minimum values

The label of the positive direction is called "maxLabel". The label of the negative direction is called "minLabel".

Three letter codes are supported, e.g. "RAI", "LAS", or its "+"" variant "LPS+". Supported letters are R (right), L (left), A (anterior), P (posterior), I (inferior) or F (foot), S (superior) or H (head). 3 letter code "RAI" means - axis 0 (X) goes from Right (negative direction) to left (positive direction) - axis 1 (Y) goes from Anterior to posterior - axis 2 (Z) goes from Inferior to superior. The "+" variant reverses this convention, so LPS+ is equivalent to RAI

Using custom labels is also supported (this is incompatible with three letter code convention). In this case you can set positive and/or negative direction labels for any axis. Custom labels should only be used for specialized context / specific organ anatomy description (e.g. heart imaging along apex/base axis), as the standard viewer can only deal with the standard axial/coronal/sagittal orientation. Using standard 3-letter orientation is recommended.

Note
Indirect frame of references are supported.

This replaces and extend ImageOrientationHelper.

Constructor & Destructor Documentation

◆ AnatomicalOrientation() [1/3]

camitk::AnatomicalOrientation::AnatomicalOrientation ( )
inline

Default constructor.

Anatomical orientation is unknown

References setUnkown().

+ Here is the call graph for this function:

◆ AnatomicalOrientation() [2/3]

camitk::AnatomicalOrientation::AnatomicalOrientation ( QString  threeLetterCode)
inlineexplicit

Constructor from a 3-letter code (e.g.

"RAI")

References setOrientation().

+ Here is the call graph for this function:

◆ AnatomicalOrientation() [3/3]

camitk::AnatomicalOrientation::AnatomicalOrientation ( QString  minXLabel,
QString  maxXLabel,
QString  minYLabel,
QString  maxYLabel,
QString  minZLabel,
QString  maxZLabel 
)
inline

Constructor setting a custom label for each axis negative and positive directions.

References setOrientation().

+ Here is the call graph for this function:

Member Function Documentation

◆ fromVariant()

void camitk::AnatomicalOrientation::fromVariant ( const QVariant &  variant)
inlineoverridevirtual

Load data from a QVariant to initialize the current object.

Implements camitk::InterfacePersistence.

◆ get3LetterCode()

QString camitk::AnatomicalOrientation::get3LetterCode ( bool  plus = false) const
inline

Return the current 3 letter code or an empty string if it is unknown or custom.

Parameters
plusif true, the "+" variant is returned instead
See also
setOrientation(QString threeLetterCode) for more detail

References invert3LetterCode().

+ Here is the call graph for this function:

◆ getAxisFromName()

std::pair< int, bool > camitk::AnatomicalOrientation::getAxisFromName ( QString  name) const
inline
Returns
a pair<axisIndex, directionIsMin> where
  • axisIndex is the axis index (0,1,2) that matches the given label name (-1 is returned if there is no match),
  • directionIsMin is true if the given label name matches the negative/minimum direction of axisIndex and false if it matches the positive/maximum direction

Example: getAxisFromName("R") -> (0, true) for RAI data, (0, false) for LAI, getAxisFromName("A") -> (1, true) for RAI data. getAxisFromName("Apex") -> (1, false) if "Apex" is the label of the positive/maximum direction for the y-axis

◆ getLabel()

QString camitk::AnatomicalOrientation::getLabel ( int  axis,
bool  minDirection 
) const
inline

Returns the label of the corresponding axis/direction (or empty string if there is no label)

Parameters
axisThe axis index (0,1,2)
minDirectionif true, return the label of the minimum/negative direction, otherwise return the label of the maximum/position direction for the given axis

Referenced by camitk::FrameOfReference::getAnatomicalOrientationLabel().

+ Here is the caller graph for this function:

◆ getMaxLabel()

QString camitk::AnatomicalOrientation::getMaxLabel ( int  axis) const
inline

Get the label of the positive/maximum direction of the specified axis.

Referenced by camitk::InteractiveViewer::setCameraOrientation().

+ Here is the caller graph for this function:

◆ getMinLabel()

QString camitk::AnatomicalOrientation::getMinLabel ( int  axis) const
inline

Get the label of the negative/minimum direction of the specified axis.

Referenced by camitk::InteractiveViewer::setCameraOrientation().

+ Here is the caller graph for this function:

◆ getUuid()

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

Returns an invalid uuid because AnatomicalOrientation is part of a FrameOfReference which has its own uuid, but this method is needed to implement InterfacePersistence.

Implements camitk::InterfacePersistence.

◆ invert3LetterCode()

static QString camitk::AnatomicalOrientation::invert3LetterCode ( const QString &  code)
inlinestatic

Returns the inverted 3-letter code (e.g.

RAI becomes LPS)

Referenced by get3LetterCode().

+ Here is the caller graph for this function:

◆ isUnknown()

bool camitk::AnatomicalOrientation::isUnknown ( ) const
inline

Check if anatomical information is unknown.

Referenced by camitk::InteractiveViewer::setCameraOrientation().

+ Here is the caller graph for this function:

◆ setLabels()

void camitk::AnatomicalOrientation::setLabels ( int  axis,
QString  minLabel,
QString  maxLabel 
)
inline

Set both negative and positive direction labels for an axis.

Parameters
minLabelThe label towards the negative/minimum values in the chosen axis
maxLabelThe label towards the positive/maximum values in the chosen axis

References setMaxLabel(), and setMinLabel().

+ Here is the call graph for this function:

◆ setMaxLabel()

void camitk::AnatomicalOrientation::setMaxLabel ( int  axis,
QString  maxLabel 
)
inline

Set the label of the corresponding axis positive direction.

Referenced by setLabels().

+ Here is the caller graph for this function:

◆ setMinLabel()

void camitk::AnatomicalOrientation::setMinLabel ( int  axis,
QString  minLabel 
)
inline

Set the label of the corresponding axis negative direction.

Referenced by setLabels().

+ Here is the caller graph for this function:

◆ setOrientation() [1/2]

void camitk::AnatomicalOrientation::setOrientation ( QString  minXLabel,
QString  maxXLabel,
QString  minYLabel,
QString  maxYLabel,
QString  minZLabel,
QString  maxZLabel 
)
inline

Set a custom label for the negative and positive directions of all axes.

◆ setOrientation() [2/2]

void camitk::AnatomicalOrientation::setOrientation ( QString  threeLetterCode)
inline

Sets the orientation using the standard 3-letter code.

Referenced by AnatomicalOrientation(), AnatomicalOrientation(), and camitk::FrameOfReference::setAnatomicalOrientation().

+ Here is the caller graph for this function:

◆ setUnkown()

void camitk::AnatomicalOrientation::setUnkown ( )
inline

Reset anatomical information to unknown.

Referenced by AnatomicalOrientation().

+ Here is the caller graph for this function:

◆ setUuid()

bool camitk::AnatomicalOrientation::setUuid ( QUuid  newid)
inlineoverridevirtual

SetUuid does nothing It does not store the uuid, but is needed to implement InterfacePersistence.

Implements camitk::InterfacePersistence.

◆ toVariant()

QVariant camitk::AnatomicalOrientation::toVariant ( ) const
inlineoverridevirtual

Convert all data from the object to a QVariantMap.

Implements camitk::InterfacePersistence.


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