CTL  0.6.1
Computed Tomography Library
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
CTL::AbstractReconstructor Class Referenceabstract

The AbstractReconstructor class defined the interface for reconstruction types. More...

#include <abstractreconstructor.h>

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

Public Types

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

Public Member Functions

int type () const override
 
virtual void configure (const AcquisitionSetup &setup)=0
 Configures the reconstructor. More...
 
 AbstractReconstructor (const AbstractReconstructor &)=delete
 
 AbstractReconstructor (AbstractReconstructor &&)=default
 
AbstractReconstructoroperator= (const AbstractReconstructor &)=delete
 
AbstractReconstructoroperator= (AbstractReconstructor &&)=default
 
 ~AbstractReconstructor () override=default
 
virtual bool isApplicableTo (const AcquisitionSetup &setup) const
 Returns true if the reconstruction method can be applied to data whose acquisition is described by setup. More...
 
virtual bool reconstructToPlain (const ProjectionDataView &projections, VoxelVolume< float > &targetVolume)
 Reconstruct data (in-place) from projections into volume. More...
 
virtual bool reconstructToSpectral (const ProjectionDataView &projections, SpectralVolumeData &targetVolume)
 Reconstruct data (in-place) from projections into volume. More...
 
virtual bool reconstructToDynamic (const ProjectionDataView &projections, AbstractDynamicVolumeData &targetVolume)
 Reconstruct data (in-place) from projections into volume. More...
 
virtual bool reconstructToComposite (const ProjectionDataView &projections, CompositeVolume &targetVolume)
 Reconstruct data (in-place) from projections into volume. More...
 
virtual bool reconstructToSparse (const ProjectionDataView &projections, SparseVoxelVolume &targetVolume)
 Reconstruct data (in-place) from projections into volume. More...
 
template<class VolumeType >
bool reconstructTo (const ProjectionDataView &projections, VolumeType &targetVolume)
 Convenience method wrapping up all reconstructToXXX() methods. More...
 
template<class VolumeType >
bool configureAndReconstructTo (const AcquisitionSetup &setup, const ProjectionDataView &projections, VolumeType &targetVolume)
 Combines the calls to configure() and reconstructTo(). More...
 
template<class VolumeType , class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::type>
Q_REQUIRED_RESULT VolumeType reconstruct (const ProjectionDataView &projections, const VolumeType &initialVolume, bool *ok=nullptr)
 Reconstructs projections into a new volume object initialized with initialVolume and returns the result. More...
 
template<class VolumeType , class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::type>
Q_REQUIRED_RESULT VolumeType reconstruct (const ProjectionDataView &projections, VolumeType &&initialVolume, bool *ok=nullptr)
 Reconstructs projections into a new volume object initialized with initialVolume and returns the result. More...
 
template<class VolumeType , class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::type>
Q_REQUIRED_RESULT VolumeType configureAndReconstruct (const AcquisitionSetup &setup, const ProjectionDataView &projections, const VolumeType &initialVolume, bool *ok=nullptr)
 Combines the calls to configure() and reconstruct(). More...
 
template<class VolumeType , class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::type>
Q_REQUIRED_RESULT VolumeType configureAndReconstruct (const AcquisitionSetup &setup, const ProjectionDataView &view, VolumeType &&initialVolume, bool *ok=nullptr)
 Combines the calls to configure() and reconstruct(). More...
 
virtual QVariant parameter () const
 Returns the parameters of this instance as a QVariant. More...
 
virtual void setParameter (const QVariant &parameter)
 Sets the parameters of this instance based on the passed QVariant parameter. 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 ReconstructorNotifiernotifier ()
 Returns a pointer to the notifier of the reconstructor. More...
 
void connectNotifierToMessageHandler (bool includeProgress=false)
 Connects this instance's notifier to the CTL's MessageHandler. More...
 
template<>
bool reconstructTo (const ProjectionDataView &projections, VoxelVolume< float > &targetVolume)
 Convenience method wrapping up all reconstructToXXX() methods. More...
 
template<>
bool reconstructTo (const ProjectionDataView &projections, SpectralVolumeData &targetVolume)
 Convenience method wrapping up all reconstructToXXX() methods. More...
 
template<>
bool reconstructTo (const ProjectionDataView &projections, CompositeVolume &targetVolume)
 Convenience method wrapping up all reconstructToXXX() methods. More...
 
template<>
bool reconstructTo (const ProjectionDataView &projections, SparseVoxelVolume &targetVolume)
 Convenience method wrapping up all reconstructToXXX() methods. More...
 
template<>
bool configureAndReconstructTo (const AcquisitionSetup &setup, const ProjectionDataView &projections, VoxelVolume< float > &targetVolume)
 Combines calls to configure() and reconstructTo(). More...
 
template<>
bool configureAndReconstructTo (const AcquisitionSetup &setup, const ProjectionDataView &projections, SpectralVolumeData &targetVolume)
 
template<>
bool configureAndReconstructTo (const AcquisitionSetup &setup, const ProjectionDataView &projections, CompositeVolume &targetVolume)
 
template<>
bool configureAndReconstructTo (const AcquisitionSetup &setup, const ProjectionDataView &projections, SparseVoxelVolume &targetVolume)
 
template<class DynamicVolumeType >
bool reconstructTo (const ProjectionDataView &projections, DynamicVolumeType &targetVolume)
 
template<class DynamicVolumeType >
bool configureAndReconstructTo (const AcquisitionSetup &setup, const ProjectionDataView &projections, DynamicVolumeType &targetVolume)
 
template<class VolumeType , class >
VolumeType reconstruct (const ProjectionDataView &projections, const VolumeType &initialVolume, bool *ok)
 Reconstructs projections into a new volume object initialized with initialVolume and returns the result. More...
 
template<class VolumeType , class >
VolumeType reconstruct (const ProjectionDataView &projections, VolumeType &&initialVolume, bool *ok)
 Reconstructs projections into a new volume object initialized with initialVolume and returns the result. More...
 
template<class VolumeType , class >
VolumeType configureAndReconstruct (const AcquisitionSetup &setup, const ProjectionDataView &projections, const VolumeType &initialVolume, bool *ok)
 Combines the calls to configure() and reconstruct(). More...
 
template<class VolumeType , class >
VolumeType configureAndReconstruct (const AcquisitionSetup &setup, const ProjectionDataView &projections, VolumeType &&initialVolume, bool *ok)
 Combines the calls to configure() and reconstruct(). More...
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual ~SerializationInterface ()=default
 

Private Attributes

std::unique_ptr< ReconstructorNotifier_notifier
 The notifier object used for signal emission. More...
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Related Functions

(Note that these are not member functions.)

std::unique_ptr< ReconstructorType > makeReconstructor (ConstructorArguments &&... arguments)
 

Additional Inherited Members

- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 

Detailed Description

The AbstractReconstructor class defined the interface for reconstruction types.

Note: the beginning of this section deals with usage of reconstruction classes. Information on sub-classing AbstractReconstructor can be found at the end of this description.

In the CTL, a reconstruction type is defined as any class that provides an algorithm to transform data from the projection domain to the volume domain. Note that, in common practical terms, this includes both straightforward backprojection methods as well as full reconstruction routines ( e.g. FDK, ART).

Generally, two options to reconstruct can be used:

  1. Reconstructing "into" an already existing volume through reconstructTo().
  2. Requesting the reconstructed volume by value through reconstruct().

In both cases, an AcquisitionSetup object containing a setup that describes all required details on the acquisition setting used to acquire the projections must be passed to configure() before any reconstruction can be performed. It might also be useful to check whether or not the specific reconstruction class is able to handle your input data first via isApplicableTo().

When using version 1., reconstructed values are added to the input volume. In doing so, the input volume simultaneously serves as initialization as well as final output—the reconstruction is carried out in place. As for version 2., there is also a volume object required as input for the routine. This volume, however, only serves the purpose of initializing the result as well as specifying its properties, such as dimensions and potential further information (e.g. material). The result will then be returned as a separate volume object.

Depending on the capabilities of the specific sub-class you are using, you may use the reconstruction methods for one or more different input volume data types (i.e. plain VoxelVolume<float>, SpectralVolumeData, AbstractDynamicVolumeData sub-classes, SparseVoxelVolume, and/or CompositeVolume). If the corresponding method for a particular volume type is not re-implemented by the reconstructor, it will return std::runtime_error when called.

AbstractReconstructor provides a selection of pre-implemented convenience methods that rely on the virtual interface. These include:

It is possible to force the use of a particular reconstruction method when using special volume types through use of an explicit reconstructToXYZ() call or by specifying the target type as template parameter for reconstructTo() or reconstruct(). Note: you can only enforce usage of methods on the superclasses of a volume.

Example: explicitely using the method for plain VoxelVolume<float> on SpectralVolumeData input

AbstractReconstructor* reconstructor /*= new SomeActualReconstructor*/;
// define a 'SpectralVolumeData' volume
auto volume = SpectralVolumeData::cube(100, 1.0f, 0.0f,
database::attenuationModel(database::Composite::Water));
AcquisitionSetup setup;
// specify details of the setup, according to the desired simulation setting or used measurement equipment
// ...
auto projections = ProjectionData::dummy();
// simulate projections or load some real measurement data here instead
// assuming 'reconstructor' does not provide a reconstructToSpectral() implementation
try {
reconstructor->configureAndReconstructTo(setup, projections, volume);
} catch (std::exception& err) {
qInfo() << "Error:" << err.what();
}
// output: Error: No reconstruction method for SpectralVolumeData implemented.
// instead, force 'reconstructor' to apply its VoxelVolume<float> algorithm to 'volume'
reconstructor->configureAndReconstructTo<VoxelVolume<float>>(setup, projections, volume);
// alternative:
// pass the acquisition setup and use 'reconstructToPlain()'
reconstructor->configure(setup);
reconstructor->reconstructToPlain(projections, volume);

Sub-classing

AbstractReconstructor is a moveable but non-copyable type.

The concept of the interface defined by AbstractReconstructor is fairly similar to the one found in AbstractProjector. Sub-classes need to :

  1. Implement configure(const AcquisitionSetup&) - This method takes an AcquisitionSetup object containing a setup that describes all available details on the acquisition setting used to acquire the data that will later be reconstructed. Use it to extract all relevant data needed for your reconstruction method.
  2. Override at least on of the actual (virtual) reconstruction methods: a) reconstructToPlain(), b) reconstructToSpectral(), c) reconstructToDynamic(), d) reconstructToComposite(), e) reconstructToSparse(), to provide the desired reconstruction routine.

Additionally, you might want to re-implement

bool isApplicableTo(const AcquisitionSetup&)

such that it inspects the passed setup and returns true / false depending on whether or not the contained acquisition can be handled by your implementation (e.g. by means of verifying potential geometry constraints). By default, isApplicableTo() always returns true.

To enable de-/serialization of sub-class objects, also reimplement the parameter() and setParameter() methods. parameter() should stores all parameters of your class in a QVariant; setParameter() must parse an input QVariant and read from it all values defining you instance. Additionally, call the macro DECLARE_SERIALIZABLE_TYPE(YourNewClassName) within the .cpp file of your new class (substitute "YourNewClassName" with the actual class name). Objects of the new class can then be de-/serialized with any of the serializer classes (see also AbstractSerializer).

Alternatively, the de-/serialization interface methods toVariant() and fromVariant() can be reimplemented directly. This might be required in some highly specific situations. For the majority of cases, using the parameter() / setParameter() approach should be sufficient and is recommended.

Constructor & Destructor Documentation

◆ ~AbstractReconstructor()

CTL::AbstractReconstructor::~AbstractReconstructor ( )
overridedefault

Virtual default destructor.

Member Function Documentation

◆ configure()

void CTL::AbstractReconstructor::configure ( const AcquisitionSetup setup)
pure virtual

Configures the reconstructor.

This method must be implemented by sub-classes. It should be used to gather all necessary information on the acquisition that are required in the actual reconstruction procedure. This usually contains all geometry and system information, which can be retrieved from setup.

Note that the passed setup must always refer to the entire set of projections that will be passed to a reconstruction task later on. That means, even if the passed data (to reconstruction) will be a ProjectionDataView that refers only to a subset of the underlying data, the setup passed in configure() must always correspond to the full projection data (i.e. the data referenced by the view).

If you intend to call configure() and any reconstruction method directly after each other, you should consider using configureAndReconstruct() or configureAndReconstructTo() instead.

Implemented in CTL::ARTReconstructor, CTL::OCL::BackprojectorBase, CTL::OCL::FDKReconstructor, and CTL::SimpleBackprojectorCPU.

◆ configureAndReconstruct() [1/4]

template<class VolumeType , class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::type>
Q_REQUIRED_RESULT VolumeType CTL::AbstractReconstructor::configureAndReconstruct ( const AcquisitionSetup setup,
const ProjectionDataView projections,
const VolumeType &  initialVolume,
bool *  ok = nullptr 
)

Combines the calls to configure() and reconstruct().

This convenience method combines the calls to configure() and reconstruct() into a single call. Returns the result of reconstruct (i.e. the reconstructed volume). The result of the (internally) performed reconstructTo() call will be placed in ok. You may use it to check for reconstruction success as reported by the actual reconstruction routine.

Using this method is recommended over individual calls of configure() and reconstruct() directly after one another, because it may help you avoid mistakes. In particular, it prevents potentially missing the call to configure() before calling reconstruct(), e.g. after changing settings of the reconstructor (which usually requires a re-configure).

Note that this method usually changes the state of the reconstructor due to the configure step.

See also
configure(), reconstruct()

◆ configureAndReconstruct() [2/4]

template<class VolumeType , class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::type>
Q_REQUIRED_RESULT VolumeType CTL::AbstractReconstructor::configureAndReconstruct ( const AcquisitionSetup setup,
const ProjectionDataView view,
VolumeType &&  initialVolume,
bool *  ok = nullptr 
)

◆ configureAndReconstruct() [3/4]

template<class VolumeType , class >
VolumeType CTL::AbstractReconstructor::configureAndReconstruct ( const AcquisitionSetup setup,
const ProjectionDataView projections,
const VolumeType &  initialVolume,
bool *  ok 
)

Combines the calls to configure() and reconstruct().

This convenience method combines the calls to configure() and reconstruct() into a single call. Returns the result of reconstruct (i.e. the reconstructed volume). The result of the (internally) performed reconstructTo() call will be placed in ok. You may use it to check for reconstruction success as reported by the actual reconstruction routine.

Using this method is recommended over individual calls of configure() and reconstruct() directly after one another, because it may help you avoid mistakes. In particular, it prevents potentially missing the call to configure() before calling reconstruct(), e.g. after changing settings of the reconstructor (which usually requires a re-configure).

Note that this method usually changes the state of the reconstructor due to the configure step.

See also
configure(), reconstruct()

◆ configureAndReconstruct() [4/4]

template<class VolumeType , class >
VolumeType CTL::AbstractReconstructor::configureAndReconstruct ( const AcquisitionSetup setup,
const ProjectionDataView projections,
VolumeType &&  initialVolume,
bool *  ok 
)

◆ configureAndReconstructTo() [1/6]

template<class VolumeType >
bool CTL::AbstractReconstructor::configureAndReconstructTo ( const AcquisitionSetup setup,
const ProjectionDataView projections,
VolumeType &  targetVolume 
)

Combines the calls to configure() and reconstructTo().

This convenience method combines the calls to configure() and reconstructTo() into a single call. Returns the result of reconstructTo.

Using this method is recommended over individual calls of configure() and reconstructTo() directly after one another, because it may help you avoid mistakes. In particular, it prevents potentially missing the call to configure() before calling reconstructTo(), e.g. after changing settings of the reconstructor (which usually requires a re-configure).

Note that this method usually changes the state of the reconstructor due to the configure step.

See also
configure(), reconstructTo()

◆ configureAndReconstructTo() [2/6]

bool CTL::AbstractReconstructor::configureAndReconstructTo ( const AcquisitionSetup setup,
const ProjectionDataView projections,
VoxelVolume< float > &  targetVolume 
)

Combines calls to configure() and reconstructTo().

Specialization for VoxelVolume<float> input. Returns the result of reconstructToPlain().

Specialization for VoxelVolume<float> input. See configureAndReconstructTo().

◆ configureAndReconstructTo() [3/6]

bool CTL::AbstractReconstructor::configureAndReconstructTo ( const AcquisitionSetup setup,
const ProjectionDataView projections,
SpectralVolumeData targetVolume 
)

Specialization for SpectralVolumeData input. See configureAndReconstructTo().

◆ configureAndReconstructTo() [4/6]

bool CTL::AbstractReconstructor::configureAndReconstructTo ( const AcquisitionSetup setup,
const ProjectionDataView projections,
CompositeVolume targetVolume 
)

Specialization for CompositeVolume input. See configureAndReconstructTo().

◆ configureAndReconstructTo() [5/6]

bool CTL::AbstractReconstructor::configureAndReconstructTo ( const AcquisitionSetup setup,
const ProjectionDataView projections,
SparseVoxelVolume targetVolume 
)

Specialization for SparseVoxelVolume input. See configureAndReconstructTo().

◆ configureAndReconstructTo() [6/6]

template<class DynamicVolumeType >
bool CTL::AbstractReconstructor::configureAndReconstructTo ( const AcquisitionSetup setup,
const ProjectionDataView projections,
DynamicVolumeType &  targetVolume 
)

Implementation for all remaining input types. See configureAndReconstructTo().

Asserts that the type is convertible to a AbstractDynamicVolumeData and (if successful) calls reconstructToDynamic() (preceded by configure()).

◆ connectNotifierToMessageHandler()

void CTL::AbstractReconstructor::connectNotifierToMessageHandler ( bool  includeProgress = false)

Connects this instance's notifier to the CTL's MessageHandler.

Same as:

notifier()->connectToMessageHandler(includeProgress);
See also
AbstractReconstructor::connectToMessageHandler

◆ fromVariant()

void CTL::AbstractReconstructor::fromVariant ( const QVariant &  variant)
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.

◆ isApplicableTo()

bool CTL::AbstractReconstructor::isApplicableTo ( const AcquisitionSetup setup) const
virtual

Returns true if the reconstruction method can be applied to data whose acquisition is described by setup.

Re-implement this method in sub-classes to provide reasonable information whether or not the implemented method can be applied to a setup as passed. Decision criteria might include, for example, restrictions on the system used (e.g. detector geometry) or geometrical limitations w.r.t. the scan orbit.

By default, this always returns true.

Reimplemented in CTL::OCL::FDKReconstructor.

◆ notifier()

ReconstructorNotifier * CTL::AbstractReconstructor::notifier ( )
virtual

Returns a pointer to the notifier of the reconstructor.

The notifier object can be used to emit the signal ReconstructorNotifier::progress(qreal) to broadcast an update on the (relative) progress of the reconstruction procedure. A value of 1.0 should indicate that the reconstruction has finished. More general information can be communicated through the information() signal.

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 reconstruction progress information to a QProgressBar:

AbstractReconstructor* myReconstructor /* = new ActualReconstructor */;
QProgressBar* myProgressBar = new QProgressBar();
// ... e.g. add the progress bar somewhere in your GUI
QObject::connect(myReconstructor->notifier(), SIGNAL(projectionFinished(int)),
myProgressBar, SLOT(setValue(int)));

/// Example 2 - forwarding the information text to a QStatusBar

AbstractReconstructor* myReconstructor /* = new ActualReconstructor */;
QStatusBar* myStatusBar = new QStatusBar;
// ... e.g. add the status bar somewhere in your GUI (or take a pointer to an existing one)
QObject::connect(myReconstructor->notifier(), SIGNAL(information(QString)),
myStatusBar, SLOT(showMessage(QString)));

◆ parameter()

QVariant CTL::AbstractReconstructor::parameter ( ) const
virtual

Returns the parameters of this instance as a QVariant.

Re-implement this method within your sub-class such that it encapsulates all necessary information into a QVariant.

Best practice is to invoke the base class version of this method to take care of all content originating from underlying base classes.

A typical reimplementation in sub-classes might look like this:

QVariantMap ret = DirectBaseClass::parameter().toMap();
ret.insert("my new parameter", _myNewParameter);
return ret;

Reimplemented in CTL::ARTReconstructor, CTL::OCL::BackprojectorBase, CTL::OCL::FDKReconstructor, CTL::OCL::SimpleBackprojector, CTL::SimpleBackprojectorCPU, and CTL::OCL::SFPBackprojector.

◆ reconstruct() [1/4]

template<class VolumeType , class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::type>
Q_REQUIRED_RESULT VolumeType CTL::AbstractReconstructor::reconstruct ( const ProjectionDataView projections,
const VolumeType &  initialVolume,
bool *  ok = nullptr 
)

Reconstructs projections into a new volume object initialized with initialVolume and returns the result.

This method provides a means to perform reconstructions with the result being returned by value (as opposed to in-place reconstruction carried out with reconstructTo()). Creates a volume initialized by initialVolume. Note that this implies that the new volume has the same specifications (e.g. dimensions) as initialVolume. Specific sub-classes of AbstractReconstructor might also allow use of initialVolume which does not have any memory allocated. In these cases it might be interpreted as a template for the specifications of the new volume only (usually combined with zero-initialization). Refer to the documentation of actual reconstruction sub-classes for details on this aspect.

The result of the performed reconstructTo() call will be placed in ok. You may use it to check for reconstruction success as reported by the actual reconstruction routine.

◆ reconstruct() [2/4]

template<class VolumeType , class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::type>
Q_REQUIRED_RESULT VolumeType CTL::AbstractReconstructor::reconstruct ( const ProjectionDataView projections,
VolumeType &&  initialVolume,
bool *  ok = nullptr 
)

Reconstructs projections into a new volume object initialized with initialVolume and returns the result.

Overload for r-value input of initialVolume. See reconstruct(const ProjectionDataView&,const VolumeType&,bool*).

◆ reconstruct() [3/4]

template<class VolumeType , class >
VolumeType CTL::AbstractReconstructor::reconstruct ( const ProjectionDataView projections,
const VolumeType &  initialVolume,
bool *  ok 
)

Reconstructs projections into a new volume object initialized with initialVolume and returns the result.

This method provides a means to perform reconstructions with the result being returned by value (as opposed to in-place reconstruction carried out with reconstructTo()). Creates a volume initialized by initialVolume. Note that this implies that the new volume has the same specifications (e.g. dimensions) as initialVolume. Specific sub-classes of AbstractReconstructor might also allow use of initialVolume which does not have any memory allocated. In these cases it might be interpreted as a template for the specifications of the new volume only (usually combined with zero-initialization). Refer to the documentation of actual reconstruction sub-classes for details on this aspect.

The result of the performed reconstructTo() call will be placed in ok. You may use it to check for reconstruction success as reported by the actual reconstruction routine.

◆ reconstruct() [4/4]

template<class VolumeType , class >
VolumeType CTL::AbstractReconstructor::reconstruct ( const ProjectionDataView projections,
VolumeType &&  initialVolume,
bool *  ok 
)

Reconstructs projections into a new volume object initialized with initialVolume and returns the result.

Overload for r-value input of initialVolume. See reconstruct(const ProjectionDataView&,const VolumeType&,bool*).

◆ reconstructTo() [1/6]

template<class VolumeType >
bool CTL::AbstractReconstructor::reconstructTo ( const ProjectionDataView projections,
VolumeType &  targetVolume 
)

Convenience method wrapping up all reconstructToXXX() methods.

Directs the call to the correct reconstructToXXX() method, according to the type of targetVolume.

◆ reconstructTo() [2/6]

bool CTL::AbstractReconstructor::reconstructTo ( const ProjectionDataView projections,
VoxelVolume< float > &  targetVolume 
)

Convenience method wrapping up all reconstructToXXX() methods.

Specialization for VoxelVolume<float> input. Directs the call to reconstructToPlain().

See also
reconstructTo(const ProjectionDataView&,VolumeType&)

◆ reconstructTo() [3/6]

bool CTL::AbstractReconstructor::reconstructTo ( const ProjectionDataView projections,
SpectralVolumeData targetVolume 
)

Convenience method wrapping up all reconstructToXXX() methods.

Specialization for SpectralVolumeData input. Directs the call to reconstructToSpectral().

See also
reconstructTo(const ProjectionDataView&,VolumeType&)

◆ reconstructTo() [4/6]

bool CTL::AbstractReconstructor::reconstructTo ( const ProjectionDataView projections,
CompositeVolume targetVolume 
)

Convenience method wrapping up all reconstructToXXX() methods.

Specialization for CompositeVolume input. Directs the call to reconstructToComposite().

See also
reconstructTo(const ProjectionDataView&,VolumeType&)

◆ reconstructTo() [5/6]

bool CTL::AbstractReconstructor::reconstructTo ( const ProjectionDataView projections,
SparseVoxelVolume targetVolume 
)

Convenience method wrapping up all reconstructToXXX() methods.

Specialization for SparseVoxelVolume input. Directs the call to reconstructToSparse().

See also
reconstructTo(const ProjectionDataView&,VolumeType&)

◆ reconstructTo() [6/6]

template<class DynamicVolumeType >
bool CTL::AbstractReconstructor::reconstructTo ( const ProjectionDataView projections,
DynamicVolumeType &  targetVolume 
)

Implementation for all remaining input types. See reconstructTo().

Asserts that the type is convertible to a AbstractDynamicVolumeData and (if successful) calls reconstructToDynamic().

◆ reconstructToComposite()

bool CTL::AbstractReconstructor::reconstructToComposite ( const ProjectionDataView projections,
CompositeVolume targetVolume 
)
virtual

Reconstruct data (in-place) from projections into volume.

Re-implement this method in sub-classes to provide actual reconstruction functionality for reconstructions operating on CompositeVolume.

Note that projections is a ProjectionDataView, meaning it may contain a subset of data (or data in shuffled order). Make sure to correctly address individual views by their particular view ids (see ProjectionDataView::viewIds()). This becomes particularly important when referring to the corresponding AcquisitionSetup. You might consider using AcquisitionSetup::subset() along with the view ids of projections to select the correct data from setup.

By default, throws a std::runtime_error stating that the functionality is not implemented.

◆ reconstructToDynamic()

bool CTL::AbstractReconstructor::reconstructToDynamic ( const ProjectionDataView projections,
AbstractDynamicVolumeData targetVolume 
)
virtual

Reconstruct data (in-place) from projections into volume.

Re-implement this method in sub-classes to provide actual reconstruction functionality for reconstructions operating on (sub-classes of) AbstractDynamicVolumeData. You might want to check for the specific sub-class and decide whether or not your implementation can handle it. The implementation shall treat volume as an initialization. That means, reconstructed data shall be added to the input volume (instead of overwriting its values).

Note that projections is a ProjectionDataView, meaning it may contain a subset of data (or data in shuffled order). Make sure to correctly address individual views by their particular view ids (see ProjectionDataView::viewIds()). This becomes particularly important when referring to the corresponding AcquisitionSetup. You might consider using AcquisitionSetup::subset() along with the view ids of projections to select the correct data from setup.

By default, throws a std::runtime_error stating that the functionality is not implemented.

◆ reconstructToPlain()

bool CTL::AbstractReconstructor::reconstructToPlain ( const ProjectionDataView projections,
VoxelVolume< float > &  targetVolume 
)
virtual

Reconstruct data (in-place) from projections into volume.

Re-implement this method in sub-classes to provide actual reconstruction functionality for reconstructions operating on VoxelVolume<float>. The implementation shall treat volume as an initialization. That means, reconstructed data shall be added to the input volume (instead of overwriting its values).

Note that projections is a ProjectionDataView, meaning it may contain a subset of data (or data in shuffled order). Make sure to correctly address individual views by their particular view ids (see ProjectionDataView::viewIds()). This becomes particularly important when referring to the corresponding AcquisitionSetup. You might consider using AcquisitionSetup::subset() along with the view ids of projections to select the correct data from setup.

By default, throws a std::runtime_error stating that the functionality is not implemented.

Reimplemented in CTL::ARTReconstructor, CTL::OCL::BackprojectorBase, CTL::SimpleBackprojectorCPU, CTL::OCL::SimpleBackprojector, CTL::OCL::FDKReconstructor, and CTL::OCL::SFPBackprojector.

◆ reconstructToSparse()

bool CTL::AbstractReconstructor::reconstructToSparse ( const ProjectionDataView projections,
SparseVoxelVolume targetVolume 
)
virtual

Reconstruct data (in-place) from projections into volume.

Re-implement this method in sub-classes to provide actual reconstruction functionality for reconstructions operating on SparseVoxelVolume.

Note that projections is a ProjectionDataView, meaning it may contain a subset of data (or data in shuffled order). Make sure to correctly address individual views by their particular view ids (see ProjectionDataView::viewIds()). This becomes particularly important when referring to the corresponding AcquisitionSetup. You might consider using AcquisitionSetup::subset() along with the view ids of projections to select the correct data from setup.

By default, throws a std::runtime_error stating that the functionality is not implemented.

◆ reconstructToSpectral()

bool CTL::AbstractReconstructor::reconstructToSpectral ( const ProjectionDataView projections,
SpectralVolumeData targetVolume 
)
virtual

Reconstruct data (in-place) from projections into volume.

Re-implement this method in sub-classes to provide actual reconstruction functionality for reconstructions operating on SpectralVolumeData. The implementation shall treat volume as an initialization. That means, reconstructed data shall be added to the input volume (instead of overwriting its values).

Note that projections is a ProjectionDataView, meaning it may contain a subset of data (or data in shuffled order). Make sure to correctly address individual views by their particular view ids (see ProjectionDataView::viewIds()). This becomes particularly important when referring to the corresponding AcquisitionSetup. You might consider using AcquisitionSetup::subset() along with the view ids of projections to select the correct data from setup.

By default, throws a std::runtime_error stating that the functionality is not implemented.

Reimplemented in CTL::ARTReconstructor.

◆ setParameter()

void CTL::AbstractReconstructor::setParameter ( const QVariant &  parameter)
virtual

Sets the parameters of this instance based on the passed QVariant parameter.

Extract all necessary information contained in the passed QVariant and re-implement this method within your sub-class to include all necessary additions.

Best practice is to invoke the base class version of this method to take care of all content originating from underlying base classes.

A typical reimplementation in sub-classes might look like this:

DirectBaseClass::setParameter(parameter);
// assuming our class has a parameter member "double _myNewParameter"
_myNewParameter = parameter.toMap().value("my new parameter").toDouble();

Reimplemented in CTL::ARTReconstructor, CTL::OCL::BackprojectorBase, CTL::OCL::FDKReconstructor, CTL::OCL::SimpleBackprojector, CTL::SimpleBackprojectorCPU, and CTL::OCL::SFPBackprojector.

◆ toVariant()

QVariant CTL::AbstractReconstructor::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::SerializationInterface.

Reimplemented in CTL::ARTReconstructor, CTL::OCL::SimpleBackprojector, CTL::SimpleBackprojectorCPU, and CTL::OCL::SFPBackprojector.

◆ type()

int CTL::AbstractReconstructor::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::SerializationInterface.

Reimplemented in CTL::OCL::BackprojectorBase, CTL::ARTReconstructor, CTL::OCL::SimpleBackprojector, CTL::OCL::FDKReconstructor, CTL::SimpleBackprojectorCPU, and CTL::OCL::SFPBackprojector.

Friends And Related Function Documentation

◆ makeReconstructor()

std::unique_ptr< ReconstructorType > makeReconstructor ( ConstructorArguments &&...  arguments)
related

Global (free) make function that creates a new reconstructor from possible constructor arguments. The component is returned as a std::unique_ptr<ReconstructorType>, whereas ReconstructorType is the template argument of this function that needs to be specified.

Example:

auto reconstructor = makeReconstructor<SimpleBackprojectorCPU>(SimpleBackprojectorCPU::DistanceWeightsOnly);

Member Data Documentation

◆ _notifier

std::unique_ptr<ReconstructorNotifier> CTL::AbstractReconstructor::_notifier
private
Initial value:
{
new ReconstructorNotifier
}

The notifier object used for signal emission.


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