ImFusion SDK 4.3
GatingMetadata Class Reference

#include <ImFusion/Base/GatingMetadata.h>

Metadata allowing to perform gating operations on periodic datasets acquired over time. More...

+ Inheritance diagram for GatingMetadata:

Detailed Description

Metadata allowing to perform gating operations on periodic datasets acquired over time.

Public Member Functions

bool operator== (const GatingMetadata &other) const
 
std::string id () const override
 Returns a unique string identifier for this type of data component.
 
bool hasPhase (int numFrames) const
 Retruns true, of there are as many phase signal entries as desired.
 
bool hasSimilarity (int numFrames) const
 Returns true if there are as many similarity signal entries as desired.
 
bool hasPeriodicSimilarityMinima (int numFrames) const
 Returns true if there are as many similarity minimum signal entries as desired.
 
double phase (int frameIdx) const
 Returns the phase signal for a given frame, taking the phase offset into account.
 
int indexClosestToPhase (int startingIndex, double phase)
 Returns the frame index that is closest to startingIndex and matches the given phase.
 
int referenceIndex (int frameIdx, int referenceSequenceSize) const
 Returns the index of that element of a reference sequence that corresponds to the given frame, taking the phase offset into account.
 
- Public Member Functions inherited from DataComponent< GatingMetadata >
std::unique_ptr< DataComponentBaseclone () const override
 Creates a clone of this data component.
 
std::unique_ptr< SubclasscloneDerived () 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 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
 

Static Public Member Functions

static int referenceIndex (double currentPhase, int referenceSequenceSize)
 Returns the index of that element of a reference sequence that corresponds to the given phase.
 

Public Attributes

double m_phaseOffset = 0.
 Phase offset in the interval [0,1] to adjust to a reference dataset.
 
double m_averagePeriod = 0.
 Average period, i.e. number of frames until motion repeats.
 
int m_bandSize = 0
 Size of the similarity band used when computing this gating data.
 
bool m_usedShiftCorrection = false
 Whether shift correction was used when computing this gating data.
 
std::vector< double > m_phaseSignal
 Phase signal for each frame in the interval [0,1] (ramp).
 
std::vector< double > m_similaritySignal
 Similarity of each frame its close neighboursm in [0,1].
 
std::vector< double > m_similaritySignalNormalized
 The content of m_similaritySignal, normalized and de-trended.
 
std::vector< double > m_isPeriodicSimilarityMinimum
 Value of 1 for each frame index that we expect to be a minimum point of the local similarity, i.e.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
void configure (const Properties *p) override
 \ Name Configurable Interface
 
void configuration (Properties *p) const override
 Serialize the current object configuration into the given Properties object.
 

Additional Inherited Members

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

Member Function Documentation

◆ id()

std::string id ( ) const
overridevirtual

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 DataComponentBase.

◆ configure()

void configure ( const Properties * p)
overridevirtual

\ Name Configurable Interface

Reimplemented from Configurable.

◆ configuration()

void 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 Configurable.

◆ phase()

double phase ( int frameIdx) const

Returns the phase signal for a given frame, taking the phase offset into account.

Parameters
frameIdxFrame for phase signal look-up.
Returns
Phase in the interval [0,1] for valid phase information, -1 otherwise.

◆ referenceIndex() [1/2]

int referenceIndex ( int frameIdx,
int referenceSequenceSize ) const

Returns the index of that element of a reference sequence that corresponds to the given frame, taking the phase offset into account.

Parameters
frameIdxFrame for phase signal look-up, e.g. US frame the gating information belongs to.
referenceSequenceSizeNumber of reference images to map to, e.g. size of 4D CT.
Returns
Returns an index in the interval [0,referenceSequenceSize-1] for valid phase information, -1 otherwise.

Important: This method assumes that the reference sequence contains exactly one full cycle. If there are less or more images contained in it, the normalization factor referenceSequenceSize needs to be adjusted accordingly.

This method uses phase() to compute the phase signal for the given frame.

◆ referenceIndex() [2/2]

static int referenceIndex ( double currentPhase,
int referenceSequenceSize )
static

Returns the index of that element of a reference sequence that corresponds to the given phase.

Parameters
currentPhasePhase signal in the interval [0,1]
referenceSequenceSizeNumber of reference images to map to, e.g. size of 4D CT.
Returns
Returns an index in the interval [0,referenceSequenceSize-1] for valid phase information, -1 otherwise.

Member Data Documentation

◆ m_phaseSignal

std::vector<double> m_phaseSignal

Phase signal for each frame in the interval [0,1] (ramp).

Values are computed by convolving the similarity matrix with a kernel taken around the current frame. This approach mostly matches via the duration of the oscillation pattern and will become unreliable if that changes significantly within 1 period. Noise tolerance is rather high though.

◆ m_similaritySignal

std::vector<double> m_similaritySignal

Similarity of each frame its close neighboursm in [0,1].

Computes the average similarity with the m_averagePeriod/2 closest frames once before and once after the frame in question. Value supplied here is the higher of those 2 directional values. This choice was made because changes in visible anatomy not causes by the periodic motion will usually decrease the similarity value, so higher direction should be cleaner. There are no additional assumptions about the signal shape, in particular the result stays valid under rapid changes in oscillation frequency. Drawback: Noise in the input data is translated directly to noise in this curve.

◆ m_similaritySignalNormalized

std::vector<double> m_similaritySignalNormalized

The content of m_similaritySignal, normalized and de-trended.

Normalization is performed by forcing the signal at the similarity minima positions in m_isPeriodicSimilarityMinimum to zero. Each individual interval between a neighbouring pair of such minima is then normalized to reach a maximum of 0. Reliability of the result depends on m_isPeriodicSimilarityMinimum, if that signal is off individual values may end up < 0.

◆ m_isPeriodicSimilarityMinimum

std::vector<double> m_isPeriodicSimilarityMinimum

Value of 1 for each frame index that we expect to be a minimum point of the local similarity, i.e.

the frame that is most different to all other frames within half a cycle. These typically mark events that are rare in the periodic motion, i.e. the short inhale in a breathing cycle. All other frames have a value of 0. Computed by taking the average similarity with the m_averagePeriod/2 closest frames once before and once after the frame in question. Then all points where the smoothed versions of both of the resulting curves have a local minimum are considered as candidates for these events. This is based on the assumption that the similarity change caused by external factors like probe movement does not completely compensate the loss due to the periodic tissue movement. Candidate rejection in case of clustering and filling of areas without candidates is performed by extrapolating safe candidates using m_averagePeriod. As such the resulting peaks may be slightly off in areas where the similarity contribution from tissue movement is weak and the period changes.


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