### Install VoxTool Source: https://ieeg-recon.readthedocs.io/en/latest/module%201.html Install the VoxTool application using pip. This is a prerequisite for running the tool from the command line. ```bash $ pip install voxtool ``` -------------------------------- ### Install iEEG-recon GUI with Docker Source: https://ieeg-recon.readthedocs.io/en/latest/Getting%20Started.html Execute the installation script for the iEEG-recon GUI when using the Docker container. This script is part of the downloaded repository. ```bash bash ieeg-recon/python/install_ieeg-recon_gui_docker.sh ``` -------------------------------- ### Install iEEG-recon GUI (Python) Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/Getting%20Started.rst.txt Run this script to install the iEEG-recon GUI for Python. Ensure you have the necessary dependencies installed. ```console $ bash ieeg-recon/python/install_ieeg-recon_gui_m1m2.sh ``` -------------------------------- ### Install iEEG-recon GUI (M1/M2) Source: https://ieeg-recon.readthedocs.io/en/latest/Getting%20Started.html Run the specific installation script for the iEEG-recon GUI, optimized for M1/M2 Macs. This script is located within the Python directory of the cloned repository. ```bash bash ieeg-recon/python/install_ieeg-recon_gui_m1m2.sh ``` -------------------------------- ### Run Module 2 with Docker Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%202.rst.txt Execute Module 2 using Docker. Ensure the example data path is absolute. The -gc flag is optional but recommended for Greedy registration. ```console $ docker run -v absolute/path/to/exampleData:/source_data lucasalf11/ieeg_recon -s sub-RID0922 -m 2 -cs ses-clinical01 -rs ses-clinical01 -d /source_data ``` -------------------------------- ### Configure MATLAB for iEEG-recon Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/Getting%20Started.rst.txt Set the FSLDIR and ITKSNAPDIR environment variables in your MATLAB startup.m file. Update paths to match your local installation of FSL and ITK-Snap. ```MATLAB %% 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; ``` -------------------------------- ### Install VoxTool via pip Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%201.rst.txt Install the VoxTool package using pip. This is required for command-line usage. ```console $ pip install voxtool ``` -------------------------------- ### Run VoxTool from command line Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%201.rst.txt Launch the VoxTool application from your terminal. Ensure VoxTool is installed first. ```console $ voxtool ``` -------------------------------- ### Clone iEEG-recon Repository Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/Getting%20Started.rst.txt Clone the iEEG-recon repository to your local machine to begin the installation process. ```console $ git clone git@github.com:penn-cnt/ieeg-recon.git ``` -------------------------------- ### Run Module 3 via Docker Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%203.rst.txt Execute Module 3 using Docker. Ensure the example data is mounted to the container. This command uses the default AntSpyNet atlas. ```console $ docker run -v absolute/path/to/exampleData:/source_data lucasalf11/ieeg_recon -s sub-RID0922 -m 3 -cs ses-clinical101 -rs ses-clinical01 -d /source_data -r 2 -apn ``` -------------------------------- ### Run iEEG-recon with Docker Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/Getting%20Started.rst.txt Execute the iEEG-recon application using Docker. Mount your data directory to the container and specify subject and session details. This example includes options for Greedy and AntsPyNet. ```console $ docker run -v :/source_data lucasalf11/ieeg_recon -s sub- -cs ses- -rs ses- -gc -m -1 -apn -r 2 -d /source_data ``` ```console $ docker run -v /Users/username/:/source_data lucasalf11/ieeg_recon -s sub- -cs ses- -rs ses- -gc -m -1 -apn -r 2 -d /source_data ``` -------------------------------- ### Clone iEEG-recon Repository Source: https://ieeg-recon.readthedocs.io/en/latest/Getting%20Started.html Download the latest release of the iEEG-recon project from GitHub. This is a prerequisite for both Docker and manual installations. ```bash git clone https://github.com/penn-cnt/ieeg-recon.git ``` ```bash git clone git@github.com:penn-cnt/ieeg-recon.git ``` -------------------------------- ### Initialize and Run Module 3 in MATLAB Source: https://ieeg-recon.readthedocs.io/en/latest/module%203.html Set up subject, session, and BIDS directory variables, then initialize the ieeg_recon object and run Module 3. ```matlab % Set up subID = 'sub-RID0922'; % subject ID ct_session = 'ses-clinical01'; % name of session with CT scan mri_session = 'ses-clinical01'; % name of session with reference MRI scan BIDS_dir = '../exampleData'; % path to BIDS directory subject_rid922 = ieeg_recon(subID, ct_session, mri_session, BIDS_dir); % Run Module 3 fileLocations = subject_rid0922.module3; ``` -------------------------------- ### Create Conda Environment (Python) Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/Getting%20Started.rst.txt Navigate to the python directory and create a conda environment using the provided configuration file. ```console $ cd python $ conda env create -f ieeg_recon_config.yml ``` -------------------------------- ### Run Module 3 via Docker Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%203.rst.txt Execute Module 3 using Docker. Mount your data directory to \"/source_data\" within the container. Ensure all required arguments are provided. ```console $ docker run -v absolute/path/to/exampleData:/source_data lucasalf11/ieeg_recon -s sub-RID0922 -m 3 -cs ses-clinical01 -rs ses-clinical01 -r 2 -apn -mri -d /source_data ``` -------------------------------- ### Run Module 2 using Matlab Source: https://ieeg-recon.readthedocs.io/en/latest/module%202.html Initialize the ieeg_recon object with subject and session details, then call the module2 method to run the registration process. ```matlab % Set up subID = 'sub-RID0922'; % subject ID ct_session = 'ses-clinical01'; % name of session with CT scan mri_session = 'ses-clinical01'; % name of session with reference MRI scan BIDS_dir = '../exampleData'; % path to BIDS directory subject_rid922 = ieeg_recon(subID, ct_session, mri_session, BIDS_dir); % Run Module 2 fileLocations = subject_rid922.module2; ``` -------------------------------- ### Run VoxTool Application Source: https://ieeg-recon.readthedocs.io/en/latest/module%201.html Launch the VoxTool graphical user interface from the terminal. This command initiates the application for electrode labeling. ```bash $ voxtool ``` -------------------------------- ### Run Module 2 using Docker Source: https://ieeg-recon.readthedocs.io/en/latest/module%202.html Execute Module 2 via Docker. Ensure the data path is correctly mounted. The -gc flag is optional but recommended for Greedy registration. ```bash $ docker run -v absolute/path/to/exampleData:/source_data lucasalf11/ieeg_recon -s sub-RID0922 -m 2 -cs ses-clinical01 -rs ses-clinical01 -d /source_data | Arguments: | -s: subject ID | -m: Module number | -cs: name of session with CT scan | -rs: name of session with reference MRI scan | -d: path to BIDS directory | -gc: (optional, recommended) run with Greedy ``` -------------------------------- ### Run Module 3 using MATLAB Source: https://ieeg-recon.readthedocs.io/en/latest/module%203.html Initialize the ieeg_recon object with subject and session details, then call the module3 method to process the data. Requires setting up subject ID, session names, and BIDS directory. ```matlab % Set up subID = 'sub-RID0922'; % subject ID ct_session = 'ses-clinical01'; % name of session with CT scan mri_session = 'ses-clinical01'; % name of session with reference MRI scan BIDS_dir = '../exampleData'; % path to BIDS directory subject_rid922 = ieeg_recon(subID, ct_session, mri_session, BIDS_dir); % Run Module 3 fileLocations = subject_rid922.module3; ``` -------------------------------- ### Run Module 2 using Python (conda) Source: https://ieeg-recon.readthedocs.io/en/latest/module%202.html Execute Module 2 from the command line after activating the conda environment. The -gc flag is optional but recommended for Greedy registration. ```bash $ conda activate ieeg_recon $ cd python $ python ieeg_recon.py -s sub-RID0922 -m 2 -cs ses-clinical101 -rs ses-clinical01 -d absolute/path/to/exampleData -gc | Arguments: | -s: subject ID | -m: Module number | -cs: name of session with CT scan | -rs: name of session with reference MRI scan | -d: path to BIDS directory | -gc: (optional, recommended) run with Greedy ``` -------------------------------- ### Run Module 2 with Matlab Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%202.rst.txt Set up subject and session variables in Matlab and then call the ieeg_recon function to run Module 2. The 'fileLocations' variable will contain the output paths. ```matlab % Set up subID = 'sub-RID0922'; % subject ID ct_session = 'ses-clinical01'; % name of session with CT scan mri_session = 'ses-clinical01'; % name of session with reference MRI scan BIDS_dir = '../exampleData'; % path to BIDS directory subject_rid922 = ieeg_recon(subID, ct_session, mri_session, BIDS_dir); % Run Module 2 fileLocations = subject_rid0922.module2; ``` -------------------------------- ### Run Module 3 via Matlab Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%203.rst.txt Set up subject and session variables in Matlab, then instantiate the ieeg_recon object and call the module3 method to run the analysis. ```matlab % Set up subID = 'sub-RID0922'; % subject ID ct_session = 'ses-clinical01'; % name of session with CT scan mri_session = 'ses-clinical01'; % name of session with reference MRI scan BIDS_dir = '../exampleData'; % path to BIDS directory subject_rid922 = ieeg_recon(subID, ct_session, mri_session, BIDS_dir); % Run Module 3 fileLocations = subject_rid0922.module3; ``` -------------------------------- ### Run Module 2 with Python Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%202.rst.txt Execute Module 2 using Python after activating the 'ieeg_recon' conda environment. The -gc flag is optional but recommended for Greedy registration. ```console $ conda activate ieeg_recon $ cd python $ python ieeg_recon.py -s sub-RID0922 -m 2 -cs ses-clinical101 -rs ses-clinical01 -d absolute/path/to/exampleData -gc ``` -------------------------------- ### Run Module 3 with Docker and MNI Registration Source: https://ieeg-recon.readthedocs.io/en/latest/module%203.html Execute Module 3 using Docker, specifying subject ID, module number, session details, BIDS directory, radius, AntsPyNet atlas, and MNI registration. ```bash $ docker run -v absolute/path/to/exampleData:/source_data lucasalf11/ieeg_recon -s sub-RID0922 -m 3 -cs ses-clinical01 -rs ses-clinical01 -r 2 -apn -mri -d /source_data | Arguments: | -s: subject ID | -m: Module number | -cs: name of session with CT scan | -rs: name of session with reference MRI scan | -d: path to BIDS directory | -r: radius | -apn: use atropos atlas from AntsPyNet | -mni: (optional) perform MNI registration ``` -------------------------------- ### Configure MATLAB Environment Variables Source: https://ieeg-recon.readthedocs.io/en/latest/Getting%20Started.html Set environment variables for FSLDIR and ITKSNAPDIR within MATLAB's startup.m file. This ensures that iEEG-recon can locate these essential tools. Paths may need adjustment based on your system. ```matlab %% 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; ``` -------------------------------- ### Run Module 3 via Python Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%203.rst.txt Execute Module 3 using the Python script after activating the conda environment. Specify the BIDS directory and other required parameters. ```console $ conda activate ieeg_recon $ cd python $ python ieeg_recon.py -s sub-RID0922 -m 3 -cs ses-clinical101 -rs ses-clinical01 -d absolute/path/to/exampleData -r -apn -mni ``` -------------------------------- ### Run Module 3 using Docker Source: https://ieeg-recon.readthedocs.io/en/latest/module%203.html Execute Module 3 via Docker, specifying subject ID, module, sessions, data directory, radius, and segmentation options. ```bash $ docker run -v absolute/path/to/exampleData:/source_data lucasalf11/ieeg_recon -s sub-RID0922 -m 3 -cs ses-clinical101 -rs ses-clinical01 -d /source_data -r 2 -apn | Arguments: | -s: subject ID | -m: Module number | -cs: name of session with CT scan | -rs: name of session with reference MRI scan | -d: path to BIDS directory | -r: radius | -apn: run AntsPyNet DKT and Atropos segmentation ``` -------------------------------- ### Create Conda Environment for iEEG-recon Source: https://ieeg-recon.readthedocs.io/en/latest/Getting%20Started.html Set up a Conda environment for iEEG-recon by creating it from the provided YAML configuration file. This is necessary for running the application from the command line. ```bash cd python conda env create -f ieeg_recon_config.yml ``` -------------------------------- ### Run Module 3 using Python (conda) Source: https://ieeg-recon.readthedocs.io/en/latest/module%203.html Execute Module 3 from the command line using a Python script after activating the 'ieeg_recon' conda environment. Specify subject, module, sessions, data directory, radius, and segmentation. ```bash $ conda activate ieeg_recon $ cd python $ python ieeg_recon.py -s sub-RID0922 -m 3 -cs ses-clinical01 -rs ses-clinical01 -d ../exampleData -r 2 -apn | Arguments: | -s: subject ID | -m: Module number | -cs: name of session with CT scan | -rs: name of session with reference MRI scan | -d: path to BIDS directory | -r: radius (in mm) of the electrode spheres used to assign regions to each electrode | -apn: run AntsPyNet DKT and Atropos segmentation ``` -------------------------------- ### Run Module 3 with Conda and MNI Registration Source: https://ieeg-recon.readthedocs.io/en/latest/module%203.html Execute Module 3 using Conda environment, specifying subject ID, module number, session details, BIDS directory, radius, AntsPyNet atlas, and MNI registration. ```bash $ conda activate ieeg_recon $ cd python $ python ieeg_recon.py -s sub-RID0922 -m 3 -cs ses-clinical101 -rs ses-clinical01 -d absolute/path/to/exampleData -r -apn -mni | Arguments: | -s: subject ID | -m: Module number | -cs: name of session with CT scan | -rs: name of session with reference MRI scan | -d: path to BIDS directory | -r: radius | -apn: use atropos atlas from AntsPyNet | -mni: (optional) perform MNI registration ``` -------------------------------- ### Run Module 3 via MATLAB Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%203.rst.txt Set up subject and session variables in MATLAB and then call the 'module3' method on the subject object to run Module 3. This uses the default AntSpyNet atlas. ```matlab % Set up subID = 'sub-RID0922'; % subject ID ct_session = 'ses-clinical01'; % name of session with CT scan mri_session = 'ses-clinical01'; % name of session with reference MRI scan BIDS_dir = '../exampleData'; % path to BIDS directory subject_rid922 = ieeg_recon(subID, ct_session, mri_session, BIDS_dir); % Run Module 3 fileLocations = subject_rid922.module3; ``` -------------------------------- ### Run Module 3 via Python Source: https://ieeg-recon.readthedocs.io/en/latest/_sources/module%203.rst.txt Execute Module 3 from the command line using a Python script after activating the 'ieeg_recon' conda environment. This command uses the default AntSpyNet atlas. ```console conda activate ieeg_recon cd python python ieeg_recon.py -s sub-RID0922 -m 3 -cs ses-clinical01 -rs ses-clinical01 -d ../exampleData -r 2 -apn ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.