msqms.qc.msqm module#
MEG quality assessment based on MEG Signal Quality Metrics(MSQMs)
Summary#
Classes:#
MEG Signal Quality Metrics (MSQMs) for assessing the quality of MEG signals. |
Reference#
- class msqms.qc.msqm.MSQM(raw, data_type, origin_raw=None, n_jobs=-1, verbose=False)[source]#
Bases:
objectMEG Signal Quality Metrics (MSQMs) for assessing the quality of MEG signals.
- get_quality_references()[source]#
Load quality reference values based on the MEG data type.
- Return type:
Dict- Returns:
A dictionary containing the quality reference values.
- Return type:
dict
- get_configure()[source]#
Load configuration parameters from configuration file[conf folder].
- Return type:
Dict- Returns:
A dictionary containing the configuration parameters.
- Return type:
dict
- compute_single_metric(metric_score, metric_name, method)[source]#
Calculate a single quality metric score based on the reference range.
- Parameters:
metric_score (float) – The score of the quality metric.
metric_name (str) – The name of the metric.
method (str) – Method for range calculation (‘iqr’ or ‘sigma’).
- Returns:
A dictionary containing the calculated quality score and related metadata.
- Return type:
dict
- calculate_category_score(metrics_df, method)[source]#
Calculate average scores for each metric category.
- Parameters:
metrics_df (pd.DataFrame) – DataFrame containing metrics.
method (str) – Method for score calculation (‘iqr’ or ‘sigma’).
- Returns:
A dictionary with category scores and detailed metric scores.
- Return type:
dict
- compute_msqm_score()[source]#
Compute the MSQM score based on metric categories.
- Returns:
dict – The computed MSQM score and detailed scores for each category.
# For example,
# compute the msqm score and obtain the reference values & hints[↑↓✔]
# “msqm_score” (98,)
# “S” ({“lower_bound”,”upper_bound,”hint”:”✔”})
# “I” ({“score”:0.9,”value”:10e-12,”lower_bound”:,”upper_bound,”hints”:”↓”})