# Hands-On Deformation of Volumetric Anatomical Images on a Touchscreen
## 4 Methods: User-Guided Handle Selection
### Region Growing for Handle Selection  
The seed and extent parameters defined in the previous section let users define their selection intent in an intuitive manner. The actual selection, however, requires identifying the visible part of the organ that is being touched, within the intended extent. This selection becomes a difficult task due to the complex topology of the anatomy embedded in the volume images and the lack of explicit definition of organ boundaries and connectivity. To tackle the selection problem, we resort to image segmentation techniques, in particular the well-known seeded region growing algorithm [49]. This algorithm aligns perfectly with our interaction approach, as it allows us to efficiently identify a region of the volume that is connected to the seed and fulfills some homogeneity criterion. It considers the distribution of image density values around the seed voxel, and it grows a selected region incrementally by adding other voxels whose density is within a range of the density distribution at the seed. Specifically, we start by registering the density \(\delta_{\text{seed}}\) at the seed voxel and computing the standard deviation \(\sigma_{\text{seed}}\) of density values in the 1-ring neighborhood of the seed voxel. Then, we start a breadth-first growth from the seed. For every candidate voxel that we visit, we compute a homogeneity ratio \(h\) based on its density \(\delta\) as:  
\[h=\frac{|\delta-\delta_{\text{seed}}|}{\sigma_{\text{seed}}}. \tag{1}\]  
If the homogeneity ratio is below a threshold \(h_{\text{max}}\), we accept the candidate voxel into the selected region, and we add as candidates the unvisited voxels within its six direct neighbors. In all our examples, we have used \(h_{\text{max}}=1.1\) as homogeneity threshold, indicating that we accept voxels whose density difference w.r.t. the seed voxel is less than 110% of the standard deviation of the density around the seed. The threshold value was selected by preprocessing the data and analyzing the homogeneity of the organs present in the volume. By comparing the density differences to the standard deviation around the seed, we automatically adapt the selection criterion to the level of noise in the density data, and the user only needs to specify the seed and the extent of the selection. Nevertheless, our selection method assumes that the seed and its neighborhood are representative of the whole region of interest, and distinctive with respect to other adjacent anatomy. If the contrast in the image data is not sufficient, the method may have trouble growing the selection correctly. In contrast to other segmentation approaches, region growing enables simple user-guided definition of the selection extent, following the interaction metaphor described in  
Figure 4: A mask is rasterized on the volume data to depict the selection of a handle. In the two snapshots, the extent indicated with the fingers is mapped to the selection. Section 4.1. Moreover, region growing also allows for highly efficient parallel implementation on GPUs. We follow a queue-based implementation of the region growing algorithm, where the queue is initialized with the six direct neighbors of the seed, and each pass of breadth-first search flushes the queue and repopulates it with candidate neighbors of visited voxels. We stop the growth process when the number of passes over the queue has reached the extent, or if there are no more candidate voxels. On the GPU, we launch one thread per candidate voxel in the queue. With this parallel implementation, the algorithm constitutes a parallel stencil-computation problem, which adapts perfectly to the computational paradigm of modern GPUs. However, due to the nature of the growth process, only a small fraction of the voxels are actually candidates and must be visited on each pass. Then, a simple dispatch mechanism of the parallel jobs would yield many launched threads that would perform futile computation.