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
Install the following dependencies:
- In a Terminal window, download the latest release of iEEG-recon:
git clone https://github.com/penn-cnt/ieeg-recon.git
- Open iEEG-recon in a Terminal window, then run the installation command:
bash ieeg-recon/python/install_ieeg-recon_gui_docker.sh
The iEEG-recon application should now be found in your Applications folder
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):
Mac and Windows: Install ITK Snap >= V3.2. Open ITK Snap and click on Help > Install Command Line Tools.
Linux: Download the Greedy binary and C3D binary, OR compile from source.
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
Set the FSLDIR and ITKSNAPDIR environment variables in ~/../MATLAB/startup.m. You you may need to update the paths to reflect the location of FSL and ITK-Snap on your local system.
%% in MATLAB/startup.m
% Set FSLDIR to FSL install location
setenv( 'FSLDIR', '/usr/local/fsl' );
setenv('FSLOUTPUTTYPE', 'NIFTI_GZ');
fsldir = getenv('FSLDIR');
fsldirmpath = sprintf('%s/etc/matlab',fsldir);
path(path, fsldirmpath);
clear fsldir fsldirmpath;
% Set ITKSNAPDIR to ITK-Snap install location
setenv('ITKSNAPDIR', '/Applications/ITK-SNAP.app/Contents/bin');
itksnapdir = getenv('ITKSNAPDIR');
itksnapmpath = sprintf('%s',itksnapdir);
path(path,itksnapmpath)
clear itksnapdir itksnapmpath;
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/
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-clinicalorses-research3T).In each session folder, the
anat/,ct/, andieeg/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:
![]()
Below is an example file structure for the example data referenced throughout this tutorial. The example data be downloaded here:
