SEEG epileptogenicity maps

Authors: Francois Tadel, Olivier David.

This tutorial introduces some concepts that are specific to the management of intracranial, SEEG recordings in the Brainstorm environment, and explains how to compute maps of epileptogenicity from ictal recordings. It is based on a clinical case from the Grenoble University Hospital, France.

Note that the operations used here are not detailed, the goal of this tutorial is not to introduce Brainstorm to new users. For in-depth explanations of the interface and theoretical foundations, please refer to the introduction tutorials. Another tutorial is available for processing the same dataset with the ImaGIN toolbox.

NOT FOR CLINICAL USE:
The performance characteristics of the methods and software implentation presented in this tutorial have not been certified as medical devices and should be used for research purposes only.

Dataset description

License

This tutorial dataset (EEG and MRI data) remains property of the Grenoble University Hospital, France. Its use and transfer outside the ImaGIN and Brainstorm tutorials, e.g. for research purposes, is prohibited without written consent. For questions, please contact Olivier David, PhD ( olivier.david@inserm.fr ).

Clinical description

This dataset includes recordings for a patient that was not reported in the above article, but are part of the same study. The patient presents a focal epilepsy of the left temporo-occipital junction, MRI-negative, and was implanted in the surrounding areas. The subfolder "seeg" contains the recordings of three seizures, all of them showing a propagation of high-frequency oscillations from the lesion towards the temporal lobe, bilaterally.

SEEG recordings

http://neuroimage.usc.edu/brainstorm/DatasetEpileptogenicity?action=AttachFile&do=get&target=dixi_am.gif

The depth electrodes used in this example dataset are DIXI D08-**AM Microdeep electrodes, with the following specifications:

  • Diameter: 0.8 mm
  • Contact length: 2 mm
  • Insulator length: 1.5 mm
  • Distance between the center of two contacts: 3.5 mm
  • Between 8 and 18 contacts on each electrode

Files

The dataset we distribute with this tutorial follows the Brain Imaging Data Structure (BIDS) standard for neuroimaging data organization. This specification was first established for MRI and fMRI (Gorgolewski, 2016) and then refined with an extension dedicated to iEEG (Holdgraf, 2019). The files that will be imported in this tutorial are the following:

tutorial_epimap_bids/

  • derivatives/: Everything that cannot be considered as raw data

    • brainvisa/sub-01_ses-pre/: Result of the BrainVISA 4.5 segmentation for the pre-implantation T1 MRI.

  • sub-01/: Raw data for subject 01

    • ses-preimp/: Imaging exams performed before the implantation of the sEEG.

      • anat/sub-01_ses-preimp_T1w.nii.gz: T1-weighted MRI pre-implantation

    • ses-postimp/: Exams performed with the sEEG devices implanted.

      • anat/sub-01_ses-postimp_T1w.nii.gz: T1-weighted MRI post-implantation

      • ieeg/..._task-seizure_run-0*_ieeg.eeg: Three seizure recordings in BrainVision file format, one seizure per file (with the header files .vhdr and .vmrk)

      • ieeg/..._space-IXI549Space_electrodes.tsv: Position of the contacts in MNI space (SPM12 Segment non-linear normalization)

      • ieeg/..._space-ScanRAS_electrodes.tsv: Position of the contacts in world coordinates, relative to the post-implantation T1 MRI.

  • All the anatomical images have been de-identified with mri_deface from FreeSurfer 6.

References

The acquisition methodology is described in the following articles:

David O, Blauwblomme T, Job AS, Chabardès S, Hoffmann D, Minotti L, Kahane P, Imaging the seizure onset zone with stereo-electroencephalography, Brain. 2011 Oct;134(10):2898-911

Lamarche F, Job AS, Deman P, Bhattacharjee M, Hoffmann D, Gallazzini-Crépin C, Bouvard S, Minotti L, Kahane P, David O, Correlation of FDG-PET hypometabolism and SEEG epileptogenicity mapping in patients with drug-resistant focal epilepsy, Epilepsia. 2016 Dec; 57(12):2045–2055

Download and installation

Import the anatomy

Pre-implantation MRI

Post-implantation MRI

Generate default surfaces

Note: This tutorial was initially written using SPM canonical surfaces, which are template cortical surfaces that are transformed to the patient space using SPM's MNI normalization. For backward compatibility purposes and for keeping this tutorial simple, we kept using this processing pipeline. However, we later integrated more third-party tools and now recommend generating cortical surfaces with CAT12, especially if you are interested in a realistic representation of the patient's cortical folding in 3D.

Access the recordings

Import the contacts positions

In order to generate epileptogenicity maps, we need accurate 3D positions for the contacts of the depth electrodes. Placing the contacts requires a good understanding of the implantation scheme reported by the neurosurgeon, and some skills in reading MRI scans. To make this tutorial easier to reproduce and follow, we distribute the positions of the contacts saved in a text file. For instructions to place the SEEG contacts using Brainstorm, read the advanced section Edit the contacts positions.

Display the depth electrodes

3D figures

MRI Viewer

Panel iEEG

Display the SEEG recordings

SEEG time series

Interpolate on the anatomy

2D topography

Two additional popup menus allow you to display the SEEG recordings grouped by electrode, but without any 3D information: 2DLayout and 2DElectrodes.

display_2dlayout.gif

Review recordings

Power spectrum

We recommend you always start your data analysis with a spectral evalution of the recordings, it may help you identify bad channels. This is described in tutorials Power spectrum and EEG and epilepsy.

Bad channels

We will now review the recordings of the three seizures recorded for this subject: run-01, run-02, run-03. All the following steps are illustrated only for run-01 but need to be reproduced for the other files.

Seizure onset

Two events are already available in this file: "Part1" only indicates the beginning of the file, and "Seizure" indicates approximately the onset of the first seizure. This marking was done for clinical use, to jump quickly to the page of interest, but here we need a more accurate marker. We will create a new marker "Onset" where we observe the beginning of the fast gamma activity, which is the main feature used in the computation of the epileptogenicity maps.

Baseline

In the following sections, we will compute a time-frequency decomposition of the seizure and normalize it with respect to a baseline level. We will identify and import this baseline now. The baseline could be a segment of 5s to 30s of recordings, typically before the seizure, that contains as little interictal epileptiform activity as possible.

The duration of the baseline influences the computation time for the following steps of this tutorial. We will work here with short segments of 5s for illustration purposes, between 72.8s and 77.8s. Use longer segments for more accurate results.

Import epochs of interest

At this point of the analysis, we are still looking at the original files, no SEEG data was copied to the database. The montages are saved in the Brainstorm preferences, the bad channels and new events are saved in the links of the database but not reported to the original .TRC files. If you delete your protocol at this point, you would only lose the event marking and bad channel selection.

We are now going to import two segments of recordings for each seizure file: the seizure (10s before and 40s after the onset) and the baseline (all the segment selected). This will make real copies of the data in the database, so we can run additional processes on them.

Import in database

Bipolar montage

We will run the rest of the analysis using a bipolar montage (bipolar-2). The montage selected in the Record tab is for visualization only, most processes ignore this selection and work only on the original common-reference data. To force all the processes to work on the bipolar values, we need to explicitly apply the montage to the recordings.

Advanced

Uniform list of channels

In this example dataset, the list of channels recorded for all the files is the same, we can directly process the three seizures together. But this is not always the case, the list of recorded channels might be different between two files. This could happen if the patient was implanted multiple times, or if not all the contacts could be recorded simultaneously due to technical limitations related with the amplifiers or the acquisition software.

For files that have different channels recorded, or the same contacts in a different order, you need to chose one of the two following approaches:

Time-frequency analysis (pre-onset baseline)

The aim of this section is to evaluate the frequency range for the computation of the epileptogenicity maps. We need to identify which frequency band is the most representation and specific of the high-frequency activity at the beginning of the seizures.

Starting from this step, you need to have the SPM12 toolbox installed on your computer, as a Brainstorm plugin or a custom installation. We need here the multitaper functions from the FieldTrip toolbox, which are also packaged in SPM .

Time-frequency analysis (separate baseline)

Another approach is to normalize the time-frequency maps based on the baseline file used for the computation of the epileptogenicity maps, instead of the short baseline immediately before the seizure onset. This is a bit more complicated but produces maps that are more coherent with the epileptogenicity measures used in the next section. To increase the educational value of this section, let's manage the time differently: we'll compute the time-frequency decomposition for the entire Onset epochs (-10s,+40s) and then extract only the section we are interested in.

Epileptogenicity maps

The goal of this section is to create 3D maps of epileptogenicity, with the expectation they indicate the location and extent of the seizure onset zone, and maps of propagation delay in the patient's brain. The method used for computing the epileptogenicity maps is described in this article:

David O, Blauwblomme T, Job AS, Chabardès S, Hoffmann D, Minotti L, Kahane P, Imaging the seizure onset zone with stereo-electroencephalography, Brain, 2011

The first seizure is short (around 5s), without any propagation. We will first compute the epileptogenicity map for this one, without any delay map. Then we will process seizures #2 and #3 together, with the associated delay maps during the first 20s of the seizure.

We can compute and display the results either in the full MRI volume, or only limited to the cortex surface. To illustrate the two approaches, we will run the first example (seizure #1) in the volume, and the second example (seizure #2 and #3) on the surface. This choice is arbitrary and for demonstration purpose only. If you decide for one approach (volume or surface), keep the same choice for all your analyses.

Volume: Seizure 1

Surface: Seizure 2/3

Create a movie with the SEEG signals

Saving the conclusions of your visual exploration as a video file is an efficient solution for keeping track of your analyses and sharing them with your colleagues. In such a movie, it can be interesting to display simultaneously the original SEEG recordings with the epileptogenicity maps. However, if you try to open the two files, you get an error message explaining that Brainstorm cannot display two files with different time definitions at the same time.

A solution to go around this limitation is to resample the epileptogenicity results (one value every two seconds = 0.5Hz) with the same frequency as the SEEG recordings (initially 512Hz). This would multiply the size of the file containing the epileptogenicity results by 2*512, creating a file of several Gb. To avoid wasting too much disk space and risking to crash Matlab by creating gigantic variables, we can cut and downsample the SEEG recordings of interest. Let's illustrate this with the seizure run-02.

Anatomical labelling

Brainstorm can manage anatomical atlases, both at the volume and at the surface level. In the example below, we will import an MNI-based anatomical parcellation and use it to label the SEEG contacts. For this purpose, it is recommended to use a non-linear MNI normalization.

Advanced

Video-EEG

EEG recordings and epileptogenicity maps can be reviewed with synchronized video when available. The easier approach is to start by using the clinical EEG software (eg. Micromed BrainQuick) to export the two files for the same time window: the EEG and the video. When the two files are in the same folder with the same name, only with different extensions, they are linked automatically together by Brainstorm.

video_link.gif

If the video is not available in the same folder or has a different name from the EEG file, right-click on the "Link to raw file" > File > Add synchronized video.

On Windows computers, various display options exist thanks to Microsoft ActiveX components. For smooth playback with sound, we recommend you install the VLC ActiveX plugin, available as part of the VLC software. On Linux and MacOS, only the option "Matlab VideoRenderer" is available, with no sound and no possibility to play the video with a real-time speed (yet).

Some EEG-video systems will get automatically synchronized in Brainstorm, other won't. If you notice that the video is not synchronized correctly with the recordings, you need to define manually the delay between the time t=0s in the EEG recordings and the first image of the video. Right-click on the video link > Set start time. For example, if the EEG recordings start 20s after the beginning of the video, it means that the first image of the video corresponds to time t=-20s, so enter "-20" in the edit box.

video_settime.gif

The videos can be included in the movies created with Brainstorm, such as the one introduced in the previous section. In this case, always prefer the display option "Matlab VideoRenderer", it will work better in most cases.

Advanced

Guidelines panel

In addition to this process "Epileptogenicity maps", we developped a simpler interface to reproduce the same analysis with fewer interface manipulations.

Step 2: Import anatomy

Edit the mandatory inputs:

Ignore the advanced options, keep the default values:

Click on [>>] to validate this step and import the anatomy.

The MRI viewer opens automatically, showing the post-implantation volume as a colored layer on top of the pre- volume. Adjust the transparency and amplitude threshold of this layer in the section "Data options" of the Surface tab, adjust its colormap with the popup menu of the figure. Use this display to validate that the coregistration of the two volume is correct, all the parts of the head must align well.

Step 3: Prepare recordings

Use this panel to include the seizure recordings in the database, set the 3D positions of the SEEG contacts, exclude bad channels and mark onset and baseline events. The documentation below explains the role of each button in the toolbar.

Step 4: Import epochs

This step imports two segments of recordings for each seizure file: the seizure (duration edited in this panel) and the baseline (the segment to import is already defined). More details.

Step 5: Time-frequency

This step computes the time-frequency decomposition of the SEEG signals around the seizure onset and normalizes them based on the same measure computed from the baseline.

Step 6: Epileptogenicity

Last step of the analysis, it reproduces what is illustrated in this section.

Repeat for run-02 and run-03, processed together, on the cortex surface instead of the volume:

Advanced

Importing realistic surfaces

Instead of using the default SPM canonical surfaces, you can use realistic cortex envelopes, extracted with CAT12, FreeSurfer, BrainSuite or BrainVISA. Instead of importing the anatomy as described previously (pre MRI then post MRI), follow these steps. Note that this cannot be done with the simplified interface in the Guidelines tab.

Advanced

Volume coregistration

When importing two volumes successively in the subject anatomy, you need to coregister all the new volumes with the first volume imported, otherwise you wouldn't be able to do anything with them. The questions that are asked when importing a second volume are the following.

Advanced

Edit the contacts positions

If you don't have access to the positions of the SEEG contacts in a text file, as illustrated in this tutorial, you can place the contacts in the MRI viewer.

Advanced

Editing implantation without recordings

You can also start defining an implantation scheme without any recordings in your database. You can use this option for creating a text file with all the contacts positions, and use it in Brainstorm or any other program.

Advanced

On the hard drive

The definition of the depth electrodes is saved in the channel file, in the field IntraElectrodes. It contains all the information that can be edited in the iEEG tab. The position of the SEEG contacts is saved in the field Channel(i).Loc, as described in the tutorial Channel file. ChannelMat.IntraElectrodes is an array of structures with the following fields.

Advanced

Additional documentation

Articles

Forum discussions

Advanced

Scripting

The following script from the Brainstorm distribution reproduces the analysis presented in this tutorial page: brainstorm3/toolbox/script/tutorial_epileptogenicity.m

1 function tutorial_epileptogenicity(tutorial_dir) 2 % TUTORIAL_EPILEPTOGENITICY: Script that reproduces the results of the online tutorial "SEEG Epileptogenicity maps". 3 % 4 % CORRESPONDING ONLINE TUTORIALS: 5 % https://neuroimage.usc.edu/brainstorm/Tutorials/Epileptogenicity 6 % 7 % INPUTS: 8 % tutorial_dir: Directory where the tutorial_epimap_bids.zip file has been unzipped 9 10 % @============================================================================= 11 % This function is part of the Brainstorm software: 12 % https://neuroimage.usc.edu/brainstorm 13 % 14 % Copyright (c) University of Southern California & McGill University 15 % This software is distributed under the terms of the GNU General Public License 16 % as published by the Free Software Foundation. Further details on the GPLv3 17 % license can be found at http://www.gnu.org/copyleft/gpl.html. 18 % 19 % FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE 20 % UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY 21 % WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF 22 % MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, NOR DO THEY ASSUME ANY 23 % LIABILITY OR RESPONSIBILITY FOR THE USE OF THIS SOFTWARE. 24 % 25 % For more information type "brainstorm license" at command prompt. 26 % =============================================================================@ 27 % 28 % Author: Francois Tadel, 2017-2022 29 30 31 % ===== FILES TO IMPORT ===== 32 % You have to specify the folder in which the tutorial dataset is unzipped 33 if (nargin == 0) || isempty(tutorial_dir) || ~file_exist(tutorial_dir) 34 error('The first argument must be the full path to the tutorial dataset folder.'); 35 end 36 % Build the path of the files to import 37 MriFilePre = fullfile(tutorial_dir, 'tutorial_epimap_bids', 'sub-01', 'ses-preimp', 'anat', 'sub-01_ses-preimp_T1w.nii.gz'); 38 MriFilePost = fullfile(tutorial_dir, 'tutorial_epimap_bids', 'sub-01', 'ses-postimp', 'anat', 'sub-01_ses-postimp_T1w.nii.gz'); 39 Sz1File = fullfile(tutorial_dir, 'tutorial_epimap_bids', 'sub-01', 'ses-postimp', 'ieeg', 'sub-01_ses-postimp_task-seizure_run-01_ieeg.eeg'); 40 Sz2File = fullfile(tutorial_dir, 'tutorial_epimap_bids', 'sub-01', 'ses-postimp', 'ieeg', 'sub-01_ses-postimp_task-seizure_run-02_ieeg.eeg'); 41 Sz3File = fullfile(tutorial_dir, 'tutorial_epimap_bids', 'sub-01', 'ses-postimp', 'ieeg', 'sub-01_ses-postimp_task-seizure_run-03_ieeg.eeg'); 42 ElecPosFile = fullfile(tutorial_dir, 'tutorial_epimap_bids', 'sub-01', 'ses-postimp', 'ieeg', 'sub-01_ses-postimp_space-ScanRAS_electrodes.tsv'); 43 % Check if the folder contains the required files 44 if ~file_exist(Sz1File) 45 error(['The folder ' tutorial_dir ' does not contain the folder from the file tutorial_epimap_bids.zip.']); 46 end 47 % Subject name 48 SubjectName = 'Subject01'; 49 50 51 % ===== CREATE PROTOCOL ===== 52 % The protocol name has to be a valid folder name (no spaces, no weird characters...) 53 ProtocolName = 'TutorialEpimap'; 54 % Start brainstorm without the GUI 55 if ~brainstorm('status') 56 brainstorm nogui 57 end 58 % Delete existing protocol 59 gui_brainstorm('DeleteProtocol', ProtocolName); 60 % Create new protocol 61 gui_brainstorm('CreateProtocol', ProtocolName, 0, 0); 62 % Start a new report 63 bst_report('Start'); 64 65 66 % ===== IMPORT MRI VOLUMES ===== 67 % Create subject 68 [sSubject, iSubject] = db_add_subject(SubjectName, [], 0, 0); 69 % Import both volumes 70 DbMriFilePre = import_mri(iSubject, MriFilePre, 'ALL', 0, 0, 'T1pre'); 71 DbMriFilePost = import_mri(iSubject, MriFilePost, 'ALL', 0, 0, 'T1post'); 72 % Compute the non-linear MNI coordinates for both volumes 73 [sMriPre, errMsg] = bst_normalize_mni(DbMriFilePre, 'segment'); 74 % Volumes are not registered: Register with SPM 75 isRegistered = 1; 76 if ~isRegistered 77 [DbMriFilePostReg, errMsg, fileTag, sMriPostReg] = mri_coregister(DbMriFilePost, DbMriFilePre, 'spm', 0); 78 % Volumes are registered: Copy SCS and NCS fiducials to post volume 79 else 80 [DbMriFilePostReg, errMsg, fileTag, sMriPostReg] = mri_coregister(DbMriFilePost, DbMriFilePre, 'vox2ras', 0); 81 end 82 % Reslice the "post" volume 83 [DbMriFilePostReslice, errMsg, fileTag, sMriPostReslice] = mri_reslice(DbMriFilePostReg, DbMriFilePre, 'vox2ras', 'vox2ras'); 84 85 % Compute SPM canonical surfaces 86 SurfResolution = 3; %1=5124V, 2=8196V, 3=20484V 4=7861V+hip+amyg 87 process_generate_canonical('Compute', iSubject, 1, SurfResolution, 0); 88 89 90 % ===== ACCESS THE RECORDINGS ===== 91 % Process: Create link to raw file 92 sFilesRaw = bst_process('CallProcess', 'process_import_data_raw', [], [], ... 93 'subjectname', SubjectName, ... 94 'datafile', {{Sz1File, Sz2File, Sz3File}, 'SEEG-ALL'}, ... 95 'channelreplace', 0, ... 96 'channelalign', 0); 97 % Process: Add EEG positions 98 bst_process('CallProcess', 'process_channel_addloc', sFilesRaw, [], ... 99 'channelfile', {ElecPosFile, 'BIDS-SCANRAS-MM'}, ... 100 'fixunits', 0, ... 101 'vox2ras', 1, ... 102 'mrifile', {file_fullpath(DbMriFilePostReslice), 'BST'}); 103 % Process: Power spectrum density (Welch) 104 sFilesPsd = bst_process('CallProcess', 'process_psd', sFilesRaw, [], ... 105 'timewindow', [], ... 106 'win_length', 10, ... 107 'win_overlap', 50, ... 108 'sensortypes', 'SEEG', ... 109 'edit', struct(... 110 'Comment', 'Power', ... 111 'TimeBands', [], ... 112 'Freqs', [], ... 113 'ClusterFuncTime', 'none', ... 114 'Measure', 'magnitude', ... 115 'Output', 'all', ... 116 'SaveKernel', 0)); 117 118 119 %% ===== EVENTS AND BAD CHANNELS ===== 120 % Process: Set bad channels 121 bst_process('CallProcess', 'process_channel_setbad', sFilesRaw(1), [], 'sensortypes', 'v''1, f''1'); 122 bst_process('CallProcess', 'process_channel_setbad', sFilesRaw(2), [], 'sensortypes', 'v''1, t''8'); 123 bst_process('CallProcess', 'process_channel_setbad', sFilesRaw(3), [], 'sensortypes', 'o''1, t''8'); 124 % Define events 125 sEvt1 = db_template('event'); 126 sEvt1(1).label = 'Onset'; 127 sEvt1(1).epochs = 1; 128 sEvt1(1).channels= []; 129 sEvt1(1).notes = []; 130 sEvt1(2).label = 'Baseline'; 131 sEvt1(2).epochs = 1; 132 sEvt1(2).channels= []; 133 sEvt1(2).notes = []; 134 % SZ1 135 sEvt1(1).times = 120.800; 136 sEvt1(2).times = [72.800; 77.800]; 137 % SZ2 138 sEvt2 = sEvt1; 139 sEvt2(1).times = 143.510; 140 sEvt2(2).times = [103.510; 108.510]; 141 % SZ3 142 sEvt3 = sEvt1; 143 sEvt3(1).times = 120.287; 144 sEvt3(2).times = [45.287; 50.287]; 145 % Process: Events: Import from file 146 bst_process('CallProcess', 'process_evt_import', sFilesRaw(1), [], ... 147 'evtfile', {sEvt1, 'struct'}, ... 148 'evtname', ''); 149 bst_process('CallProcess', 'process_evt_import', sFilesRaw(2), [], ... 150 'evtfile', {sEvt2, 'struct'}, ... 151 'evtname', ''); 152 bst_process('CallProcess', 'process_evt_import', sFilesRaw(3), [], ... 153 'evtfile', {sEvt3, 'struct'}, ... 154 'evtname', ''); 155 156 157 % ===== EPOCH RECORDINGS ===== 158 % Import baselines 159 sFilesBaselines = bst_process('CallProcess', 'process_import_data_event', sFilesRaw, [], ... 160 'subjectname', SubjectName, ... 161 'eventname', 'Baseline', ... 162 'timewindow', [], ... 163 'createcond', 0, ... 164 'ignoreshort', 0, ... 165 'usessp', 0); 166 % Import seizures 167 sFilesOnsets = bst_process('CallProcess', 'process_import_data_event', sFilesRaw, [], ... 168 'subjectname', SubjectName, ... 169 'eventname', 'Onset', ... 170 'epochtime', [-10, 40], ... 171 'timewindow', [], ... 172 'createcond', 0, ... 173 'ignoreshort', 0, ... 174 'usessp', 0); 175 % Rename folders 176 db_rename_condition(bst_fullfile(SubjectName, 'sub-01_ses-postimp_task-seizure_run-01_ieeg'), bst_fullfile(SubjectName, 'run-01')); 177 db_rename_condition(bst_fullfile(SubjectName, 'sub-01_ses-postimp_task-seizure_run-02_ieeg'), bst_fullfile(SubjectName, 'run-02')); 178 db_rename_condition(bst_fullfile(SubjectName, 'sub-01_ses-postimp_task-seizure_run-03_ieeg'), bst_fullfile(SubjectName, 'run-03')); 179 % Search again for files 180 sFilesBaselines = bst_process('CallProcess', 'process_select_search', [], [], ... 181 'search', '([name CONTAINS "Baseline"])'); 182 sFilesOnsets = bst_process('CallProcess', 'process_select_search', [], [], ... 183 'search', '([name CONTAINS "Onset"])'); 184 185 186 % ===== BIPOLAR MONTAGE ===== 187 MontageName = [SubjectName, ': SEEG (bipolar 2)[tmp]']; 188 % Apply montage (create new folders) 189 sFilesBaselinesBip = bst_process('CallProcess', 'process_montage_apply', sFilesBaselines, [], ... 190 'montage', MontageName, ... 191 'createchan', 1); 192 sFilesOnsetsBip = bst_process('CallProcess', 'process_montage_apply', sFilesOnsets, [], ... 193 'montage', MontageName, ... 194 'createchan', 1); 195 % Delete original imported folder 196 bst_process('CallProcess', 'process_delete', [sFilesBaselines, sFilesOnsets], [], 'target', 2); % Delete folders 197 % Replace files with bipolar versions 198 sFilesBaselines = sFilesBaselinesBip; 199 sFilesOnsets = sFilesOnsetsBip; 200 201 202 % ===== EPILEPTOGENICITY: SEIZURE #1 ===== 203 % Get options 204 FreqBand = [120 200]; 205 Latency = '0'; 206 TimeConstant = 3; 207 TimeResolution = .2; 208 ThDelay = 0.05; 209 OutputType = 'volume'; 210 % Process: Epileptogenicity index (A=Baseline,B=Seizure) 211 sFilesEpilepto1 = bst_process('CallProcess', 'process_epileptogenicity', sFilesBaselines(1), sFilesOnsets(1), ... 212 'sensortypes', 'SEEG', ... 213 'freqband', FreqBand, ... 214 'latency', Latency, ... 215 'timeconstant', TimeConstant, ... 216 'timeresolution', TimeResolution, ... 217 'thdelay', ThDelay, ... 218 'type', OutputType); 219 220 % ===== EPILEPTOGENICITY: SEIZURE #2-3 ===== 221 % Get options 222 FreqBand = [120 200]; 223 Latency = '0:2:20'; 224 TimeConstant = 3; 225 TimeResolution = .2; 226 ThDelay = 0.05; 227 OutputType = 'surface'; 228 % Process: Epileptogenicity index (A=Baseline,B=Seizure) 229 sFilesEpilepto2 = bst_process('CallProcess', 'process_epileptogenicity', sFilesBaselines(2:3), sFilesOnsets(2:3), ... 230 'sensortypes', 'SEEG', ... 231 'freqband', FreqBand, ... 232 'latency', Latency, ... 233 'timeconstant', TimeConstant, ... 234 'timeresolution', TimeResolution, ... 235 'thdelay', ThDelay, ... 236 'type', OutputType); 237 238 239 % Save and display report 240 ReportFile = bst_report('Save', []); 241 bst_report('Open', ReportFile); 242 243 244





Feedback: Comments, bug reports, suggestions, questions
Email address (if you expect an answer):


Tutorials/Epileptogenicity (last edited 2023-08-07 18:46:47 by RaymundoCassani)