================================
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.
Must have MATLAB (r2019a) or newer installed with Image Processing Toolbox. (note: has not been tested with previous MATLAB versions)
No other dependencies.
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.
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.
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 :
Imaging/
subdirectory, which contains the following:
mri/
subdirectory, which contains the MRI data as follows:Meshes/
subdirectory, containing processed surface mesh data as follows:subcortical/
subdirectory, for meshes of the hippocampus and amygdala
Elecs/
subdirectory, containing electrode information as follows:A subdirectory for each of the seizures to be imaged. These seizures subdirectories should be named PatientName/PatientName_XX/
, where XX
is the seizure ID (usually the seizures are numbered starting from 1), and they should contain the following:
The following files are the ones one should be familiar with in order to use OPSCEA:
ICEEG data should have the following preprocessing steps, in order:
The OPSCEAparams.xlsx sheet contains the following parameters:
PatientName/
, used to name the patient directoryPatientName/PatientName_XX
, where XX
is the seizure ID
0.1
) to quickly generate a small video to verify everything is workingAdjust 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.
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)
-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.