CTL  0.6.1
Computed Tomography Library
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
CTL::TubularGantry Class Reference

Specialized sub-class of AbstractGantry to represent systems with tube gantries. More...

#include <tubulargantry.h>

Inheritance diagram for CTL::TubularGantry:
Inheritance graph
[legend]
Collaboration diagram for CTL::TubularGantry:
Collaboration graph
[legend]

Public Types

enum  { Type = 220 }
 
- Public Types inherited from CTL::AbstractGantry
enum  { Type = 200 }
 
- Public Types inherited from CTL::SystemComponent
enum  { Type = 0 }
 
- Public Types inherited from CTL::SerializationInterface
enum  { Type = -1, UserType = 65536 }
 

Public Member Functions

int type () const override
 
 TubularGantry (double sourceToDetectorDistance, double sourceToIsoCenterDistance, double rotationAngle=0.0, double pitchPosition=0.0, double tiltAngle=0.0, const QString &name=defaultName())
 
 TubularGantry (double sourceToDetectorDistance, double sourceToIsoCenterDistance, const QString &name)
 
SystemComponentclone () const override
 
QString info () const override
 
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
double pitchPosition () const
 Returns the table pitch position. Position value is specified in millimeters.
 
double rotationAngle () const
 Returns the gantry rotation angle (in radians).
 
double tiltAngle () const
 Returns the gantry tilt angle (in radians).
 
void setPitchPosition (double position)
 
void setRotationAngle (double angle)
 
void setTiltAngle (double angle)
 
- Public Member Functions inherited from CTL::AbstractGantry
mat::Location sourceLocation () const
 
mat::Location detectorLocation () const
 
const mat::LocationdetectorDisplacement () const
 
const mat::LocationgantryDisplacement () const
 
const mat::LocationsourceDisplacement () const
 
void setDetectorDisplacement (const mat::Location &displacement)
 
void setGantryDisplacement (const mat::Location &displacement)
 
void setSourceDisplacement (const mat::Location &displacement)
 
Vector3x1 sourcePosition () const
 
Matrix3x3 sourceRotation () const
 
Vector3x1 detectorPosition () const
 
Matrix3x3 detectorRotation () const
 
void setDetectorDisplacementAngles (double rollAngle, double tiltAngle, double twistAngle)
 
void setDetectorDisplacementPosition (const Vector3x1 &position)
 
void setDetectorDisplacementPosition (double x, double y, double z)
 
void setGantryDisplacementPosition (const Vector3x1 &position)
 
void setGantryDisplacementPosition (double x, double y, double z)
 
void setSourceDisplacementPosition (const Vector3x1 &position)
 
void setSourceDisplacementPosition (double x, double y, double z)
 
std::unique_ptr< GenericGantrytoGeneric () const
 
- Public Member Functions inherited from CTL::SystemComponent
 SystemComponent (const QString &name=defaultName())
 
virtual int elementalType () const
 
const QString & name () const
 
void rename (QString name)
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual ~SerializationInterface ()=default
 

Static Public Member Functions

static QString defaultName ()
 
- Static Public Member Functions inherited from CTL::SystemComponent
static QString defaultName ()
 

Protected Member Functions

mat::Location nominalDetectorLocation () const override
 
mat::Location nominalSourceLocation () const override
 
- Protected Member Functions inherited from CTL::AbstractGantry
 AbstractGantry (const QString &name)
 
 AbstractGantry (const AbstractGantry &)=default
 
 AbstractGantry (AbstractGantry &&)=default
 
AbstractGantryoperator= (const AbstractGantry &)=default
 
AbstractGantryoperator= (AbstractGantry &&)=default
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 

Protected Attributes

double _sourceToDetectorDistance
 Distance between source and detector (in mm).
 
double _sourceToIsoCenterDistance
 Distance between source and iso center (in mm).
 
double _rotationAngle
 Gantry rotation angle (in rad).
 
double _pitchPosition
 Table pitch position (in mm).
 
double _tiltAngle
 Gantry tilt angle (in rad).
 

Private Member Functions

Matrix3x3 totalGantryRotation () const
 
mat::Location sourceLocationTG () const
 
mat::Location detectorLocationTG () const
 
Vector3x1 sourcePositionTG () const
 
Matrix3x3 sourceRotationTG () const
 
Vector3x1 detectorPositionTG () const
 
Matrix3x3 detectorRotationTG () const
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Additional Inherited Members

- Static Protected Member Functions inherited from CTL::SystemComponent
static QString typeInfoString (const std::type_info &type)
 

Detailed Description

Specialized sub-class of AbstractGantry to represent systems with tube gantries.

This gantry sub-class allows for simplified description of tubular gantry systems. Instead of the need to specify source and detector position (and orientation) individually, the configuration of the TubularGantry can be fully described by the following parameters:

Coordinate system of a tubular gantry. The position of source f, isocenter o and detector d lay on a straight line.


Definition of gantry rotation angle alpha.

Constructor & Destructor Documentation

◆ TubularGantry() [1/2]

CTL::TubularGantry::TubularGantry ( double  sourceToDetectorDistance,
double  sourceToIsoCenterDistance,
double  rotationAngle = 0.0,
double  pitchPosition = 0.0,
double  tiltAngle = 0.0,
const QString &  name = defaultName() 
)

Constructs a TubularGantry with the dimensions sourceToDetectorDistance and sourceToIsoCenterDistance. Optionally, the system configuration can be specified by rotationAngle, pitchPosition and tiltAngle. If unspecified, these values default to zero.

◆ TubularGantry() [2/2]

CTL::TubularGantry::TubularGantry ( double  sourceToDetectorDistance,
double  sourceToIsoCenterDistance,
const QString &  name 
)

Convenience constructor that constructs a TubularGantry similar to the full constructor using the dimensions sourceToDetectorDistance and sourceToIsoCenterDistance, but still allows to specify a custom name for the component when omitting the system configuration. Here, all configuration parameters (i.e. gantry rotation angle, table pitch position and gantry tilt angle) default to zero.

Member Function Documentation

◆ clone()

SystemComponent * CTL::TubularGantry::clone ( ) const
overridevirtual

Constructs a copy of the object and returns a base class pointer to it.

Reimplemented from CTL::SystemComponent.

◆ defaultName()

QString CTL::TubularGantry::defaultName ( )
static

Returns the default name for the component: "Tubular gantry".

◆ detectorLocationTG()

mat::Location CTL::TubularGantry::detectorLocationTG ( ) const
private

Computed the current detector location (i.e. position and rotation) based on the system configuration.

Same as mat::Location(detectorPositionTG(), detectorRotationTG())

◆ detectorPositionTG()

Vector3x1 CTL::TubularGantry::detectorPositionTG ( ) const
private

Computes the current detector position based on the system configuration.

\( t_{\textrm{det}}^{\textrm{nominal}}=R_{\textrm{gantry}}\left[\begin{array}{c} \mathtt{SID-SDD}\\0\\0\end{array}\right] + \left[\begin{array}{c} 0\\0\\-\mathtt{pitchPos}\end{array}\right]= \mathbf{R}_{x}(\mathtt{tilt})\cdot\mathbf{R}_{z}(\mathtt{gantryRot}) \cdot\left[\begin{array}{c} \mathtt{SID-SDD}\\0\\0\end{array}\right] + \left[\begin{array}{c} 0\\0\\-\mathtt{pitchPos}\end{array}\right] \)

◆ detectorRotationTG()

Matrix3x3 CTL::TubularGantry::detectorRotationTG ( ) const
private

Computes the current detector rotation based on the system configuration.

This is computed such that the gantry rotation angle is defined with respect to the (WCS) x-axis. Hence, for an angle of zero degrees, the detector is located on the negative x-axis.

\( R_{\textrm{det}}^{\textrm{nominal}}=\mathbf{R}_{x}(\mathtt{\pi/2}) \cdot\mathbf{R}_{z}(-\pi/2)\cdot R_{\textrm{gantry}}^{T} \)

◆ fromVariant()

void CTL::TubularGantry::fromVariant ( const QVariant &  variant)
overridevirtual

Interface to read all member variables from the QVariant variant.

Reimplement this method such that it reads all newly introduced content when sub-classing. A typical reimplementation in sub-classes might look like this:

DirectBaseClass::fromVariant(variant);
// assuming our class has a member "double _myMemberVariable"
_myMemberVariable = variant.toMap().value("my member variable").toDouble();

Reimplemented from CTL::AbstractGantry.

◆ info()

QString CTL::TubularGantry::info ( ) const
overridevirtual

Returns a formatted string with information about the object.

In addition to the information from the base classes (GenericGantry and GenericComponent), the info string contains the following details:

  • Source-to-detector distance
  • Source-to-iso-center distance
  • Rotation angle
  • Table pitch position
  • Tilt angle.

Reimplemented from CTL::AbstractGantry.

◆ nominalDetectorLocation()

mat::Location CTL::TubularGantry::nominalDetectorLocation ( ) const
overrideprotectedvirtual

Returns the nominal detector location. This ignores any (optional) detector or gantry displacement.

Overrides the base class method and computes the detector location based on the tubular gantry parametrization (i.e. source-to-detector distance etc.).

\( L_{\textrm{det}}^{\textrm{nominal}}= (t_{\textrm{det}}^{\textrm{nominal}},R_{\textrm{det}}^{\textrm{nominal}}), \)

where:

\( \begin{align*} t_{\textrm{det}}^{\textrm{nominal}} &= R_{\textrm{gantry}}\left[\begin{array}{c} \mathtt{SID-SDD}\\0\\0\end{array}\right] + \left[\begin{array}{c} 0\\0\\-\mathtt{pitchPos}\end{array}\right]= \mathbf{R}_{x}(\mathtt{tilt})\cdot\mathbf{R}_{z}(\mathtt{gantryRot}) \cdot\left[\begin{array}{c} \mathtt{SID-SDD}\\0\\0\end{array}\right] + \left[\begin{array}{c} 0\\0\\-\mathtt{pitchPos}\end{array}\right]\\ R_{\textrm{det}}^{\textrm{nominal}} & =\mathbf{R}_{x}(\mathtt{\pi/2}) \cdot\mathbf{R}_{z}(-\pi/2)\cdot R_{\textrm{gantry}}^{T} \end{align*} \)

Implements CTL::AbstractGantry.

◆ nominalSourceLocation()

mat::Location CTL::TubularGantry::nominalSourceLocation ( ) const
overrideprotectedvirtual

Returns the nominal source location. This ignores any (optional) source or gantry displacement.

Overrides the base class method and computes the source location based on the tubular gantry parametrization (i.e. source-to-detector distance etc.).

\( L_{\textrm{src}}^{\textrm{nominal}}= (t_{\textrm{src}}^{\textrm{nominal}},R_{\textrm{src}}^{\textrm{nominal}}), \)

where:

\( \begin{align*} t_{\textrm{src}}^{\textrm{nominal}} & =R_{\textrm{gantry}}\cdot\left[\begin{array}{c} \mathtt{SID}\\0\\0\end{array}\right] + \left[\begin{array}{c} 0\\0\\-\mathtt{pitchPos}\end{array}\right]= \mathbf{R}_{x}(\mathtt{tilt})\cdot\mathbf{R}_{z}(\mathtt{gantryRot}) \cdot\left[\begin{array}{c} \mathtt{SID}\\0\\0\end{array}\right] + \left[\begin{array}{c} 0\\0\\-\mathtt{pitchPos}\end{array}\right]\\ R_{\textrm{src}}^{\textrm{nominal}} & =R_{\textrm{gantry}} \cdot\mathbf{R}_{z}(\pi/2)\cdot\mathbf{R}_{x}(\mathtt{-\pi/2}) \end{align*} \)

Implements CTL::AbstractGantry.

◆ setPitchPosition()

void CTL::TubularGantry::setPitchPosition ( double  position)

Sets the table pitch to position. Position value is expected in millimeters.

◆ setRotationAngle()

void CTL::TubularGantry::setRotationAngle ( double  angle)

Sets the gantry rotation to angle. Rotation angle is expected in radians.

◆ setTiltAngle()

void CTL::TubularGantry::setTiltAngle ( double  angle)

Sets the gantry tilt to angle. Tilt angle is expected in radians.

◆ sourceLocationTG()

mat::Location CTL::TubularGantry::sourceLocationTG ( ) const
private

Computed the current source location (i.e. position and rotation) based on the system configuration.

Same as mat::Location(sourcePositionTG(), sourceRotationTG())

◆ sourcePositionTG()

Vector3x1 CTL::TubularGantry::sourcePositionTG ( ) const
private

Computes the current source position based on the system configuration.

\( t_{\textrm{src}}^{\textrm{nominal}}=R_{\textrm{gantry}}\cdot\left[\begin{array}{c} \mathtt{SID}\\0\\0\end{array}\right] + \left[\begin{array}{c} 0\\0\\-\mathtt{pitchPos}\end{array}\right]= \mathbf{R}_{x}(\mathtt{tilt})\cdot\mathbf{R}_{z}(\mathtt{gantryRot}) \cdot\left[\begin{array}{c} \mathtt{SID}\\0\\0\end{array}\right] + \left[\begin{array}{c} 0\\0\\-\mathtt{pitchPos}\end{array}\right] \)

◆ sourceRotationTG()

Matrix3x3 CTL::TubularGantry::sourceRotationTG ( ) const
private

Computes the current source rotation based on the system configuration.

This is computed such that the gantry rotation angle is defined with respect to the (WCS) x-axis. Hence, for an angle of zero degrees, the source is located on the positive x-axis.

\( R_{\textrm{src}}^{\textrm{nominal}}=R_{\textrm{gantry}} \cdot\mathbf{R}_{z}(\pi/2)\cdot\mathbf{R}_{x}(\mathtt{-\pi/2}) \)

◆ totalGantryRotation()

Matrix3x3 CTL::TubularGantry::totalGantryRotation ( ) const
private

Computes the total rotation matrix of the gantry system. This includes gantry rotation and tilt:

\( R_{\textrm{gantry}}= \mathbf{R}_{x}(\mathtt{tilt})\cdot\mathbf{R}_{z}(\mathtt{gantryRot}) \)

◆ toVariant()

QVariant CTL::TubularGantry::toVariant ( ) const
overridevirtual

Interface to store all member variables in a QVariant.

Stores the object's type-id.

Reimplement this method such that it stores all newly introduced object data when sub-classing. This needs to cover everything that is necessary to fully determine the state of an object. Best practice is to invoke the base class version of this method to take care of all content originating from underlying base classes.

A typical reimplementation in sub-classes might look like this:

QVariantMap ret = DirectBaseClass::toVariant().toMap();
ret.insert("my member variable", _myMemberVariable);
return ret;

Reimplemented from CTL::AbstractGantry.

◆ type()

int CTL::TubularGantry::type ( ) const
inlineoverridevirtual

Returns the type-id of the serializable object. Used in deserialization to determine the proper object type.

Add derived classes to the enumeration using the CTL_TYPE_ID macro.

Reimplemented from CTL::AbstractGantry.


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