# Structure-Aware Trail Bundling for Large DTI Datasets
## 3 Method
### DTI Bundling  
As outlined in Section 2.2, the aim of DTI bundling is to produce a visually simpler, easier to understand, structure of the dense trail set \(T\) in which salient tubes and manifolds (surfaces) inherently present in the brain-fiber structure show up. For this, we adapt the original isotropic CUBu bundling method in [8], as follows. To explain this, we first briefly introduce CUBu (for full details, we refer to [8]). For ease of reading, we reuse below, where applicable, the same notations as in [8].  
**Resampling:** For CUBu to work well, we need \(T\) to be densely, and uniformly, sampled. Given a user-specified sampling step \(\sigma\), we resample all trails \(\mathbf{t}_{i}\in T\) so that the average distance between consecutive sampling points \(\mathbf{x}_{j},\mathbf{x}_{j+1}\) on a trail \(\mathbf{t}_{i}\) equals \(\sigma\).  
Figure 1: **Left:** Sagittal slide from a DWI volume. **Right:** Mask (in light blue) for the brain region within this volume. See Section 3.1.  
**Density computation:** Given our trail set \(T\), we first compute a 3D density map \(\rho\) for points \(\mathbf{x}_{j}\) uniformly sampled along the 3D trails \(\mathbf{t}_{i}\in T\) as  
\[\rho(\mathbf{x})=\sum_{\mathbf{x}_{j}\in T,\|\mathbf{x}-\mathbf{x}_{j}\|\leq P _{R}}K(\|\mathbf{x}-\mathbf{x}_{j}\|) \tag{1}\]  
where \(K:\mathbb{R}^{+}\rightarrow\mathbb{R}^{+}\) is a parabolic (Epanechnikov) kernel of width \(P_{R}\), shown to yield better kernel density estimates (KDEs) than e.g., Gaussian kernels [38]. The kernel width \(P_{R}\) (in voxels) controls the visualization's simplification level but also the sample points \(\mathbf{x}_{j}\) considered when evaluating Equation (1). Typical good values are \(P_{R}\) in 5% to 10% of the extent of the volume \(V\). Figure 2 shows the effect of \(P_{R}\) upon the bundling. We see that increasing \(P_{R}\) simplifies the 3D trail set \(T\) more. Similar effects have been reported for 2D trail bundling applications [8], but not yet demonstrated for the bundling of 3D trail sets.  
**Advection:** We next use the density map \(\rho\) to advect every trail-sampling-point \(\mathbf{x}_{j}\) in the normalized density gradient, following  
\[\mathbf{x}_{j}^{new}=\mathbf{x}_{j}+P_{R}\frac{\
abla\rho(\mathbf{x}_{j})}{ \|\
abla\rho\mathbf{x}_{j}\|}. \tag{2}\]  
**Smoothing:** Next, following CUBu [8], we smooth the advected trails \(T^{new}=\{\mathbf{x}_{j}^{new}\}\) by applying a 1D Laplacian kernel of size \(L\) sampling points and strength \(\phi\) (see Equation (3)) to remove potential noise effects caused by the discrete advection in Equation (2).  
\[\mathbf{x}_{j}^{smooth}=(1-\phi)\mathbf{x}_{j}^{new}+\frac{\phi}{2L+1}\sum_{ k=j-L}^{j+L}\mathbf{x}_{k}^{new} \tag{3}\]  
The smoothing kernel size \(L\) is set so as to match the KDE kernel radius \(P_{R}\), i.e., \(\|\mathbf{x}_{j}-\mathbf{x}_{j-L}\|\approx P_{R}\).  
**Relaxation:** Finally, we apply a relaxation step that interpolates linearly between the bundled trails \(B(T)=\{\mathbf{x}_{j}^{smooth}\}\) and the original ones \(T\) as \(T^{relax}=\gamma B(T)+(1-\gamma)T\). Figure 3 shows this effect for two different \(\gamma\) values. Simply put, \(\gamma\) interpolates between a fully bundled (tight) visualization \(B(T)\)  
Figure 2: Effect of kernel-width bundling parameter \(P_{R}\). Rows show two different views of the same dataset. Trails are directionally colored according to the displayed legend. Gray shows the seeding-and-trail-clipping mask \(M\). See Section 3.2.  
(\(\gamma=1\)) and a fully relaxed visualization showing the original DTI trail set \(T\) (\(\gamma=0\)). Using the preset \(\gamma=0.2\) gave good results for all datasets we experimented with.  
We repeat all above steps (relaxation, resampling, density computation, advection, smoothing, and resampling) \(P_{N}\) times. As shown in [8] for 2D trail sets, and verified by us for 3D trails, the process converges yielding strongly bundled trails after \(P_{N}=15\) iterations.