ImFusion SDK 4.3
ConeBeamSimulation Class Reference

#include <ImFusion/CT/ConeBeamSimulation.h>

Algorithm for simulating cone-beam X-ray projections from CT volumes. More...

+ Inheritance diagram for ConeBeamSimulation:

Detailed Description

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 Propertiesmotion () const
 Return configured motion parameters, if available.
 
const SharedImageSetreferenceProj () const
 Return pointer to the projections used as reference.
 
SharedImagevolume ()
 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.
 
Progressprogress () 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 FactoryInfofactoryInfo () 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
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (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.
 
SignalReceiveroperator= (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< GeometryPresetp_geometryPreset = {"geometryPreset", GeometryPreset::HalfScan, this}
 Geometry preset of the projections to be simulated.
 
Parameter< MotionPresetp_motionPreset = {"motionPreset", MotionPreset::NoMotion, this}
 Motion preset of the projections to be simulated.
 
Parameter< Projectionp_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< PixelTypep_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

SharedImagem_volume
 Input volume to simulate from.
 
SharedImageSetm_cbRef = nullptr
 Reference cone-beam data, not owned.
 
std::unique_ptr< SharedImageSetm_cbOutOwned
 Output cone-beam data, owned.
 
SharedImageSetm_cbOut = nullptr
 Output cone-beam data.
 
ConeBeamGeometry m_geom
 Cone-beam geometry information.
 
std::unique_ptr< Propertiesm_motion
 Motion configuration.
 
mat4 m_initIsoMatrix
 Initial iso-matrix of the cone beam geometry.
 
std::unique_ptr< GlFilterSetm_filter
 FilterSet instance for simulation of Poisson noise.
 
- Protected Attributes inherited from Algorithm
std::string m_name
 Algorithm name.
 
Progressm_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< Actionm_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< Paramm_params
 List of all registered Parameter and SubProperty instances.
 
ConeBeamGeometrygeometry ()
 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.
 

Member Enumeration Documentation

◆ GeometryPreset

enum class GeometryPreset
strong

Geometry presets to be simulated.

Enumerator
None 

None.

HalfScan 

Half-rotation scan mode.

FullScan 

Full-rotation scan mode.

ShortScan 

Short scan mode.

SingleXRayShot 

Single X-ray shot (AP shot at 180 degrees)

BiplanarShot 

Biplanar shot (AP shot at 180 degrees, LAT shot at 270 degrees)

EOSScanner 

EOS scanner.

CArmScanner 

C-Arm scanner.

CardiovascularCArmScanner 

Cardiovascular C-Arm canner.

SpecialGeometryPreset 

See the source file for more details.

◆ MotionPreset

enum class MotionPreset
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.

◆ Projection

enum class Projection
strong

Projection types to be simulated.

Enumerator
PhotonCount 

Photon count projection.

LogConvertedAttenuation 

Log-converted attenuation projection.

Member Function Documentation

◆ setMotion()

void setMotion ( int par,
vec3i pos,
vec3 amp,
vec3 ofs,
bool jitterMode )

Set motion parameters.

Parameters
par0 if motion shall be disabled, 1-3 for translation, 4-6 for rotation parameter
posframe number at start, turning point and end of motion
ampamplitude of motion at start, turning point and end of motion (in mm or degrees)
ofsrotation offset in case of a rotation parameter
jitterModejitter motion if true, otherwise ramp motion

◆ createCompatible()

static bool createCompatible ( const DataList & data,
Algorithm ** a = nullptr )
static

Create cone-beam simulation algorithm instance

◆ compute()

void compute ( )
overridevirtual

Compute the simulation.

Implements Algorithm.

◆ takeOutput()

OwningDataList takeOutput ( )
overridevirtual

Output the simulated data.

Reimplemented from Algorithm.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Configure algorithm from properties.

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Store current algorithm configuration.

Reimplemented from Configurable.

Member Data Documentation

◆ p_continuousUpdates

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


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close