diffusion - weighted imaging ( dwi ) is a recent , noninvasive magnetic resonance imaging ( mri ) technique that allows the user to measure the diffusion of water molecules in a given direction . diffusion tensor imaging ( dti )   describes the diffusion measured with dwi as a second - order tensor . dwi works on the knowledge that the diffusion of water molecules within biological tissue is influenced by the microscopic structure of the tissue . the theory of brownian motion dictates that molecules within a uniform volume of water will diffuse randomly in all directions , that is , the diffusion is isotropic . however , in the presence of objects that hinder the diffusion of water in some specific directions , the diffusion will become anisotropic . in fibrous tissue , the diffusion of water will be large in the direction parallel to the fibers and small in perpendicular directions . therefore , dwi data is used to deduce and analyze the structure of fibrous tissue , such as the white matter of the brain , and muscular tissue in the heart . dwi data has been used during the planning stages of neurosurgery , and in the diagnosis and treatment of certain diseases , such as alzheimer 's disease , multiple sclerosis , and strokes . since the tissue of the white matter is macroscopically homogeneous , other imaging techniques , such as t2-weighted mri , are unable to detect the structure of the underlying fibers , making dwi uniquely suitable for in vivo inspection of white matter . the process of using the measured diffusion to reconstruct the underlying fiber structure is called fiber tracking . this paper focuses on an approach in which fibers are constructed by finding geodesics on a riemannian manifold defined by the dti data . this technique , called geodesic ray - tracing [ 6 , 7 ] , has several advantages over other ones , such as its relatively low sensitivity to measurement noise , and its ability to identify multiple solutions between two points , which makes it suitable for analysis of complex structures . our goal is to overcome this problem by mapping the geodesic ray - tracing algorithm onto the highly parallel architecture of a graphical processing unit ( gpu ) , using the cuda programming language . since fibers can be computed independently of each other , the geodesic ray - tracing algorithm can be meaningfully parallelized . as a result , the running time can be reduced by a factor of up to 40 , compared to a multithreaded cpu implementation . the paper describes the structure of the cuda implementation , as well as the relevant design considerations . in the next section , we discuss the background theory related to our method , including dti and the geodesic ray - tracing algorithm . next , we give an overview of past research related to the gpu - based acceleration of fiber tracking algorithms . in section 4 , the implementation of the geodesic ray - tracing algorithm on a gpu using cuda is discussed . next , we show benchmarking results and optimization strategies for the cuda implementation in section 5 , followed by a discussion of the results in section 6 , and a conclusion in section 7 . dti allows us to reconstruct the connectivity of the white matter , thus giving us greater insight into the structure of the brain . after performing dwi for multiple different directions , we can model the diffusion process using a second - order tensor d [ 1 , 8 ] . d is a 3    3 positive - definite tensor , which can be visualized as an ellipsoid defined by its eigenvectors and eigenvalues , as shown in figure 1 . using the eigenvalues of a tensor , we can quantify its level of anisotropy using anisotropy measures [ 9 , 10 ] . in areas with nearly isotropic diffusion , tensor ellipsoids will be nearly spherical , and anisotropy measure values will be low , while in areas with highly anisotropic diffusion ( due to the presence of fibers ) , ellipsoids will be sharp and elongated , and anisotropy values will be high . in anisotropic areas , the eigenvector corresponding to the largest eigenvalue ( the main eigenvector ) will indicate the direction of the fibrous structure . dti fiber tracking is the process of digitally reconstructing the pathways of fibers in fibrous tissue using the dti tensor data , with the aim of deducing the structure of the tissue . a common approach to fiber tracking is to track lines from one or more seed points , using a set of differential equations . the most straightforward fiber tracking algorithm ( generally called the streamline method ) uses the direction of the main eigenvector as the local orientation of the fibers . thus , a fiber in biological tissue may be reconstructed by integration of the main eigenvector , using an ordinary differential equation ( ode ) solver such as euler 's method . fiber tracking algorithms based on this approach have been shown to achieve acceptable results [ 13 , 14 ] , but are limited in their accuracy by a high sensitivity to noise and to the partial volume effect [ 15 , 16 ] . one possible solution to the limitations of classic streamline methods is to use a global minimization solution , for example , a front - propagation method . in such a method , a front is propagated from a seed point throughout the entire volume [ 1719 ] . the local propagation speed of the front depends on the characteristics of the dti image , and fibers are constructed by back - tracing through the characteristics of the front . a subset of these front - propagation methods use the theory of geodesics to find potential fiber connections [ 1921 ] . these algorithms generally compute the geodesics ( defined as the shortest path through a tensor - warped space ) by solving the stationary hamilton - jacobi ( hj ) equation . geodesic algorithms have been shown to produce good results and are generally more robust to noise than simple streamline methods . one disadvantage , however , is that they generally only find a single possible connection between target regions , which is often not the correct solution in very complex areas . furthermore , research has shown it is possible to have multiple fiber connections between regions of the white matter . the focus of this paper is a relatively new fiber tracking algorithm based on geodesics , as proposed by sepasian et al . the main advantages of this algorithm , compared to those discussed in the previous section , are the fact that it provides a multivalued solution ( i.e. , it allows us to find multiple geodesics between regions in the brain ) , and the fact that it is able to detect fibers in regions with low anisotropy ( e.g. , regions of the white matter with crossing fiber bundles ) . in figure 3 , we show that this algorithm is capable of detecting complex structural features , such as the divergence of the corpus callosum , which can not be captured using streamline - based methods . detailed validation of this algorithm is considered beyond the scope of this paper ; for an in - depth discussion on the validity and applicability of the algorithm , we refer the reader to the works by sepasian et al . this is a real , differentiable manifold , on which each tangent space is equipped with a so - called riemannian metric , which is a positive - definite tensor . roughly speaking , the elements of the metric tensor are an indication of the cost of ( or energy required for ) moving in a specific direction . for dti data , large values in the dti tensor correspond to small values in its inverse , indicating low diffusion costs , and vice versa . locally , a geodesic will tend to follow the direction with the lowest metric value , which is analogous to the direction with the highest diffusion . we define the riemannian metric as g = d , where d is the diffusion tensor . in the algorithm discussed in this paper , the trajectory of a fiber the odes used to compute the trajectory of the fiber are derived from the theory of geodesics in a riemannian manifold , as shown below . let x( ) be a smooth , differentiable curve through a volume described by parameter  = [ 0 , t ] , with derivative vector x( ) . we define the riemannian length of x( ) as follows : 
 ( 1)l(x)=0txtgxd. 
  the geodesic is the line that minimizes the geodesic length of ( 1 ) . we can use the euler - lagrange equations to translate this function to a set of odes , as described in detail by jost . let x and x be the first and second derivatives with regard to  , respectively , of the geodesic for dimension  = ( 1 ,  2 ,  3 ) . the odes that allow us to compute the geodesics are given by the following equation : 
 ( 2)x+=13  =13xx=0 , 
							 where  are the so - called christoffel symbols , defined as follows : 
 ( 3)==1312[g(xg+xgxg ) ] . here , gij represents element ( i , j ) of the inverse diffusion tensor , while g represents an element of the original diffusion tensor . we note that , in order to compute all christoffel symbols , we need to compute the derivatives of the inverse dti tensor in all three dimensions . given an initial position and an initial direction , we can construct a path through the 3d dti image , using the second - order runge - kutta ode solver . the initial position is usually specified by the user , who is interested in a particular area of the tissue ( in our case , the white matter ) . for the initial direction , we can use a large number of directions per seed points ( distributed either uniformly on a sphere , or around the main eigenvector ) , and see which of the resulting fibers intersect some user - specified target region . doing so increases our chances of finding all valid connections between the seed point(s ) and the target region(s ) . this approach , which is referred to as the region - to - region connectivity approach , requires a suitable connectivity measure , which quantifies the strength of the connection between seed point and target region . in other words , this measure symbolizes the probability that a computed geodesic corresponds to an actual fibrous connection in the white matter . while this paper does not discuss the implementation of the region - to - region connectivity approach , we do note that in order to reliably find all geodesics between the seed point(s ) and the target region , we need to compute a large amount of trajectories in all directions . this need for a large amount of fibers , in combination with the high computational complexity of the algorithm itself , motivates our decision to parallelize the geodesic ray - tracing algorithm . the possibility of using the gpu to accelerate fiber tracking algorithms ( using cuda or other languages ) has recently been explored in other literature [ 2528 ] . these implementations use either geometric shaders or fragment shaders to accelerate the streamline tracking algorithm . with the exception of mittmann et al . , who introduce a stochastic element , these papers all use the simple streamline method for fiber tracking , in which the main eigenvector of the dti tensor is used as the direction vector for the integration step . in addition to using algorithms with a lower computational complexity than the geodesic ray - tracing algorithm discussed in section 2.3 , these implementations differ from ours in the sense that they use gpu shaders to compute the fibers , while we use cuda , which offers higher flexibility and a more gentle learning curve than programmable gpu shaders . more recently , mittmann et al . introduced a gpu implementation of a simple streamline algorithm using cuda . compared to a multithreaded cpu implementation , this gpu implementation allows for a significantly higher frame rate , enabling real - time , interactive exploration of large groups of fibers . the speedup factor , based on the number of frames per second , is between 10 and 20 times . the paper 's main focus , however , is interactivity , and a technical discussion of the advantages and limitations of cuda in the context of fiber tracking algorithms is omitted . jeong et al .   have developed a cuda implementation of a fiber tracking algorithm based on the hamilton - jacobi equation , which computes the fiber pathways by propagating a front throughout the entire volume . their solution parallelizes the propagation of the front by dividing the dti image into blocks of 43 voxels , after which the front is propagated through a number of such blocks in parallel . this approach has been shown to be 50 to 100 times faster than sequential implementations of similar algorithms on a cpu . however , as stated in section 2.3 , the hj algorithm on which they base their implementation is not able to find multiple connections between target regions . furthermore , the front - propagation algorithm used by jeong et al . requires a fundamentally different parallelization approach from our ray - tracing method . we therefore conclude that our solution is the first cuda - aided acceleration of a fiber tracking algorithm of this complexity . as will be shown in the next sections , the complex nature of the algorithm introduces a number of challenges to the parallelization process . furthermore , the advantages of the geodesic ray - tracing algorithm , as discussed in section 2.3 , suggest that its implementation will also have practical applications . in section 2.3 , we introduced a system of odes which can be used to compute the trajectory of a fiber , given an initial position and direction . the basis of our algorithm is an ode solver which numerically solves ( 2 ) using a fixed integration step length . specifically , let xi be the coordinate of point i along the fiber for dimension  , and let xi be the local direction of the fiber in this point . using euler as the ode solver , we can compute xi+1 and xi+1 ( i.e. , the position and direction at the next time step ) as follows : 
 ( 4)xi+1=xi+hxi,xi+1=xih=13  =13xx. 
  here , h is a fixed step size , and  is the christoffel symbol as defined in ( 3 ) . in the implementation described below , we use a second - order runge - kutta ode solver instead of the euler solver , but the basic method of numerically solving the system of odes remains the same . when computing the christoffel symbols , the four required tensors ( inverse dti tensors and its three derivates ) are interpolated using trilinear interpolation . to summarize , a single integration step of the ode solver consists of the following actions . compute the inverse diffusion tensor and its derivative in all three dimensions for the eight voxels surrounding the current fiber point ( xi ) . compute all christoffel symbols . according to ( 2 ) and ( 3 ) , we require nine symbols per dimension , for a total of 27 symbols . however , using the symmetric qualities of the diffusion tensor ( and therefore , of its inverse and the derivates of its inverse ) , we can reduce this to 18 unique symbols .   using the christoffel symbols , , the only stopping condition is the fiber leaving the volume of the dti image . while this increases the amount of memory required by the algorithm , it also significantly decreases the number of required computations per integration step . this pre - processing step has been implemented in cuda , but due to its trivial implementation and relatively low running time ( compared the that of steps 2 through 5 ) , we do not discuss it in detail , instead focusing on the actual tracking process . figure 4 summarizes the tracking process of steps 2 through 5 , assuming the four input tensor fields have been computed in a pre - processing step . the region - to - region connectivity approach outlined in section 2.3 presents us with one significant problem : it requires the computation of a large number of geodesics . in combination with the relatively complex odes presented in ( 2 ) ( compared to the odes used for simpler fiber tracking methods ) , this makes this approach computationally expensive . our aim is to overcome this hurdle by implementing the algorithm in cuda , of which we give a quick overview in this section . nvidia 's compute unified device architecture ( cuda )   is a way to facilitate general - purpose computing on graphics processing units ( gpgpu ) . modern gpus contain large number of generic processors in parallel , and cuda allows a programmer to utilize this large computational power for nongraphical purposes . in cuda , a kernel ( usually a small , simple function ) is executed in parallel by a large number of threads , each working on one part of the input data . in a typical execution pattern , the host pc first uploads the input data to the gpu , then launches a number of threads that execute the kernel . the resulting data is then either downloaded back to the host pc or drawn on the screen . a cuda - enabled gpu generally consists of the device memory , which is between 512  mb and 2  gb on most modern gpus , and a number of multiprocessors . each multiprocessor contains eight scalar processors ( in most current - generation gpus ; newer generations will have more scalar processors per multiprocessor ) ; a register file ; a shared memory block , which enables communication between the scalar processors ; and an instruction unit , which dispatches instructions to the processors . the type of parallelism in these multiprocessors is called single instruction , multiple threads ( simt ) , which differs from single instruction , multiple data ( simd ) in the sense that the threads have some level of independence . ideally , all active threads in a multiprocessor will execute the same instruction at the same time ; however , unlike simd , simt also allows for branching threads using if - statements . while this does allow the programmer to create more complex kernels , it also adds an overhead in terms of execution time , since the different branches must be executed sequentially . the two memory blocks local to each multiprocessor  the register file and the shared memory  both have low memory access latencies . however , the available space in these two memory blocks is limited , with typical values of 16  kb for the shared memory , and 16 or 32  kb for the register file . the device memory has far more storage space , but accessing this memory adds a latency of between 400 and 900 clock cycles . the device memory contains four different memory spaces : 
 constant memory , a small , read - only block best used for constant values ;  
 texture memory , a read - only space optimized for texture reads ;  
 global memory , the main random - access memory space ;  
 local memory , a per - thread extension of the register file . local memory is used when the register file of a multiprocessor can not contain all variables of a kernel . since access latencies to the device memory are very high , the use of large kernels is generally best avoided . as a general rule , communication between the device memory and the multiprocessors should be kept as low as possible . a second important guideline is that the size of the kernels , in terms of the number of registers per thread and the amount of shared memory used per thread block , should be kept small . doing so will allow the gpu to run more threads in parallel , thus increasing the occupancy of the scalar processors ( i.e. , the percentage of time that each scalar processor is active ) . keeping in mind the advantages and limitations of cuda as discussed in section 4.2 , we can design a cuda implementation for the algorithm introduced in section 2.3 . as mentioned in step 3 of the algorithm as outlined in section 4.1 , we require the derivatives of the inverse of the dti tensor in all three dimensions . we intuitively see that computing these derivatives for each point along the fiber would be far too costly in terms of the number of instructions , as computing these derivates for all eight surrounding voxels ( using two - sided numerical derivation ) would require the inversion of 32 diffusion tensors . this gives us four input tensors per voxel : the diffusion tensor and the three derivatives of its inverse . with six unique elements per tensor and four bytes per value , this gives us a memory requirement of 464 = 96 bytes per voxel . the algorithm also has the seed points as input , which contain the initial position and direction for each fiber . these seed points are determined by the user , for example , by specifying a region of interest in the image . the output of the algorithm consists of a number of fibers , each consisting of a list of 3d coordinates . in postprocessing steps , these fibers can be filtered through the target region(s ) and sorted according to their connectivity measure value , but these steps are not part of the cuda implementation discussed herein . since cuda does not support dynamic memory allocation , we hard - coded a limit in the number of iteration steps for each fiber , and statically allocated an output array per fiber of corresponding size . we note here that the choice of this limit may impact performance : for high limits , more fibers will terminate prematurely ( due to leaving the volume ) , leading to lower occupancy in later stages of the algorithm , while for lower limits , the start - up overhead of the cuda algorithm may become relevant . we intuitively recognize two different approaches for parallelization of the geodesic ray - tracing algorithm : per - region parallelization and per - fiber parallelization . the per - region approach would entail loading a small region of the image into the shared memory of a multiprocessor , tracking a number of fibers through this region ( using one thread per fiber ) , and then loading the next region . while this approach would guarantee low memory bandwidth requirements between the multiprocessors and the device memory , it is impractical due to two reasons . first , it is impossible to guarantee that a region will contain a sufficient number of fibers to enable meaningful parallelization . second , due to the limited size of the shared memory , these regions would be very small ( no more than approximately 160 voxels per region ) , which would defeat the purpose of this approach . in other words , this approach requires some degree of spatial coherence between the fibers , and since we do not know their trajectories beforehand , ensuring this spatial coherence is highly impractical . we therefore use the per - fiber parallelization approach , in which each thread computes a single fiber . the main advantage of this approach is that it does not require any spatial coherence between the fibers to efficiently utilize the parallelism offered by the gpu . as long as we have a high number of seed points and initial directions , all scalar processors of the gpu will be able to run their own threads individual of the other threads , thus minimizing the need for elaborate synchronization between threads , and guaranteeing a stable computational throughput for all active processors . the main disadvantage of this approach is that it requires a higher memory throughput than the per - region approach , as it does not allow us to avoid redundant memory reads . the kernel that executes the fiber tracking process executes the following steps , as summarized in figure 4 : fetch the initial position and direction of the fiber .   for the current fiber position , fetch the diffusion tensor and the derivatives of its inverse , using trilinear interpolation .   using these four tensors , using the symbols and the current direction , compute the next position and direction of the fiber , using the odes of ( 2 ) with a second - order runge - kutta step . stop if the fiber has left the volume or the maximum number of steps has been reached . as noted in the previous section , the main disadvantage of the per - fiber parallelization approach is that it does not allow us to avoid redundant reads . we can partially solve this problem by storing the input images in texture memory , rather than in global memory . unlike global memory reads , texture memory reads are cached through a number of small caches . these caches can contain about 8  kb per multiprocessor , although the actual amount varies per gpu . while we argue that cached memory reads could reduce the required memory throughput , we note that the lack of spatial coherence between the fibers , coupled with the small cache sizes , will largely negate the positive effects of cached memory reads . a second , more important advantage of the texture memory is the built - in texture filtering functionality . when reading texture data from a position located between grid points , cuda will apply either nearest - neighbor or linear interpolation using dedicated texture filtering hardware . when storing the input data in the global memory , all interpolation must be done in - kernel , which increases both the number of instructions per integration step , and the amount of memory required by the kernels . by delegating the interpolation process to this dedicated hardware , we are able to reduce both the size and the computational complexity of the kernels . the size is especially important in this case , as smaller kernels allow for a higher degree of parallelism . while we expect the use of texture - filtering interpolation to be beneficial for the running time of our algorithm ( which we will demonstrate in the next section ) , we do identify one possible trade - off . one property of in - kernel interpolation is that the values of the eight surrounding voxels can be stored in either the local memory of the thread , or in the shared memory of the multiprocessor . doing so increases the size of the threads , but also allows them to reuse some of this data , thus reducing the memory throughput requirements . using texture - filtering interpolation , we can not store the surrounding voxel values , so we need to read them again in every integration step . thus , in - kernel interpolation may require a significantly lower memory throughput than texture - filtering interpolation , especially for small step sizes ( in which case it takes multiple steps for a fiber to cross a cell ) . for the experiments presented in this section , we used a synthetic data set of 1024  64  64 voxels with 2048 predefined seed points . the seed points were distributed randomly to mimic the low spatial coherence of the fibers , and their initial directions were chosen in such a way that no thread would terminate prematurely due to its fiber leaving the volume ( i.e. , all fibers stay within the volume for the predefined maximum number of integration steps , running parallel to the long edge of the volume ) . while neither the shape and content of the volume nor the fact that no fibers leave the volume prematurely can be considered realistic all experiments were conducted on an nvidia gtx 260 , a mid - range model with 24 multiprocessors ( for a total of 192 scalar processors ) and 1 gigabyte of device memory . it should be noted that we only consider the actual fiber tracking process for our benchmarks . the data preparation stage ( which includes preprocessing and inverting the tensors , and computing the derivatives of the inverse tensors ) has also been implemented in cuda , but is considered outside of the scope of this paper due to its low complexity , trivial parallelization , and low running times compared to the tracking stage . on the gtx 260 , the data preparation stage requires roughly 50 milliseconds per million voxels , and only needs to be executed once per image . the overhead resulting from the communication between the cpu and gpu lies in the order of a few milliseconds . in section 4.4 , we stated that using the dedicated texture filtering hardware for the trilinear interpolation step of our algorithm would significantly reduce the size and complexity of our kernel , allowing for an increase in performance . we also identified a possible trade - off : for small step sizes , in - kernel interpolation might be faster than texture - filtering interpolation , as the former allows for data reuse , while the latter does not . we test this hypothesis by varying the step size between 0.05 ( i.e. , twenty steps per cell on average ) and 0.5 ( two steps ) . the measured running times for the two proposed interpolation methods are shown in figure 6 . from this , we can conclude that , while small step sizes do indeed reduce the running times for in - kernel interpolation , texture - filtering interpolation is still the faster option for typical step size values ( between 0.1 and 0.2 ) . the performance of cuda programs is usually limited either by the maximum memory throughput between the device memory and the multiprocessors , or by the maximum computational throughput of the scalar processors . to find out which of these two is the limiting factor for our algorithm , we first compute its performance in terms of memory throughput and computational throughput . when computing 2048 fibers , each executing 4096 integration steps , the algorithm takes approximately 165 milliseconds to complete . for each integration step , a single thread needs to read 8 voxels  4 tensors  6 unique tensor elements  4 bytes  =  768 bytes , and it writes 12 bytes ( 3d coordinates of the new point ) . this gives us a total memory transfer of 780  2048  4096  6.54  gb . dividing this by the running time , we get an effective memory throughput of approximately 3.97  gb / s , which is well below the maximum 111.9  gb / s of the gtx 260 .   to compute the computation throughput in flops ( floating - point operations per second ) , we first decompile the cuda program using the decuda software . by inspecting the resulting code note that this does not include any instructions needed for interpolation , since we are using the dedicated texture filtering hardware for this purpose . the algorithm performs a total of 256  2048  4096 = 2,147,483,648 floating - point operations , giving us a computational throughput of roughly 13 gflops . again , this is well below the specified maximum of the gtx 260 , which is 715 gflops . since neither the memory throughput nor the computational throughput is close to the specified maximum , we need to determine the limiting factor in a different way . we first rule out the computational throughput as the limiting factor by replacing the current second - order runge - kutta ( rk2 ) ode solver by a simple euler solver . this does not reduce the amount of data transferred between device memory and multiprocessors , but it does reduce the number of floating - point operations per integration step from 256 to 195 . this , however , does not significantly impact the running time ( 165.133  ms for rk2 versus 165.347  ms for euler ) , indicating that the computational throughput ( i.e. , processor load ) is not a limiting factor in our case . to prove that the memory throughput is indeed the limiting factor , we need to reduce the amount of data read in each integration step , without changing the number of instructions . we do so by using the knowledge that the four input tensors of our synthetic data set share a number of duplicate values . by removing some of the redundant reads , we can reduce the memory requirements of each thread , without compromising the mathematical correctness of the algorithm . , we can conclude that the performance of our algorithm is limited by the memory throughput , despite the actual throughput being significantly lower than the theoretical maximum of the gtx 260 . possible explanations for this discrepancy are listed in section 6 . to evaluate the performance of our cuda implementation , we compare its running times to those of a c++ implementation of the same algorithm running on a modern cpu . in order to fully explore the performance gain , we use four different cuda - supported gpus : the quadro fx 770 m , the geforce 8800 gt , the geforce gtx 260 , and the geforce gtx 470 . it should be noted that our cuda implementation was developed for the gtx 260 and was not modified for execution on the other gpus . in particular , this means that we did not optimize our algorithm to make use of the improved cuda features of the more recent gtx 470 gpu . the cpu running the c++ implementation is an intel core i5 750 , which has four cores , with a clock speed of 2.67  ghz . in terms of both date of release and price segment , the i5 750 ( released in fall 2009 ) is closest to the gtx 470 ( spring 2010 ) ; at the time of writing , both are considered mid- to high - range consumer products of the previous generation . for this benchmark , we use a brain dti image with dimensions of 128    128    30 voxels . seed points are placed in a small , two - dimensional region of 22 by 4 voxels , located in a part of the corpus callosum . an approximation of the seed region , as well as the resulting fibers , is shown in figure 8 . this test thus closely mimics a real - life application of the ray - tracing algorithm , as demonstrated in figure 8 . our c++ implementation of the algorithm features support for multiple threads of execution ( multithreading ) , which allows it to utilize the parallelism offered by the cpu 's four cores . we assign s / n seed points to each cpu thread , thus having each thread compute s / n fibers . we have measured the running times of this cpu implementation for several different values of n , and with s set to 4096 points . , we can conclude that parallelizing the cpu implementation ( using essentially the same fiber - level parallelism as for our gpu implementation ) can reduce the running times by a factor of roughly 4.5 . the fact that the performance increases for n larger than the number of cores can be attributed to the fact that a cpu core can switch to a different thread when the active thread is waiting for data from the main memory of the pc . from figure 7 , we can also conclude that 64 threads is the best configuration for this algorithm and this cpu . we performed the same benchmarking experiment on the four cuda - enabled gpus , and we compared the running times to those of the best cpu configuration . the results for this test are shown in table 3 . from the results , we can conclude that our cuda implementation significantly reduces the running time of the ray - tracing algorithm . even on a mid - range gpu for laptops like the fx 770 m , the running time is reduced by a factor of roughly two times . using a high - end , recent gpu like the gtx 470 , we are even able to achieve a speed - up factor of 40 times , which greatly increases the applicability of the algorithm . the differences in speed - up factors between the gpus can be explained in part by the differences in bandwidth  which was identified as the limiting factor in section 5.2and by the number of processors . in previous sections , we described a cuda implementation of a geodesic fiber tracking method . this cuda program uses the knowledge that fibers can be computed independently of one another to parallelize these computations , thus reducing running times by a factor of up to 40 times , compared to multithreaded cpu implementations of the same algorithm . while the algorithm does allow for meaningful parallelization , we do note two problems that make full exploitation of the parallelism offered by the gpu challenging . the algorithm requires a large amount of internal storage ; between the four input tensors , the christoffel symbol , and the position and direction of the fiber , even the most efficient version of our implementation still required 43 registers per thread , while typical values for cuda algorithms are between 8 and 32 . more importantly , the algorithm requires a large amount of data transfer , and as a result , the memory throughput becomes its limiting factor . this problem is far from trivial to solve , and while some options do exist , they all have their own downsides . ( 1)reducing the number of bits per input value would lower the required memory throughput , but comes at the cost of reduced accuracy . ( 2)allowing fibers to reuse the input data used for interpolation greatly increases the size of the kernel and does not work with texture - filtering interpolation , the use of which has been shown to be very beneficial in our case . ( 3)sharing the input data between threads in one multiprocessor requires some sort of spatial coherence between the fibers , which is extremely difficult to guarantee . reducing the number of bits per input value would lower the required memory throughput , but comes at the cost of reduced accuracy .   allowing fibers to reuse the input data used for interpolation greatly increases the size of the kernel and does not work with texture - filtering interpolation , the use of which has been shown to be very beneficial in our case . sharing the input data between threads in one multiprocessor requires some sort of spatial coherence between the fibers , which is extremely difficult to guarantee . as noted , the memory throughput between the device memory and the multiprocessors is the limiting factor for our performance . however , as noted in section 5.2 , the actual throughput is well below the theoretical maximum of the device . most random - access memory ( ram ) configurations experience a certain overhead when subsequent reads access different parts of a data range . since a low spatial locality of the seed points will lead to such scattered access pattern , this overhead may explain our relatively low memory throughput .   according to cuda documentation , texture reads have been optimized for 2d spatial locality , presumably using a space - filling curve . the throughput of the texture fetching and filtering units may become a limiting factor when large numbers of voxels are involved . the documentation of the gtx 260 states that it should be able to process 36.9 billion texels per second , while our implementation only loads 39 billion bytes ( of multibyte texels ) per second . however , this figure is based on 2d bilinear interpolation , while we use 3d trilinear interpolation . we expect the first point to be the main contributing factor , though we have not conducted experiments to either prove or disprove this hypothesis . the gpu - based acceleration of the geodesic ray - tracing algorithm for dti is a useful technique , but its implementation poses several challenges . part of the problem in accelerating numerical integration algorithms such as the one under discussion in the paper is that it almost inevitably introduces unpredictable memory access patterns , while existing cuda algorithms generally use access patterns that are more regular and predictable , and thus easier to optimize . this is a fundamental problem without an easy solution , and one that is not restricted to cuda - enabled gpus , but applies to other parallel platforms as well . still , despite our implementation achieving suboptimal performance , we do believe that its significant speed - up factor of up to 40 times , coupled with the low cost and high availability of cuda - enabled hardware , makes it a practical solution to the computational complexity of the geodesic ray - tracing algorithm for fiber tracking , and a good starting point for future acceleration of similar algorithms . in this paper , we discussed the gpu - based acceleration of a geodesic ray - tracing algorithm for fiber tracking for dti . one of the advantages of this algorithm is its ability to find multivalued solutions , that is , multiple possible connections between regions of the white matter . however , the high computational complexity of the algorithm , combined with the fact that we need to compute a large amount of trajectories if we want to find the right connection , makes it slow compared to similar algorithms . to overcome this problem , we accelerated the algorithm by implementing a highly parallel version on a gpu , using nvidia 's cuda platform . we showed that despite the large kernel size and high memory requirements of this gpu implementation , we were able to speed up the algorithm by a factor of up to 40 . this significant reduction in running time using cheap and widely available hardware greatly increases the applicability of the algorithm . aside from further optimization of our current gpu implementation , with the aim of further reducing its running time , we identify two possible extensions of the work presented in this paper . at the moment , the computed fibers are downloaded back to the cpu , where they are postprocessed and subsequently visualized . a more direct approach would be to directly visualize the fibers computed by our algorithm , using the available rendering features of the gpu . if we can also implement the necessary postprocessing steps in cuda , we can significantly reduce the amount of memory that needs to be transferred between the cpu and the gpu , thus accelerating the complete fiber tracking pipeline . the region - to - region connectivity method is a valuable application of the geodesic ray - tracing algorithm . this method introduces three extra steps : ( 1 ) computing a suitable connectivity measure , either while tracking the fibers or during a post - processing step , ( 2 ) filtering the computed fibers through a target region , and ( 3 ) sorting the remaining fibers according to their connectivity measure , showing only those fibers with high cm values . these three steps have currently been implemented on a cpu , but implementing them on a gpu can reduce the overall processing time of the fiber tracking pipeline , as noted above . the dti model is limited in its accuracy by its inability to model crossing fibers . high angular resolution diffusion imaging ( hardi ) aims to overcome this limitation by measuring and modeling the diffusion in more directions . an extension of the algorithm presented in section 2.3 which uses hardi data rather than dti data would theoretically be more accurate , particularly in complex areas of the white matter . such an extension may , for example , be realized by using the finsler metric tensor ( which depends both on the position and local orientation of the fiber ) , rather than the riemannian metric tensor [ 38 , 39 ] . while the extended algorithm for hardi would likely be more complex in terms of both number of computations and amount of required memory , a cuda - based acceleration using the parallelization principles presented in this paper will still be significantly faster than any cpu implementation . we note that , while these extensions would be valuable additions , the current cuda implementation already provides a practical and scalable solution for the acceleration of geodesic ray - tracing .
diffusion tensor imaging ( dti ) allows to noninvasively measure the diffusion of water in fibrous tissue . by reconstructing the fibers from dti data using a fiber - tracking algorithm 
 , we can deduce the structure of the tissue . in this paper 
 , we outline an approach to accelerating such a fiber - tracking algorithm using a graphics processing unit ( gpu ) . 
 this algorithm , which is based on the calculation of geodesics , has shown promising results for both synthetic and real data , but is limited in its applicability by its high computational requirements . 
 we present a solution which uses the parallelism offered by modern gpus , in combination with the cuda platform by nvidia , to significantly reduce the execution time of the fiber - tracking algorithm . compared to a multithreaded cpu implementation of the same algorithm , 
 our gpu mapping achieves a speedup factor of up to 40 times .