= iEEG Contact Localization (UNDER CONSTRUCTION) =
''Authors: Chinmay Chinara, Takfarinas Medani.''
Detection, localization and labeling of SEEG depth electrodes is a vital step in studying brain activity. This tutorial can be considered as a precursor to the [[https://neuroimage.usc.edu/brainstorm/Tutorials/Epileptogenicity|Epileptogenicity]] tutorial.
__'''NOT FOR CLINICAL USE'''__:<
>The performance characteristics of the methods and software implementation presented in this tutorial have not been certified as medical devices and should be used for research purposes only.
<>
== Download and installation ==
* '''Requirements''': You have already followed all the introduction tutorials and you have a working copy of Brainstorm installed on your computer.
* '''CT2MRIREG''': If you are running Brainstorm from the MATLAB environment, for the coregistration between pre-implantation MRI and post-implantation CT volumes, you need to have the '''ct2mrireg''' plugin installed on your computer, as a [[https://neuroimage.usc.edu/brainstorm/Tutorials/Plugins|Brainstorm plugin]]. It can be found under the menu '''Plugins > Anatomy > ct2mrireg'''.
* '''Download the dataset''':
* Go to the [[http://neuroimage.usc.edu/bst/download.php|Download]] page of this website, and download the file: '''tutorial_seeg_contact_localization.zip'''.
* Unzip it in a folder that is not in any of the Brainstorm folders (program folder or database folder).
* '''Brainstorm''':
* Start Brainstorm (MATLAB scripts or stand-alone version).
* Select the menu '''File > Create new protocol'''. Name it "'''TutorialSeegImplantation'''" and select the options: <
>"'''No, use individual anatomy'''",<
>"'''No, use one channel file per acquisition run'''".
== Import the anatomy ==
=== Pre-implantation MRI ===
* Right-click on the TutorialSeegImplantation folder > '''New subject''' > '''Subject01'''.<
>Keep the default options you defined for the protocol.
* Switch to the "anatomy" view of the protocol.
* Right-click on the subject node > '''Import MRI''':<
>Set the file format: "All MRI file (subject space)"<
>Select: '''tutorial_epimap_bids/sub-01/ses-preimp/anat/sub-01_ses-preimp_T1w.nii.gz'''
* Do you want to apply the transformation to the MRI file? '''YES'''
* The MRI viewer opens automatically. The positions of all the anatomical fiducials are already defined, they were read from the .json file located in the same folder.
* Click on "[[http://neuroimage.usc.edu/brainstorm/Tutorials/ImportAnatomy#MNI_normalization|Click here to compute MNI normalization]]", option "'''segment'''". It computes a non-linear transformation between the subject space and the MNI ICBM152 space. <
><
> {{attachment:mni_transformation.gif}}
* Click on [Save] to close the MRI viewer.
* Rename the new file: '''T1pre'''. <
><
> {{attachment:import_t1pre.gif}}