Delineation of resected brain cavities on magnetic resonance images (MRIs) of epilepsy surgery patients is essential for neuroimaging/neurophysiology studies investigating biomarkers of the epileptogenic zone. The gold standard to delineate the resection on MRI remains manual slice-by-slice tracing by experts. Here, the researchers proposed and validated a semiautomated MRI segmentation pipeline, generating an accurate model of the resection and its anatomical labeling, and developed a graphical user interface (GUI) for user-friendly usage.
1. Epilepsy Surgery and Resected Brain Cavity
Brain surgery is the best available treatment for patients suffering from drug-resistant epilepsy (DRE) 
who represent between 20–30% of all the epilepsy cases 
. The objective of resective epilepsy surgery is the complete resection or disconnection of the epileptogenic zone, which is defined as “the area of cortex indispensable for the generation of clinical seizures” 
. Delineating the epileptogenic zone, therefore, is key to the success of epilepsy surgery; yet, this zone is a fully theoretical concept: no diagnostic modality, that is currently available, can measure the entire epileptogenic zone directly. Prior to the surgery, the researchers cannot exclude the presence of a potential epileptogenic zone that would only become clinically apparent postoperatively (once the patient continues to have epileptic seizures, coming for a spared part of the brain). The more recent concept of the epileptogenic zone as “the minimum amount of cortex that must be surgically resected (or completely disconnected) to produce seizure freedom” apparently provides a more objective definition of this zone 
. This provides an objective and practical criterion for the testing of this theoretical concept. It means that seizure-freedom after surgery is evidence that the whole epileptogenic zone was included in the resected area 
. Therefore, delineating the exact margins of the resected brain tissue epileptogenic zone postoperatively is a key step to study the epileptogenic zone and understand what characterizes it.
In patients with DRE, neuroimaging techniques, and particularly magnetic resonance imaging (MRI) coupled with electroencephalography (EEG) or magnetoencephalography (MEG) data, represent the techniques of choice to carefully plan the intervention and evaluate its effectiveness 
. Many research efforts are dedicated to extricating the associations between specific characteristics of the resected brain tissue and patients’ postsurgical outcome 
: identifying which properties of the resected tissue (also relative to the non-resected tissue) are associated with postsurgical seizure freedom constitutes the first step towards the identification and validation of epilepsy biomarkers or outcome predictors in epilepsy surgery. Recent studies on DRE have showed how the presence of specific biomarkers–such as EEG or MEG high-frequency oscillations 
, EEG phase-amplitude coupling 
, MEG discharges 
, multi-feature intracranial EEG patterns 
–in the resected tissue, relative to that in non-resected tissue, is associated with high probability of good outcome.
Therefore, the accurate segmentation of the resected brain cavity in neuroimaging data represents a crucial step for testing the epileptogenic zone concept as well as improving epilepsy surgery outcome prediction that is key for clinical decision-making.
2. Technical Aspects, Cons and Pros of Existing Methods
A wealth of different algorithms for automated, semiautomated and interactive segmentation of brain structures or abnormalities (such as tumors or lesions) have been developed in the last 20 years 
, but none of them have been specifically designed to investigate neurosurgical resections 
. This task is typically performed manually through a slice-by-slice tracing of MR images 
, which is a time-consuming procedure, requires an expert and is still prone to inter- and intra-rater errors.
An ideal medical image-segmentation process of a specific region of interest (ROI; e.g., a generic anatomical structure, a tumor, or in the researchers' case, a resection cavity) is characterized by: (i) minimum user interaction, (ii) fast computation, (iii) accurate and robust results 
, (iv) quantitative data on different sizes, shapes and location 
. Only one study, to the best of the researchers' knowledge, investigated the accuracy of different segmentation methods for resected brain areas 
: In this research, Gau et al. showed how the semiautomated (boundary-based) segmentation of the ITK-SNAP software 
outperformed the fully automated (statistical-based) approach of the lesion_GNB software 
. Statistical-based fully automated methods rely on parametric models of intensity distribution, usually available for the healthy brain: these algorithms delineate the brain regions by tuning such parameters and effectively address the problem of segmentation when intensity distributions of different tissues are a priori known 
; yet in real cases, especially for pathological brains, no prior knowledge about the data distribution is available 
. On the other hand, the semiautomated segmentation method used by Gau et al. 
was not specifically developed to delineate resection cavities and requires substantial inputs by the user, who must manually initialize the starting contour in several layers of the image, which can be both inaccurate and tedious, and could lead to errors caused by local gradients 
. This is due to the fact that boundary-based segmentation methods 
use local image features (i.e., edges) to attract an evolving contour delineating the ROI onto the target edges. The most common limitations of this class of algorithms are the long computation time, and the necessity to manually initialize the starting contour. Therefore, there is an evident need for a semiautomated user-friendly tool to accurately delineate resection cavities on patients’ MRIs. This tool should be conceived to be used to any nonexpert user without requiring fine tuning of multiple unintuitive parameters as in the currently available systems. While the specific segmentation of surgical resections has not been largely investigated yet, several semiautomated approaches have been developed for other medical applications, such as tumors, vessels or lesion segmentation 
. Semiautomatic approaches have the advantage of combining the efficiency and repeatability of automatic segmentation with the sound judgement that can only come from human expertise, resulting in higher overlaps between the outcome of the algorithm and the human segmentation compared to fully automated approaches (0.78 vs. 0.58 
). Among this type of approaches, region-growing-based methods have been largely explored 
. These methods provide a simpler way to delineate a ROI on an image, since they require the user to manually select only one seed (whose value falls in an interval that is representative for the segmentation task), which then typically grows (growing region) until the difference between its intensity and that of the next candidate voxels is higher than a predefined threshold. Region-growing methods can be successfully applied to segment ROIs with homogeneous intensity, in which the seed placement is relatively easy, as in the case of neurosurgical resections (whose intensity is homogenous and markedly different from the surrounding voxels). Lack of homogeneity may otherwise produce inaccurate segmentations that leak outside the ROI; besides this, if the ROI has an intensity level that is similar to other regions or to the background, the growing process may leak into them as well 
. When delineating a surgical resection in the brain, while the lack of homogeneity does not represent an issue, the possible leakage into the MRI background does.
3. The Researchers' Contribution
Based on all these considerations and on the results from previous neuroimaging studies, the researchers aimed at developing a semiautomated segmentation pipeline to delineate brain resections on the MRI of patients who had epilepsy surgery. The researchers used a hybrid approach that integrates a region-growing process on the patient’s postoperative MRI with the definition of a patient-specific mask through preoperative MRI segmentation in order to overcome leakage into the background. The researchers tested a variety of settings for image processing and region growth and identified the most appropriate configuration to optimize the output, thus reducing the considerable amount of human expertise otherwise needed for accurate tuning. Finally, the researchers developed a semiautomated, user-friendly graphical user interface (GUI) for brain MRI segmentation, specifically tuned and optimized to generate an accurate model of the resection and its neuroanatomical labeling, while requiring minimal user interaction and image-processing expertise. The GUI source code is freely available as a MATLAB-based application (https://github.com/rbillardello/BrainResectionApp
(accessed on 14 April 2022)).
The researchers finally presented and made publicly available an open-source, user-friendly application for medical image processing that can be used by the epilepsy research community to extract the volume and margins of a resection cavity in 3D MRIs along with its neuroanatomical labeling (anatomical resection report). The GUI is focused entirely and specifically on segmenting the resection cavity and it was designed to maximize user efficiency and the output accuracy, as:
the researchers identified the optimal values for a variety of image-processing parameters so that no tuning is needed (which would be otherwise difficult for anyone without expertise in image processing);
the researchers left the simplified parameter selection and kept it to a minimum: the researchers only left the user the option to vary one parameter and made its tuning through the GUI intuitive (see Figure 1B);
the researchers demonstrated how by varying one single parameter (among seven possible choices), the user can reach a performance that is very similar to that of a user who can vary all of them (504 choices)
the user is only asked to place an initial seed anywhere in the resection cavity that they desire to delineate (Figure 1C and Figure 2A).
GUI for the resection segmentation. (A
): Interface to select postoperative MRI and preoperative brain-mask files, or the patient’s Brainstorm [39
anatomy folder that contains them. (B
): Slider to select tolerance threshold (default: optimal value). (C
): Interface to place the initial seed using an MRI viewer (see Figure 2
) or entering its coordinates. The user can set an additional ROI for region growing by entering its ranges (this is optional, see Figure 2
): Options to exclude brain ventricles and/or generate the anatomical report through a brain parcellation file, which must be selected. E and F: the user can change the view (E
) and slice (F
) to visualize the postoperative MRI and resection model shown in G. (G
): Preview of results (left: postoperative MRI; middle: resection model, right: automated report and resection volume in cm3
): Buttons to run the segmentation (“Calculate”), or to export results to a file (NIfTI), MATLAB workspace, or directly to the initial Brainstorm anatomy folder. Status LED turns red in case of error (green otherwise). “Show 3D” button shows the resection model (see Figure 2
), while “Reset” allows to reset all settings and run again.
Figure 2. GUI popup windows. (A) MRI viewer for seed placement (when “Place Manually” is clicked). (B) Window for the definition of an optional ROI in which the region is free to grow (when “Change Ranges” button is clicked). (C) 3D MRI viewer from Brainstorm software (if “Show 3D” button is clicked) shows the 3D resection output (red). (D) If “Export to Workspace” is clicked, the user can export the output in voxel coordinates and/or in Subject Coordinates System (SCS), as well as the segmentation parameters and seed coordinates (Segmentation info). (E) Bar graph of the anatomical report (when “Generate automated report graphs” is selected).
Although delineation of the resected brain cavity on the MRI of patients who had epilepsy surgery is key for identifying biomarkers of the EZ, the current gold standard remains manual slice-by-slice tracing by experts. Here, the researchers presented a novel user-friendly open-source GUI that implements a semiautomated segmentation pipeline specifically optimized to generate resection models and their anatomical reports from patients who had epilepsy neurosurgery, while minimizing the user interaction. The GUI was validated on a cohort of 35 patients, demonstrating excellent performance, and was made publicly available to the research community.