ROAST


ROAST: A fully automated, Realistic, vOlumetric Approach to Simulate Transcranial electric stimulation. This is an open-source tool that runs on Matlab and calls open-source software packages such as iso2mesh and getDP. Starting from an MRI structural image, it segments the full head, places virtual electrodes, generates an FEM mesh and solves for voltage and electric field distribution -- at 1 mm resolution. All this in about 10-30 minutes and fully automated.


Getting started

Download ROAST (v 2.6)* | Contribute your code to ROAST

Unzip this file, launch Matlab** and change to the roast directory, then enter:


roast
 

This will demo a modeling process on the MNI152 head. Specifically, it will use the T1 image of the 6th gen MNI-152 head to build a TES model with anode on Fp1 (1 mA) and cathode on P4 (-1 mA).

See video demonstration | A short talk at IEEE EMBC 2018

Examples

One can specify an individual*** head (in NIfTI format) and any combination of electrodes and currents as follows:


roast('example/subject1.nii',{'F1',0.3,'P2',0.7,'C5',-0.6,'O2',-0.4})

This will build a model for subject1.nii in subdirectory ./example with anodes F1 (0.3 mA) and P2 (0.7 mA), and cathodes C5 (0.6 mA), O2 (0.4 mA).

If you don't have an individual MRI, then you should use a high-quality standard, such as The NY Head. ROAST will skip the segmentation step as this standard head was already segmented with great care at 0.5 mm resolution (though simulations will be slower due to the more detailed spatial resolutions). To run this standard head with calibrated conductivity values use the following:


roast('nyhead',{'Fpz',1,'Oz',-1},'conductivities',struct('white',0.11,'gray',0.21,'csf',0.53,'bone',0.02,'skin',0.90))

These values were calibrated to best match intracranial voltage recordings from 10 human subjects (Huang, Liu, et al 2017, specifically for the Fpz--Oz configuration).

Since version V2.0 the following features are supported: customized electrodes; addition of T2 images to improve segmentation; customize mesh options; user-defined tissue conductivities; resampling MRI into 1 mm resolution; add empty slices (zero-padding) to MRI to allow specific electrode placement; save all the results into NIfTI format; easier to manage simulation data. See README file for more details and examples. Here is an 'awesomeSimulation' demonstrating many of these features:


roast('example/subject1.nii',{'Fp1',0.3,'F8',0.2,'POz',-0.4,'Nk1',0.5,'custom1',-0.6},...
        'electype',{'disc','ring','pad','ring','pad'},...
        'elecsize',{[],[7 9 3],[40 20 4],[],[]},...
        'elecori','ap','T2','example/subject1_T2.nii',...
        'meshoptions',struct('radbound',4,'maxvol',8),...
        'conductivities',struct('csf',0.6,'skin',1.0),...
        'resampling','on','zeropadding',30,...
        'simulationTag','awesomeSimulation')


To review the simulation results that are computed in this example, you can just enter the subject name and the simulation tag as follows:


reviewRes('example/subject1.nii','awesomeSimulation')

Processing pipeline

Modeling includes the following steps:

  1. Segment the MRI into skin, bone, CSF, white matter, gray matter and air cavities (using SPM8 in Matlab as explained here).
  2. Touch-up the segmentation to be sure there are no "holes" (using a touch-up script in Matlab).
  3. Place virtual electrodes of 6 mm radius at locations Fp1 and P4 (using this script in Matlab).
  4. Generate a Finite Element Model (FEM) mesh (using iso2mesh).
  5. Solve the FEM for voltage and electric field distributions (using getDP).
  6. Resample the result into the original 3D volume and make some interactive displays (using Matlab).

You may want to review the result of the automated segmentation on your individual heads, and if necessary, touch it up "by hand" using volume editing software, e.g. ITK-SNAP.

Acknowledgements

Preliminary comparisions of ROAST with other modeling tools are here (please use these as references):

This work was supported by NIH through grants R01MH111896, R44NS092144, R41 NS076123, and by Soterix Medical Inc.

Notes and Disclaimers

* Version 2.x is incompatible with simulation data generated by Version 1.x. V2.6 is incompatible with V2.1 and earlier versions.
** A Docker version
*** ROAST was not designed to build models for pathological heads, but there are plans to add this capability in future versions.

Latest update, August 14, 2018, Yu (Andy) Huang and Lucas C Parra