CTL
0.6.1
Computed Tomography Library
|
The StandardPipeline class is a convenience class to work with a predefined processing pipeline for creation of projections. More...
#include <standardpipeline.h>
Classes | |
class | Settings |
class | SettingsAFS |
class | SettingsDetectorSaturation |
class | SettingsPoissonNoise |
class | SettingsRayCaster |
class | SettingsSpectralEffects |
Public Types | |
enum | { Type = 201 } |
enum | ApproximationPolicy { No_Approximation, Default_Approximation, Full_Approximation } |
![]() | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
StandardPipeline (ApproximationPolicy policy=StandardPipeline::Default_Approximation) | |
StandardPipeline (const StandardPipeline &)=delete | |
StandardPipeline & | operator= (const StandardPipeline &)=delete |
StandardPipeline (StandardPipeline &&other) noexcept | |
StandardPipeline & | operator= (StandardPipeline &&other) noexcept |
void | configure (const AcquisitionSetup &setup) override |
Sets the acquisition setup for the simulation to setup. More... | |
ProjectionData | project (const VolumeData &volume) override |
Creates projection data from volume. More... | |
ProjectionData | projectComposite (const CompositeVolume &volume) override |
Creates projection data from the composite volume volume. More... | |
ProjectionData | projectSparse (const SparseVoxelVolume &volume) override |
Creates projection data from the sparse volume volume. More... | |
bool | isLinear () const override |
ProjectorNotifier * | notifier () override |
Returns a pointer to the notifier of the projector. More... | |
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... | |
void | enableArealFocalSpot (bool enable=true) |
void | enableDetectorSaturation (bool enable=true) |
void | enablePoissonNoise (bool enable=true) |
void | enableSpectralEffects (bool enable=true) |
SettingsAFS & | settingsArealFocalSpot () |
SettingsDetectorSaturation & | settingsDetectorSaturation () |
SettingsPoissonNoise & | settingsPoissonNoise () |
SettingsSpectralEffects & | settingsSpectralEffects () |
SettingsRayCaster & | settingsRayCaster () |
![]() | |
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 QVariant | parameter () const |
Returns the parameters of this instance as QVariant. More... | |
virtual void | setParameter (const QVariant ¶meter) |
Sets the parameters of this instance based on the passed QVariant parameter. Parameters need to follow the naming convention as described in parameter(). More... | |
void | connectNotifierToMessageHandler (bool includeProgress=false) |
Connects the notifier to the CTL's MessageHandler. More... | |
![]() | |
virtual | ~SerializationInterface ()=default |
Private Member Functions | |
uint | posAFS () const |
uint | posDetSat () const |
uint | posPoisson () const |
uint | posSpectral () const |
Private Attributes | |
ProjectionPipeline | _pipeline |
The pipeline object; owns the projector and all extensions. | |
OCL::RayCasterProjector * | _projector |
Pointer to the ray caster projector. | |
ArealFocalSpotExtension * | _extAFS |
Pointer to the ArealFocalSpotExtension. | |
DetectorSaturationExtension * | _extDetSat |
Pointer to the DetectorSaturationExtension. | |
PoissonNoiseExtension * | _extPoisson |
Pointer to the PoissonNoiseExtension. | |
SpectralEffectsExtension * | _extSpectral |
Pointer to the SpectralEffectsExtension. | |
CTL::StandardPipeline::SettingsRayCaster | _settingsRayCaster |
CTL::StandardPipeline::SettingsAFS | _settingsAFS |
CTL::StandardPipeline::SettingsDetectorSaturation | _settingsDetSat |
CTL::StandardPipeline::SettingsPoissonNoise | _settingsPoisson |
CTL::StandardPipeline::SettingsSpectralEffects | _settingsSpectral |
ApproximationPolicy | _approxMode |
approximation level for the simulation | |
bool | _arealFSEnabled = false |
enabled/disabled state variable for areal focal spot | |
bool | _detSatEnabled = false |
enabled/disabled state variable for detector saturation | |
bool | _spectralEffEnabled = false |
enabled/disabled state variable for spectral effects | |
bool | _poissonEnabled = false |
enabled/disabled state variable for Poisson noise | |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Additional Inherited Members | |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
![]() | |
VolumeData | |
Alias name for CTL::SpectralVolumeData. More... | |
std::unique_ptr< ProjectorType > | makeProjector (ConstructorArguments &&... arguments) |
The StandardPipeline class is a convenience class to work with a predefined processing pipeline for creation of projections.
This class provides a preset arrangement of projector and extensions in a meaningful composition. Individual simulation effects can be simply enabled/disabled using the corresponding methods (default setting in brackets) :
Specific settings for all effects can be adjusted using the corresponding setter objects.
The StandardPipeline supports three different options with respect to degree of approximation used in the processing of individual effects:
The Default_Approximation setting (default) uses the approximation of processing Poisson noise after the spectral effects. This leads to substantial acceleration with slight loss in accuracy. However, in case a spectral detector response is in use, the use of the Fast setting is strongly discouraged, because it then leads to incorrect results. In addition to the approximation described above, the Full_Approximation also uses the linearized setting for the ArealFocalSpotExtension. This uses sub-sample averaging in extinction domain and leads to further increases in computation speed, but yields inaccurate results in case of strong extinction gradients (e.g. edges) in the projection images. In the No_Approximation setting (most accurate), Poisson noise is processed for each individual energy bin requested by the spectral effects extension. While being most accurate, this option is substatially more time-consuming and not strongly required in many situations. The approximation behavior must be decided in the constructor and cannot be changed afterwards.
StandardPipeline uses OCL::RayCasterProjector as the actual forward projector. Its settings can be adjusted calling the corresponding member methods of settingsRayCaster().
A fully-enabled pipeline is composed as follows:
Volume Data <- OCL::RayCasterProjector <- ArealFocalSpotExtension <- SpectralEffectsExtension <- PoissonNoiseExtension <- DetectorSaturationExtension [Default_Approximation or Full_Approximation]
Volume Data <- OCL::RayCasterProjector <- ArealFocalSpotExtension <- PoissonNoiseExtension <- SpectralEffectsExtension <- DetectorSaturationExtension [No_Approximation]
The StandardPipeline object itself can be used in the same way as any projector; use configure() to pass the AcquisitionSetup for the simulation and then call project() (or projectComposite()) with the volume dataset that shall be projected to create the simulated projections using the full processing pipeline that is managed your StandardPipeline object.
The following code example demonstrates the usage of StandardPipeline for creating projections of a water ball phantom. In addition to its standard settings, we want to also enable the simulation of an areal focal spot (with default sampling of 3x3 sub-samples) and set the energy resolution for spectral effects to 5 keV (i.e. bin width).
Enumeration for the approximation behavior in the standard pipeline. See Detailed Description for more details.
Enumerator | |
---|---|
No_Approximation | Configuration with spectral effects simulation wrapping Poisson noise addition for each energy bin. Approximation-free but increased computation effort. Can be used in combination with a spectral detector response. |
Default_Approximation | The default setting for the StandardPipeline. Configuration in which Poisson noise addition is applied to final result of the spectral effects simulation. Approximation with substantially increased computation speed. Not suited in combination with a spectral detector response. |
Full_Approximation | Same configuration as in Default_Approximation setting. Additionally, a linearized approach is used in the ArealFocalSpotExtension (if enabled). Not suited in combination with a spectral detector response and inaccurate in case of high extinction gradients (e.g. edges of highly absorbing material) in the projection images. |
|
explicit |
Constructs a StandardPipeline object and with the ApproximationPolicy policy.
The default configuration enables spectral effects and Poisson noise simulation.
|
overridevirtual |
Sets the acquisition setup for the simulation to setup.
Sets the acquisition setup for the simulation to setup. This needs to be done prior to calling project().
Implements CTL::AbstractProjector.
void CTL::StandardPipeline::enableArealFocalSpot | ( | bool | enable = true | ) |
Enables/disables the simulation of areal focal spot effects, according to enable.
void CTL::StandardPipeline::enableDetectorSaturation | ( | bool | enable = true | ) |
Enables/disables the simulation of detector saturation effects, according to enable.
This only has an effect on the simulation if the detector component of the system passed with the setup during configure() has a detector response model (see AbstractDetector::setSaturationModel()).
void CTL::StandardPipeline::enablePoissonNoise | ( | bool | enable = true | ) |
Enables/disables the simulation of Poisson noise, according to enable.
void CTL::StandardPipeline::enableSpectralEffects | ( | bool | enable = true | ) |
Enables/disables the simulation of spectral effects, according to enable.
Spectral effects require full spectral information (see SpectralVolumeData) in the volume data passed to project(). Otherwise, the spectral effects step will be skipped.
Spectral detector response effects will be considered if a corresponding response model has been set to the detector component (see AbstractDetector::setSpectralResponseModel()) of the system passed with the setup during configure(). Note that trying to simulate settings with a spectral response model in combination with volume data without full spectral information is not supported and leads to an exception.
|
overridevirtual |
Sets the contents of the object based on the QVariant variant.
Implementation of the deserialization interface. This method uses setParameter() to deserialize class members.
Reimplemented from CTL::AbstractProjector.
|
overridevirtual |
Returns true if the application of the full processing pipeline is linear.
Reimplemented from CTL::AbstractProjector.
|
overridevirtual |
Returns a pointer to the notifier of the projector.
The notifier object can be used to emit the signal ProjectorNotifier::projectionFinished(int) when the calculation of the viewNb'th view has been done.
To receive emitted signals, use Qt's connect() method to connect the notifier object to any receiver object of choice. The notifier can also conveniently be connected to the MessageHandler of the CTL using connectToMessageHandler() or directly from the projector through AbstractProjector::connectNotifierToMessageHandler().
Example - sending simulation progress information to a QProgressBar:
/// Example 2 - forwarding the information text to a QStatusBar
Reimplemented from CTL::AbstractProjector.
|
private |
Returns the position of the areal focal spot extension in the standard pipeline. This is defined to always be the first position (maximum efficiency).
|
private |
Returns the position of the detector saturation extension in the standard pipeline. This is defined to always be the last position, as it is only accurate in this spot.
|
private |
Returns the position of the Poisson noise extension in the standard pipeline. Depending on whether the mode has been set to StandardPipeline::No_Approximation or not (i.e. StandardPipeline::Full_Approximation or StandardPipeline::Default_Approximation), the Poisson extension is placed before or after the spectral effects extension, respectively.
|
private |
Returns the position of the spectral effects extension in the standard pipeline. Depending on whether the mode has been set to StandardPipeline::No_Approximation or not (i.e. StandardPipeline::Full_Approximation or StandardPipeline::Default_Approximation), the spectral effects extension is placed after or before the Poisson noise extension, respectively.
|
overridevirtual |
Creates projection data from volume.
Creates projection data from volume using the current processing pipeline configuration of this instance. Uses the last acquisition setup set by configure().
Implements CTL::AbstractProjector.
|
overridevirtual |
Creates projection data from the composite volume volume.
Creates projection data from the composite volume volume using the current processing pipeline configuration of this instance. Uses the last acquisition setup set by configure().
Reimplemented from CTL::AbstractProjector.
|
overridevirtual |
Creates projection data from the sparse volume volume.
Creates projection data from the sparse volume volume using the current processing pipeline configuration of this instance. Uses the last acquisition setup set by configure().
Reimplemented from CTL::AbstractProjector.
StandardPipeline::SettingsAFS & CTL::StandardPipeline::settingsArealFocalSpot | ( | ) |
Returns a handle to the settings for the areal focal spot simulation.
Areal focal spot settings are:
false
(true
for StandardPipeline::Full_Approximation) ]Example:
StandardPipeline::SettingsDetectorSaturation & CTL::StandardPipeline::settingsDetectorSaturation | ( | ) |
Returns a handle to the settings for the detector saturation simulation.
Detector saturation settings are:
Example:
StandardPipeline::SettingsPoissonNoise & CTL::StandardPipeline::settingsPoissonNoise | ( | ) |
Returns a handle to the settings for the Poisson noise simulation.
Poisson noise settings are:
Example:
StandardPipeline::SettingsRayCaster & CTL::StandardPipeline::settingsRayCaster | ( | ) |
Returns a handle to the settings for the ray caster projector.
Ray caster settings are:
Example:
StandardPipeline::SettingsSpectralEffects & CTL::StandardPipeline::settingsSpectralEffects | ( | ) |
Returns a handle to the settings for the spectral effects simulation.
Spectral effects settings are:
Example:
|
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.