Fast volumetric rendering of NURBS-based surfaces Andreas Maier Chair of Pattern Recognition (Computer Science 5) Friedrich-Alexander-University Erlangen-Nuremberg Monday, 07 September 2015
Motivation High spatial resolution scanning of the knee is currently only possible in a laying position Knee pain often only occurs when the knee is under pressure (i.e. the knee bears weight) Only imaging in weight-bearing position allows insights on the structural alterations that cause the knee pain => Use a C-arm system to scan in a horizontal trajectory
Motivation X-ray acquisitions require the use of ionizing radiation Exposure of X-rays to any human subjects should be minimized Design and implementation of novel trajectories require a “testing environment” The “test environment” should be as realistic as possible
Outline Simulation of X-ray images using X-Cat Open CL acceleration based on HHardware tessellation AAppend buffer-based triangle drawing PPixel-based absorption modeling Results Summary and Outlook
Simulation of X-ray images with X-cat X-Cat is a 3D model of the human body based on the visual human Supports the simulation of motion: Breathing Heart beat Based on 3D/3D Spline surfaces: Each surface is 2D that changes over time: (u, v, t) Each tuple (u, v, t) corresponds to a 3D point (x, y, z)
Simulation of X-ray images with X-cat (2) Simulation of an x-ray image: Render 3D volume at time t Write volume to disk (~500 MB) Load volume for projection Project to 2D Save image to disk 133 to 495 projections required per simulated scan X-Cat internally employs ray casting and iterative computation of ray spline intersections
Outline Simulation of X-ray images using X-Cat Open CL acceleration based on HHardware tessellation AAppend buffer-based triangle drawing PPixel-based absorption modeling Results Summary and Outlook
Open CL acceleration 3D Points Tessellate spline 2D Points + z Project points List of intersections Draw to “append buffer” Line segments Order intersections along z Resolve overlays Absorption value Evaluate absorption model (mono- or polychromatic)
Hardware Tessellation Ray / Spline intersection are computationally inefficient Sampling of points and triangles is fast (Tessellation) Tessellation in hardware is even faster Hardware tessellation causes a slight loss in accuracy (here: ~ 28 micron) => Results in a 2D grid of 3D Points
Append buffer-based drawing Projection of 3D points yields 2D points plus their z coordinate Use 2D neighborhood relation of the set of points to generate and draw triangles (use any triangle rasterizing algorithm) Draw points into an “append buffer” like structure Idea: Save all drawn values
z buffer-based drawing Screen bufferz buffer x y If (z < z buffer(x, y)){ screen buffer(x, y) = color; z buffer(x, y) = z; } x y
2 Append buffer-based drawing (2) append buffer pixel buffer append buffer pointer
3 Append buffer-based drawing (2) append buffer pixel buffer append buffer pointer
4 3 Append buffer-based drawing (2) append buffer pixel buffer append buffer pointer 21 00
54 3 Append buffer-based drawing (2) append buffer pixel buffer append buffer pointer
Append buffer-based drawing (2) append buffer pixel buffer append buffer pointer 21 00
Append buffer-based drawing (2) append buffer pixel buffer append buffer pointer 21 00
Append buffer-based drawing (2) append buffer pixel buffer append buffer pointer 21 00
Append buffer-based drawing (3) By saving more than one entry per pixel we can store: ID of the painted object Depth value Pointer to the next element in the list Access to append buffer and pixel counter need to be atomic Especially access to the global append buffer pointer is expensive Reading from the append buffer is highly not coalesced
Pixel-based absorption modeling Read the list from the append buffer Sort the intersections along z Remove impossible cases (e.g. three intersections in a row of the same object) Compute length of line segments along z Evaluate absorption model
Outline Simulation of X-ray images using X-Cat Open CL acceleration based on HHardware tessellation AAppend buffer-based triangle drawing PPixel-based absorption modeling Results Summary and Outlook
Results – Tesselation (10 6 points) 1DTime [ms]Accuracy [mm] CPU (Java)625- Open CL E-7 Open CL Texture DTime [ms]Accuracy [mm] CPU (Java)2582- Open CL E-7 Open CL Texture DTime [ms]Accuracy [mm] CPU (Java) Open CL E-5 Open CL Texture
Results – Projection X-Cat Heart (23 Splines) 30 x 30 Time [ms] 50 x 50 Time [ms] 100 x 100 Time [ms] Global append buffer Local append buffer Z-Buffer Monochromatic absorption
Outline Simulation of X-ray images using X-Cat Open CL acceleration based on HHardware tessellation AAppend buffer-based triangle drawing PPixel-based absorption modeling Results Summary and Outlook
Summary and Outlook Simulation of X-ray images is required to save dose X-Cat can be accelerated using Hardware tessellation Append buffer-based triangle drawing Pixel-based absorption modeling Computation of one projection can be done in 200 ms Current state of the software still requires some debugging Next: Sample motion fields and volumes
Thank you for your attention