# Adapting the Segment Anything Model for Volumetric X-ray Data-Sets of Arbitrary Sizes
## 3 Results
### Tile-Based Algorithms and Artefact Mitigation  
Figures 14 and 15 showcase the segmentation results of a volumetric inference run using the proposed SAM algorithm on a small subset of the marble and corn data-sets for the two tile sizes \(48\times 48\times 48\) voxels and \(1024\times 1024\times 1024\) voxels. These results exhibit segmentation errors in the form of erroneous segmented edges as well as tiling artefacts, resulting in a textured appearance of the segment with noticeable gaps. Notably, for a tile size of \(48\times 48\times 48\) voxels, the marble example in Figure 15 demonstrates tiling artefacts. Since the volumetric inference algorithm with the small tile size cannot segment the entire marble in a single step, it must combine multiple steps, which can introduce and propagate errors. These artefacts can be cleaned up using a morphological closing operation as a post-processing step. In contrast, segmentations using a larger tile size of \(1024\times 1024\times 1024\) voxels exhibit fewer of these textured artefacts. However, segmentations may extend beyond the actual segment due to segmentation errors, as illustrated in Figure 14, where thin segments protrude vertically and horizontally beyond the intended boundaries. These protrusions often occur within the initially segmented slices that include the seed point of the current segment. In the green upper right marble of the example in Figure 15, the adjacent slices directly connected to the seed point were misclassified as not belonging to the marble, resulting in an early termination of the slice-wise segmentation process. The inference algorithm with a tile size of \(1024\times 1024\times 1024\) voxels can only attempt to segment the segment once as, due to its high field of view, it performs a single volumetric step per seed point. In contrast, the inference algorithm with a tile size of \(48\times 48\times 48\) voxels iterates over the volume in multiple steps, providing the ability to compensate for weak and erroneous segmentations in subsequent steps. However, this approach tends to under-segment when a neighbouring segment has already been partially segmented in a previous step. Figure 13: Poorly performing cases for SAM vit_b segmenting thin metal sheets in the Me 163 data-set as well as the better but still not optimal segmentation results achieved by the model fine-tuned on the Me 163 data-set. Figure 14: Slices from a volumetric inference run on three corn kernels of the corn data-set. The input volume (**a**), reference volume (**d**), and the proposed segmentations generated by the proposed algorithm using the two tile sizes: \(48\times 48\times 48\) voxels (**b**) and \(1024\times 1024\times 1024\) voxels (**c**). Additionally, the postprocessed volumes are depicted in (**e**,**f**). Figure 15: Slices from a volumetric inference run on three marbles of the marbles data-set. The input volume (**a**), reference volume (**d**), and the proposed segmentations generated by the proposed algorithm using the two tile sizes: \(48\times 48\times 48\) voxels (**b**) and \(1024\times 1024\times 1024\) voxels (**c**). Additionally, the postprocessed volumes are depicted in (**e**,**f**). Due to the suboptimal quality of the segmentation, it proves problematic to compute a definitive overall numerical assessment of the complete segmentation. This difficulty arises from the ambiguity in assigning each segment unambiguously to a reference segment, a result of widespread under-segmentation or over-segmentation, which gives rise to various possible interpretations. Figure 16 shows the correlation matrices for the result of four inference runs on the Me 163 testing data-sets. Two of the inference runs were performed using the default SAM model vit_b, while the other two were performed using the fine-tuned model vit_bCVB. Two of the four experiments used a tile size of \(48\times 48\times 48\) voxels and the other two used a tile size of \(1024\times 1024\times 1024\) voxels. Each experiment was fine-tuned on the validation data-set using [31].