# Mapping electrodes onto the brain surface

**URL:** <https://mne.discourse.group/t/mapping-electrodes-onto-the-brain-surface/5984>\
**Category:** Support & Discussions\
**Created:** [November 24, 2022, 12:47pm UTC](https://mne.discourse.group/t/mapping-electrodes-onto-the-brain-surface/5984 "2022-11-24T12:47:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhosePolter](https://avatars.discourse-cdn.com/v4/letter/w/b4bc9f/32.png) [@WhosePolter](https://mne.discourse.group/u/WhosePolter)\
**Post date:** [November 24, 2022, 12:47pm UTC](https://mne.discourse.group/t/mapping-electrodes-onto-the-brain-surface/5984/1 "2022-11-24T12:47:29Z")

</div>

My SEEG electrode coordinates are in the AC/PC coordinates and I have a T1 scan of the subject. I am looking for a way to mark the location of each electrode contact in the individual brain reconstructed by FreeSurfer, warp to `fsaverage`, and generate maps like [this](https://mne.tools/stable/_images/sphx_glr_20_seeg_002.png).

I went through the relevant tutorials but remain confused. MNE-BIDS documentation note "MNE-Python [to] support using `mni_tal` and `mri coordinate` frames, **corresponding** to the `fsaverage` and `ACPC` BIDS coordinate systems **respectively**. Shall I assume that my data is in subject MRI space and apply FreeSurfer’s talairach.xfm transform to get positions in the MNI fsaverage space?

To download my dataset, run the following command in terminal: `openneuro-py download --dataset=ds003688 --include=sub-01`

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [December 7, 2022, 11:16pm UTC](https://mne.discourse.group/t/mapping-electrodes-onto-the-brain-surface/5984/2 "2022-12-07T23:16:55Z")

</div>

I can point you to the notes section of [DigMontage.add\_mni\_fiducials](https://mne.tools/stable/generated/mne.channels.DigMontage.html#mne.channels.DigMontage.add_mni_fiducials) and [this tutorial](https://mne.tools/stable/auto_tutorials/clinical/10_ieeg_localize.html#aligning-the-t1-to-acpc) but it sounds like maybe you’ve already seen those. @alexrockhill is the expert here and may have better advice.

---

<div class="post-metadata">

**Author:** ![alexrockhill](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/alexrockhill/32/31_2.png) [@alexrockhill](https://mne.discourse.group/u/alexrockhill)\
**Post date:** [December 7, 2022, 11:48pm UTC](https://mne.discourse.group/t/mapping-electrodes-onto-the-brain-surface/5984/3 "2022-12-07T23:48:27Z")

</div>

I looked at the dataset and it’s in ACPC space which means that the T1 in the `anat` folder should hopefully be aligned to ACPC and the electrode contact locations should be in `scannerRAS`. So, what you’ll need to do is convert them to Freesurfer `surfaceRAS` since that is the coordinate frame where the labels in the imaged linked above are in. The function [mne\_bids.convert\_montage\_to\_mri — MNE-BIDS 0.12.dev0 documentation](https://mne.tools/mne-bids/dev/generated/mne_bids.convert_montage_to_mri.html#mne_bids.convert_montage_to_mri) in [08. Convert iEEG data to BIDS format — MNE-BIDS 0.12.dev0 documentation](https://mne.tools/mne-bids/dev/auto_examples/convert_ieeg_to_bids.html) does that part for you. However, you’ll need a completed `recon-all` which has not been included with this openneuro dataset so you’ll have to do something like `recon-all -subj sub-1 -sd /path/to/subjects/dir -i sub-1/ses-mri3t/anat/sub-1_ses-mri3t_t1w.nii.gz --all` but I would double check that the T1 is aligned to ACPC first just to be sure. Once you’ve done that you should be at the same place as the tutorial @drammock linked and hopefully on your way. Hope that helps!
