Before processing: Open brainstorm and create a new subject. The subject's name must be the same than the one used in the following codes in the format 'AAA_BB'.
To process P1, P2 and P3 at the same time use:
process_data_cogBST.m
See tutorial
To process P1 or P2 or P3 individually use:
convert_letswave_to_brainstorm.m
See tutorial
The path where the file process_data_cogBST needs to be added in matlab (Home -> Set Path -> Add folder).
Before starting the script you need to:
- Import patient's MRI into brainstorm
- Right click on the patient MRI and select "MRI segmentation" and use CAT12 (warning this process takes time)
- Set the NAS, RPA, LPA, AC, PC and IH in the brainstorm's MRI viewer
- In the excel file generated by ICEM (seeg coordinates), copy the first 4 column and save them in a .txt file
Usage:
In Maltab, write in the command widow
[values,coordinates] = process_data_cogBST
The first step consists of providing the information in the window (see screenshot below): Patient code: the name of the subject created in brainstorm before running the program in the format 'AAA_BB'
The second step constists of selecting the three corresponding matrices generated from Letswave: P1, P2 and P3. Select the file indicated at the top of the explorer window (see screnshot below):
The third step constists of selecting the SEEG coordinates file in .txt
format
In the matlab workspace 2 variables are generated:
- values: a MxN matrix where M is the number of intracerebral contacts and N the number of experimental states (Here N = 3 for P1, P2 and P3)
- coordinates: a Mx4 table where M is the number of intracerebral contacts. The first column is the name of the intracerebral contact and the three others are the coordinates X,Y and Z
This function make possible to convert a results matrix generated from letswave into a brainstorm compatible format
values = convert_letswave_to_brainstorm(bst_seeg,PatientName,experimentName,letswave_table,comment)
Before starting the script you need to:
- Import patient's MRI into brainstorm
- Right click on the patient MRI and select "MRI segmentation" and use CAT12 (warning this process takes time)
- Set the NAS, RPA, LPA, AC, PC and IH in the brainstorm's MRI viewer
- In the excel file generated by ICEM (seeg coordinates), copy the first 4 column and save them in a .txt file
- In brainstorm: Import a .TRC file into brainstorm to obtain the SEEG channel
- In brainstorm: right click on 'Channels', then click on 'Add EEG positions' -> 'Import from file'. In the explorer window modify the filter 'Files of types' into 'EEG: ASCII: Name,XYZ'. Then select the coordinates file (.txt) created before. Use the default answers when brainstorm asks questions. Once the electrode coordinates are uploaded in brainstorm, right click on 'Channels' -> 'File' -> 'Export to Maltab'
Input:
- bst_seeg: the electrodes file imported into the matlab workspace from brainstorm (right clic on the electrode's file and export to matlab)
- letswave_table the table imported from letswave
- PatientName : the patient code must be the same as the subject created in brainstorm before running the code in the format 'AAA_BB'.
- experimentName: The name of the experiment
- comment : The file name displayed in brainstorm
Output: a brainstorm formated file to import then into brainstorm.
The matrix is automatically uploaded in brainstorm
Example of usage:
values = convert_letswave_to_brainstorm(bst_seeg,'LOU_SA','Raw_data',letswave_table,'Z_score')