Chapter 7: Bridging Back to MNE-Python¶
Continuing from Chapter 6 — Source Localization. This is the final chapter of the Brainstorm track.
You've now seen the same broad arc twice in this repository — import, preprocess, epoch, average, localize — once as MNE-Python code, once as Brainstorm clicks. This closing chapter connects the two directly.
Shared sample data¶
MNE-Python ships a dataset module, mne.datasets.brainstorm, containing recordings originally distributed as official Brainstorm tutorial datasets (auditory, resting-state, and phantom recordings among them). That means you can load genuinely Brainstorm-associated data inside MNE-Python and run the same style of pipeline you just clicked through here, entirely in code — a useful way to check your understanding of both tools against each other on identical data.
Moving files between the two¶
- Brainstorm → MNE-Python: Brainstorm can export recordings, head models, and source results to formats MNE-Python reads directly, including plain
.matfiles and FieldTrip-compatible structures. - MNE-Python → Brainstorm:
.fiffiles written by MNE-Python (raw recordings, epochs, forward/inverse solutions) can be imported straight into a Brainstorm database using the same Review raw file import step from Chapter 3.
Neither tool locks your data in — a recording processed halfway in one can usually continue in the other.
Choosing a tool for a given task¶
- Reach for Brainstorm when you want fast, visual, exploratory analysis; when a collaborator on the project doesn't write code; or when you want a polished 3D source figure without writing plotting code.
- Reach for MNE-Python when you need a pipeline that runs identically across many subjects, needs to be version-controlled or peer-reviewed as code, or needs to integrate with other Python analysis (statistics, machine learning, custom preprocessing).
Many real projects use both: explore and sanity-check a subject or two in Brainstorm, then encode the finalized pipeline as an MNE-Python script for the full dataset.
Where to go next¶
If you'd like to see these same concepts written as executable code, the MNE-Python track's EEG Fundamentals and ERP Analysis chapters cover the sensor-level side of this pipeline, and Apply This to Your Own Data is a template for running it on your own recording.
That's the end of the Brainstorm track — thanks for reading.