# Deep Learning-Based Segmentation of Various Brain Lesions for Radiosurgery
## Materials and Methods  
### Dataset  
#### 2.1.1 NTUH (National Taiwan University Hospital) Dataset  
The data were extracted from a medical center in northern Taiwan. The SRS device used was CyberKnife (Accuray, Sunnyvale, CA, USA) and commenced operation in January 2008. In the decade until December 2017, there were 2578 treatment courses completed in 2411 patients. Among these, 2036 treatment courses of 1921 patients were intracranial.  
We only selected patients undergoing first SRS with contrast-enhanced T1-weighted (T1+C) MRI images available. Finally, there were 1688 patients included in our dataset. Their data were randomly divided into training and test sets (Table 1). However, because treatment targets for patients with trigeminal neuralgia are neither tumor nor vascular malformation, their data were all assigned to the training set.  
For each patient, the target was extracted from the treatment planning system together with axial T1+C MRI. Most of the time, the targets were contoured by a neurosurgeon and then reviewed by a radiation oncologist. Occasionally only one radiation oncologist contoured the targets without review by another physician. An image volume could contain more than one target, particularly in patients with brain metastases. NTUH volumes were registered to CT volumes before contouring, with tumor contours stored in CT coordinates. We had to make an inverse transformation to put the tumor labels in MRI coordinates. In other words, volumes were resampled on a common voxel grid instead of directly cropped on grids of different voxel numbers. The images were retrieved from DICOM format and saved in NIfTI-1 data format, where names, birth dates, and geographic data were removed. After registration and de-identification, these image/label pairs were used for the training and evaluation of deep neural networks. The images were presented in native axial slices, with 1-2 mm slice thicknesses. The number of slices varied from 30 to 233 since the slices did not necessarily cover the full cranial regions, instead, they could only include the region of interest. The in-plane resolution was usually 512 \(\times\) 512, and the smallest resolution was 197 \(\times\) 197. The field of view in the x-y plane was usually 300 mm, ranging from 200 to 350 mm. The pixel size was mostly 0.5859 \(\times\) 0.5859 mm\({}^{2}\) and was 1.1719 \(\times\) 1.1719 mm\({}^{2}\) for some images with lower resolution.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Types of Brain Lesions** & **Train** & **Test** \\ \hline Metastases & 504 & 53 \\ Meningioma & 314 & 29 \\ Schwannoma & 305 & 20 \\ Pituitary tumor & 147 & 8 \\ Arteriovenous malformation & 80 & 6 \\ Trigeminal neuralgia & 38 & 0 \\ Other tumors & 169 & 15 \\ Total & 1557 & 131 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Clinical diagnoses of 1688 patients in the final dataset.  
There were a total of 2568 distinct targets in these 1688 image sets. The target volumes ranged from 20 to 72,646 mm\({}^{3}\), with a median of 1236 mm\({}^{3}\) and a mean of 3696 \(\pm\) 6637 mm\({}^{3}\). In 1013 image sets, there was only one target. The number of targets may reach up to 34 in a single image set.