![]() |
ImFusion SDK 4.3
|
#include <ImFusion/CT/ConeBeamSimulation.h>
Algorithm for simulating cone-beam X-ray projections from CT volumes. More...
Inheritance diagram for ConeBeamSimulation:Algorithm for simulating cone-beam X-ray projections from CT volumes.
Generates synthetic projection data using forward projection with configurable geometry.
Public Types | |
| enum class | GeometryPreset { None = -1 , HalfScan = 0 , FullScan = 1 , ShortScan = 2 , SingleXRayShot = 3 , BiplanarShot = 4 , EOSScanner = 5 , CArmScanner = 6 , CardiovascularCArmScanner = 7 , SpecialGeometryPreset = 8 } |
| Geometry presets to be simulated. More... | |
| enum class | MotionPreset { None = -1 , NoMotion = 0 , FollowingDetector = 1 , NodAfter25 = 2 , NodAfter50 = 3 , NodAfter75 = 4 , DeviceJitter = 5 , Ramp = 6 , IsoJitter = 7 } |
| Motion presets to be simulated. More... | |
| enum class | Projection { PhotonCount = 0 , LogConvertedAttenuation = 1 } |
| Projection types to be simulated. More... | |
Public Types inherited from Algorithm | |
| enum | Status { Unknown = -1 , Success = 0 , Error = 1 , InvalidInput , IncompleteInput , OutOfMemoryHost , OutOfMemoryGPU , UnsupportedGPU , UnknownAction , AbortedByUser , User = 1000 } |
| Status codes. More... | |
Public Member Functions | |
| ConeBeamSimulation (SharedImage &volume, SharedImageSet *proj=0) | |
| Constructor with reference to volume data and optional projection data pointer. | |
| ~ConeBeamSimulation () override | |
| Destructor. | |
| void | setMotion (int par, vec3i pos, vec3 amp, vec3 ofs, bool jitterMode) |
| Set motion parameters. | |
| const Properties * | motion () const |
| Return configured motion parameters, if available. | |
| const SharedImageSet * | referenceProj () const |
| Return pointer to the projections used as reference. | |
| SharedImage & | volume () |
| Return input volume. | |
| void | clearReferenceProj () |
| Clear the reference projection data. | |
| void | updateProjections (Progress *p=nullptr) |
| Called by compute() and triggered by signals if p_continuousUpdates is true. | |
Public Member Functions inherited from Algorithm | |
| Algorithm () | |
| Default constructor will registers a single "compute" action that calls compute() and returns status(). | |
| virtual void | setProgress (Progress *progress) |
| Sets a Progress interface the algorithm can use to notify observers about its computing progress. | |
| Progress * | progress () const |
| Returns the progress interface if set. | |
| virtual int | status () const |
| Indicates the status of the last call to compute(). | |
| virtual bool | survivesDataDeletion (const Data *) const |
| Indicates whether the algorithm can handle (partial) deletion of the specified data, by default this checks whether the data is in the input list. | |
| const FactoryInfo & | factoryInfo () const |
| Returns the record describing how this Algorithm was instantiated by the AlgorithmFactory. | |
| void | setFactoryInfo (const FactoryInfo &value) |
| Sets the record describing how this Algorithm was instantiated by the AlgorithmFactory. | |
| Status | runAction (const std::string &id) |
Run the action with name id if it exists. | |
| const std::vector< Action > & | actions () |
| Get a mapping from Action id to Action as registered in this algorithm. | |
Public Member Functions inherited from Configurable | |
| virtual void | configureDefaults () |
| Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
| void | registerParameter (ParameterBase *param) |
| Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
| void | unregisterParameter (const ParameterBase *param) |
| Remove the given Parameter or SubProperty from the list of registered parameters. | |
| Configurable (const Configurable &rhs) | |
| Configurable (Configurable &&rhs) noexcept | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Public Member Functions inherited from SignalReceiver | |
| SignalReceiver ()=default | |
| Default constructor. | |
| SignalReceiver (const SignalReceiver &other) | |
| Copy constructor, does not copy any existing signal connections from other. | |
| SignalReceiver & | operator= (SignalReceiver rhs) |
| Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs. | |
| virtual | ~SignalReceiver () |
| Virtual destructor disconnects from all connected signals. | |
Public Attributes | |
| Parameter< GeometryPreset > | p_geometryPreset = {"geometryPreset", GeometryPreset::HalfScan, this} |
| Geometry preset of the projections to be simulated. | |
| Parameter< MotionPreset > | p_motionPreset = {"motionPreset", MotionPreset::NoMotion, this} |
| Motion preset of the projections to be simulated. | |
| Parameter< Projection > | p_projType = {"projType", Projection::PhotonCount, this} |
| Projection type of the projections to be simulated, either log-converted attenuation or photon count projection. | |
| Parameter< int > | p_width = {"width", 0, this} |
| Width of the projections to be simulated. | |
| Parameter< int > | p_height = {"height", 0, this} |
| Height of the projections to be simulated. | |
| Parameter< int > | p_frames = {"frames", 0, this} |
| Number of frames to be simulated. | |
| Parameter< PixelType > | p_dataType = {"dataType", PixelType::Float, this} |
| Image data type to use for simulated images. | |
| Parameter< bool > | p_subtract = {"subtract", false, this} |
| Subtract reference data from simulation. | |
| Parameter< double > | p_scaling = {"scaling", 1.0, this} |
| Global intensity scaling factor. | |
| Parameter< double > | p_i0 = {"i0", 1.0, this} |
| Maximum X-Ray intensity, i.e. air intensity value, or 0 for attenuation data (as GL texture value) | |
| Parameter< bool > | p_addPoissonNoise = {"addPoissonNoise", false, this} |
| Add Poisson noise if photon count projections are simulated (i.e. if p_i0 != 0). | |
| Parameter< bool > | p_physicalUnits = {"physicalUnits", false, this} |
| Whether the input volume should be interpreted as a density map in kg/m^3. | |
| Parameter< bool > | p_streamProj = {"streamProj", false, this} |
| If enabled the simulated frames will always be synced to the CPU after simulation. | |
| Parameter< double > | p_duration = {"duration", 1.0, this} |
| Duration of the motion in seconds. This will set the timestamps of the SharedImageSet accordingly. | |
| Parameter< std::optional< Random::Generator::Seed > > | p_randomSeed = {"randomSeed", std::nullopt, this} |
| Random seed to be used for the random jitter motion. | |
| Parameter< bool > | p_continuousUpdates = {"continuousUpdates", false, this} |
| If set, the last projections created by compute() are updated continuously when the volume/geometry changes. | |
Public Attributes inherited from Algorithm | |
| Signal | signalOutputChanged |
| Signal should be emitted by Algorithms when their output/result has changed. | |
| Signal | signalParametersChanged |
| Signal should be emitted by Algorithms when their parameter configuration has changed. | |
Public Attributes inherited from Configurable | |
| Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Protected Attributes | |
| SharedImage & | m_volume |
| Input volume to simulate from. | |
| SharedImageSet * | m_cbRef = nullptr |
| Reference cone-beam data, not owned. | |
| std::unique_ptr< SharedImageSet > | m_cbOutOwned |
| Output cone-beam data, owned. | |
| SharedImageSet * | m_cbOut = nullptr |
| Output cone-beam data. | |
| ConeBeamGeometry | m_geom |
| Cone-beam geometry information. | |
| std::unique_ptr< Properties > | m_motion |
| Motion configuration. | |
| mat4 | m_initIsoMatrix |
| Initial iso-matrix of the cone beam geometry. | |
| std::unique_ptr< GlFilterSet > | m_filter |
| FilterSet instance for simulation of Poisson noise. | |
Protected Attributes inherited from Algorithm | |
| std::string | m_name |
| Algorithm name. | |
| Progress * | m_progress = nullptr |
| Non-owing pointer to a progress interface. May be a nullptr. | |
| FactoryInfo | m_factoryInfo = {} |
| Record describing how this algorithm was instantiated by the AlgorithmFactory. | |
| int | m_status = Status::Unknown |
| Algorithm status after last call to compute() | |
| std::vector< Action > | m_actions |
| Map of key given by the id of the action, of the available actions of this algorithm. | |
Protected Attributes inherited from Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
| ConeBeamGeometry & | geometry () |
| Access the geometry instance for updating it. | |
Algorithm interface methods | |
| void | compute () override |
| Compute the simulation. | |
| OwningDataList | takeOutput () override |
| Output the simulated data. | |
| void | configure (const Properties *p) override |
| Configure algorithm from properties. | |
| void | configuration (Properties *p) const override |
| Store current algorithm configuration. | |
| static bool | createCompatible (const DataList &data, Algorithm **a=nullptr) |
Additional Inherited Members | |
Static Public Member Functions inherited from Algorithm | |
| static bool | createCompatible (const DataList &data, Algorithm **a=nullptr) |
| Factory function to check algorithm compatibility with input data and optionally instantiate it. | |
Protected Member Functions inherited from Algorithm | |
| void | loadDefaults () |
| void | registerAction (const std::string &id, const std::string &guiName, const std::function< Algorithm::Status(void)> &action) |
| Register an action to be run via runAction. | |
| template<typename D> | |
| void | registerAction (const std::string &id, const std::string &guiName, Algorithm::Status(D::*action)(void)) |
| Template version of runAction that can be used with a pointer to a member function. | |
| void | registerAction (const Action &action) |
| Register an action. | |
Protected Member Functions inherited from SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
|
strong |
Geometry presets to be simulated.
|
strong |
Motion presets to be simulated.
| Enumerator | |
|---|---|
| None | None. |
| NoMotion | No motion. |
| FollowingDetector | Following detector motion. |
| NodAfter25 | Nod motion after 25%. |
| NodAfter50 | Nod motion after 50%. |
| NodAfter75 | Nod motion after 75%. |
| DeviceJitter | Device jitter motion. |
| Ramp | Ramp motion. |
| IsoJitter | Iso-jitter motion. |
|
strong |
Projection types to be simulated.
| Enumerator | |
|---|---|
| PhotonCount | Photon count projection. |
| LogConvertedAttenuation | Log-converted attenuation projection. |
| void setMotion | ( | int | par, |
| vec3i | pos, | ||
| vec3 | amp, | ||
| vec3 | ofs, | ||
| bool | jitterMode ) |
Set motion parameters.
| par | 0 if motion shall be disabled, 1-3 for translation, 4-6 for rotation parameter |
| pos | frame number at start, turning point and end of motion |
| amp | amplitude of motion at start, turning point and end of motion (in mm or degrees) |
| ofs | rotation offset in case of a rotation parameter |
| jitterMode | jitter motion if true, otherwise ramp motion |
Create cone-beam simulation algorithm instance
|
overridevirtual |
Compute the simulation.
Implements Algorithm.
|
overridevirtual |
Output the simulated data.
Reimplemented from Algorithm.
|
overridevirtual |
Configure algorithm from properties.
Reimplemented from Configurable.
|
overridevirtual |
Store current algorithm configuration.
Reimplemented from Configurable.
| Parameter<bool> p_continuousUpdates = {"continuousUpdates", false, this} |
If set, the last projections created by compute() are updated continuously when the volume/geometry changes.
This is achieved by listening to the signalChanged signal on the volume, or is triggered by the controller using the updateProjections() function