CTL
0.6.1
Computed Tomography Library
|
Specialized sub-class of AbstractGantry to represent systems with tube gantries. More...
#include <tubulargantry.h>
Public Types | |
enum | { Type = 220 } |
![]() | |
enum | { Type = 200 } |
![]() | |
enum | { Type = 0 } |
![]() | |
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) | |
SystemComponent * | clone () 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) |
![]() | |
mat::Location | sourceLocation () const |
mat::Location | detectorLocation () const |
const mat::Location & | detectorDisplacement () const |
const mat::Location & | gantryDisplacement () const |
const mat::Location & | sourceDisplacement () 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< GenericGantry > | toGeneric () const |
![]() | |
SystemComponent (const QString &name=defaultName()) | |
virtual int | elementalType () const |
const QString & | name () const |
void | rename (QString name) |
![]() | |
virtual | ~SerializationInterface ()=default |
Static Public Member Functions | |
static QString | defaultName () |
![]() | |
static QString | defaultName () |
Protected Member Functions | |
mat::Location | nominalDetectorLocation () const override |
mat::Location | nominalSourceLocation () const override |
![]() | |
AbstractGantry (const QString &name) | |
AbstractGantry (const AbstractGantry &)=default | |
AbstractGantry (AbstractGantry &&)=default | |
AbstractGantry & | operator= (const AbstractGantry &)=default |
AbstractGantry & | operator= (AbstractGantry &&)=default |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (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 QString | typeInfoString (const std::type_info &type) |
![]() | |
std::unique_ptr< ComponentType > | makeComponent (ConstructorArguments &&... arguments) |
std::unique_ptr< SystemComponent > | makeComponentFromJson (const QJsonObject &object, bool fallbackToGenericType) |
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:
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.
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.
|
overridevirtual |
Constructs a copy of the object and returns a base class pointer to it.
Reimplemented from CTL::SystemComponent.
|
static |
Returns the default name for the component: "Tubular gantry".
|
private |
Computed the current detector location (i.e. position and rotation) based on the system configuration.
Same as mat::Location(detectorPositionTG(), detectorRotationTG())
|
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] \)
|
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} \)
|
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:
Reimplemented from CTL::AbstractGantry.
|
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:
Reimplemented from CTL::AbstractGantry.
|
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.
|
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.
void CTL::TubularGantry::setPitchPosition | ( | double | position | ) |
Sets the table pitch to position. Position value is expected in millimeters.
void CTL::TubularGantry::setRotationAngle | ( | double | angle | ) |
Sets the gantry rotation to angle. Rotation angle is expected in radians.
void CTL::TubularGantry::setTiltAngle | ( | double | angle | ) |
Sets the gantry tilt to angle. Tilt angle is expected in radians.
|
private |
Computed the current source location (i.e. position and rotation) based on the system configuration.
Same as mat::Location(sourcePositionTG(), sourceRotationTG())
|
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] \)
|
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}) \)
|
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}) \)
|
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:
Reimplemented from CTL::AbstractGantry.
|
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.