Kleen-Lab / OPSCEA

From the Kleen Lab at UCSF (http://kleen.ucsf.edu). Software for heatmaps of seizure activity projected onto reconstructed brains (Omni-Planar and Surface Casting of Epileptiform Activity). PAPER: https://doi.org/10.1111/epi.16841, VIDEO EXAMPLES: https://www.youtube.com/playlist?list=PLGmfrsRwdva-WKwqLyWwcZxE0f_MA9vIL
Other
8 stars 7 forks source link

OPSCEA for Matlab

================================

Omni-planar and surface casting of epileptiform activity (OPSCEA) (UC Case Number SF2020-281) jointly created by Dr. Jon Kleen, Ben Speidel, Dr. Robert Knowlton, and Dr. Edward Chang is licensed for non-commercial research use at no cost by the Regents of the University of California under CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/). Please contact innovation@ucsf.edu if you are interested in using OPSCEA for commercial purposes.  

The following copyright notice and citation is to be included in any publication, material or media wherein all or a part of Licensed Material is contained, “Certain materials incorporated herein are Copyright © 2016 The Regents of the University of California (REGENTS). All Rights Reserved.  

Please cite the following paper in your publications if you have used our software in your research, as well as any relevant toolboxes used herein as appropriate (img_pipe, FreeSurfer):

Kleen JK, Speidel B, Baud MO, Rao VR, Ammanuel SG, Hamilton LS, Chang EF, Knowlton RC. "Accuracy of omni-planar and surface casting of epileptiform activity for intracranial seizure localization." Epilepsia. 2021 Apr;62(4):947-959. https://doi.org/10.1111/epi.16841 (cover: https://doi.org/10.1111/epi.16080)

The OPSCEA MATLAB package. All code included to generate a video of ictal activity projected on a reconstructed brain. Documentation with additional instructions and sample data are provided as well.

Package setup.

1. Required Software

Must have MATLAB (r2019a) or newer installed with Image Processing Toolbox. (note: has not been tested with previous MATLAB versions)

2. Other dependencies

No other dependencies.

3. Installation

To install the package and have a copy of the code to edit locally, navigate to where you would like to store the package code in your terminal. Clone the package.

git clone https://github.com/Kleen-Lab/OPSCEA.git

Note that you will have to configure paths in the code to wherever your data is stored. Recommended to store data folder in same location as this repository.

4. Download sample data (optional)

Sample data to make practice videos is available for download on OSF in a zip file called OPSCEADATA.zip (https://osf.io/49znp/).

Once downloaded, unzip file and move it to the same folder as the code from this repo. The paths in the software default to using the sample data in this location.

5. Use your own data

To use your own data with the OPSCEA package, you need to organize it in a specific way. Each patient should have a subdirectory within your data directory, as follows: PatientName/. Each patient subdirectory should contain :

Preprocessing

ICEEG data should have the following preprocessing steps, in order:

Parameters

The OPSCEAparams.xlsx sheet contains the following parameters:

Adjust these parameters for each seizure of each patient at your convenience.
Additionally, each patient should have a separate sheet, named PatientName, in OPSCEAparams.xlsx. It should contain the following:

An example of all of this is provided in the OPSCEAparams_ex.xlsx file within this repository.

Usage

After the data files have been organized as described in Use your own data, the data has been preprocessed as explained in Preprocessing, and the parameters have been adjusted as described in Parameters, one can generate a video by running the following command in matlab:

OPSCEA(PatientName, SzId, ShowLabel, JumpTo)

Where PatientName is the patient ID, SzId is the seizure ID to be plotted, ShowLabel is a boolean value to decide whether to show the channel labels (1 shows the label; 0 hides the labels and randomizes the order; default is 1), and JumpTo is the number of seconds by which to offset the start of the video from the value that is specified in OPSCEAparams.xslx (Default is 0).
Example usage using the default data, as described in the sample data section:

OPSCEA('UCSF1', '01', 1, 0)

References.

-Philipp Berens (2021). Circular Statistics Toolbox (Directional Statistics) (https://www.mathworks.com/matlabcentral/fileexchange/10676-circular-statistics-toolbox-directional-statistics), MATLAB Central File Exchange. Retrieved February 12, 2021.