CTL
0.6.1
Computed Tomography Library
|
The ArealFocalSpotExtension class is an extension for forward projectors that considers the finite dimensions of the focal spot. More...
#include <arealfocalspotextension.h>
Public Types | |
enum | { Type = 101 } |
![]() | |
enum | { Type = 100 } |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
void | configure (const AcquisitionSetup &setup) override |
ArealFocalSpotExtension (const QSize &discretization, bool lowExtinctionApproximation=false) | |
void | setDiscretization (const QSize &discretization) |
void | enableLowExtinctionApproximation (bool enable=true) |
QVariant | toVariant () const override |
Stores the contents of this instance in a QVariant. More... | |
QVariant | parameter () const override |
void | setParameter (const QVariant ¶meter) override |
Sets the parameters of this instance based on the passed QVariant parameter. Parameters need to follow the naming convention as described in parameter(). More... | |
bool | isLinear () const override |
ProjectorExtension (AbstractProjector *projector=nullptr) | |
ProjectorExtension (std::unique_ptr< AbstractProjector > projector) | |
![]() | |
int | type () const override |
void | configure (const AcquisitionSetup &setup) override |
ProjectionData | project (const VolumeData &volume) override |
ProjectorExtension (AbstractProjector *projector=nullptr) | |
ProjectorExtension (std::unique_ptr< AbstractProjector > projector) | |
ProjectionData | projectComposite (const CompositeVolume &volume) override |
Provides the functionality to forward project CompositeVolume data. More... | |
ProjectionData | projectSparse (const SparseVoxelVolume &volume) override |
Provides the functionality to forward project SparseVoxelVolume data. More... | |
bool | isLinear () const override |
Returns true if the projection operation is linear. More... | |
virtual void | use (AbstractProjector *other) |
void | use (std::unique_ptr< AbstractProjector > other) |
void | fromVariant (const QVariant &variant) override |
Sets the contents of the object based on the QVariant variant. More... | |
QVariant | toVariant () const override |
Stores the contents of this instance in a QVariant. More... | |
AbstractProjector * | release () |
void | reset () |
![]() | |
AbstractProjector (const AbstractProjector &)=delete | |
AbstractProjector (AbstractProjector &&)=default | |
AbstractProjector & | operator= (const AbstractProjector &)=delete |
AbstractProjector & | operator= (AbstractProjector &&)=default |
~AbstractProjector () override=default | |
ProjectionData | configureAndProject (const AcquisitionSetup &setup, const VolumeData &volume) |
Performs a forward projection with a precedent configuration of the projector. More... | |
ProjectionData | configureAndProject (const AcquisitionSetup &setup, const CompositeVolume &volume) |
Performs a forward projection with a precedent configuration of the projector. More... | |
ProjectionData | configureAndProject (const AcquisitionSetup &setup, const SparseVoxelVolume &volume) |
Performs a forward projection with a precedent configuration of the projector. More... | |
virtual ProjectorNotifier * | notifier () |
Returns a pointer to the notifier of the projector. More... | |
void | connectNotifierToMessageHandler (bool includeProgress=false) |
Connects the notifier to the CTL's MessageHandler. More... | |
![]() | |
virtual | ~SerializationInterface ()=default |
Protected Member Functions | |
ProjectionData | extendedProject (const MetaProjector &nestedProjector) override |
QVector< QPointF > | discretizationGrid () const |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
Protected Attributes | |
QSize | _discretizationSteps { 1, 1 } |
Requested number of discretization steps in both dimensions. | |
AcquisitionSetup | _setup |
A copy of the setup used for acquisition. | |
bool | _lowExtinctionApprox { false } |
True if low attenuation approximation has been enabled. | |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Additional Inherited Members | |
![]() | |
std::unique_ptr< ProjectorExtensionType > | makeExtension (AbstractProjector *projector=nullptr) |
std::unique_ptr< ProjectorExtensionType > | makeExtension (std::unique_ptr< AbstractProjector > projector) |
![]() | |
VolumeData | |
Alias name for CTL::SpectralVolumeData. More... | |
std::unique_ptr< ProjectorType > | makeProjector (ConstructorArguments &&... arguments) |
The ArealFocalSpotExtension class is an extension for forward projectors that considers the finite dimensions of the focal spot.
This class is an extension for projectors that takes into account the finite extent of the X-ray source. Typically, forward projection routines assume a point source, which is only an approximation of the real scenario.
In reality, the origin of the radiation - henceforth referred to as the focal spot - covers the area of \(\left[-\frac{w_{fs}}{2},\frac{w_{fs}}{2}\right]\times \left[-\frac{h_{fs}}{2},\frac{h_{fs}}{2}\right]\), where \(w_{fs}\) and \(h_{fs}\) denote the width and height of the focal spot, respectively. To simulate this extended area, projections will be simulated for a grid of sampling points (see figure below) and averaged afterwards. The number of discretization steps can be specified using setDiscretization().
By default, the focal spot discretization defaults to [1, 1], resulting in conventional point source approximation.
Note that this extension will increase the time required for projection linearly with the number of requested sampling points. It also doubles the required system memory (needs to keep two full sets of projections in memory simultaneously).
The following example shows how to extend a simple ray caster algorithm to approximate the focal spot extensions with a 5x5 grid:
|
explicit |
Constructs an ArealFocalSpotExtension with a focal spot sub-sampling given by discretization and linearization approximation enabled if lowExtinctionApproximation = true
.
|
overridevirtual |
Re-implementation of the configuration step. This takes copies of the AcquisitionSetup and the AbstractProjectorConfig. The actual configure() method of the nested projector is called within project(). Use setDiscretization() to change the level of discretization.
Implements CTL::AbstractProjector.
|
protected |
Computes and returns the grid of (relative) sampling points.
This discretizes the area of the focal spot, i.e. \(\left[-\frac{1}{2},\frac{1}{2}\right]\times \left[-\frac{1}{2},\frac{1}{2}\right]\) into _discretizationSteps.width()
x _discretizationSteps.height()
steps.
See detailed class description for a figure depicting the discretization pattern.
void CTL::ArealFocalSpotExtension::enableLowExtinctionApproximation | ( | bool | enable = true | ) |
Sets the use of the low extinction approximation to enable.
When activated, the low extinction approximation causes projection images of individual focal spot sub-samples to be averaged in extinction domain instead of in intensity domain. This is an approximation that allows the ArealFocalSpotExtension to become a linear extension, which has potential performance benefit when used in combination with other extensions. However, the result will become inaccurate, particularly if strong extinction gradients are present in the projection images. For low extinction (and esp. their gradients), the approximation is acceptable.
From a mathematical point of view, this requires: \( -\ln\frac{1}{F}\sum_{f=1}^{F}\exp(-\epsilon_{f})\approx\frac{1}{F}\sum_{f=1}^{F}\epsilon_{f}, \)
where \(\epsilon_{f}\) denotes the extinction value of a certain pixel for focal spot sub-sample \(f\). It can be shown that this is fulfilled for \(\epsilon_{f}\ll 1\) (overall low extinction values) or \(\epsilon_{f}=\epsilon+\delta_{f}\) with \(\delta_{f}\ll 1\) (small gradients, i.e. different focal spot positions create only small changes in extinction).
|
overrideprotectedvirtual |
Re-implementation of the projection step.
This method invokes an individual projection computation (i.e. delegation to the project() method of the nested projector object) for each of the discretization points that are requested. Returns the average of the resulting individual projection images.
In short, the work flow is as follows:
foreach
discretizationPoint
end
foreach
Detailled description:
Technically, this is realized using the source displacement functionality. The focal spot covers the area of \(\left[-\frac{w_{fs}}{2},\frac{w_{fs}}{2}\right]\times \left[-\frac{h_{fs}}{2},\frac{h_{fs}}{2}\right]\), where \(w_{fs}\) and \(h_{fs}\) denote the width and height of the focal spot, respectively. This area is discretized into _discretizationSteps.width()
x _discretizationSteps.height()
steps. For each of these points, the corresponding spatial shift (w.r.t. the point source location used in conventional methods) is added to the source displacement. Afterwards, the nested projector is configured (using its configure() method) and and projections are simulated with the resulting system (using project() from the nested projector). Note that adding this displacement component is required (instead of simply setting it) in order to allow for other sources of displacement that already exist in the system before simulating the focal spot extent.
This extension will invoke an individual projection computation for each of the sampling points. Hence, computation time increases (at least) linearly with the number of requested sampling points. Furthermore, required system memory is doubled, since two full sets of projections need to be kept in memory simultaneously.
By default, projections are averaged in intensity domain. This makes the extension non-linear. To enforce averaging in extinction domain, and by that, make the extension linear, enable the low extinction approximation (see enableLowExtinctionApproximation()).
Reimplemented from CTL::ProjectorExtension.
|
overridevirtual |
Returns false
(requires averaging operation in intensity domain) unless the low extinction approximation is enabled.
Reimplemented from CTL::AbstractProjector.
|
overridevirtual |
Returns the parameters of this instance as QVariant.
This returns a QVariantMap with three key-value-pairs: The first to are ("Discretization X", _discretizationSteps.width()) and ("Discretization Y", _discretizationSteps.height()), which refer to the number of sampling points used to sub-sample the focal spot in x and y direction (CT coordinates), respectively. The third key-value-pair is ("Low extinction approx", _lowExtinctionApprox) and represents the information whether this instance has the low extinction approximation enabled.
This method is used within toVariant() to serialize the object's settings.
Reimplemented from CTL::AbstractProjector.
|
explicit |
Constructs a ProjectorExtension object and sets the nested projector to projector. The nested projector is internally used as a basis for computing forward projections. Note that the constructed object takes over the ownership of projector.
|
explicit |
Constructs a ProjectorExtension object and sets the nested projector to projector. A good practice to create a ProjectorExtension on the heap is to use the make function makeExtension(std::unique_ptr<AbstractProjector> projector) which will interally use this constructor.
void CTL::ArealFocalSpotExtension::setDiscretization | ( | const QSize & | discretization | ) |
Sets the discretization of the focal spot to discretization. The focal spot will then be sampled with discretization.width()
x discretization.height()
sampling points. These sampling dimensions correspond to the width and height of the focal spot (or x and y direction in CT coordinates).
|
overridevirtual |
Sets the parameters of this instance based on the passed QVariant parameter. Parameters need to follow the naming convention as described in parameter().
This method is used within fromVariant() to deserialize the object's settings. Direct use of this method is discouraged; consider using dedicated setter methods instead.
Reimplemented from CTL::AbstractProjector.
|
overridevirtual |
Stores the contents of this instance in a QVariant.
Implementation of the serialization interface. Stores the object's type-id (from SerializationInterface::toVariant()).
This method uses parameter() to serialize class members.
Reimplemented from CTL::AbstractProjector.
|
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::AbstractProjector.