MEG Signal Quality Metrics (MSQMs) is a fully automated quality control tool for OPM-MEG and SQUID-MEG.
pip install msqmsThe new msqms_summary command is used to generate summary quality control reports for multiple MEG files. This command automatically traverses all matching files in the specified directory.
msqms_summary -i ./data -o ./reports -t opm-i, --input: Input directory path (required, contains the directory with MEG files)-s, --suffix: File suffix (optional, default is '.fif', e.g., '.fif', '.ds')-o, --outdir: Output directory (required, default is the current directory)-t, --data_type: Data type (required, choices are 'opm' or 'squid')-n, --report_name: Summary report filename (optional, default is 'summary_report')-r, --recursive: Recursively search subdirectories (optional flag)
msqms_summary -i ./data -o ./quality_reports -t opm# Process .ds files
msqms_summary -i ./data -s .ds -o ./output -t squid
# Process .fif files (explicitly specified)
msqms_summary -i ./data -s .fif -o ./output -t opm# Recursively search for all .fif files in subdirectories
msqms_summary -i ./data -r -o ./reports -t opmmsqms_summary -i ./data -o ./output -t opm -n my_summary_report# Recursively search for all .fif files and generate a custom-named summary report
msqms_summary -i /path/to/meg/data -r -s .fif -o /path/to/output -t opm -n batch_quality_reportAfter executing the command, the following will be generated:
- Summary Report:
{report_name}.html- Contains statistical information and visual charts for all files - Individual Reports: Each file will generate a corresponding
{filename}.report.html - Visual Images: Each file will create a corresponding
{filename}.imgs/directory
The generated summary report includes:
-
Summary Tab:
- Summary statistics (total number of files, average scores, standard deviations, etc.)
- MSQM score distribution charts
- Distribution charts for various metrics (Time Metrics, Frequency Metrics, Entropy Metrics, Fractal Metrics, Artifacts)
-
Individual Reports Tab:
- A list of all files displaying filenames and scores
- Clicking on any file allows viewing the detailed report below
- Quality level badges (Excellent/Good/Fair/Poor/Bad)
To view the complete help information:
msqms_summary --helpUsing msqms_report to Generate Quality Control (QC) Reports for MEG Data
The msqms_report command is used to generate a Quality Control (QC) report for a specified MEG data file. This report includes various quality metrics calculated from the MEG data, such as signal quality, noise levels, and other key statistics. The report is saved in the specified output directory. Users must specify the type of MEG data, which can be either opm or squid.
msqms_report -f ./auditory_raw.fif -o ./ -t opm-
--file, -f:
The path to the MEG file required for quality assessment. This option is mandatory. -
--outdir, -o:
The directory where the generated quality report will be saved. This option is mandatory. Default is the current directory (.). -
--data_type, -t:
The type of MEG data. Choose eitheropmorsquid. This option is mandatory.
To generate a QC report for a data.fif file and save the report in the reports/ directory, use the following command:
msqms_report --file data/data.fif --outdir reports/ --data_type opmThis command processes the data.fif MEG file, calculates the relevant quality metrics for opm data, and generates an HTML quality control report in the reports/ directory. The generated report will be named data.report.html.
To see the help documents for the command:
msqms_report -hPlease use the GitHub issue tracker to report bugs.
Please read our contributing guide.