CTL
0.6.1
Computed Tomography Library
|
The AbstractProjector class is the abstract base class defining the interfaces for forward projectors. More...
#include <abstractprojector.h>
Public Types | |
enum | { Type = 0 } |
![]() | |
enum | { Type = -1, UserType = 65536 } |
Public Member Functions | |
int | type () const override |
virtual void | configure (const AcquisitionSetup &setup)=0 |
Configures the projector. More... | |
virtual ProjectionData | project (const VolumeData &volume)=0 |
Provides the actual forward projection functionality. More... | |
AbstractProjector (const AbstractProjector &)=delete | |
AbstractProjector (AbstractProjector &&)=default | |
AbstractProjector & | operator= (const AbstractProjector &)=delete |
AbstractProjector & | operator= (AbstractProjector &&)=default |
~AbstractProjector () override=default | |
virtual bool | isLinear () const |
Returns true if the projection operation is linear. More... | |
virtual ProjectionData | projectComposite (const CompositeVolume &volume) |
Provides the functionality to forward project CompositeVolume data. More... | |
virtual ProjectionData | projectSparse (const SparseVoxelVolume &volume) |
Provides the functionality to forward project SparseVoxelVolume data. More... | |
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... | |
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... | |
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... | |
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 |
Private Attributes | |
std::unique_ptr< ProjectorNotifier > | _notifier |
The notifier object used for signal emission. More... | |
Friends | |
template<class > | |
struct | SerializationHelper::RegisterWithSerializationHelper |
Related Functions | |
(Note that these are not member functions.) | |
VolumeData | |
Alias name for CTL::SpectralVolumeData. More... | |
std::unique_ptr< ProjectorType > | makeProjector (ConstructorArguments &&... arguments) |
Additional Inherited Members | |
![]() | |
SerializationInterface ()=default | |
SerializationInterface (const SerializationInterface &)=default | |
SerializationInterface (SerializationInterface &&)=default | |
SerializationInterface & | operator= (const SerializationInterface &)=default |
SerializationInterface & | operator= (SerializationInterface &&)=default |
The AbstractProjector class is the abstract base class defining the interfaces for forward projectors.
This class defines the interface every forward projection implementation needs to satisfy. This comes down to two methods that need to be provided:
Two structurally different ways of how such an implementation can be realized are given by the examples external::RayCasterAdapter and RayCasterProjector. Both can be found in the OpenCL module (ocl_routines.pri).
|
overridedefault |
Virtual default destructor.
|
pure virtual |
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.
Implemented in CTL::ProjectorExtension, CTL::StandardPipeline, CTL::SpectralEffectsExtension, CTL::ProjectionPipeline, CTL::ArealFocalSpotExtension, CTL::PoissonNoiseExtension, CTL::DetectorSaturationExtension, CTL::OCL::RayCasterProjector, CTL::OCL::SFPProjector, CTL::DynamicProjectorExtension, CTL::RayCasterProjectorCPU, and CTL::OCL::external::RayCasterAdapter.
ProjectionData CTL::AbstractProjector::configureAndProject | ( | const AcquisitionSetup & | setup, |
const VolumeData & | volume | ||
) |
Performs a forward projection with a precedent configuration of the projector.
This convenience method combines the calls to configure() and project() into a single call. Returns the result of project
.
Same as:
Using this method is recommended over individual calls of configure() and project() directly after one another, because it may help you avoid mistakes. In particular, it prevents that configure() is missed to call before calling project(), e.g. after changing settings of the projector (which usually require a re-configure
).
Note that this method usually changes the state of the projector due to the configure
step.
ProjectionData CTL::AbstractProjector::configureAndProject | ( | const AcquisitionSetup & | setup, |
const CompositeVolume & | volume | ||
) |
Performs a forward projection with a precedent configuration of the projector.
This convenience method combines the calls to configure() and projectComposite() into a single call. Returns the result of projectComposite
.
Same as:
Using this method is recommended over individual calls of configure() and projectComposite() directly after one another, because it may help you avoid mistakes. In particular, it prevents that configure() is missed to call before calling project(), e.g. after changing settings of the projector (which usually require a re-configure
).
Note that this methods usually change the state of the projector due to the configure
step.
ProjectionData CTL::AbstractProjector::configureAndProject | ( | const AcquisitionSetup & | setup, |
const SparseVoxelVolume & | volume | ||
) |
Performs a forward projection with a precedent configuration of the projector.
This convenience method combines the calls to configure() and projectSparse() into a single call. Returns the result of projectSparse
.
Same as:
Using this method is recommended over individual calls of configure() and projectSparse() directly after one another, because it may help you avoid mistakes. In particular, it prevents that configure() is missed to call before calling project(), e.g. after changing settings of the projector (which usually require a re-configure
).
Note that this methods usually change the state of the projector due to the configure
step.
void CTL::AbstractProjector::connectNotifierToMessageHandler | ( | bool | includeProgress = false | ) |
Connects the notifier to the CTL's MessageHandler.
Same as:
|
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::SerializationInterface.
Reimplemented in CTL::ProjectorExtension, CTL::StandardPipeline, and CTL::ProjectionPipeline.
|
virtual |
Returns true if the projection operation is linear.
By default, this method returns true. Override this method to return false in case of sub-classing that leads to non-linear operations. Overrides of this method should never return an unconditional true
(as this might outrule underlying non-linearity).
Reimplemented in CTL::ProjectorExtension, CTL::StandardPipeline, CTL::SpectralEffectsExtension, CTL::ProjectionPipeline, CTL::ArealFocalSpotExtension, CTL::PoissonNoiseExtension, and CTL::DetectorSaturationExtension.
|
virtual |
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 in CTL::StandardPipeline, and CTL::ProjectionPipeline.
|
virtual |
Returns the parameters of this instance as QVariant.
This shall return a QVariantMap with key-value-pairs representing all settings of the object.
This method is used within toVariant() to serialize the object's settings.
Reimplemented in CTL::SpectralEffectsExtension, CTL::ArealFocalSpotExtension, CTL::PoissonNoiseExtension, CTL::DetectorSaturationExtension, CTL::OCL::RayCasterProjector, and CTL::RayCasterProjectorCPU.
|
pure virtual |
Provides the actual forward projection functionality.
This method takes a voxelized dataset volume and shall return the full set of forward projections that have been requested by the AcquisitionSetup set in the configure() step.
The passed volume data can be either:
CompositeVolume data can be projected using projectComposite(); SparseVoxelVolume input can be processed by projectSparse().
Note that the functionality of specific ProjectorExtension classes might depend on a passing a certain type of volume data. Please refer to the documentation of the extensions you are using.
If you intend to call configure() and project() directly after each other, you should use configureAndProject() instead.
Implemented in CTL::ProjectorExtension, CTL::StandardPipeline, CTL::SpectralEffectsExtension, CTL::ProjectionPipeline, CTL::OCL::RayCasterProjector, CTL::OCL::SFPProjector, CTL::DynamicProjectorExtension, CTL::RayCasterProjectorCPU, and CTL::OCL::external::RayCasterAdapter.
|
virtual |
Provides the functionality to forward project CompositeVolume data.
This method takes a composite dataset volume and returns the full set of forward projections according to the AcquisitionSetup set in the configure() step.
By default, this method performs separate calls to project() for each individual voxel volume stored in the composite volume. The final projection result is the sum of all these individual projections (extinction domain). Change this behavior in sub-classes, if this is not suitable for your desired purpose. This is typically the case for non-linear operations.
If you intend to call configure() and projectComposite() directly after each other, you should use configureAndProject() instead.
Reimplemented in CTL::ProjectorExtension, CTL::StandardPipeline, CTL::SpectralEffectsExtension, CTL::ProjectionPipeline, and CTL::DynamicProjectorExtension.
|
virtual |
Provides the functionality to forward project SparseVoxelVolume data.
This method takes a sparse dataset volume and returns the full set of forward projections according to the AcquisitionSetup set in the configure() step.
By default, this method performs converts volume to a regular VoxelVolume<float> and calls project() with it. Re-implement this method in sub-classes if you can provide more efficient ways of forward projecting sparse data.
If you intend to call configure() and projectSparse() directly after each other, you should use configureAndProject() instead.
Reimplemented in CTL::ProjectorExtension, CTL::StandardPipeline, CTL::SpectralEffectsExtension, CTL::ProjectionPipeline, CTL::DynamicProjectorExtension, and CTL::OCL::SFPProjector.
|
virtual |
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 in CTL::SpectralEffectsExtension, CTL::ArealFocalSpotExtension, CTL::PoissonNoiseExtension, CTL::DetectorSaturationExtension, CTL::OCL::RayCasterProjector, and CTL::RayCasterProjectorCPU.
|
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::SerializationInterface.
Reimplemented in CTL::ProjectorExtension, CTL::StandardPipeline, CTL::SpectralEffectsExtension, CTL::ProjectionPipeline, CTL::ArealFocalSpotExtension, CTL::PoissonNoiseExtension, CTL::DetectorSaturationExtension, CTL::OCL::RayCasterProjector, CTL::DynamicProjectorExtension, and CTL::RayCasterProjectorCPU.
|
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::SerializationInterface.
Reimplemented in CTL::ProjectorExtension, CTL::StandardPipeline, CTL::SpectralEffectsExtension, CTL::ProjectionPipeline, CTL::ArealFocalSpotExtension, CTL::PoissonNoiseExtension, CTL::DetectorSaturationExtension, CTL::DynamicProjectorExtension, CTL::OCL::RayCasterProjector, and CTL::RayCasterProjectorCPU.
|
related |
Global (free) make function that creates a new Projector from possible constructor arguments. The component is returned as a std::unique_ptr<ProjectorType>
, whereas ProjectorType
is the template argument of this function that needs to be specified.
Example:
|
related |
Alias name for CTL::SpectralVolumeData.
Also serves as a placeholder for potential future changes to the concept of volume data.
|
private |
The notifier object used for signal emission.