Skip to content

Instantly share code, notes, and snippets.

@SherazKhan
Last active May 27, 2020 15:36
Show Gist options
  • Save SherazKhan/8809ad2d300ba5d6183eb80fdf80a84d to your computer and use it in GitHub Desktop.
Save SherazKhan/8809ad2d300ba5d6183eb80fdf80a84d to your computer and use it in GitHub Desktop.
import mne
import os.path as op
import glob
import numpy as np
subjects = ['CC110033', 'CC110037', 'CC110045']
subject = subjects[0]
# For Desktop
# https://www.dropbox.com/sh/zkq03rj76usd6b5/AAC4pvtWoNMUkxNwrCrzUVNRa?dl=0
data_path = '/cluster/transcend/sheraz/Dropbox/mne-camcan-data/'
subjects_dir = op.join(data_path,'recons')
subject_dir = op.join(subjects_dir,subject)
bem_dir = op.join(subject_dir,'bem')
trans_file = op.join(data_path, 'trans',subject + '-trans.fif')
labels_fname = glob.glob(op.join(data_path, 'labels', '*.label'))
labels = [mne.read_label(label, subject='fsaverageSK', color='r')
for label in labels_fname]
for index, label in enumerate(labels):
label.values.fill(1.0)
labels[index] = label
labels = [label.morph('fsaverageSK', subject, subjects_dir=subjects_dir) for label in labels]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment