Computer Assited Medical Intervention Tool Kit  version 4.1
Public Types | Static Public Member Functions | List of all members
camitk::ImageOrientationHelper Class Reference

Helper class. More...

#include <ImageOrientationHelper.h>

Inherits QObject.

Public Types

enum  PossibleImageOrientations {
  RAI = 0, RPS = 1, RIP = 2, RSA = 3,
  LAS = 4, LPI = 5, LIA = 6, ARS = 7,
  ALI = 8, AIR = 9, ASL = 10, PRI = 11,
  PLS = 12, PIL = 13, PSR = 14, IRA = 15,
  ILP = 16, IAL = 17, IPR = 18, SRP = 19,
  SLA = 20, SAR = 22, SPL = 23, UNKNOWN = 50
}
 For each axis (x, y or z), 6 possibilities: More...
 

Static Public Member Functions

static PossibleImageOrientations getOrientationAsEnum (QString orientation)
 Returns the Possible Medical Image orientation in PossibleImageOrientations enumeration format from a QString format. More...
 
static QString getOrientationAsQString (PossibleImageOrientations orientation)
 Returns the Possible Medical Image orientation in QString format from a PossibleImageOrientation enumeration format. More...
 
static const QStringList getPossibleImageOrientations ()
 Returns the enumeration type PossibleImageOrientations in the format of a QStringList. More...
 
static vtkSmartPointer< vtkMatrix4x4 > getTransformFromRAI (PossibleImageOrientations orientation, double dimX, double dimY, double dimZ)
 Given a possible Dicom Image Orientation, this method returns the transform matrix to express an RAI image in this orientation. More...
 
static vtkSmartPointer< vtkMatrix4x4 > getTransformFromRAI (QString orientation, double dimX, double dimY, double dimZ)
 Given a possible Dicom Image Orientation, this method returns the transform matrix to express an RAI image in this orientation. More...
 
static vtkSmartPointer< vtkMatrix4x4 > getTransformToRAI (PossibleImageOrientations orientation, double dimX, double dimY, double dimZ)
 Given a possible Dicom Image Orientation, this method returns the transform matrix to express the image in the RAI (x: Right to Left, y: Anterior to Posterior, z: Inferior to Superior) orientation. More...
 
static vtkSmartPointer< vtkMatrix4x4 > getTransformToRAI (QString orientation, double dimX, double dimY, double dimZ)
 Given a possible Dicom Image Orientation, this method returns the transform matrix to express the image in the RAI (x: Right to Left, y: Anterior to Posterior, z: Inferior to Superior) orientation. More...
 

Detailed Description

Helper class.

By convention, vtkImageDatas stored in ImageComponents MUST BE in RAI format. Indeed, for the 2D Axial, Coronal and Sagittal viewers to display correct views in CamiTK, all images should be oriented the same way, that is to say:

This class gives Transformation Matrices to orient Medical Images acquired in standard Dicom Image Orientation from or toward RAI orientation.

Note: this class only consideres Direct image orientations.

Member Enumeration Documentation

◆ PossibleImageOrientations

For each axis (x, y or z), 6 possibilities:

  • Right (of th patient) to left (of the patient) [R]
  • Left (of th patient) to right (of th patient) [L]
  • Anterior (face) to Posterior (back) [A]
  • Posterior (back) to Anterior (face) [P]
  • Inferior (feet) to Superior (head) [I]
  • Superior (head) to Inferior (feet) [S]

So 6 possibilities for x, 4 for y and 2 for z -> 48 possibilities 24 direct and 24 indirect.

Only Direct Orientations are considered here.

Enumerator
RAI 

Direct Orientations X: Right to Left, Y: Anterior to Posterior, Z: Inferior to Superiror.

RPS 

X: Right to Left, Y: Posterior to Anterior, Z: Superior to Inferior.

RIP 

X: Right to Left, Y: Inferior to Superiror, Z: Posterior to Anterior.

RSA 

etc.

LAS 
LPI 
LIA 
ARS 
ALI 
AIR 
ASL 
PRI 
PLS 
PIL 
PSR 
IRA 
ILP 
IAL 
IPR 
SRP 
SLA 
SAR 
SPL 
UNKNOWN 

Member Function Documentation

◆ getOrientationAsEnum()

ImageOrientationHelper::PossibleImageOrientations camitk::ImageOrientationHelper::getOrientationAsEnum ( QString  orientation)
static

Returns the Possible Medical Image orientation in PossibleImageOrientations enumeration format from a QString format.

References getPossibleImageOrientations(), and UNKNOWN.

Referenced by getTransformFromRAI(), and getTransformToRAI().

◆ getOrientationAsQString()

QString camitk::ImageOrientationHelper::getOrientationAsQString ( ImageOrientationHelper::PossibleImageOrientations  orientation)
static

Returns the Possible Medical Image orientation in QString format from a PossibleImageOrientation enumeration format.

References getPossibleImageOrientations().

Referenced by VtkImageComponentExtension::save(), and camitk::ImageComponent::setImageData().

◆ getPossibleImageOrientations()

const QStringList camitk::ImageOrientationHelper::getPossibleImageOrientations ( )
static

Returns the enumeration type PossibleImageOrientations in the format of a QStringList.

This may be needed for GUI not using enums.

Note: the index of each orientation String refers to the corresponding enum number for example the getPossibleImageOrientations().indexOf("LAS") returns 4 which is the enum number of LAS in the PossibleImageOrientations enumeration

Referenced by getOrientationAsEnum(), getOrientationAsQString(), and RawDataDialog::init().

◆ getTransformFromRAI() [1/2]

vtkSmartPointer< vtkMatrix4x4 > camitk::ImageOrientationHelper::getTransformFromRAI ( PossibleImageOrientations  orientation,
double  dimX,
double  dimY,
double  dimZ 
)
static

Given a possible Dicom Image Orientation, this method returns the transform matrix to express an RAI image in this orientation.

Returns
a transform homogeneous matrix containing the rigid transformation (rotation + translation) from the RAI orientation to the orientation given in parameter
Parameters
orientationnew orientation wiched for the image (originnally in RAI orientation).
dimXimage dimension in X direction in millimeters (mm). It can be generally calculated the following way: dimX = (number of voxels in X direction) * (size of a voxel in X direction)
dimYimage dimension in Y direction in millimeters (mm). It can be generally calculated the following way: dimY = (number of voxels in Y direction) * (size of a voxel in Y direction)
dimZimage dimension in Z direction in millimeters (mm). It can be generally calculated the following way: dimZ = (number of voxels in Z direction) * (size of a voxel in Z direction)

Note: The original image dimensions are needed to re-translate the image to the origin after a possible rotation.

References AIR, ALI, ARS, ASL, IAL, ILP, IPR, IRA, LAS, LIA, LPI, PIL, PLS, PRI, PSR, RAI, RIP, RPS, RSA, SAR, SLA, SPL, and SRP.

Referenced by getTransformFromRAI(), and getTransformToRAI().

◆ getTransformFromRAI() [2/2]

vtkSmartPointer< vtkMatrix4x4 > camitk::ImageOrientationHelper::getTransformFromRAI ( QString  orientation,
double  dimX,
double  dimY,
double  dimZ 
)
static

Given a possible Dicom Image Orientation, this method returns the transform matrix to express an RAI image in this orientation.

Returns
a transform homogeneous matrix containing the rigid transformation (rotation + translation) from the RAI orientation to the orientation given in parameter
Parameters
orientationnew orientation wiched for the image (originnally in RAI orientation).
orientationoriginal orientation of the image (this orientation should have been encoded in the input image file).
dimXimage dimension in X direction in millimeters (mm). It can be generally calculated the following way: dimX = (number of voxels in X direction) * (size of a voxel in X direction)
dimYimage dimension in Y direction in millimeters (mm). It can be generally calculated the following way: dimY = (number of voxels in Y direction) * (size of a voxel in Y direction)
dimZimage dimension in Z direction in millimeters (mm). It can be generally calculated the following way: dimZ = (number of voxels in Z direction) * (size of a voxel in Z direction)

Note: The original image dimensions are needed to re-translate the image to the origin after a possible rotation.

References getOrientationAsEnum(), getTransformFromRAI(), and UNKNOWN.

◆ getTransformToRAI() [1/2]

vtkSmartPointer< vtkMatrix4x4 > camitk::ImageOrientationHelper::getTransformToRAI ( PossibleImageOrientations  orientation,
double  dimX,
double  dimY,
double  dimZ 
)
static

Given a possible Dicom Image Orientation, this method returns the transform matrix to express the image in the RAI (x: Right to Left, y: Anterior to Posterior, z: Inferior to Superior) orientation.

Returns
a transform homogeneous matrix containing the rigid transformation (rotation + translation) from the orientation given in parameter to the RAI orientation
Parameters
orientationoriginal orientation of the image (this orientation should have been encoded in the input image file) as PossibleImageOrientations ennumeration.
dimXimage dimension in X direction in millimeters (mm). It can be generally calculated the following way: dimX = (number of voxels in X direction) * (size of a voxel in X direction)
dimYimage dimension in Y direction in millimeters (mm). It can be generally calculated the following way: dimY = (number of voxels in Y direction) * (size of a voxel in Y direction)
dimZimage dimension in Z direction in millimeters (mm). It can be generally calculated the following way: dimZ = (number of voxels in Z direction) * (size of a voxel in Z direction)

Note: The original image dimensions are needed to re-translate the image to the origin after a possible rotation.

References AIR, ALI, ARS, ASL, getTransformFromRAI(), IAL, ILP, IPR, IRA, LAS, LIA, LPI, PIL, PLS, PRI, PSR, RAI, RIP, RPS, RSA, SAR, SLA, SPL, and SRP.

Referenced by getTransformToRAI(), and camitk::ImageComponent::setImageData().

◆ getTransformToRAI() [2/2]

vtkSmartPointer< vtkMatrix4x4 > camitk::ImageOrientationHelper::getTransformToRAI ( QString  orientation,
double  dimX,
double  dimY,
double  dimZ 
)
static

Given a possible Dicom Image Orientation, this method returns the transform matrix to express the image in the RAI (x: Right to Left, y: Anterior to Posterior, z: Inferior to Superior) orientation.

Returns
a transform homogeneous matrix containing the rigid transformation (rotation + translation) from the orientation given in parameter to the RAI orientation
Parameters
orientationoriginal orientation of the image (this orientation should have been encoded in the input image file) in QString format.
dimXimage dimension in X direction in millimeters (mm). It can be generally calculated the following way: dimX = (number of voxels in X direction) * (size of a voxel in X direction)
dimYimage dimension in Y direction in millimeters (mm). It can be generally calculated the following way: dimY = (number of voxels in Y direction) * (size of a voxel in Y direction)
dimZimage dimension in Z direction in millimeters (mm). It can be generally calculated the following way: dimZ = (number of voxels in Z direction) * (size of a voxel in Z direction)

Note: The original image dimensions are needed to re-translate the image to the origin after a possible rotation.

References getOrientationAsEnum(), getTransformToRAI(), and UNKNOWN.


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