{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n\n# Plotting sensor layouts of MEG systems\n\nShow sensor layouts of different MEG systems.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Author: Eric Larson \n#\n# License: BSD-3-Clause\n# Copyright the MNE-Python contributors." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from pathlib import Path\n\nimport mne\nfrom mne.datasets import sample, spm_face, testing\nfrom mne.io import (\n read_raw_artemis123,\n read_raw_bti,\n read_raw_ctf,\n read_raw_fif,\n read_raw_kit,\n)\nfrom mne.viz import plot_alignment, set_3d_title\n\nprint(__doc__)\n\nroot_path = Path(mne.__file__).parent.absolute()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Neuromag\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "kwargs = dict(eeg=False, coord_frame=\"meg\", show_axes=True, verbose=True)\n\nraw = read_raw_fif(sample.data_path() / \"MEG\" / \"sample\" / \"sample_audvis_raw.fif\")\nfig = plot_alignment(raw.info, meg=(\"helmet\", \"sensors\"), **kwargs)\nset_3d_title(figure=fig, title=\"Neuromag\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## CTF\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "raw = read_raw_ctf(\n spm_face.data_path() / \"MEG\" / \"spm\" / \"SPM_CTF_MEG_example_faces1_3D.ds\"\n)\nfig = plot_alignment(raw.info, meg=(\"helmet\", \"sensors\", \"ref\"), **kwargs)\nset_3d_title(figure=fig, title=\"CTF 275\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## BTi\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "bti_path = root_path / \"io\" / \"bti\" / \"tests\" / \"data\"\nraw = read_raw_bti(\n bti_path / \"test_pdf_linux\",\n bti_path / \"test_config_linux\",\n bti_path / \"test_hs_linux\",\n)\nfig = plot_alignment(raw.info, meg=(\"helmet\", \"sensors\", \"ref\"), **kwargs)\nset_3d_title(figure=fig, title=\"Magnes 3600wh\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## KIT\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "kit_path = root_path / \"io\" / \"kit\" / \"tests\" / \"data\"\nraw = read_raw_kit(kit_path / \"test.sqd\")\nfig = plot_alignment(raw.info, meg=(\"helmet\", \"sensors\"), **kwargs)\nset_3d_title(figure=fig, title=\"KIT\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Artemis123\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "raw = read_raw_artemis123(\n testing.data_path()\n / \"ARTEMIS123\"\n / \"Artemis_Data_2017-04-14-10h-38m-59s_Phantom_1k_HPI_1s.bin\"\n)\nfig = plot_alignment(raw.info, meg=(\"helmet\", \"sensors\", \"ref\"), **kwargs)\nset_3d_title(figure=fig, title=\"Artemis123\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.2" } }, "nbformat": 4, "nbformat_minor": 0 }