Reports#
MEGPrep provides two report interfaces:
A portable static HTML report generated by the Nextflow workflow.
An interactive Streamlit report viewer started with
-ror--view_report.
Static HTML Report#
Every MEGPrep run that reaches a MEG milestone writes a static report under:
<output_dir>/static_html_report/
Open the report entry point:
<output_dir>/static_html_report/index.html
The static report can also be regenerated without rerunning the pipeline:
docker run --rm -it \
-v /data/bids:/input \
-v /data/out:/output \
-v /data/smri:/smri \
cmrlab/megprep:0.0.3 \
-i /input -o /output --fs_subjects_dir /smri --steps report
The report directory is self-contained and includes copied figures, sidecar
files, JSON summaries, CSV summaries, and a config snapshot when available.
Subject pages also include a collapsed Task Details table derived from the
Nextflow trace file when one is available. If a task failed or was ignored, the
page adds Task Failure Details with the error summary and packaged command
log excerpts.
Path |
Description |
|---|---|
|
Dataset-level dashboard with workflow diagram, aggregate metrics, subject table, alarm counts, and links to subject pages. |
|
Recording-level details for artifacts, ICA, coregistration, epochs, covariance, head model, source reconstruction, and packaged files. |
|
Searchable alarm list across all recordings. |
|
Machine-readable dataset summary. |
|
Spreadsheet-friendly subject summary table. |
|
Machine-readable per-recording summary. |
|
Effective Nextflow config snapshot when MEGPrep can locate one. |
|
Workflow mode and run metadata used to render the workflow diagram. |
|
Packaged |
|
Optional |
Task Log Bundling#
By default, MEGPrep copies successful-task .command.log excerpts as well
as failed-task command logs so the portable report contains fuller task
provenance. Configure this with static_task_log_mode in the Nextflow
config, or pass --static_task_log_mode through the Docker entrypoint or
Nextflow command.
Value |
Behavior |
|---|---|
|
Default. Copy |
|
Copy command logs only for failed or ignored tasks when a smaller report package is preferred. |
|
Do not copy |
Example:
docker run ... cmrlab/megprep:<version> \
-i /input -o /output \
--static_task_log_mode all-command-log
How to Interpret the Static Report#
Start from index.html:
Review the workflow diagram to verify that the selected
stepsmode matches the intended run.Sort the subject table by alarms, bad channels, bad segments, coregistration distance, or epoch rejection rate.
Open subject pages for recordings marked
WARNorFAIL.For artifact alarms, inspect the bad-channel list, bad-segment table, and artifact mask heatmap. The heatmap summarizes where bad channels and bad time segments occur across the recording before opening the more detailed waveform images.
For ICA alarms, inspect marked components, ECG/EOG candidates, component topographies, and ICA overlay/PSD plots.
For coregistration alarms, inspect the staged coregistration figures and confirm that the recording was matched to the correct MRI subject.
If a subject is marked
FAILbecause a Nextflow task failed or was ignored, openTask Failure Detailsfirst, then expandTask Detailsfor the full trace context.
The current report uses static thresholds and measured values. It does not yet include calibrated normative QC scores. See Quality Control Metrics for the complete metric list.
Interactive Streamlit Report#
To view quality control reports through the interactive Streamlit interface,
run MEGPrep with Docker and expose port 8501:
docker run --rm -it -p 8501:8501 \
-v /data/megprep_output:/output \
cmrlab/megprep:<version> \
-r
The Docker entrypoint handles mounted output permissions automatically. It
starts as root, prepares /output when needed, then drops to the host UID/GID
inferred from /input. For report-only runs that only mount /output, the
UID/GID are inferred from /output instead, so an existing report directory
owned by the submitting user stays writable. If neither mount has the desired
owner, pass -e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)".
Then open:
http://<server_ip>:8501
Use http://localhost:8501 when running locally. The Streamlit report is a
viewer and does not run Nextflow preprocessing.