ImFusion SDK 4.3
SweepCalibrator Class Reference

#include <ImFusion/US/SweepCalibrator.h>

Calibrates UltrasoundSweep instances given a SweepCalibrationData. More...

+ Inheritance diagram for SweepCalibrator:

Detailed Description

Calibrates UltrasoundSweep instances given a SweepCalibrationData.

Use setForceNoProbeNames to ignore the probe and tracker names in the UltrasoundSweep and use empty names. Call calibrate with an UltrasoundSweep to apply a calibration from the SweepCalibrationData. When calibrating, if there is no exact match using the ProbeTrackerPair associations in the SweepCalibrationData, a default value identified by the "*-TrackingInstrumentName" string will also be looked for. This mechanism allows a TrackingStream to pass a value for the calibration to be used with any ImageStream via an InstrumentCalibrationDataComponent.

See also
SweepCalibrationData, SweepCalibrationDataIO

Public Member Functions

void setCalibrationData (SweepCalibrationData calibData)
 Sets a new SweepCalibrationData for the SweepCalibrator to use.
 
SweepCalibrationDatacalibrationData ()
 Returns the SweepCalibrationData.
 
bool loadCalibrationData (const Filesystem::Path &path)
 Loads the calibration data from the given path, stores the path for reference.
 
void clearCalibrationDataPath ()
 Clears the calibration data path.
 
std::optional< Filesystem::PathcalibrationDataPath ()
 Returns the calibration data path if loadCalibrationData() has been called before or it has been configured with a file path.
 
void addTipOfProbeCalibration (const mat4 &mat, std::string probeName="")
 Add a calibration matrix expressed w.r.t.
 
void addTipOfProbeCalibration (const UltrasoundSweep *us)
 Add a calibration matrix expressed w.r.t.
 
std::optional< mat4 > tipOfProbeCalibration (std::string probeName="") const
 Returns, if available for the given probe name, a calibration matrix expressed w.r.t.
 
void removeCalibrationData (std::string probeName)
 Remove an existing calibration.
 
void renameCalibrationData (const std::string &oldProbeName, const std::string &newProbeName)
 Rename an existing calibration.
 
bool calibrate (UltrasoundSweep &sweep, const ProbeTrackerPair &probeTracker)
 Computes a calibration matrix given the sweep's current frame geometry offset.
 
bool calibrate (UltrasoundSweep *sweep)
 Computes a calibration matrix given the sweep's current frame geometry offset.
 
void setForceNoProbeNames (bool flag)
 Set if the calibrator should ignore the probe names and use always the default calibration, i.e. empty string.
 
bool forcesNoProbeNames () const
 
int calibrationDataCount (std::string probeName="") const
 Returns number of known calibration data.
 
std::vector< std::stringknownProbes ()
 Returns list of known probe names.
 
bool hasCalibrationFor (UltrasoundSweep &sweep)
 Returns if there is a matching calibration for the sweep.
 
void configure (const Properties *p) override
 Set the calibration data from Properties.
 
void configuration (Properties *p) const override
 Retrieve the calibration data.
 
- 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.
 

Static Public Member Functions

static std::optional< ProbeTrackerPairfindProbeTrackerPair (const UltrasoundSweep &us)
 Returns pair of probe name and main tracking instrument name Returns empty optional if there is no main tracking instrument.
 
static ProbeTrackerPair findProbeTrackerPair (const UltrasoundSweep &us, const TrackingSequence &ts)
 Returns pair of probe name and main tracking instrument name ProbeTrackerPair internal values might be empty, if no names were found.
 
static std::string findProbeName (const UltrasoundSweep &us)
 Concatenates probe name and main tracking instrument name, separated by dash.
 
static std::string findProbeName (const UltrasoundSweep &us, const TrackingSequence &ts)
 Concatenates probe name and tracking instrument name, separated by dash.
 
static double findDepth (const UltrasoundSweep *us)
 Extracts image depth from frame geometry, ultrasound metadata, or raw image height (in that order)
 
static mat4 convertImageCenterToTipOfProbe (mat4 center, const FrameGeometry &fg, double legacyDepth, double currentDepth)
 Converts an image center matrix to a tip of probe matrix, from a legacy depth and a new depth.
 
static mat4 convertImageCenterToTipOfProbe (mat4 center, const FrameGeometry &fg)
 Converts an image center matrix to a tip of probe matrix.
 
static mat4 convertTipOfProbeToImageCenter (mat4 tipOfProbe, const FrameGeometry &fg)
 Converts a tip of probe matrix to an image center matrix.
 

Public Attributes

Signal< SweepCalibrator * > signalCalibrationDataChanged
 Emitted when a calibration is added or removed.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 

Additional Inherited Members

- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Function Documentation

◆ addTipOfProbeCalibration() [1/2]

void addTipOfProbeCalibration ( const mat4 & mat,
std::string probeName = "" )

Add a calibration matrix expressed w.r.t.

the tip of the US probe (i.e. NOT the image center). An already existing matrix is replaced.

Deprecated
"Use calibrationData() with ProbeTrackerPair instead"

◆ addTipOfProbeCalibration() [2/2]

void addTipOfProbeCalibration ( const UltrasoundSweep * us)

Add a calibration matrix expressed w.r.t.

the tip of the US probe using the given sweep's current calibration, frame geometry offset and probe name. The probe name is extracted using findProbeName(), see above. An already existing matrix is replaced.

Deprecated
"Use calibrationData() with ProbeTrackerPair instead"

◆ tipOfProbeCalibration()

std::optional< mat4 > tipOfProbeCalibration ( std::string probeName = "") const

Returns, if available for the given probe name, a calibration matrix expressed w.r.t.

the tip of the US probe (i.e. NOT the image center).

Deprecated
"Use calibrationData() with ProbeTrackerPair instead"

◆ removeCalibrationData()

void removeCalibrationData ( std::string probeName)

Remove an existing calibration.

Deprecated
"Use calibrationData() with ProbeTrackerPair instead"

◆ renameCalibrationData()

void renameCalibrationData ( const std::string & oldProbeName,
const std::string & newProbeName )

Rename an existing calibration.

Deprecated
"Use calibrationData() with ProbeTrackerPair instead"

◆ calibrate() [1/2]

bool calibrate ( UltrasoundSweep & sweep,
const ProbeTrackerPair & probeTracker )

Computes a calibration matrix given the sweep's current frame geometry offset.

The given ProbeTrackerPair will be used to pick the calibration from the SweepCalibrationData

◆ calibrate() [2/2]

bool calibrate ( UltrasoundSweep * sweep)

Computes a calibration matrix given the sweep's current frame geometry offset.

The probe name used for the look-up is extracted using findProbeName(), see above.

◆ calibrationDataCount()

int calibrationDataCount ( std::string probeName = "") const

Returns number of known calibration data.

Deprecated
"Use calibrationData() with ProbeTrackerPair instead"

◆ knownProbes()

std::vector< std::string > knownProbes ( )

Returns list of known probe names.

Deprecated
"Use calibrationData() with ProbeTrackerPair instead"

◆ configure()

void configure ( const Properties * p)
overridevirtual

Set the calibration data from Properties.

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Retrieve the calibration data.

Reimplemented from Configurable.


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