1 #ifndef CTL_ABSTRACTRECONSTRUCTOR_H 2 #define CTL_ABSTRACTRECONSTRUCTOR_H 4 #include "img/projectiondataview.h" 10 class AbstractDynamicVolumeData;
11 class AcquisitionSetup;
12 class CompositeVolume;
13 class SparseVoxelVolume;
14 class SpectralVolumeData;
15 template <
typename>
class VoxelVolume;
41 void progress(qreal portionCompleted);
45 QMetaObject::Connection _progressConnection;
191 template <class VolumeType>
194 template <class VolumeType>
197 VolumeType& targetVolume);
200 template <class VolumeType,
201 class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::
type>
204 const VolumeType& initialVolume,
207 template <class VolumeType,
208 class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::
type>
211 VolumeType&& initialVolume,
214 template <class VolumeType,
215 class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::
type>
219 const VolumeType& initialVolume,
222 template <class VolumeType,
223 class = typename std::enable_if<!std::is_lvalue_reference<VolumeType>::value>::
type>
227 VolumeType&& initialVolume,
234 void fromVariant(const QVariant& variant) override;
248 VoxelVolume<float>& targetVolume);
251 SpectralVolumeData& targetVolume);
254 CompositeVolume& targetVolume);
257 SparseVoxelVolume& targetVolume);
264 template <
class DynamicVolumeType>
266 DynamicVolumeType& targetVolume)
268 static_assert(std::is_convertible<DynamicVolumeType*, AbstractDynamicVolumeData*>::value,
269 "Method call defaulted to dynamic case, because the passed volume type is not covered " 270 "by any available specialization. Consider explicitly providing the required base type " 271 "(e.g. reconstruct[To]<SpectralVolumeData>()).");
310 template <
class DynamicVolumeType>
313 DynamicVolumeType& targetVolume)
315 static_assert(std::is_convertible<DynamicVolumeType*, AbstractDynamicVolumeData*>::value,
316 "Method call defaulted to dynamic case, because the passed volume type is not covered " 317 "by any available specialization. Consider explicitly providing the required base type " 318 "(e.g. reconstruct[To]<SpectralVolumeData>()).");
327 template <
class VolumeType,
class>
329 const VolumeType& initialVolume,
332 VolumeType ret(initialVolume);
344 template <
class VolumeType,
class>
346 VolumeType&& initialVolume,
349 VolumeType ret(std::move(initialVolume));
361 template <
class VolumeType,
class>
364 const VolumeType& initialVolume,
368 return reconstruct(projections, initialVolume, ok);
374 template <
class VolumeType,
class>
377 VolumeType&& initialVolume,
381 return reconstruct(projections, std::move(initialVolume), ok);
473 template <
typename ReconstructorType,
typename... ConstructorArguments>
474 auto makeReconstructor(ConstructorArguments&&... arguments) ->
475 typename std::enable_if<std::is_convertible<ReconstructorType*, AbstractReconstructor*>::value,
476 std::unique_ptr<ReconstructorType>>::type
478 return std::unique_ptr<ReconstructorType>(
new ReconstructorType(
479 std::forward<ConstructorArguments>(arguments)...));
502 #endif // CTL_ABSTRACTRECONSTRUCTOR_H virtual void setParameter(const QVariant ¶meter)
Sets the parameters of this instance based on the passed QVariant parameter.
Definition: abstractreconstructor.cpp:183
bool reconstructTo(const ProjectionDataView &projections, VolumeType &targetVolume)
Convenience method wrapping up all reconstructToXXX() methods.
void progress(qreal portionCompleted)
Helper class that can emit signals during calculations of a certain reconstructor.
Definition: abstractreconstructor.h:34
std::unique_ptr< ReconstructorNotifier > _notifier
The notifier object used for signal emission.
Definition: abstractreconstructor.h:241
void connectToMessageHandler(bool includeProgress)
Connects this instance's signals to the CTL's MessageHandler.
Definition: abstractreconstructor.cpp:382
bool configureAndReconstructTo(const AcquisitionSetup &setup, const ProjectionDataView &projections, VolumeType &targetVolume)
Combines the calls to configure() and reconstructTo().
void information(QString info)
QVariant toVariant() const override
Stores the contents of this instance in a QVariant.
Definition: abstractreconstructor.cpp:355
The VoxelVolume class provides a simple container for storage of voxelized 3D volume data.
Definition: ctsystemview.h:14
Holds a CTSystem together with the information about the system settings for all views from which pro...
Definition: acquisitionsetup.h:175
virtual ReconstructorNotifier * notifier()
Returns a pointer to the notifier of the reconstructor.
Definition: abstractreconstructor.cpp:315
The ProjectionDataView class is a read-only wrapper for a reference to ProjectionData.
Definition: projectiondataview.h:51
Definition: sparsevoxelvolume.h:14
Specify an interface for de-/serialization from/to QVariants.
Definition: serializationinterface.h:17
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 resu...
virtual bool reconstructToDynamic(const ProjectionDataView &projections, AbstractDynamicVolumeData &targetVolume)
Reconstruct data (in-place) from projections into volume.
Definition: abstractreconstructor.cpp:102
The AbstractReconstructor class defined the interface for reconstruction types.
Definition: abstractreconstructor.h:163
int type() const override
Definition: abstractreconstructor.h:165
void fromVariant(const QVariant &variant) override
Sets the contents of the object based on the QVariant variant.
Definition: abstractreconstructor.cpp:338
The CompositeVolume class is a container to hold multiple volume datasets of any type from the CTL.
Definition: compositevolume.h:108
virtual bool reconstructToSparse(const ProjectionDataView &projections, SparseVoxelVolume &targetVolume)
Reconstruct data (in-place) from projections into volume.
Definition: abstractreconstructor.cpp:141
virtual bool reconstructToPlain(const ProjectionDataView &projections, VoxelVolume< float > &targetVolume)
Reconstruct data (in-place) from projections into volume.
Definition: abstractreconstructor.cpp:59
virtual void configure(const AcquisitionSetup &setup)=0
Configures the reconstructor.
virtual QVariant parameter() const
Returns the parameters of this instance as a QVariant.
Definition: abstractreconstructor.cpp:164
#define CTL_TYPE_ID(newIndex)
Definition: serializationinterface.h:189
The SpectralVolumeData class holds voxelized data (for a single material) along with information on i...
Definition: spectralvolumedata.h:40
virtual bool reconstructToSpectral(const ProjectionDataView &projections, SpectralVolumeData &targetVolume)
Reconstruct data (in-place) from projections into volume.
Definition: abstractreconstructor.cpp:80
Definition: abstractdynamicvolumedata.h:14
virtual bool isApplicableTo(const AcquisitionSetup &setup) const
Returns true if the reconstruction method can be applied to data whose acquisition is described by se...
Definition: abstractreconstructor.cpp:41
virtual bool reconstructToComposite(const ProjectionDataView &projections, CompositeVolume &targetVolume)
Reconstruct data (in-place) from projections into volume.
Definition: abstractreconstructor.cpp:122
void connectNotifierToMessageHandler(bool includeProgress=false)
Connects this instance's notifier to the CTL's MessageHandler.
Definition: abstractreconstructor.cpp:327
Q_REQUIRED_RESULT VolumeType configureAndReconstruct(const AcquisitionSetup &setup, const ProjectionDataView &projections, const VolumeType &initialVolume, bool *ok=nullptr)
Combines the calls to configure() and reconstruct().