# Structure-Aware Trail Bundling for Large DTI Datasets
## 4 Scalable Implementation  
We implemented our end-to-end pipeline fully on the GPU using NVidia CUDA and programmable OpenGL (pixel shaders and tessellation) and C++ for the main architecture. The various scalar volumes (DTI, fractional anisotropy, density \(\rho\)) are implemented as 32-bit floating-point 3D textures. Density estimation (Equation (1)) is implemented by separable convolution requiring three one-dimensional passes. For the density map \(\rho\), we use volumes of higher (up to 8 times) resolution than the original DTI volumes (Table 1), as the latter are too coarse for the accuracy needed to compute the gradient \(\
abla\rho\) (Equation (2)). Gradient estimation is done by central differences. The above implementation can efficiently compute and render the fiber bundling of large trail sets. Table 2 shows, for three different DTI datasets, the number of trails \(|T|\), sampling points \(\mathbf{x}_{j}\), average time per bundling iteration (over 15 total iterations), and total bundling-and-rendering time. Experiments were done on a PC running Ubuntu Linux using a NVidia GTX 1080 graphics card (2560 CUDA cores). Time includes the CPU-to-GPU transfer of trail sets needed to load the input dataset \(T\) on the GPU prior to doing the bundling proper. The rendering time is a small fraction of the total time--under 4%--and as such not reported separately. For each of the three datasets, we constructed two trail sets, one with 50 K trails, and the other one with 500 K trails (all of them randomly seeded). Details over these available datasets are shown in Table 1. The table lists the (public) data sources, identification of the dataset in terms of patient (subject) ID and accession number, and data characteristics--DTI volume size, voxel size, and number of diffusion directions used to acquire the DTI tensor field. Summarizing Table 1, we argue that our data is compatible with real-world, large, and complex DTI volumes used in medical practice. Table 2 shows us several insights. First and foremost, we see that the end-to-end processing time of our pipeline is of a _few seconds_ at most, even for the large (500 K) trail sets. Given that we bundle a \(3D\)_trail set_, and that we perform additional steps during bundling--constrained advection (Section 3.2.1), anisotropy bundling (Section 3.2.2), and tract reseeding (Section 3.2.3), this is just slightly slower than the 2D bundling reported by CUBu [8], which, according to the survey in [7] is by one up to two \begin{table}
\begin{tabular}{l l l l} \hline \hline  & **Dataset 1** & **Dataset 2** & **Dataset 3** \\ \hline Data source & 3 DSlicer [48] & OpenfMRI [49] & HCP [50] \\ Subject ID & n/a & Subject 10159 & mgh\_1001 \\ Accession number & n/a & ds000030 & 501322 \\ Volume sizes & \(128\times 128\times 94\) & \(96\times 96\times 50\) & \(140\times 140\times 96\) \\ Voxel size (mm) & \(1.5\times 1.5\times 1.5\) & \(1.98\times 1.98\times 2\) & \(1.5\times 1.5\times 1.5\) \\ Diffusion directions & 42 & 64 & 512 \\ Mask sizes & \(88\times 111\times 82\) & \(61\times 82\times 42\) & \(84\times 98\times 83\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Datasets used in the evaluation. Figure 11: Creating bundle outlines. Trail set rendered (**a**) with shading but no outlines, (**b**) with shading and outlines, and (**c**) as outlines only. See Section 3.3.4.  
orders of magnitude the fastest method for bundling general 2D trail sets. Additionally, note that the bundling step (Section 3.2) is typically done only sparsely during a dataset investigation. Once the desired geometry is obtained, that geometry is next interactively explored using different rendering settings (Section 3.3) and viewpoints. Changing these is, as we mentioned above, real time. The memory requirements of our method are dominated by storing the density volume needed to sample the KDE density map \(\rho\) (Equation (1)). Additional costs involve storing the sample points for \(T\).