Skip to content

Conversation

@varshaa-1616
Copy link

Reference issue

Fixes #13493

What does this implement/fix?

This PR implements a combined QC + Full MNE report workflow.
It merges the essential QC steps used in the mne-bids-pipeline with the standard MNE report features, allowing users to generate a comprehensive HTML report without requiring anatomical dependencies (BEM, coregistration, or forward/inverse solutions).

The report includes:

  • Raw data overview and PSD plots
  • Event visualization
  • Epochs overview
  • ICA diagnostics
  • Evoked responses
  • Covariance and projectors
  • Custom figures, images, and code

Additional information

  • Tested on sample MNE datasets with raw, epochs, and ICA data.
  • No changes to existing pipeline functions; fully backward compatible.
  • This PR does not include source-space analyses (BEM, forward/inverse solutions).
  • Documentation and example tutorial added for users.

@@ -0,0 +1,31 @@
# OptiPNG version 0.7.8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look more fully next week. But in the meantime, these files should not be added

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, okay, got it. I'll remove those files and wait for your review. Thank you!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some incorrect files are still there

@larsoner
Copy link
Member

Rather than changing 70_report.py the idea -- since it's complementary info -- would be to create a new tutorial/example instead

@varshaa-1616
Copy link
Author

varshaa-1616 commented Dec 14, 2025 via email

@varshaa-1616
Copy link
Author

@larsoner
Thanks for the guidance!
I’ve cleaned up the PR by removing unintended files and moved the work into a new standalone tutorial under doc/tutorials/preprocessing/, without modifying 70_report.py or other core files.

Please let me know if you’d like any structural or content changes.

============================================

Quality control (QC) is the process of systematically inspecting M/EEG data
before any serious preprocessing, modeling, or source analysis is attempted.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually mne.Report can be used to QC at all steps of a pipeline, not just at the raw data stage. I'd actually recommend looking at all stages to make sure things "look okay"

Comment on lines +21 to +22
Authors: The MNE-Python contributors
License: BSD-3-Clause
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These go in a code comment not in the __doc__

events_path = sample_dir / "sample_audvis_filt-0-40_raw-eve.fif"

raw = mne.io.read_raw(raw_path, preload=True)
raw.pick(["meg", "eeg", "eog", "stim"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do this? If so -- or if it helps in some way -- a code comment saying why would help users understand

Comment on lines +367 to +368
if __name__ == "__main__":
report.save("qc_report.html", overwrite=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually don't protect these with __name__ == "__main__" actually, see the other Report tutorial -- we write a lot actually. We probably should have a open_browser=False in here either way

Comment on lines +192 to +193
ICA fitting is computationally expensive and therefore <b>not executed
during documentation builds</b>. To inspect ICA components locally,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually do compute ICA in several examples and tutorials. There are tricks to make it faster for when users (and doc builds) run it. Can you update to use ICA similar to what we do elsewhere?

Also, let's not refer to "doc build" anywhere in this tutorial -- the fact that we build these examples is an implementation / maintenance detail that end users don't need to care about. You can instead talk about making things faster or more memory efficient when running these examples (which will be true both for end users -- which they will care about -- and for our doc build -- which they probably won't and shouldn't need to care about).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC: Document quality control procedures / ideas / reports

2 participants