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

The DetectorSaturationExtension class is an extension for forward projectors that considers over- and/or undersaturation effects of the detector. More...

#include <detectorsaturationextension.h>

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

Public Types

enum  { Type = 102 }
 
- Public Types inherited from CTL::ProjectorExtension
enum  { Type = 100 }
 
- Public Types inherited from CTL::AbstractProjector
enum  { Type = 0 }
 
- Public Types inherited from CTL::SerializationInterface
enum  { Type = -1, UserType = 65536 }
 

Public Member Functions

int type () const override
 
void configure (const AcquisitionSetup &setup) override
 Configures the projector. More...
 
 DetectorSaturationExtension (uint nbSpectralSamples)
 
bool isLinear () const override
 
void setIntensitySampling (uint nbSamples)
 
QVariant toVariant () const override
 Stores the contents of this instance in a QVariant. More...
 
QVariant parameter () const override
 
void setParameter (const QVariant &parameter) 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...
 
 ProjectorExtension (AbstractProjector *projector=nullptr)
 
 ProjectorExtension (std::unique_ptr< AbstractProjector > projector)
 
- Public Member Functions inherited from CTL::ProjectorExtension
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...
 
AbstractProjectorrelease ()
 
void reset ()
 
- Public Member Functions inherited from CTL::AbstractProjector
 AbstractProjector (const AbstractProjector &)=delete
 
 AbstractProjector (AbstractProjector &&)=default
 
AbstractProjectoroperator= (const AbstractProjector &)=delete
 
AbstractProjectoroperator= (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 ProjectorNotifiernotifier ()
 Returns a pointer to the notifier of the projector. More...
 
void connectNotifierToMessageHandler (bool includeProgress=false)
 Connects the notifier to the CTL's MessageHandler. More...
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual ~SerializationInterface ()=default
 

Protected Member Functions

ProjectionData extendedProject (const MetaProjector &nestedProjector) override
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 

Private Member Functions

void processCounts (ProjectionData &projections)
 
void processExtinctions (ProjectionData &projections)
 
void processIntensities (ProjectionData &projections)
 

Private Attributes

AcquisitionSetup _setup
 A copy of the acquisition setup.
 
uint _nbSamples { 0u }
 Number of samples used to extract spectrally resolved information.
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Additional Inherited Members

Detailed Description

The DetectorSaturationExtension class is an extension for forward projectors that considers over- and/or undersaturation effects of the detector.

This extension performs a postprocessing on the projection data to consider over- and/or undersaturation effects of the detector. It will use the saturation model set to the detector component (see AbstractDetector::setSaturationModel()). Depending on the specification of the saturation model, the postprocessing will be applied in the domain of extinction values, intensities, or photon counts.

The following example shows how to extend a simple ray caster algorithm to consider detector (over- and under-) saturation:

// define volume and acquisition setup (incl. system)
auto volume = VolumeData::cube(100, 1.0f, 0.02f);
auto system = SimpleCTSystem::fromCTSystem(CTSystemBuilder::createFromBlueprint(blueprints::GenericCarmCT(DetectorBinning::Binning4x4)));
AcquisitionSetup acquisitionSetup(system, 10);
acquisitionSetup.applyPreparationProtocol(protocols::ShortScanTrajectory(750.0));
// Core part
// set a detector saturation model (operating in extinction domain, clamps values to [0.1, 2.5])
auto saturationModel = new DetectorSaturationLinearModel(0.1f, 2.5f);
acquisitionSetup.system()->detector()->setSaturationModel(saturationModel, AbstractDetector::Extinction);
auto simpleProjector = new RayCasterProjector; // our simple projector
// optional parameter settings for the projector
// e.g. simpleProjector->settings().raySampling = 0.1f;
// This is what we do without the extension:
// simpleProjector->configure(acquisitionSetup);
// ProjectionData projections = simpleProjector->project(volume);
// qInfo() << projections.min() << projections.max(); // output: 0 2.79263
// Instead we now do the following:
DetectorSaturationExtension* extension = new DetectorSaturationExtension;
extension->use(simpleProjector); // tell the extension to use the ray caster
extension->configure(acquisitionSetup); // configure the simulation
ProjectionData projections = extension->project(volume); // (compute and) get the final projections
qInfo() << projections.min() << projections.max(); // output: 0.1 2.5

Constructor & Destructor Documentation

◆ DetectorSaturationExtension()

CTL::DetectorSaturationExtension::DetectorSaturationExtension ( uint  nbSpectralSamples)
explicit

Constructs a DetectorSaturationExtension and sets the number of samples used when (internally) a spectrum needs to be sampled to nbSpectralSamples.

Member Function Documentation

◆ configure()

void CTL::DetectorSaturationExtension::configure ( const AcquisitionSetup setup)
overridevirtual

Configures the projector.

This method should be used to gather all necessary information to prepare the actual forward projection. This usually contains all geometry and system information, which can be retrieved from setup.

If you intend to call configure() and project() (or projectComposite()) directly after each other, you should use configureAndProject() instead.

Implements CTL::AbstractProjector.

◆ extendedProject()

ProjectionData CTL::DetectorSaturationExtension::extendedProject ( const MetaProjector nestedProjector)
overrideprotectedvirtual

Performs the extension of the projection step by means of postprocessing the projection data created by nestedProjector. This allows for handling the cases of single and composite volumes in the same fashion.

Reimplemented from CTL::ProjectorExtension.

◆ isLinear()

bool CTL::DetectorSaturationExtension::isLinear ( ) const
overridevirtual

Returns false, because in general, detector saturation effects are non-linear.

Reimplemented from CTL::AbstractProjector.

◆ parameter()

QVariant CTL::DetectorSaturationExtension::parameter ( ) const
overridevirtual

Returns the parameters of this instance as QVariant.

This returns a QVariantMap with one key-value-pair: ("Intensity sampling points", _nbSamples), which represents the number of sampling points used when (internally) a spectrum needs to be sampled.

This method is used within toVariant() to serialize the object's settings.

Reimplemented from CTL::AbstractProjector.

◆ processCounts()

void CTL::DetectorSaturationExtension::processCounts ( ProjectionData projections)
private

Applies the detector saturation model to projections in the photon count domain. Transformation of input extinction data from projections to counts is based on the incident photon count queried from the system (see SimpleCTSystem::photonsPerPixel()).

◆ processExtinctions()

void CTL::DetectorSaturationExtension::processExtinctions ( ProjectionData projections)
private

Applies the detector saturation model to projections in the extinction domain.

◆ processIntensities()

void CTL::DetectorSaturationExtension::processIntensities ( ProjectionData projections)
private

Applies the detector saturation model to projections in the intensity domain. Transformation of input extinction data from projections to intensities is based on the incident photon count queried from the system (see SimpleCTSystem::photonsPerPixel()) multiplied by the mean energy in the incident X-ray spectrum. Note that this is an approximation. Ideally, the final radiation spectrum reaching the detector would be considered instead.

◆ ProjectorExtension() [1/2]

CTL::ProjectorExtension::ProjectorExtension
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.

◆ ProjectorExtension() [2/2]

CTL::ProjectorExtension::ProjectorExtension
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.

◆ setIntensitySampling()

void CTL::DetectorSaturationExtension::setIntensitySampling ( uint  nbSamples)

Sets the number of samples used when (internally) a spectrum needs to be sampled to nbSpectralSamples. This has no meaning if the saturation model set for the detector is specified in the extinction domain (because processing extinctions does not require computation of a spectrum at any point).

If nbSamples = 0, the sampling hint from the source component will be used (see AbstractSource::spectrumDiscretizationHint().

◆ setParameter()

void CTL::DetectorSaturationExtension::setParameter ( const QVariant &  parameter)
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.

◆ toVariant()

QVariant CTL::DetectorSaturationExtension::toVariant ( ) const
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.

◆ type()

int CTL::DetectorSaturationExtension::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::AbstractProjector.


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