Hardware-Based Nonlinear Filtering
and Segmentation using High-Level
Shading Languages
I. Viola, A. Kanitsar, M. E. Gröller
Institute of Computer Graphics and Algorithms
Vienna University of Technology
Vienna, Austria
Volume Visualization Pipeline
DATA ACQUISITION
DATA
ENHANCEMENT
VISUALIZATION
MAPPING
CPU
GPU
GPU
RENDERING
Ivan Viola
2 / 23
Vienna University of Technology
GPU-based Algorithms
 high performance
 high flexibility
 easy implementation: HLSL
 necessary features:
 floating point precision
DATA
 long shader programs
ENHANCEMENT
 latest commodity graphics hardware
liver dataset
Ivan Viola
segmented vessels
3 / 23
Vienna University of Technology
Talk Outline
 processing pipeline
 GPU-based filtering
 per-vertex stage
 per-fragment stage



median filter
bilateral filter
rotated mask filter
 GPU-based segmentation
Ivan Viola
4 / 23
Vienna University of Technology
Liver Vessel Tree Visualization
GPU
CPU
 pre-filtering
 improving thresholding segmentation
 edge-preserving filters
 interactive threshold adjustment
 mask generation
 volumetric clipping
GPU
 volume rendering
Ivan Viola
5 / 23
Vienna University of Technology
Processing Pipeline
Ivan Viola
6 / 23
Vienna University of Technology
Talk Outline
 processing pipeline
 GPU-based filtering
 per-vertex stage
 per-fragment stage



median filter
bilateral filter
rotated mask filter
 GPU-based segmentation
Ivan Viola
7 / 23
Vienna University of Technology
Filtering in Graphics Hardware
Issues
 data representation: textures
 3D texture
 stack of 2D textures
 access to value: texture fetch
 neighborhood addressing: texture offset
 we use 5×5×5 neighborhood
 filter implementation: per-fragment stage
 results: rendered into off-screen buffer
Ivan Viola
8 / 23
Vienna University of Technology
Data Representation
TEXTURE STACK
TEXTURE STACK
Ivan Viola
OFF-SCREEN BUFFER STACK
OFF-SCREEN BUFFER STACK
9 / 23
Vienna University of Technology
Neighborhood Addressing
Two alternatives:
 directly in fragment program
 requires additional computation




pre-compute in per-vertex stage
store in vertex attributes
interpolation “for-free”
swizzle operator
Ivan Viola
10 / 23
Vienna University of Technology
Address Pre-computation
PER-VERTEX
STAGE
TEXCOORD0.xy
TEXCOORD0.zw
TEXCOORD0.xw
TEXCOORD0.zy
X-2
XY XW
Y+2
X-1
ZY ZW
Y+1
XY
FILTER
KERNEL
OUT.TEXCOORD0.xy
zw=
=
IN.TEXCOORD0.x + float4(-2, 2
2, -1,1)
yxy
y
11 / 23
Vienna University of Technology
Ivan Viola
Per-fragment Stage
 medical data - 12 bit precision
 fixed point 12-bit arithmetics
 use cache coherence
 exploit 4D instructions
 reduce conditionals
 reduce number of registers
 push computation to per-vertex stage
Ivan Viola
12 / 23
Vienna University of Technology
Median Filter
 central value of ordered set
 implementation
 CPU-based  sorting
 GPU-based  similar to quickselect()
3
1
4
5
5
6
2
7
7
Ivan Viola
1
2
13 / 23
3
4
5
5 6
7
7
Vienna University of Technology
GPU-based Median Filter




input data 12 bit [0..4095]
multi-pass approach
not efficient on CPU
exploiting GPU 4D arithmetics
0
Ivan Viola
1
2
3
14 / 23
4
5
6
7
Vienna University of Technology
Bilateral Filter
 edge preservation: anisotropic filter kernel
 product of two weights:
 geometric:

photometric:
low
highphotometric
geometric weight
weight
f(x
)
highlow
geometric
geometric
weight
weight
x
Ivan Viola
15 / 23
Vienna University of Technology
GPU-based Bilateral Filter
 weights are precomputed
 geometric weight stored
in unused vertex
attributes (COLOR0)
 photometric weight
stored in 1D mirror LUT
 weight product
 sum-up contributions &
weights
 normalize
Ivan Viola
16 / 23
Vienna University of Technology
Rotated Mask Filter
anisotropic noise removal with edge
preservation
splits filter mask into sub-regions
mean and variance value for each subregion
result – mean value of sub-region with
minimal variance
GPU implementation
0
0 0 pass
0
0
0 0
0single
- slow
7 7 registers
7
7 7
0 7
7
0multiple
passes
- reduce
temp.
7
Ivan Viola
7
7
7
17 / 23
7
7
7
7
Vienna University of Technology
Talk Outline
 processing pipeline
 GPU-based filtering
 per-vertex stage
 per-fragment stage



median filter
bilateral filter
rotated mask filter
 GPU-based segmentation
Ivan Viola
18 / 23
Vienna University of Technology
Segmentation
 input: pre-filtered data after noise
removal
 thresholding segmentation
 0 outside interval
 1 within interval
 interactive threshold adjustment
 output: compressed form
 32 slices in one 32 bit slice
Ivan Viola
19 / 23
Vienna University of Technology
Results
Operation
Median filter
Bilateral filter
Rotated mask f.
Thresholding
Thresholding
& compression
GPU [ms]
CPU [ms]
Speedup
24678
9668
7989
40
48639
14706
58003
349
1.97
1.52
7.26
8.73
64
–
–
 GPU: NVIDIA GeForceFX 5900 Ultra
 CPU: AMD AthlonXP 2.4 GHz, 1GB DDR RAM
 liver dataset: 512×512×72
Ivan Viola
20 / 23
Vienna University of Technology
Results
Ivan Viola
21 / 23
Vienna University of Technology
Conclusions




data enhancement step on GPU!
simple tasks  better speedup
optimization HW specific
high-level programming
 friendly
 many implementation possibilities
 compiler efficiency
Ivan Viola
22 / 23
Vienna University of Technology
Thank you for your attention!
Ivan Viola
23 / 23
Vienna University of Technology
Descargar

Titel des Vortrages - Vienna University of Technology