Computational protocol: iElectrodes: A Comprehensive Open-Source Toolbox for Depth and Subdural Grid Electrode Localization

Similar protocols

Protocol publication

[…] Figure shows an overview of the pre-processing pipeline. The acquired MRI and CT images were exported in DICOM format and then transformed to the NIfTI standard using dcm2nii software (MRIcron, USA). Pre-processing requires the coregistration of the images before they can be processed using the iElectrodes toolbox. We also normalized the images to a standard space as part of the pre-processing pipeline. However, this step can be omitted if a native space representation is required, as it is in some clinical practice routines (Princich et al., ).Although we have implemented the pre-processing steps using a particular set of image analysis softwares, pre-processing can be performed using other available packages. The ability to adopt alternative normalization procedures will be of particular interest, in view of the marked peri-operative cerebral deformations arising with subdural grids. [...] MRI images were normalized to the Montreal Neurological Institute (MNI152) standard space in SPM8 (Figure ). Brain masks obtained from Freesurfer were used in the normalization procedure to avoid unwanted deformations due to non-standard tissue (see Supplementary Figures ). Normalization was performed in two steps: (a) bias correction and (b) non-linear coregistration (Ashburner and Friston, ). This process includes non-linear warping transformations to account for the large deformations observed due to the surgical procedure (see Figure ). The same non-linear transformation was applied to the coregistered CT images (Figure ). Other normalization procedures may be adopted for use with iElectrodes. [...] Brain segmentation masks were obtained from normalized MRI images using FMRIB software library (FSL, Oxford, UK) Brain Extraction Tool (BET) (Smith, ; Jenkinson et al., ; Figure ). These brain masks were useful in circumscribing the regions where intracranial electrodes were localized. [...] Subdural grids were expected to be on top of the cortical envelope of the MNI brain after the normalization procedure. Therefore, a smoothed cortical envelope (SCE) was constructed to take into account electrodes sitting above sulci. An MNI brain mask image was obtained from the Harvard-Oxford atlas in FSL (HarvardOxford-sub-maxprob-thr25-1mm.nii file) (Jenkinson et al., ). The brain stem structure and the cerebellum were removed, and left and right hemispheres were split. The image was processed with the vol2surf function (“cgalsurf” method) in ISO2Mesh toolbox for MATLAB (Fang and Boas, ). A tetrahedral mesh surface of the brain cortex was obtained for each hemisphere, the so called SCE.Grid electrodes were projected to this surface while minimizing an energy cost function that considered the electrodes' displacement and the deformation of a spring like grid connecting the electrodes (Dykstra et al., ):constrained to ∀k,||Lk-sk||2=0, where Lk is the coordinate of electrode k, Lk0 is the original coordinate for electrode k, dij is the distance between electrodes i and j, dij0 is the original distance among the same pair of electrodes, aij is a parameter that take the value of 1 when electrodes i and j are neighbors and 0 otherwise, and sk is the closest node in the SCE mesh to electrode k. The minimization procedure was implemented in MATLAB using the “fmincon” function. The projection vector for each grid electrode is Dk = Lk-Lk0.When depth electrodes were implanted simultaneously to grids, a displacement field function was estimated based on the grid electrodes' projection (Taimouri et al., ). Translations were applied to the depth electrodes with variable strength according to their distance to the grid electrodes. We defined a weight function for each pair of grid electrode k and depth electrode j as:where σR is a regularization parameter.Depth electrodes close to the brain geometrical center were less affected by the spatial normalization than the ones on the brain surface. Accordingly, we calculated a weight function to attenuate the deformation field with distancewhere 2σD was calculated as the mean distance of all grid electrodes to the center of mass of the SCE. Finally, the displacement vector for each depth electrode j was calculated as:Supplementary Figure shows a simulated example of the displacement field function.The performance of the normalization process was assessed by measuring the projection distance of grid electrodes to the SCE || Dk||, and the displacement distance of depth electrodes || Fj||. […]

Pipeline specifications

Software tools MRIcron, SPM, FreeSurfer, FSL, BET, iso2mesh
Application Magnetic resonance imaging
Organisms Homo sapiens