![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/GatingMetadata.h>
Metadata allowing to perform gating operations on periodic datasets acquired over time. More...
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. | |
![]() | |
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. | |
![]() | |
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 |
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. | |
![]() | |
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 | |
![]() | |
DataComponentBase (const DataComponentBase &)=default | |
DataComponentBase & | operator= (const DataComponentBase &other)=default |
![]() | |
std::vector< Param > | m_params |
List of all registered Parameter and SubProperty instances. | |
|
overridevirtual |
Returns a unique string identifier for this type of data component.
Implements DataComponentBase.
|
overridevirtual |
\ Name Configurable Interface
Reimplemented from Configurable.
|
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.
Reimplemented from Configurable.
double phase | ( | int | frameIdx | ) | const |
Returns the phase signal for a given frame, taking the phase offset into account.
frameIdx | Frame for phase signal look-up. |
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.
frameIdx | Frame for phase signal look-up, e.g. US frame the gating information belongs to. |
referenceSequenceSize | Number of reference images to map to, e.g. size of 4D CT. |
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.
|
static |
Returns the index of that element of a reference sequence that corresponds to the given phase.
currentPhase | Phase signal in the interval [0,1] |
referenceSequenceSize | Number of reference images to map to, e.g. size of 4D CT. |
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.
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.
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.
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.