## 3 Theory and Methodology
### The Optimal Segmentation Boundary  
In Figure 3, we can see that the boundary in the bottom right around the white matter stays stable when threshold changes from 100 to 105, but those around the gray matter (GM, shown in the cyan bounding box) change significantly. Furthermore, when the threshold changes from 105 to 110, the boundaries inside the GM change significantly. Both the situations show that those boundaries near the truth of tissue boundaries may possess higher stability as the thresholds change. We designed an experiment to test for a significant difference in stability between pixels around the true boundaries and the rest. In our experiment, we randomly selected 3000 samples from the image to form a set \(S\) and filtered out those in the background. The samples were labeled as positive if their distance to the edge was less than 1 or labeled as negative if was greater than 1. As Figure 4 shows, for each pixel \(s\in S\), we recorded the lower segmentation threshold bound \(L(s)\) and the upper segmentation threshold bound \(U(s)\) when it appeared near the edges. By measuring the range \(\Delta(s)\) of the two thresholds, we could compare the distributions of \(\Delta\) in the positive and negative groups to see if there existed a certain tendency. \[\Delta(s)=U(s)-L(s) \tag{1}\]  
Figure 3: Edges of the thresholding result. (**a**) Top left: 100; top middle: 105; top right: 100 (blue), 105 (red); bottom: local thresholding result of the region in the cyan box with 100–105 and the heatmap at the rightmost; (**b**) top left: 105; top middle: 110; top right: 105 (blue), 110 (red); bottom: local thresholding result of the region in cyan box with 105–110 and the heatmap at the rightmost. (The heatmap was generated as follows: As the threshold varies, superimpose the boundary pixels and increase the pixel count by one each time. The pixel with the highest count is set to the darkest blue. Thus, the darker a boundary pixel is, the more stable it is). Figure 5 illustrates the \(\Delta(s)\) distribution statistics for positive samples (blue dots) and negative samples (red dots) across two slices used in the experiment, highlighting that positive samples exhibit a larger average \(\Delta\) than negative samples. To assess the difference in central tendency between these two populations, we conducted a Mann-Whitney test. The null hypothesis (\(H_{0}\)) is that the population \(X\) and \(Y\) have the same distribution; the alternative hypothesis (\(H_{1}\)) is that they have different distributions. Figure 4: Definitions of \(L(s)\) and \(U(s)\). Figure 5: Threshold range \(\Delta(s)\) distribution statistics, the blue and red lines represent the fittings of the positive and negative distributions, respectively. (**a**) displays the original experimental image; the ground truth segmentation of gray matter, white matter, and cerebrospinal fluid; and the selected points for positive and negative samples. (**b**) shows the \(\Delta(s)\) distribution statistics of the positive and negative samples from (**a**), where the horizontal axis represents delta and the vertical axis indicates its frequency. (**c**,**d**) are the results from a different slice. The Mann-Whitney U statistic is defined as  
\[U=\sum_{i=1}^{n}\sum_{j=1}^{m}S(X_{i},Y_{j}), \tag{2}\]  
where  
\[S= \begin{cases}1&X<Y\\ \frac{1}{2}&X=Y\\ 0&X>Y\end{cases}  \tag{3}\]  
The statistics for some slices in the BrainWeb dataset are calculated. As shown in Table 1, if we select a confidence level of \(1-\alpha=0.95\), we can conclude that the \(\Delta\) values from these two groups are from different distributions. To the best of our knowledge, there are few intensity-based methods that consider pixel-wise edge stability. [PERSON] [56] evaluated shape stability with the region expanding rate (RER) and selected a threshold with a low RER; [PERSON] [57] considered the area-stable elongation to find the stable region. All of the above methods measured an overall stability pattern between boundaries.