CTL
0.6.1
Computed Tomography Library
|
The GeometryEncoder class translates the system geometry into a corresponding set of projection matrices. More...
#include <geometryencoder.h>
Public Member Functions | |
GeometryEncoder (const SimpleCTSystem *system) | |
void | assignSystem (const SimpleCTSystem *system) |
SingleViewGeometry | encodeSingleViewGeometry () const |
const SimpleCTSystem * | system () const |
float | effectivePixelArea (uint module) const |
std::vector< float > | effectivePixelAreas () const |
Vector3x1WCS | finalModulePosition (uint module) const |
Matrix3x3 | finalModuleRotation (uint module) const |
Vector3x1WCS | finalSourcePosition () const |
Static Public Member Functions | |
static FullGeometry | encodeFullGeometry (AcquisitionSetup setup) |
static FullGeometry | encodeSubsetGeometry (AcquisitionSetup setup, const std::vector< uint > &viewIds) |
static SingleViewGeometry | encodeSingleViewGeometry (const SimpleCTSystem &system) |
static float | effectivePixelArea (const SimpleCTSystem &system, uint module) |
static std::vector< float > | effectivePixelAreas (const SimpleCTSystem &system) |
static Vector3x1WCS | finalModulePosition (const SimpleCTSystem &system, uint module) |
static Matrix3x3 | finalModuleRotation (const SimpleCTSystem &system, uint module) |
static Vector3x1WCS | finalSourcePosition (const SimpleCTSystem &system) |
Static Private Member Functions | |
static Matrix3x3 | intrinsicParameterMatrix (const Vector3x1CTS &principalPointDeviation, const QSize &nbPixel, const QSizeF &pixelSize, double skewAngle) |
Private Attributes | |
const SimpleCTSystem * | _system |
Pointer to system whose geometry shall be encoded. | |
The GeometryEncoder class translates the system geometry into a corresponding set of projection matrices.
This class provides the functionality to encode all geometry information about a particular acquisition with a given imaging system into projection matrices. To do so, the entire acquisition is sub-divided into two levels:
Within one particular view, all system parameters are fixed. That means, for example, that the positioning of the detector system or the power settings of the X-ray source are constant. For these constant conditions, the image acquisition is done with a detector system that might consist of several, individually arranged flat panel modules. To describe this setting, the entire system is described as a set of individual flat panel sub-systems (with a common X-ray source). For each of these sub-systems, the geometry configuration can be fully described by a projection matrix. Across different views, system parameters may change. Usually, this involves a change in the positioning of the components (like gantry rotations); but it may also contain variations in other settings (e.g. dose modulation). Note that only geometric parameters are relevant for encoding the system state into projection matrices.
To encode the geometry for an entire acquisition, the method encodeFullGeometry() needs to be called. It computes and returns the full set of projection matrices for all views (and all modules). If only a single system configuration shall be encoded, the method encodeSingleViewGeometry() can be used instead.
Projection matrices may be scaled by any nonzero number. The scaling of the projection matrices that are output by the GeometryEncoder is such that the projection matrices are normalized wrt. the principal plane normal, see ProjectionMatrix::isNormalized().
Note that the encoded projection matrices are mapping to pixel coordinates, which are to be interpreted such that integral coordinates denote the pixel center. The following figure depicts the grid alignment, which is a general convention in the CTL.
CTL::GeometryEncoder::GeometryEncoder | ( | const SimpleCTSystem * | system | ) |
Constructs a GeometryEncoder object. This object refers to a SimpleCTSystem.
Note that the SimpleCTSystem on which system points to is not owned by the GeometryEncoder and the client have to make sure that the object system points to a valid object before calling encodeSingleViewGeometry().
void CTL::GeometryEncoder::assignSystem | ( | const SimpleCTSystem * | system | ) |
Assignes system to this instance.
This instance does not take ownership of system.
float CTL::GeometryEncoder::effectivePixelArea | ( | uint | module | ) | const |
Returns the (average) effective pixel area [in mm²] of detector pixels in the detector module module of this instance's system within its current state.
|
static |
Returns the (average) effective pixel area [in mm²] of detector pixels in the detector module module of the detector in system within its current state.
Effective pixel area refers to the (normal) area that a pixel would expose (from the source point of view) if it were placed at a distance of 1 meter from the source. It computes as follows:
\( A_{m}^{\textrm{eff}}=A^{\textrm{nom}}\cdot\phi_{m}\cdot \left(\frac{1\,\textrm{m}}{d_{m}}\right)^{2}, \qquad m=\mathtt{module}\in\left[0,\textrm{nbModules}-1\right]\\ \begin{align*} \textrm{with:}\;A^{\textrm{nom}} & =s_{x}\cdot s_{y}\\ d_{m} & =\left\Vert \mathbf{r}_{m}^{\textrm{src - det.mod.}}\right\Vert \\ \phi_{m} & =\left\langle \mathbf{\hat{r}}_{m}^{\textrm{src - det.mod.}}, \hat{\mathbf{r}}_{m}^{\textrm{src - princ.pt.}}\right\rangle \\ \hat{\mathbf{r}}^{(\cdot)} & :=\mathbf{r}^{(\cdot)}/\left\Vert \mathbf{r}^{(\cdot)}\right\Vert \end{align*} \)
Here, \(A^{\textrm{nom}}\) denotes the nominal area of an individual detector pixel (i.e. pixel width \(s_{x}\) times heigth \(s_{y}\)), \(d_{m}\) is the distance (in meters) from the source to the position of detector module m, and \(\phi_{m}\) refers to the cosine of the angle between the normal vector of the module m and the connection line between source and the module's position. Due to the fact that a constant distance \(d_{m}\) and orientation \(\phi_{m}\) is assumed for all pixels in the module, this computation provides an approximation of the average effective pixel area for the individual pixels in that module. The assumption can be violated in case of very small distances, large modules, and/or large angulations.
Note that the source position used in these computations is the final position, i.e. including focal spot position shifts and/or displacements of the source component.
std::vector< float > CTL::GeometryEncoder::effectivePixelAreas | ( | ) | const |
Returns the (average) effective pixel areas of all individual modules in system.
|
static |
Returns the (average) effective pixel areas of all individual modules in system.
|
static |
Computes and returns the geometry representation of setup as a set of projection matrices.
The conceptual work flow is as follows:
foreach view prepare system, i.e. change its settings according to the parameterization in setup foreach module compute projection matrix for the flat-panel sub-system of module append resulting ProjectionMatrix to this view end foreach append resulting view to the full geometry end foreach
SingleViewGeometry CTL::GeometryEncoder::encodeSingleViewGeometry | ( | ) | const |
Computes a SingleViewGeometry based on the state of the internal SimpleCTSystem.
|
static |
Computes the geometry representation for a single view with the current configuration of system.
Vector3x1WCS CTL::GeometryEncoder::finalModulePosition | ( | uint | module | ) | const |
Returns the final position of detector module in system.
|
static |
Returns the final position of detector module in system.
Computes as:
\( t_{\textrm{module}}^{\textrm{final}}=t_{\textrm{det}}^{\textrm{final}}+ \left(R_{\textrm{det}}^{\textrm{total}}\right)^{T}\cdot t_{\textrm{module}} \)
Returns the final rotation of detector module in system.
|
static |
Returns the final rotation of detector module module in system.
Computes as:
\( R_{\textrm{module}}^{\textrm{final}}=R_{\textrm{module}}\cdot R_{\textrm{det}}^{\textrm{total}} \)
Vector3x1WCS CTL::GeometryEncoder::finalSourcePosition | ( | ) | const |
Computes the final position of the origin of the X-rays. This takes into account the location of the source component itself as well as the positioning of the focal spot.
|
static |
Computes the final position of the origin of the X-rays. This takes into account the location of the source component itself as well as the positioning of the focal spot.
Computes as:
\( t_{\textrm{source}}^{\textrm{final}}=t_{\textrm{source}}+ R_{\textrm{source}}^{\textrm{total}}\cdot t_{\textrm{focal spot}} \)
|
staticprivate |
Computes the intrinsic parameter matrix from the principalPoint, the number of pixels in the detector (module) nbPixel and the dimensions of the pixels pixelSize.
const SimpleCTSystem * CTL::GeometryEncoder::system | ( | ) | const |
Returns a pointer to the (constant) SimpleCTSystem that has been assigned to this instance.