MNE Python Tutorial 2021: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
Line 27: | Line 27: | ||
=Prep Non-tutorial Data= |
=Prep Non-tutorial Data= |
||
# Run Freesurfer on Dataset (takes 8+ hrs): |
# Run Freesurfer on Dataset (takes 8+ hrs): |
||
# Does not run on BRIK/HEAD - convert to .nii first |
# Does not run on BRIK/HEAD - convert to .nii first -- e.g (module load afni; 3dAFNItoNIFTI anat+orig. ) |
||
# Install locally on computer https://surfer.nmr.mgh.harvard.edu/fswiki/rel7downloads |
# Install and process freesurfer locally on computer https://surfer.nmr.mgh.harvard.edu/fswiki/rel7downloads |
||
# OR process on biowulf - make sure time flag is set for 24hrs (--time=24:00:00), runs on 2cpu and takes 4G of ram: |
|||
⚫ | |||
recon-all -all -i <MRI Used w/ MEG> -s <SUBJECT> |
recon-all -all -i <MRI Used w/ MEG> -s <SUBJECT> |
||
#INSTRUCTIONS FOR BIOWULF |
|||
subjid= #Set Freesurfer ID |
|||
mri= #Set MRI Name - must be a nifti file NOT BRIK/HEAD |
|||
export SUBJECTS_DIR= #Set output folder, Make sure this directory exists |
|||
⚫ | |||
echo -e '#!/bin/bash\nrecon-all -all -i ' ${mri} -s ${subjid} | sbatch --mem=3g --time=24:00:00 #SUBMITS JOB TO SBATCH |
|||
#In bash terminal - process the boundary element model - also requires freesurfer to be installed |
#In bash terminal - process the boundary element model - also requires freesurfer to be installed |
Revision as of 11:50, 28 September 2021
Steps to prepare prior to tutorial
Prepare python environment - For 3D rendering and interactive plots, this should be installed on your local computer
!!IF YOU DO NOT HAVE MINICONDA/ANACONDA INSTALLED - have IT install miniconda under your user account!! !!If you already have an mne environment, you can use another name for the environment and adjust accordingly!! conda activate base conda install -n base mamba -c conda-forge -y mamba create -n mne conda-forge::mne main::pip main:jupyter -y
conda activate mne
Wait until 09/30/21 and then Download the sample data and scripts.
These files will be changing prior to this date
NIMH Users: Download here
scp <USERNAME>@helix.nih.gov:/data/NIMH_scratch/mne_tutorial/mne_tutorial.tar.gz <NEW PATH> cd <NEW PATH> tar -xvf mne_tutorial.tar.gz
Non-NIMH MEG Users: Download from MEG Data server
The data is located on the MEG data server and is accessible by all users with accounts An email will be sent with the path to the data
Start Jupyter Notebook
cd <NEW PATH>/nimh_tutorial_data jupyter notebook mne_tutorial_10_01_21.ipynb
Prep Non-tutorial Data
# Run Freesurfer on Dataset (takes 8+ hrs): # Does not run on BRIK/HEAD - convert to .nii first -- e.g (module load afni; 3dAFNItoNIFTI anat+orig. ) # Install and process freesurfer locally on computer https://surfer.nmr.mgh.harvard.edu/fswiki/rel7downloads recon-all -all -i <MRI Used w/ MEG> -s <SUBJECT> #INSTRUCTIONS FOR BIOWULF subjid= #Set Freesurfer ID mri= #Set MRI Name - must be a nifti file NOT BRIK/HEAD export SUBJECTS_DIR= #Set output folder, Make sure this directory exists module load freesurfer echo -e '#!/bin/bash\nrecon-all -all -i ' ${mri} -s ${subjid} | sbatch --mem=3g --time=24:00:00 #SUBMITS JOB TO SBATCH #In bash terminal - process the boundary element model - also requires freesurfer to be installed subjid=<SUBJECT> subjects_dir=<SUBJECTS_DIR> conda activate mne python -c "import mne; mne.bem.make_watershed_bem(subject='${subjid}', subjects_dir='${subjects_dir}')"