ImFusion C++ SDK 4.4.0
ImFusion::InstrumentCalibrationDataComponent Class Reference

#include <ImFusion/Stream/InstrumentCalibrationDataComponent.h>

DataComponent storing calibration information for TrackingInstruments. More...

Inheritance diagram for ImFusion::InstrumentCalibrationDataComponent:

Detailed Description

DataComponent storing calibration information for TrackingInstruments.

This component stores both spatial and temporal calibration data for tracking instruments, mapping the relationship between tracking sensor positions and the actual tool/image coordinate systems.

Each calibration consists of:

  • Spatial calibration: A 4x4 transformation matrix from tracker space to tool/image space
  • Temporal calibration: Time offset in seconds to compensate for latency

Calibrations are stored per instrument, identified by the instrument's unique ID string. Multiple instruments can have different calibrations within a single component.

Example usage:

// Get or create the calibration component
auto& calib = trackingStream->components().getOrCreate<InstrumentCalibrationDataComponent>();
// Set spatial calibration for an instrument
mat4 calibMatrix = ...; // Tool tip calibration matrix
calib.setCalibration("probe-1", calibMatrix, 0.05); // 50ms temporal offset
// Retrieve calibration
if (auto cal = calib.calibration("probe-1"))
{
mat4 spatial = cal->spatial;
double temporal = cal->temporal;
}
See also
TrackingStream, TrackingStreamProperties

Classes

struct  Calibration
 Calibration data for a single instrument. More...

Public Member Functions

bool operator== (const InstrumentCalibrationDataComponent &other) const
std::string id () const override
 Returns a unique string identifier for this type of data component.
std::optional< Calibrationcalibration (const std::string &instrumentID) const
 Retrieves the calibration for a specific instrument.
const std::map< std::string, Calibration > & calibrations () const
 Returns all stored calibrations as a map from instrument ID to calibration data.
void setCalibration (const std::string &instrumentID, const mat4 &spatial, double temporal=0.0)
 Sets the calibration for a specific instrument using separate spatial and temporal values.
void setCalibration (const std::string &instrumentID, const Calibration &calib)
 Sets the calibration for a specific instrument using a Calibration struct.
virtual void configure (const Properties *) override
 Configure this object instance by de-serializing the given Properties.
virtual void configuration (Properties *) const override
 Serialize the current object configuration into the given Properties object.
Public Member Functions inherited from ImFusion::DataComponent< InstrumentCalibrationDataComponent >
std::unique_ptr< DataComponentBase > clone () const override
 Creates a clone of this data component.
std::unique_ptr< Subclass > cloneDerived () const
bool assign (const DataComponentBase &other) override
 Assigns the content of other to this data component.
bool equals (const DataComponentBase &other) const override
 Compares this data component to other for equality.
Public Member Functions inherited from ImFusion::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 Attributes

Signal< const std::string &, const Calibration & > calibrationChanged
 Emits the instrument ID and new calibration when a calibration is modified.
Public Attributes inherited from ImFusion::Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.

Additional Inherited Members

Protected Member Functions inherited from ImFusion::DataComponentBase
 DataComponentBase (const DataComponentBase &)=default
DataComponentBase & operator= (const DataComponentBase &other)=default
Protected Attributes inherited from ImFusion::Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.

Member Function Documentation

◆ id()

std::string ImFusion::InstrumentCalibrationDataComponent::id ( ) const
inlineoverridevirtual

Returns a unique string identifier for this type of data component.

Note
To avoid conflicts make sure to include potential plugin names into this ID. Due to the modular architecture of the ImFusion library, uniqueness of IDs cannot be checked at compile time. However, DataComponentFactory will check the uniqueness of the ID during registration.

Implements ImFusion::DataComponentBase.

◆ calibration()

std::optional< Calibration > ImFusion::InstrumentCalibrationDataComponent::calibration ( const std::string & instrumentID) const

Retrieves the calibration for a specific instrument.

Returns the calibration if found, or std::nullopt if none exists for this instrument.

◆ setCalibration() [1/2]

void ImFusion::InstrumentCalibrationDataComponent::setCalibration ( const std::string & instrumentID,
const mat4 & spatial,
double temporal = 0.0 )

Sets the calibration for a specific instrument using separate spatial and temporal values.

Overwrites existing calibration if present.

◆ setCalibration() [2/2]

void ImFusion::InstrumentCalibrationDataComponent::setCalibration ( const std::string & instrumentID,
const Calibration & calib )

Sets the calibration for a specific instrument using a Calibration struct.

Overwrites existing calibration if present.

◆ configure()

virtual void ImFusion::InstrumentCalibrationDataComponent::configure ( const Properties * p)
overridevirtual

Configure this object instance by de-serializing the given Properties.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configuration() for the inverse functionality

Reimplemented from ImFusion::Configurable.

◆ configuration()

virtual void ImFusion::InstrumentCalibrationDataComponent::configuration ( Properties * p) const
overridevirtual

Serialize the current object configuration into the given Properties object.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configure() for the inverse functionality

Reimplemented from ImFusion::Configurable.


The documentation for this class was generated from the following file:
  • ImFusion/Stream/InstrumentCalibrationDataComponent.h
Search Tab / S to search, Esc to close