## 2 Materials and Methods
### Ensemble Learning  
The total number of \(n_{\rho}\) records is randomly separated into six equal or almost equal groups. Any of these groups can serve as test data, while the other five groups are used to train the decision making ensemble. The ensembles consist of binary decision trees, whose main properties are listed in the following:  
1. The size of the ensemble is defined by the number of trees, set to \(n_{T}=125\) based on intermediary tests performed on the out-of-bag (OOB) data, which are the set of feature vectors from the training data that are never selected for training the trees of a given ensemble.
2. The training data size, represented by the number of randomly selected feature vectors used to train each tree, and denoted by \(n_{F}\), is chosen to vary between 100 thousand and one million in four steps: \(n_{F}\in\{100k,200k,500k,1000k\}\). These four values are used during the experimental evaluation of the proposed method to establish its effect on the segmentation accuracy and efficiency.
3. The selection of feature vectors for training the decision trees is not totally random. The balance of positive and negative feature vectors in the training set of each BDT is defined by the rate of negatives \(p_{-}\) and rate of positives \(p_{+}\). For the LGG and HGG data sets, \(p_{-}=93\%\) and \(p_{-}=91\%\) are used, respectively, values set according to the findings of intermediary tests performed on OOB data.
4. Trees are trained using an entropy-based rule, without limiting their depth, so that they can provide perfect separation of feature vectors representing pixels belonging to tumors and normal tissues. The trees of the ensemble have their maximum depth ranging between 25 and 45, depending on \(n_{F}\) and the random training data itself.  
```
Data: Set of MRI records involved in the study \(\mathcal{M}\), its set of pixels \(\Omega\), each pixel with 4 observed and \(n_{\varphi}-4\) computed features. Data: Parameters \(S\) and \(\delta\) Result: Atlas functions \(A_{\varphi}\), \(\varphi=1\ldots n_{\varphi}\) Result: Updated intensities in all records of \(\mathcal{M}\)  Define the set of training and test records, \(\mathcal{M}^{(T)}\) and \(\mathcal{M}^{(E)}\), respectively. for each \(M_{i}\in\mathcal{M}\)do  Compute the mapping function \(f_{i}(\pi)\) for every pixel \(\pi\in\Omega_{i}\) using  Equations (5)-(7). end for for\(\varphi=1\ldots n_{\varphi}\)do  Compute the atlas function \(A_{\varphi}(\hat{\pi})\) for every discrete point \(\hat{\pi}\in\mathcal{S}^{3}\) having \(\hat{v}_{\hat{\pi}}^{(\varphi)}>1\), using Equations (8)-(10). for each\(M_{i}\in\mathcal{M}\)do for each\(\pi\in\Omega_{i}\)do  Update the value of feature \(\varphi\) of pixel \(\pi\) using the formula given in  Equation (11).  end for  end for  end for
```  
**Algorithm 1**Build the atlas function \(A_{\varphi}\) for each feature \(\varphi=1\ldots n_{\varphi}\), and apply it to all feature data.  
When all trees of the ensemble are trained, they can be used to obtain the prediction for the feature vectors from the test data records. Each pixel from the test records receives \(n_{T}\) votes, one from each BDT. The decision of the ensemble is established by the majority rule, and that gives a label to each test pixel. However, these are intermediary labels only, as they undergo a twofold post-processing. The intermediary labels received by test pixels compose the \(S_{1}\) and \(S_{2}\) segmentation results indicated in Figure 1.