1 #ifndef CTL_ARTRECONSTRUCTOR_H 2 #define CTL_ARTRECONSTRUCTOR_H 5 #include "abstractsubsetgenerator.h" 6 #include "acquisition/acquisitionsetup.h" 7 #include "processing/abstractvolumefilter.h" 9 #include "defaultsubsetgenerator.h" 101 Q_FLAG(StoppingCriteria)
105 std::unique_ptr<AbstractReconstructor> backprojector);
122 std::shared_ptr<AbstractProjector> forwardProjector,
123 std::shared_ptr<AbstractReconstructor> backprojector,
124 uint nbPowerIter = 1u);
129 uint nbPowerIter = 1u);
139 uint nbPowerIter = 1u);
142 uint nbPowerIter = 1u);
146 bool enableRegularization =
true);
158 void setMaxTime(
float seconds,
bool enableCriterion =
true);
183 std::unique_ptr<AbstractProjector> _fp;
184 std::unique_ptr<AbstractReconstructor> _bp;
185 std::unique_ptr<AbstractVolumeFilter> _regularizer;
186 std::unique_ptr<AbstractSubsetGenerator> _customSubsetGen;
187 std::unique_ptr<DefaultSubsetGenerator> _defaultSubsetGen;
191 uint _maxNbIterations = 5;
192 bool _usePositivityConstraint =
true;
193 bool _useRegularization =
false;
194 bool _useRelaxationEstimation =
true;
212 float normalEqNormalization,
214 uint iteration)
const;
223 float normalization)
const;
238 Q_DECLARE_OPERATORS_FOR_FLAGS(ARTReconstructor::StoppingCriteria)
248 enum FootprintType { TR, TT, TT_Generic };
258 #endif // CTL_ARTRECONSTRUCTOR_H void setStoppingCriterionEnabled(StoppingCriterion criterion, bool enabled=true)
Sets the use of the stopping criterion criterion to enabled.
Definition: artreconstructor.cpp:478
AbstractSubsetGenerator & customSubsetGenerator() const
Returns a reference to the current custom subset generator of this instance.
Definition: artreconstructor.cpp:696
uint _terminateMaxTime
in ms
Definition: artreconstructor.h:200
Definition: artreconstructor.h:90
void setRelaxation(float relax)
Sets the relaxation parameter to relax.
Definition: artreconstructor.cpp:384
void setForwardProjector(std::unique_ptr< AbstractProjector > projector)
Sets the forward projector to be used to projector.
Definition: artreconstructor.cpp:548
bool reconstructToPlain(const ProjectionDataView &projections, VoxelVolume< float > &targetVolume) override
Reconstructs projection data projections into targetVolume and returns true on success.
Definition: artreconstructor.cpp:85
bool terminateByProjError(float projError, float inputProjNorm) const
Returns true if the ratio between projError and inputProjNorm is less than the corresponding stopping...
Definition: artreconstructor.cpp:1030
void useDefaultSubsetGenerator()
(Re-)Enables the use of the default subset generator.
Definition: artreconstructor.cpp:613
bool isDefaultSubsetGeneratorInUse() const
Returns true if the default subset generator is in use.
Definition: artreconstructor.cpp:458
bool consistencyChecks(const ProjectionDataView &projections) const
Returns true if projections are consistent with the AcquisitionSetup previously passed to configure()...
Definition: artreconstructor.cpp:856
void setMaxNbIterations(uint nbIt, bool enableCriterion=true)
Sets the maximum number of iterations to nbIt and enables the corresponding stopping criterion if ena...
Definition: artreconstructor.cpp:283
void setPositivityConstraintEnabled(bool enabled)
Sets the use of the positivity constraint to enabled.
Definition: artreconstructor.cpp:351
bool terminateByProjErrorChange(float oldProjError, float newProjError) const
Returns true if the relative difference between oldProjError and newProjError is less than the corres...
Definition: artreconstructor.cpp:968
bool isPositivityConstraintEnabled() const
Returns true if the positivity constraint is enabled.
Definition: artreconstructor.cpp:621
static float computeRelaxationEstimate(const AcquisitionSetup &setup, const VoxelVolume< float > &targetVolume, std::shared_ptr< AbstractProjector > forwardProjector, std::shared_ptr< AbstractReconstructor > backprojector, uint nbPowerIter=1u)
Computes an estimation for a suitable relaxation parameter using the power method.
Definition: artreconstructor.cpp:722
Definition: artreconstructor.h:89
void setRelaxationEstimationEnabled(bool enabled)
Sets the use of an estimation for the relaxation parameter to enabled.
Definition: artreconstructor.cpp:373
bool terminateByComputationTime(int msSpent) const
Returns true if msSpent is greater than the corresponding stopping criterion value.
Definition: artreconstructor.cpp:989
AbstractSubsetGenerator & subsetGenerator() const
Returns a reference to the subset generator that is currently enabled.
Definition: artreconstructor.cpp:711
void setMaxTime(float seconds, bool enableCriterion=true)
Sets the maximum runtime for the reconstruction to seconds and enables the corresponding stopping cri...
Definition: artreconstructor.cpp:294
void setRegularizer(AbstractVolumeFilter *regularizer, bool enableRegularization=true)
Sets the regularizer to regularizer and enables regularization if enableRegularization = true.
Definition: artreconstructor.cpp:434
Holds a CTSystem together with the information about the system settings for all views from which pro...
Definition: acquisitionsetup.h:175
Definition: artreconstructor.h:87
The ProjectionDataView class is a read-only wrapper for a reference to ProjectionData.
Definition: projectiondataview.h:51
Definition: abstractvolumefilter.h:11
bool reconstructToSpectral(const ProjectionDataView &projections, SpectralVolumeData &targetVolume) override
Reconstructs projection data projections into targetVolume and returns true on success.
Definition: artreconstructor.cpp:120
bool isRegularizationEnabled() const
Returns true if use of the regularizer is enabled.
Definition: artreconstructor.cpp:637
static QMetaEnum metaEnum()
QMetaEnum object used to decode/encode subset order enum values.
Definition: artreconstructor.cpp:831
The AbstractProjector class is the abstract base class defining the interfaces for forward projectors...
Definition: abstractprojector.h:68
ARTReconstructor()
Constructs an ARTReconstructor that uses the default forward and backprojector.
Definition: artreconstructor.cpp:56
bool hasAnyStoppingCriterion() const
Returns true if any of the available stopping criteria is enabled.
Definition: artreconstructor.cpp:898
DefaultSubsetGenerator & defaultSubsetGenerator() const
Returns a reference to the default subset generator of this instance.
Definition: artreconstructor.cpp:498
float relaxation() const
Returns the relaxation parameter.
Definition: artreconstructor.cpp:658
void setMinRelativeProjectionError(float minRelativeError, bool enableCriterion=true)
Sets the minimum (relative) projection error to minRelativeError and enables the corresponding stoppi...
Definition: artreconstructor.cpp:327
void setParameter(const QVariant ¶meter) override
Sets the parameters of this instance based on the passed QVariant parameter.
Definition: artreconstructor.cpp:1179
bool isStoppingCriterionEnabled(int criteria) const
Returns true if the stopping criterion criteria is enabled.
Definition: artreconstructor.cpp:648
The AbstractReconstructor class defined the interface for reconstruction types.
Definition: abstractreconstructor.h:163
void configure(const AcquisitionSetup &setup) override
Passes the AcquisitionSetup that describes the setting in which projections that shall be reconstruct...
Definition: artreconstructor.cpp:1094
bool reconstructData(const ProjectionDataView &projections, SpectralVolumeData &targetVolume, AbstractProjector &fp, AbstractReconstructor &bp)
Performs the iterative reconstruction of projections into targetVolume using fp and bp as forward and...
Definition: artreconstructor.cpp:192
void setBackprojector(std::unique_ptr< AbstractReconstructor > projector)
Sets the backprojector to be used to projector.
Definition: artreconstructor.cpp:559
The DefaultSubsetGenerator class is a convenience class combining the capabilities of multiple CTL su...
Definition: defaultsubsetgenerator.h:147
Definition: artreconstructor.h:93
void setMinChangeInVolumeDomain(float minRelativeChange, bool enableCriterion=true)
Sets the minimum (relative) change in volume domain to minRelativeChange and enables the correspondin...
Definition: artreconstructor.cpp:305
Definition: artreconstructor.h:84
float _terminateVolChange
relative change
Definition: artreconstructor.h:197
bool terminateByIterationCount(uint iteration) const
Returns true if iteration is greater or equal to the corresponding stopping criterion value.
Definition: artreconstructor.cpp:1010
void useCustomSubsetGenerator()
Enables the use of the (previously set) custom subset generator.
Definition: artreconstructor.cpp:598
void setMinChangeInProjectionError(float minRelativeChange, bool enableCriterion=true)
Sets the minimum (relative) change in projection domain to minRelativeChange and enables the correspo...
Definition: artreconstructor.cpp:316
The ARTReconstructor class is an implementation of the algebraic reconstruction technique that can ut...
Definition: artreconstructor.h:76
bool terminateByVolumeChange(const VoxelVolume< float > &oldVol, const VoxelVolume< float > &newVol) const
Returns true if newVol and oldVol differ by less than the corresponding stopping criterion value.
Definition: artreconstructor.cpp:910
#define CTL_TYPE_ID(newIndex)
Definition: serializationinterface.h:189
unsigned int uint
Qt style alias for unsigned int.
Definition: modulelayout.h:6
void setNormalEqTolerance(float relativeTol, bool enableCriterion=true)
Sets the minimum (relative) tolerance w.r.t the normal equation to relativeTol and enables the corres...
Definition: artreconstructor.cpp:338
bool stoppingCriterionReached(const VoxelVolume< float > &oldVol, const VoxelVolume< float > &newVol, float oldProjError, float newProjError, float inputProjNorm, float normalEqNormalization, int msSpent, uint iteration) const
Returns true if any of the enabled stopping criteria is hit.
Definition: artreconstructor.cpp:1049
The AbstractSubsetGenerator class is the abstract base class for subset generators.
Definition: abstractsubsetgenerator.h:57
float _terminateProjErrChange
relative change
Definition: artreconstructor.h:198
The SpectralVolumeData class holds voxelized data (for a single material) along with information on i...
Definition: spectralvolumedata.h:40
The ARTReconstructorSFP class is a convenience class that creates an instance of ARTReconstructor wit...
Definition: artreconstructor.h:245
QVariant toVariant() const override
Stores the contents of this instance in a QVariant.
Definition: artreconstructor.cpp:1285
int stoppingCriteria() const
Returns the combination of stopping criteria flags that are currently enabled.
Definition: artreconstructor.cpp:666
void setStoppingCriteria(int criteria)
Sets the stopping criteria to be checked after each iteration to criteria.
Definition: artreconstructor.cpp:468
void setSubsetGenerator(AbstractSubsetGenerator *generator)
Sets the subset generator to be used for subset creation to generator.
Definition: artreconstructor.cpp:519
StoppingCriterion
Definition: artreconstructor.h:82
float _terminateProjErrRel
relative error (wrt. input data)
Definition: artreconstructor.h:199
float _relax
relaxation times number of views in setup (will be divided by subset size)
Definition: artreconstructor.h:195
AbstractVolumeFilter & regularizer() const
Returns a reference to the currently set regularizer.
Definition: artreconstructor.cpp:677
bool terminateByNormalEqTol(const VoxelVolume< float > &oldVol, const VoxelVolume< float > &newVol, float normalization) const
Definition: artreconstructor.cpp:943
void setRelaxationByEstimation(const VoxelVolume< float > &targetVolume, uint nbPowerIter=1u)
Computes an estimation for the relaxation parameter and sets it for this instance.
Definition: artreconstructor.cpp:397
Definition: artreconstructor.h:88
float _terminateNormalEqTol
relative change
Definition: artreconstructor.h:196
void setRegularizationEnabled(bool enabled)
Sets the use of the regularizer to enabled.
Definition: artreconstructor.cpp:362
bool isRelaxationEstimationEnabled() const
Returns true if automatic estimation of a suitable relaxation parameter is enabled.
Definition: artreconstructor.cpp:629
QVariant parameter() const override
Returns the parameters of this instance as a QVariant.
Definition: artreconstructor.cpp:1122
Definition: artreconstructor.h:86
bool isCustomSubsetGeneratorInUse() const
Returns true if a custom subset generator is currently used to create subsets.
Definition: artreconstructor.cpp:506
Definition: artreconstructor.h:91