Dictionary generation for Magnetic Resonance Fingerprinting (MRF) can be a computationally intensive procedure, especially as complexity and density increase. Conveniently, the majority of operations required for calculating dictionary entries are already enumerated in conventional computer graphics shader packages. Here, we leverage the decades of research and hardware development spent to improve computer graphics optimization to remove the need for CUDA parallelization and instead directly render MRF dictionaries into compressible video files in virtually real time.
Development of the system was performed in the Unity Engine to allow for rapid shader iteration and debugging, but the shaders developed are platform agnostic and can be used in either DirectX or OpenGL-based implementations.
A compute shader is used to perform the dictionary simulation. Compute shaders are implementations of the standard CG language functions in a runtime format that allows for additional datatype and dispatching flexibility. The dictionary to be rendered is defined in terms of minimum and maximum T1 and T2 values, as well as resolution percentages to be used for each “step” in the dictionary. Rather than using a constant step size/resolution across the whole dictionary, the resolution at any point is based on a geometric progression, with a constant percentage change between entries in the dictionary. Therefore, a percentile resolution increases result in exponential growth of total dictionary entries. Together, these variables define the resolution of the rendered output. Additional inputs include text files defining the flip angle, phase and TR for the dictionary.
The T1 and T2 space is divided amongst an array of compute groups to parallelize the computation. An RGB texture is initialized that matches the resolution of the dictionary in T1/T2 space, and initial magnetizations are set. Standard Bloch simulation then proceeds for one timestep, with the magnetization at the end of the RF pulse and at TE is rendered to textures. Additionally, the real and imaginary components of the magnetization are rendered to the red and green components of the master dictionary texture. At each timestep, the previous timestep’s magnetizations are used as inputs, and an additional frame is added to the dictionary rendering.
This process proceeds for as many frames/timesteps as desired, with the final output being a video file containing the dictionary simulation’s values.
The speed benefits of the preliminary work presented are not insignificant, indicating that further shader optimization may yield even greater performance gains. Input-output latency is the primary limitation of the system in its current state, with GPU-> CPU transfer speeds limiting the ability of the shader system to freerun as quickly as it should. However, this limitation is primarily in implementation rather than theory.
Future work would allow for calculation of the dictionary as either an isochromat or as a group of spins with variable spin numbers and time steps. Modifications should also be made to the work assignment system to ignore impossible combinations of T1 and T2 values such as where T2 is longer than T1.
With a render-based approach, dictionaries are not calculated into arrays but are instead rendered into RGB video files. While this is a limitation when used with current reconstruction systems, requiring conversion into a more traditional format that reduces the overall performance gain, the new storage approach introduces opportunities in dictionary evaluation and compression. First, dictionaries can be “watched” along the TR dimension, with clear visualization of magnetization at different T1 and T2 combinations. This allows an MRF sequence designer to see the effects of their sequence, and to understand the effects of their sequence on the T1-T2 domain. Second, the introduction of video files as a storage medium opens paths to integration of existing compression and streaming research, allowing for storage or in-situ streaming of high resolution dictionaries without the need for massive uncompressed fully sampled dictionaries.
[1] Ma, D. Gulani, V., Seiberlich, N., Liu, K., Sunshine, J., Duerk, J. and Griswold, M.A. (2013). Magnetic Resonance Fingerprinting. Nature. 2013 Mar 14. 495(7440): 187-192.