{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n\n# Plot a cortical parcellation\n\nIn this example, we download the HCP-MMP1.0 parcellation\n:footcite:`GlasserEtAl2016` and show it on ``fsaverage``.\nWe will also download the customized 448-label aparc\nparcellation from :footcite:`KhanEtAl2018`.\n\n

Note

The HCP-MMP dataset has license terms restricting its use.\n Of particular relevance:\n\n \"I will acknowledge the use of WU-Minn HCP data and data\n derived from WU-Minn HCP data when publicly presenting any\n results or algorithms that benefitted from their use.\"

\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Author: Eric Larson \n# Denis Engemann \n#\n# License: BSD-3-Clause\n# Copyright the MNE-Python contributors." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import mne\n\nBrain = mne.viz.get_brain_class()\n\nsubjects_dir = mne.datasets.sample.data_path() / \"subjects\"\nmne.datasets.fetch_hcp_mmp_parcellation(subjects_dir=subjects_dir, verbose=True)\n\nmne.datasets.fetch_aparc_sub_parcellation(subjects_dir=subjects_dir, verbose=True)\n\nlabels = mne.read_labels_from_annot(\n \"fsaverage\", \"HCPMMP1\", \"lh\", subjects_dir=subjects_dir\n)\n\nbrain = Brain(\n \"fsaverage\",\n \"lh\",\n \"inflated\",\n subjects_dir=subjects_dir,\n cortex=\"low_contrast\",\n background=\"white\",\n size=(800, 600),\n)\nbrain.add_annotation(\"HCPMMP1\")\naud_label = [label for label in labels if label.name == \"L_A1_ROI-lh\"][0]\nbrain.add_label(aud_label, borders=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also plot a combined set of labels (23 per hemisphere).\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "brain = Brain(\n \"fsaverage\",\n \"lh\",\n \"inflated\",\n subjects_dir=subjects_dir,\n cortex=\"low_contrast\",\n background=\"white\",\n size=(800, 600),\n)\nbrain.add_annotation(\"HCPMMP1_combined\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can add another custom parcellation\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "brain = Brain(\n \"fsaverage\",\n \"lh\",\n \"inflated\",\n subjects_dir=subjects_dir,\n cortex=\"low_contrast\",\n background=\"white\",\n size=(800, 600),\n)\nbrain.add_annotation(\"aparc_sub\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## References\n.. footbibliography::\n\n" ] } ], "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 }