![]() |
ImFusion C++ SDK 4.5.0
|
#include <ImFusion/LiveUS/UltrasoundCalibrationWizardAlgorithm.h>
Back-end algorithm for the UltrasoundCalibrationWizard. More...
Back-end algorithm for the UltrasoundCalibrationWizard.
It guides the user in estimating the calibration matrix for an ultrasound probe and tracker pair. This class also holds the data that the user is capturing as they advance through the wizard. From an input image and tracking stream, a set of motions are recorded. An initial calibration is computed from the input motions. Then the user has to disambiguate the flip of the ultrasound probe. Finally two perpendicular sweeps are recorded and a final calibration is computed.
Classes | |
| struct | CalibrationData |
| Holds the TrackingSequence and UltrasoundSweep that the user is capturing throughout the wizard. More... | |
Public Member Functions | |
| UltrasoundCalibrationWizardAlgorithm (ImageStream *image, TrackingStream *tracking) | |
| Takes in an image stream and a tracking stream to use as input data for the calibration. | |
| UltrasoundCalibrationWizardAlgorithm (ImageStream *image, TrackingStream *tracking, const std::vector< SharedImageSet * > &images) | |
| Takes in an image stream and a tracking stream to use as input data for the calibration. | |
| void | compute () override |
| Computes the calibration from the input data and applies it. | |
| LiveSweepRecordingVisualizationAlgorithm * | liveUS () |
| UltrasoundCalibrationWizardAlgorithm::CalibrationData & | data () |
| ImageStream * | imageStream () |
| TrackingStream * | trackingStream () |
| SweepRecorderAlgorithm * | makeRecorder () |
| void | startRecording () |
| Starts recording the input streams. | |
| std::unique_ptr< UltrasoundSweep > | stopRecording () |
| Stops recording the input streams, generates an UltrasoundSweep from them. | |
| void | setMainInstrument (int index) |
| Sets the main instrument to record. | |
| std::vector< TrackingInstrument > | devices () |
| Returns the tracking instruments in the input streams. | |
| bool | isRecording () const |
| Returns if the recorder is currently recording. | |
| void | flipCoordinates (bool flip) |
| Flips the assumed US image horizontal orientation. | |
| void | initializeCalibration () |
| Initializes the calibration of the live sweep from the input directions. | |
| void | calibrate (Progress *progress=nullptr) |
| Runs the calibration process with a Progress. | |
| void | calibrateRecordedData () |
| Applies the initial calibration on the recorded data. | |
| mat4 | calibratedPose () |
| Returns the calibrated tracker pose. | |
| mat4 | trackerPose () |
| Returns the tracker pose without any calibration. | |
| mat4 | calibrationMatrix () |
| Returns the initial calibration matrix. | |
| bool | setForward (std::unique_ptr< TrackingSequence > ts) |
| Sets the forward motion tracking sequence. | |
| bool | setSide (std::unique_ptr< TrackingSequence > ts) |
| Sets the side motion tracking sequence. | |
| void | clearSide () |
| Clears the side motion tracking sequence. | |
| bool | setRoll (std::unique_ptr< TrackingSequence > ts) |
| Sets the roll motion tracking sequence. | |
| bool | setPitch (std::unique_ptr< TrackingSequence > ts) |
| Sets the pitch motion tracking sequence. | |
| bool | setYaw (std::unique_ptr< TrackingSequence > ts) |
| Sets the yaw motion tracking sequence. | |
| void | clearRollPitchYaw () |
| Clears all roll, pitch and yaw tracking sequences. | |
| void | setForwardSweep (std::unique_ptr< UltrasoundSweep > sweep) |
| Sets the forward ultrasound sweep. | |
| void | setSideSweep (std::unique_ptr< UltrasoundSweep > sweep) |
| Sets the side ultrasound sweep. | |
| std::optional< vec3 > | forwardAxisWorld () |
| std::optional< vec3 > | sideAxisWorld () |
| Side vector wrt to world. | |
| std::optional< vec3 > | upAxisWorld () |
| Up vector wrt to world. | |
| mat3 | surfaceOrientation () |
| Returns the surface orientation where the horizontal plane would be. | |
| OwningDataList | takeOutput () override |
| Return any new Data that was created by the Algorithm during the last call to compute(). | |
| Public Member Functions inherited from ImFusion::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 ImFusion::Configurable | |
| virtual void | configure (const Properties *p) |
| Configure this object instance by de-serializing the given Properties. | |
| virtual void | configuration (Properties *p) const |
| Serialize the current object configuration into the given Properties object. | |
| 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 ImFusion::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. | |
Static Public Member Functions | |
| static bool | createCompatible (const DataList &data, Algorithm **a=nullptr) |
| Static Public Member Functions inherited from ImFusion::Algorithm | |
| static bool | createCompatible (const DataList &data, Algorithm **a=nullptr) |
| Factory function to check algorithm compatibility with input data and optionally instantiate it. | |
Public Attributes | |
| Signal< const TrackingSequence * > | recordingChanged |
| Emitted when a recording has been taken. | |
| Signal< const TrackingInstrument * > | trackingInstrumentChanged |
| Emitted when a tracking instrument changes. | |
| Public Attributes inherited from ImFusion::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 ImFusion::Configurable | |
| Signal | signalParametersChanged |
| Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Additional Inherited Members | |
| Public Types inherited from ImFusion::Algorithm | |
| enum | Status { Unknown = -1 , Success = 0 , Error = 1 , InvalidInput , IncompleteInput , OutOfMemoryHost , OutOfMemoryGPU , UnsupportedGPU , UnknownAction , AbortedByUser , User = 1000 } |
| Status codes. More... | |
| Protected Member Functions inherited from ImFusion::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 ImFusion::SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
| Protected Attributes inherited from ImFusion::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 ImFusion::Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
|
explicit |
Takes in an image stream and a tracking stream to use as input data for the calibration.
Additionally images can be passed in containing front, side, roll, pitch, yaw and optionally two sweeps
|
overridevirtual |
Computes the calibration from the input data and applies it.
Implements ImFusion::Algorithm.
| void ImFusion::US::UltrasoundCalibrationWizardAlgorithm::calibrate | ( | Progress * | progress = nullptr | ) |
Runs the calibration process with a Progress.
Takes the initial calibration from the input directions, and runs the calibration on the input sweeps Applies the calibration on the live sweep and sets the InstrumentCalibrationDataComponent in the input tracking stream
|
overridevirtual |
Return any new Data that was created by the Algorithm during the last call to compute().
The default implementation will return an empty list.
Reimplemented from ImFusion::Algorithm.