pozitron-emission tomography reconstruction ( a computer graphics view )
DESCRIPTION
Pozitron-Emission Tomography Reconstruction ( A computer graphics view ). Szirmay-Kalos László. Scalar fields. 3D tér pontjaiban egy skalár érték. v ( x,y,z ). v ( x,y,z ). z. y. x. Skalár: hőmérséklet, sűrűség nyomás, potenciál, … Származás: Euler-i szimuláció, - PowerPoint PPT PresentationTRANSCRIPT
Pozitron-Emission TomographyReconstruction
(A computer graphics view)
Szirmay-Kalos László
Scalar fields3D tér pontjaiban egy skalár érték
• Skalár: hőmérséklet, sűrűség nyomás, potenciál, …• Származás: Euler-i szimuláció, Rekonstrukció (tomográfia)
tárolás: 3D textúravagy „voxel tömb”
x
y
z
v(x,y,z)
v(x,y,z)
Visualization of scalar fields• Megjelenítés fényszóró anyag (participating
media) analógiáját felhasználva (belsejébe belelátunk)
• Adott szintfelület kiemelése (külsőt lehámozzuk)
Transzferfüggvény
Sűrűség + deriváltak
v
grad v
Optikai paraméterek
Képszintézis
Kép
Fényszóró közeg
• Albedo a: az elnyelődés valószínűsége feltéve, hogy az ütközés bekövetkezett
• Fekete test: albedo = 0
ds A=
1
Hatáskeresztmetszet,alias kioltási tényező
·ds = P(ütközés)
Sugársűrűség változása
ds
L(s)
s
L(s+ds)
L(s+ds)= L(s) – L(s)·(s)·ds + Le(s)·ds + (s)·a(s)·ds·f(‘,)Li(‘)d‘
// Kiszóródás+abszorbció// Emisszió // Beszóródás
dL(s)/ds = –L(s)·(s) +Le(s)+Linscatter(s)
Megoldás fényelnyelő közegre (emisszió és beszóródás nincs):L(s)= L(0)·exp(–
s (s)ds)
Tomography
L(s)= L(0)·exp(–(s)ds)(s)ds = – log L(s)/L(0)
L(s)= Le(s)ds
Absorption Emission
PNP
NPN
Ne- e+
Mediso NanoPETTM/CT
Reconstruction
FBP = Filtered backprojection
Measurement + back projection
w(x,y)=w(r) 1/ri(x,y)=(x,y)
w(x,y) dxdy=2Rw(r) rdrd=
=2 Rw(r)r dr R
Circle of radius R:
Impulse response:
Correction in frequency domain
o(x,y)=i(x,y) w(x,y) FxFy o[x,y] = FxFy i[x,y]FxFyw[x,y]
1/| |FxFy i[x,y] = FxFy o[x,y] | |
dr
rd
r
Ramp filtering
Algebric back projection
v1 v1
v3 v4
d1 = A11v1 +A13v3
d2
d3
d4
Lin egyenlet (V<D): d = A v, d = [d1,..., dD]
v = [v1,..., vV]
Moore féle pseudo-inverz:
AT d = ATA v
v = (ATA)-1AT d = A+ d
(D) (D×V) (V)
(V×D) (D)(V×V)
Iteratív séma
Skalármező
Skalármező korrekciója
Projekció: vonalintegrálok
Összevetés a mért értékekkel
Light photons
• Relativistic mass is small: E = mc2 = hf• Photon’s energy (wavelength) does not
change upon elastic collision• Absorption probability is energy dependent• Wavelengts can be handled
independently
e- e-
Gamma photons
• Relativistic mass is significant• Photon’s energy (wavelength) changes
upon collision• Absorption probability is energy dependent• Wavelengts cannot be handled
independently
e- e-
Compton scattering and the Klein-Nishina phase function
cos11
1'
2
cmEE
E
e
incident photon
scatteredphoton
z
x
y
φ
collisionE
E’
2
23
sin'''
)(E
E
E
E
E
ECP
Klein-Nishina differential cross section(extinction coefficient):
Compton formula:
P(E, ) = … Rejection sampling
cos
u
Table driven sampling
Electron density
E/mec2
Cross section
E/mec2
1
C(1+cos2)
Gamma photon transport
Compton scattering +Klein-Nishina formula = New
– Direction– Energy (freq)
Detectorgrid
Why is it important?
Measureddetectorresponse
Source distribution
???
Density distribution from CT
Iterative reconstruction
Source estimation
Measureddetectorresponse
Source correctionSource
distribution???
Compute detector response
Estimateddetector response
Density distribution from CT
PET
e-
e+
LOR: y
Intensity: x
Finite-element approximation
x (v) NxV bV (v)
1b1
b2
b3
constant
1 b1
b2
b3
Tri-linear
box tent
Higher order filter• more accurate• more sensitive to noise
Non-CC grid?
BCC and FCC grids
CC
BCC FCC
System matrix
108 LOR responses: 107 voxel intensities:
Probabilities that a photon pairemitted in voxel V is detected by LOR L
• Problems:– Huge matrix: 108×107
– A matrix element is an infinite-dimensional integral– Matrix element depends on the measured object (CT)
• Compute matrix elements on-the-fly (like in radiosity)
voxel
Iterative solver
CorrectionBack-projection
Measures LORs
Computed LORs~ ~ ~ ~
Forward-projection
Current voxelintensities
Back-projectionMaximum likelihood estimation
What is x based on y?
Find x that maximizes P(y|x)
State: x Measurement result: y
Bayes estimation:P(x|y)=P(y|x)P(x)/P(y)
Back-projection• Measured LOR hits have
Poisson-distribution with means of the current estimate:
• Joint probability:
• Likelihood: logarithm of the joint probability:
• Estimate x maximizes the likelihood:
L
Ly
L
yL
L ey
yyP
~
!
~}hits {
~~
L
Ly
L
yL ey
y ~
!
~log
ek
kPk
!}{
+const
• Gathering not shooting! – Forward: voxels to LORs– Backward: LORs to voxels
Parallel implementation issues
~~
Ratios:Same relative error in all
detector pairsFor each LOR L:
For each voxel V:
Solution alternatives for gamma photon transport
• Physicists’ approach:1. Direct mathematical model of a phenomenon
2. Solution algorithm is the simulation of the nature
3. Porting to the computer
4. Performance tuning
• Computer graphics approach:1. Computer architecture
2. Algorithm that is efficient on this architecture
3. Tuning to the problem
Physicists’ approachDetector grid
Physicists’ approachDetector grid
Physicists’ approachDetector grid
Physicists’ approachDetector grid
Woodcock tracking: Free path length sampling in heterogeneous medium
e-maxx
max
s
max
s
CG approach:x
S
Physicists’ approach• Pros
– Direct simulation of nature– Rejection sampling can mimic the Klein-Nishina phase
function and free path length.– Paths are computed independently, so it scales well
on MIMD (multi-CPU = slow and expensive)
• Cons– Bad on SIMD (rejection sampling is a loop)– Similar absolute error in detectors, the relative error is
1/n where n is the number of hits.– Paths are computed independently, so it cannot
exploit coherence (cannot reuse information)– Random writes
Computer graphics approach
• SIMD-like algorithm (GPU)– Independent threads (gathering)– “No” conditional statements or variable length loops
• Reuses paths– Detector view (gathering)
• Same relative error in all detector pairs– Same number of samples in all detector pairs– Detector view (gathering)
• Solve the adjoint problem – Like path tracing instead of photon tracing– Integral transformation (Jacobi determinant)
CUDA: implementation platform
GPUCPU +Host
program
Kernel programs:
Threads
Thread blocks
Warps, …
Thread block
Fast sharedmemory
SIMD
Quasi-SIMD
Adding two N-element vectors
__global__ void AddVectorGPU( float *C, float *A, float *B, int N ) { int i = blockIdx.x * blockDim.x + threadIdx.x; // thread id if (i < N) C[i] = A[i] + B[i]; }
float C[100000], A[100000], B[100000];
int main ( ) { … int N = 100000; … int blockDim = 256; // number of threads per block int gridDim = (N + blockDim – 1) / blockDim; // number of thread blocks AddVectorGPU<<<gridDim, blockDim>>>(C, A, B, N); …}
Runs on GPU, called from CPU
0 ,…, blockDim.x-10 ,…, gridDim.x-1
Path reuse!
Detector 1 Detector 2
Integral transformation
dz1
dz2
dA: perpendicular area
dv: differentialvolume
dl: chord length
emissionpoint
d2: solid angle in which dz2 is visible from
v
2z
1z
1z
D2
D1 d: solid angle in whichdz1 and dz2 are visible from v
1
θz
2θz
1dz
2dz
21221
21 ddd||
coscosdd zzl
zzv
Forward projection
Detector 1 Detector 2
voxel
Nt
Na
=
=
Back projection
Detector 1 Detector 2
voxel
Nt
Na
~~
It can change in time!• OSEM• sample perturbation
~
Solid angle of the farther detector:
Detector sampling
Rnd Poisson-disk
Detector modeling
Measurements and phantoms
• 18x324 LOR• 1283 … 2563 voxel
Time: NV GeForce GTX 285
GPU utilization: 25%
GPU optimization
• Registers assigned to a thread (32->64)
• Forward and back-projection re-structuring– Forward:
– Back:
Error: 1283 voxels
Reconstruction quality
N_detline=1N_detline=16, Poisson diszk
ref
Single scatter compensation
Sample the location ofthe scattering point
Reusing rays:Evaluate many
integrals in parallel
What to sample?What mimics all
integrands?
Scattering point =+ 3 dimensions
Single scatter compensation
1z
2z
s
accumulatedemission
accumulatedattenuation
accumulatedattenuation
Importance sampling:
General scatter compensation
1s
2s
1. Scattering points
1z
2. Ray marching from detector to scattering points
1s
2s
1z
2z
3. Combination of paths
1s
2s
Scatter compensation
Stochastic iteration
• EM objective function (likelihood):
Expected value has some error!• Deterministic error
• Convergent but to a bad value • Random error
• Not convergent
Stochastic iteration
• New likelihood
• Only in forward projection
Likelihood
Reconstruction error
100 iterations, 1 sample/LOR2 billion photons pair/iteration
FP=4 sec, BP=5 sec
ref n=2/n
n=3/n
n=1/n
Without stochastic iteration
Det
Rand
Scatter compensation
Geometria Single scattering Double scattering