Performance-aware programming for intraoperative intensity-based image registration on graphics processing units

Martin C. W. Leong, Kit-Hang Lee, Bowen P. Y. Kwan, Yui-Lun Ng, Zhiyu Liu, Nassir Navab, Wayne Luk, Ka-Wai KwokInt. J. Comput. Assist. Radiol. Surg 2021

Introduction

In image-guided surgery, the ability to align high-resolution pre-operative scans (e.g., MRI) with real-time intra-operative data is critical for surgical precision. This process, known as image registration, must account for non-rigid tissue deformations caused by physiological factors like breathing or surgical manipulation. For clinical utility in procedures such as cardiac ablation, surgeons require these updates in under 10 seconds. However, traditional CPU-based implementations of high-accuracy algorithms, like the diffeomorphic log-demons, often take minutes to execute, failing to meet the real-time requirements of the operating room.

The Memory Bottleneck in GPU Computing

While GPUs offer massive parallel processing power, standard implementations of registration algorithms often fall short of their theoretical peak performance. The primary bottleneck is typically not raw computational capacity, but memory bandwidth.

GPU Warp Scheduling and Memory Latency Stalls

As illustrated in the figure above, when a warp (a group of threads) requests data from global memory, it encounters significant latency. If no other "eligible" warps are ready to be processed, the Streaming Multiprocessor (SM) stalls, leading to hardware underutilization. In 3D medical imaging, "scattered" memory access patterns—where threads look at neighboring voxels for convolutions or interpolations—frequently cause cache misses and exacerbate these stalls.

Methodology: Performance-Aware Programming

To overcome these hardware limitations, the researchers employed a "performance-aware programming" strategy. This iterative approach involves profiling the code to identify specific hardware bottlenecks and applying targeted GPU architectural optimizations:

  1. Shared Memory Caching: To address the "halo" problem in 3D convolutions—where overlapping regions of data are repeatedly fetched—the team implemented a pre-fetching mechanism. Data is moved from slow global memory into the GPU’s ultra-fast, on-chip shared memory before processing.
Shared Memory Pre-fetching and Access Pattern
  1. Texture Hardware Utilization: The authors offloaded 3D trilinear interpolation to the GPU’s dedicated texture mapping units. These units are hardwired for spatial locality, making them significantly more efficient at fetching 3D elements than standard global memory paths.
  2. Memory Coalescing and Vectorization: By restructuring data into float4 vectorized formats, the implementation reduces the total number of memory transaction requests, ensuring the data bus remains saturated and efficient.
  3. Instruction-Level Parallelism: Thread block dimensions were carefully aligned with the image's x-dimension to maximize occupancy and eliminate redundant data transfers in filtering operations.

Results and Clinical Impact

The optimized implementation was benchmarked using brain MRI data from The Cancer Imaging Archive (TCIA) across various resolutions. The performance gains over a high-end Intel i7 CPU were substantial:

  • Small Datasets (1.3M voxels): Achieved registration in 286 ms, a ~95x speedup.
  • Large Datasets (37M voxels): Achieved registration in 8.56 s, a 258x speedup.

Crucially, this implementation brings the runtime of the complex diffeomorphic log-demons algorithm well under the 10-second threshold required for intraoperative use. Previous GPU-based attempts often exceeded 35 seconds for similar tasks. Furthermore, the speedup did not compromise accuracy; the GPU results maintained negligible Mean Squared Error (MSE) compared to the CPU baseline.

Conclusion

By systematically addressing memory latency and utilizing specialized GPU hardware features, this work demonstrates that non-rigid image registration can be performed at clinical speeds without sacrificing the accuracy of the log-demons algorithm. The researchers have open-sourced their implementation, aiming to integrate these optimizations into standard medical imaging platforms like ITK and 3D Slicer, providing a powerful tool for the broader clinical research community.

Summary updated

BibTeX
@article{leong2021performance,
  author = {Martin C. W. Leong and Kit-Hang Lee and Bowen P. Y. Kwan and Yui-Lun Ng and Zhiyu Liu and Nassir Navab and Wayne Luk and Ka-Wai Kwok},
  title = {{Performance-aware programming for intraoperative intensity-based image registration on graphics processing units}},
  journal = {Int. J. Comput. Assist. Radiol. Surg.},
  year = {2021},
  doi = {10.1007/s11548-020-02303-y},
}
Figure