Getting Started


Quickstart: Run iEEG-recon App with Docker

We recommend installing the iEEG-recon App that runs in our standalone Docker container. This quickstart option eliminates the overhead of manually installing multiple third-party software packages. However, if you would like to tinker with the codebase, the subsequent sections detail the steps to get iEEG-recon up and running in python or MATLAB.

Note

For Mac M1/M2 users: Make sure you change your terminal to run with Rosetta before completing the following steps. To do so, open Finder -> Applications -> Utilities, then right click the Terminal app, and select Get Info. Under General, select Open using Rosetta

  1. Install the following dependencies:

  2. In a Terminal window, download the latest release of iEEG-recon:

    git clone https://github.com/penn-cnt/ieeg-recon.git

  3. Open iEEG-recon in a Terminal window, then run the installation command:

    bash ieeg-recon/python/install_ieeg-recon_gui_docker.sh

  4. The iEEG-recon application should now be found in your Applications folder

  5. Follow instructions on the Running the App page.


Requirements

The following software packages are required to run iEEG-recon in Python or MATLAB:

  • Anaconda (Note, make sure you download the correct version for your operating system)

  • MATLAB >=2020a (only if using MATLAB tools)

  • FSL >= 3.8.0
    • Ensure that $FSLDIR environment variable is sourced on your terminal path.

  • Greedy and C3D (optional, recommended):

Installation

To use iEEG-recon, first clone the repository:

$ git clone git@github.com:penn-cnt/ieeg-recon.git

To install the iEEG-recon GUI:

$ bash ieeg-recon/python/install_ieeg-recon_gui_m1m2.sh

To run from the command line, create conda environment from dependancies:

$ cd python
$ conda env create -f ieeg_recon_config.yml

Data Setup

iEEG-recon takes a reference MRI scan and a post-operative CT scan in NIfTI format (.ni.gz) as inputs. The data must be organized for each subject in a BIDS-like folder structure as follows:

BIDS/
|__ sub-XXXX/
|__ ses-YYYY/
    |__anat/
    |       |__ sub-XXXX_ses-YYYY_acq-3D_space-T00mri_T1w.nii.gz
    |__ ct/
    |       |__ sub-XXXX_ses-YYYY_acq-3D_space-T01ct_ct.nii.gz
    |__ ieeg/
        |__ sub-XXXX_ses-YYYY_space-T01ct_ desc-vox_electrodes.txt
  • Subject folders begin with sub- and are placed at the top level.

  • Session folders begin with ses- and are nested within subject folders. Session names can be used to describe the type of scanning session (e.g. ses-clinical or ses-research3T).

  • In each session folder, the anat/, ct/, and ieeg/ folders contain the reference MRI, CT scan, and coordinate files respectively. Note that the coordinate file will be generated in Module 1.

  • Breakdown of image filenames:

    Single contact selected

Below is an example file structure for the example data referenced throughout this tutorial. The example data be downloaded here:

/path/to/exampleData/
|__ sub-RID0675/
|     |__ ses-clinical01/
|     |     |__anat/
|     |     |     |__ sub-RID0675_ses-clinical01_acq-3D_space-T00mri_T1w.nii.gz
|     |     |__ct/
|     |     |     |__ sub-RID0675_ses-clinical01_acq-3D_space-T01ct_ct.nii.gz
|     |     |__ieeg/
|     |           |__ sub-RID0675_ses-clinical01_space-T01ct_ desc-vox_electrodes.txt
|     |__ ses-research3T/
|     |     |__anat/
|     |     |     |__ sub-RID0675_ses-research3T_acq-3D_space-T00mri_T1w.nii.gz
|__ sub-RID0864/
|__ sub-RID0922/
IEEG-recon pipeline