Algorithm Search⌘K

Algorithmresearch

Katsevich algorithm

Also called Katsevich helical reconstruction.

Exact helical cone-beam CT reconstruction. Differentiate the data along the source path, apply a 1D Hilbert filter along kappa-lines, and back-project over the PI-interval of each point.

Time
O(a m d + V K d) worst
Space
O(a m d) extra
Where
K = the number of views in one PI-interval; V = the number of reconstructed points; a = the number of views; d = the number of detector columns; m = the number of detector rows
Properties
deterministicnot in placenot iterativelineariterative
Origin
A. Katsevich, 2002

Katsevich's algorithm reconstructs a 3D object exactly from cone-beam X-ray data taken while the source moves on a helix around it, as in a helical CT scanner. It is of the filtered back-projection type. First it differentiates the data along the source path at a fixed ray direction. Then it applies a 1D Hilbert filter along special lines in the detector, the kappa-lines. Then it back-projects the result, for each point, over the part of the helix between the two ends of the PI-line through the point. Unlike Feldkamp-Davis-Kress, it is exact for every smooth object inside the helix, and it needs only a narrow band of detector rows. The filter is 1D and shift-invariant along each line, so the cost is close to that of FDK.

In plain words

In a helical scanner the patient moves through the ring while the X-ray source turns, so the source draws a helix around the patient. Each shot records a 2D picture on a detector with a few rows.

Older fast methods for this scan are approximate. Katsevich found a formula of the same simple shape as filtered back-projection that is exact. For each point, it uses only the shots from the part of the helix that "sees" the point between two fixed ends, a little more than half a turn. It filters each shot along slanted lines, not along the rows, and the slant of these lines follows the helix. Then it smears each filtered shot back through the volume, as other back-projection methods do.

The problem

The source is at y(s)=(Rcos⁡s,Rsin⁡s,hs)y(s) = (R\cos s, R\sin s, hs), a helix of radius RR and pitch P=2πhP = 2\pi h, the rise per turn. Put eu(s)=(−sin⁡s,cos⁡s,0)e_u(s) = (-\sin s, \cos s, 0), ev=(0,0,1)e_v = (0, 0, 1) and ew(s)=(cos⁡s,sin⁡s,0)e_w(s) = (\cos s, \sin s, 0). A flat detector at the distance DD from the source is normal to ew(s)e_w(s). Its point (u,v)(u, v) is y(s)+u eu+v ev−D ewy(s) + u\,e_u + v\,e_v - D\,e_w. The data g(s,u,v)g(s, u, v) is the integral of the attenuation ff along the ray from y(s)y(s) through the point (u,v)(u, v). This is the cone-beam X-ray transform. The unknown ff is smooth with support inside the cylinder of radius r<Rr < R around the axis. The views are sk=s0+k Δss_k = s_0 + k\,\Delta s, the columns uj=(j−(d−1)/2)Δuu_j = (j - (d-1)/2)\Delta u and the rows vr=(r−(m−1)/2)Δvv_r = (r - (m-1)/2)\Delta v.

The PI-line. For a point xx inside the helix there are sb<st<sb+2πs_b < s_t < s_b + 2\pi such that xx lies on the segment from y(sb)y(s_b) to y(st)y(s_t). This segment is the PI-line of xx, and it is unique. The PI-interval is IPI(x)=[sb,st]I_{PI}(x) = [s_b, s_t]. A helix meets every plane through the object, so it satisfies the Tuy condition.

The kappa-lines. In the detector of the view ss, the kappa-line with the angle ψ∈(−π/2,π/2)\psi \in (-\pi/2, \pi/2) is

v=vκ(u,ψ)=DP2πR(ψ+ψtan⁡ψ uD).v = v_\kappa(u, \psi) = \frac{DP}{2\pi R}\left(\psi + \frac{\psi}{\tan\psi}\,\frac{u}{D}\right).

It is the projection of the plane through y(s)y(s), y(s+ψ)y(s + \psi) and y(s+2ψ)y(s + 2\psi).

The formula. For xx and s∈IPI(x)s \in I_{PI}(x), let (u∗,v∗)(u^*, v^*) be the detector point of the ray through xx and ψ∗\psi^* the angle of the kappa-line through it. Let

g1=(∂s+u2+D2D ∂u+uvD ∂v)g,g2=Du2+v2+D2 g1.g_1 = \left(\partial_s + \frac{u^2 + D^2}{D}\,\partial_u + \frac{uv}{D}\,\partial_v\right)g, \qquad g_2 = \frac{D}{\sqrt{u^2 + v^2 + D^2}}\,g_1.

Here g1g_1 is the derivative of the data along the source path for a fixed ray direction. Then

f(x)=12π∫IPI(x)1R−x⋅ew(s) p.v. ⁣∫1π(u∗−u) g2(s,u,vκ(u,ψ∗)) du ds.f(x) = \frac{1}{2\pi}\int_{I_{PI}(x)} \frac{1}{R - x\cdot e_w(s)}\,\mathrm{p.v.}\!\int \frac{1}{\pi(u^* - u)}\,g_2\big(s, u, v_\kappa(u, \psi^*)\big)\,du\,ds.

The inner integral is the Hilbert transform of g2g_2 along the kappa-line, read at u∗u^*. This is the flat-detector form of Noo, Pack and Heuscher. The constant and the sign are written for the conventions here, and the code confirms them.

The algorithm

  1. KATSEVICH(g, geometry, x) ▷ g[k][r][j]: view s_k, detector point (u_j, v_r); one point x
  2. ▷ for each view k: g₂ from central differences
  3. 1g_s ← (g[k+1][r][j] - g[k-1][r][j]) / (2Δs), and g_u, g_v in the same way
  4. 2g₁ ← g_s + ((u_j² + D²)/D) g_u + (u_j v_r / D) g_v
  5. 3g₂[k][r][j] ← D / sqrt(u_j² + v_r² + D²) · g₁
  6. 4(s_b, s_t) ← the PI-interval of x, by bisection
  7. for each view k with s_k in [s_b - Δs, s_t + Δs] do
  8. 5(u*, v*, depth) ← the projection of x; ψ* ← the kappa-line angle through (u*, v*), by bisection
  9. 6ℓ[j] ← g₂[k] at (u_j, v_κ(u_j, ψ*)), by linear interpolation in v
  10. 7H[j] ← Σ_l (2 / (π (j - l))) ℓ[l] over odd j - l, for the two columns j next to u*
  11. 8val[k] ← H interpolated at u*, divided by depth
  12. 9return (1/(2π)) ∫ over [s_b, s_t] of the piecewise linear interpolant of val

Lines L1 to L3 depend only on the data and are done once for each view that some point needs. Lines L4 to L9 are done for each point. The code computes g2g_2 for a view the first time a point needs it and keeps it. Line L7 is the band-limited discrete Hilbert kernel: Δu\Delta u times 1/(π(u∗−u))1/(\pi(u^* - u)) at the odd offsets, doubled because the even offsets are 0. Line L9 integrates the piecewise linear interpolant exactly, including the partial cells at the two ends of the PI-interval.

Example

Take R=3R = 3, P=2P = 2 and D=3D = 3, so h=1/πh = 1/\pi and DP2πR=1π\frac{DP}{2\pi R} = \frac{1}{\pi}.

PI-interval of a point on the axis. For x=(0,0,x3)x = (0, 0, x_3) every chord through the axis is a diameter, so st=sb+πs_t = s_b + \pi and xx is at the middle of the segment. Its height is h(sb+π/2)=x3h(s_b + \pi/2) = x_3, so IPI(x)=[πx3−π/2,πx3+π/2]I_{PI}(x) = [\pi x_3 - \pi/2, \pi x_3 + \pi/2]. For x3=0x_3 = 0 this is [−1.5708,1.5708][-1.5708, 1.5708], and for x3=0.5x_3 = 0.5 it is [0,3.1416][0, 3.1416]. The code gives these values. A point off the axis has a different interval: for (0.6,0,0)(0.6, 0, 0) the code gives [−1.3694,1.3694][-1.3694, 1.3694], which is shorter than π\pi.

The filtering line. Take x=0x = 0 and the view s=π/4s = \pi/4. The depth is R−x⋅ew=3R - x\cdot e_w = 3, u∗=0u^* = 0 and v∗=3(0−π/4⋅1/π)/3=−0.25v^* = 3(0 - \pi/4 \cdot 1/\pi)/3 = -0.25. On the column u=0u = 0 the kappa-line has the height ψ/π\psi/\pi, so ψ∗=−π/4\psi^* = -\pi/4. With ψ/tan⁡ψ=(−π/4)/(−1)=π/4\psi/\tan\psi = (-\pi/4)/(-1) = \pi/4, the kappa-line is

v=1π(−π4+π4⋅u3)=−0.25+u12.v = \frac{1}{\pi}\left(-\frac{\pi}{4} + \frac{\pi}{4}\cdot\frac{u}{3}\right) = -0.25 + \frac{u}{12}.

So at u=1u = 1 the filter reads the data at v=−0.1667v = -0.1667. The line rises to the right, while the rows are horizontal. Filtering along the rows, as FDK does, would mix data from other kappa-planes.

Measurements. The table gives the output of the code for the Gaussian blob f(x)=e−10∣x−c∣2f(x) = e^{-10\vert x - c\vert^2} with c=(0.1,0.05,0)c = (0.1, 0.05, 0), on exact data with 64 views per turn, m=41m = 41 rows with Δv=0.05\Delta v = 0.05, and d=41d = 41 columns with Δu=0.055\Delta u = 0.055 or d=81d = 81 columns with Δu=0.0275\Delta u = 0.0275. These are measurements, not bounds.

point xx true f(x)f(x) d=41d = 41 d=81d = 81
(0.1,0.05,0)(0.1, 0.05, 0) 1.0000 0.9692 0.9888
(0.2,0.05,0)(0.2, 0.05, 0) 0.9048 0.8778 0.8952
(0.1,0.05,0.15)(0.1, 0.05, 0.15) 0.7985 0.7756 0.7912
(0,0,0)(0, 0, 0) 0.8825 0.8643 0.8751
(−0.2,0.1,−0.1)(-0.2, 0.1, -0.1) 0.3588 0.3566 0.3573
(0.6,0,0)(0.6, 0, 0) 0.0801 0.0831 0.0806

The error falls by about a factor 3 when the column step is halved. With 128 views per turn and 41 columns the values change by less than 0.001, so on this grid the column step dominates the error. The values are the same for D=3D = 3 and D=6D = 6 when Δu\Delta u and Δv\Delta v scale with DD, as the formula predicts.

Correctness

The proof in proofs/correctness.md is partial: it cites Katsevich's inversion theorem and proves the steps that connect it to the code. It shows that the PI-line exists, by the intermediate value theorem on the height of the chord through xx. It derives the kappa-line formula, by checking that the line passes through the projections of y(s+ψ)y(s + \psi) and y(s+2ψ)y(s + 2\psi). It proves that g1g_1 is the derivative at a fixed ray direction, by the chain rule. And it changes the inner integral of Katsevich's formula, an integral over a half circle of ray directions with the kernel 1/sin⁡γ1/\sin\gamma, into the Hilbert transform along the kappa-line on the flat detector, which gives the factors 1/(R−x⋅ew)1/(R - x\cdot e_w) and D/u2+v2+D2D/\sqrt{u^2 + v^2 + D^2}. The reason why the formula is exact is sketched there. The 3D Radon inversion writes ff as an integral over all planes through xx (Grangeat's formula gives the plane integrals from the data). Every plane through xx meets the PI-segment of the helix in one or three points, and Katsevich's weights for these points add to 1 for almost every plane. The proof also shows an exact locality property of the discrete algorithm: it never reads the detector rows outside a band around the kappa-lines.

Proof: Correctness of Katsevich's algorithmpartial

We use the conventions of the page. The source is on the helix y(s)=(Rcos⁡s,Rsin⁡s,hs)y(s) = (R\cos s, R\sin s, hs) with h=P/(2π)h = P/(2\pi). The vectors eu(s)=(−sin⁡s,cos⁡s,0)e_u(s) = (-\sin s, \cos s, 0), ev=(0,0,1)e_v = (0, 0, 1) and ew(s)=(cos⁡s,sin⁡s,0)e_w(s) = (\cos s, \sin s, 0) are orthonormal, and the flat detector point (u,v)(u, v) is y(s)+u eu+v ev−D ewy(s) + u\,e_u + v\,e_v - D\,e_w. The cone-beam data is Df(y,θ)=∫0∞f(y+tθ) dtD_f(y, \theta) = \int_0^\infty f(y + t\theta)\,dt for a unit vector θ\theta, and g(s,u,v)=Df(y(s),θ(s,u,v))g(s, u, v) = D_f(y(s), \theta(s, u, v)) with θ=(ueu+vev−Dew)/u2+v2+D2\theta = (u e_u + v e_v - D e_w)/\sqrt{u^2 + v^2 + D^2}. The object ff is smooth with support in the cylinder x12+x22<r2x_1^2 + x_2^2 < r^2, r<Rr < R.

What is proved here and what is cited. The main theorem, Katsevich's inversion formula, is cited from Katsevich (2002), and the flat-detector form that the code uses is the form of Noo, Pack and Heuscher (2003). This file proves the facts that connect the cited formula to the code: the PI-line exists, the kappa-line formula, the derivative at a fixed ray direction, the change from the angle form to the detector form with its constant, and the discretization. It also explains, without a full proof, why the formula is exact. The numbers on the page check the whole chain, including the constant 1/(2π)1/(2\pi) and the sign.

Part 1. The PI-line

Lemma 1 (existence). For every xx with x12+x22<R2x_1^2 + x_2^2 < R^2 there are sb<st<sb+2πs_b < s_t < s_b + 2\pi such that xx lies on the open segment from y(sb)y(s_b) to y(st)y(s_t).

Proof. For sb∈Rs_b \in \mathbb{R}, the line in the plane through (Rcos⁡sb,Rsin⁡sb)(R\cos s_b, R\sin s_b) and (x1,x2)(x_1, x_2) meets the circle of radius RR at a second point, since (x1,x2)(x_1, x_2) is inside. Let st(sb)s_t(s_b) be its angle in (sb,sb+2π)(s_b, s_b + 2\pi), and let λ(sb)∈(0,1)\lambda(s_b) \in (0, 1) be the position of (x1,x2)(x_1, x_2) on the chord. Both depend continuously on sbs_b. The point of the 3D segment from y(sb)y(s_b) to y(st)y(s_t) over (x1,x2)(x_1, x_2) has the height F(sb)=h((1−λ)sb+λst)F(s_b) = h((1 - \lambda)s_b + \lambda s_t). It lies between hsbh s_b and hsth s_t. At sb=x3/hs_b = x_3/h we have F>hsb=x3F > h s_b = x_3. At sb=x3/h−2πs_b = x_3/h - 2\pi we have F<hst<h(sb+2π)=x3F < h s_t < h(s_b + 2\pi) = x_3. By the intermediate value theorem F(sb)=x3F(s_b) = x_3 for some sbs_b in between, and then xx is on the segment. □\square

The PI-line is also unique for points inside the helix cylinder. This is a known result that Katsevich's paper relies on. We do not prove it here. The code finds sbs_b by bisection on F(sb)−x3F(s_b) - x_3 in the range of the proof, and the test checks that xx lies on the computed segment. The interval IPI(x)=[sb,st]I_{PI}(x) = [s_b, s_t] is the PI-interval.

For a point on the axis, (x1,x2)=0(x_1, x_2) = 0, every chord is a diameter, st=sb+πs_t = s_b + \pi and λ=12\lambda = \frac{1}{2}, so F=h(sb+π/2)F = h(s_b + \pi/2) and IPI(x)=[x3/h−π/2,x3/h+π/2]I_{PI}(x) = [x_3/h - \pi/2, x_3/h + \pi/2].

Part 2. Projections and kappa-lines

Lemma 2. The ray from y(s)y(s) through xx meets the detector at

u∗=D x⋅euR−x⋅ew,v∗=D (x3−hs)R−x⋅ew.u^* = \frac{D\,x\cdot e_u}{R - x\cdot e_w}, \qquad v^* = \frac{D\,(x_3 - hs)}{R - x\cdot e_w}.

Proof. x−y(s)=(x⋅eu)eu+(x3−hs)ev−(R−x⋅ew)ewx - y(s) = (x\cdot e_u)e_u + (x_3 - hs)e_v - (R - x\cdot e_w)e_w, because y(s)⋅eu=0y(s)\cdot e_u = 0 and y(s)⋅ew=Ry(s)\cdot e_w = R. The detector point (u,v)(u, v) is y+ueu+vev−Dewy + u e_u + v e_v - D e_w. The two vectors are parallel when u/D=x⋅eu/(R−x⋅ew)u/D = x\cdot e_u/(R - x\cdot e_w) and v/D=(x3−hs)/(R−x⋅ew)v/D = (x_3 - hs)/(R - x\cdot e_w). □\square

Lemma 3. For 0<∣ψ∣<π0 < |\psi| < \pi, the line in the detector of view ss

v=vκ(u,ψ)=DP2πR(ψ+ψtan⁡ψ uD)v = v_\kappa(u, \psi) = \frac{DP}{2\pi R}\left(\psi + \frac{\psi}{\tan\psi}\,\frac{u}{D}\right)

passes through the projections of y(s+ψ)y(s + \psi) and y(s+2ψ)y(s + 2\psi).

Proof. Put t∈{ψ,2ψ}t \in \{\psi, 2\psi\}. Here y(s+t)⋅eu(s)=Rsin⁡ty(s + t)\cdot e_u(s) = R\sin t, y(s+t)⋅ew(s)=Rcos⁡ty(s + t)\cdot e_w(s) = R\cos t and the height difference is htht. Lemma 2 gives u=Dsin⁡t/(1−cos⁡t)=Dcot⁡(t/2)u = D\sin t/(1 - \cos t) = D\cot(t/2) and v=Dht/(R(1−cos⁡t))v = Dht/(R(1 - \cos t)). For t=ψt = \psi: ψtan⁡ψcot⁡ψ2=cos⁡ψ1−cos⁡ψ\frac{\psi}{\tan\psi}\cot\frac{\psi}{2} = \frac{\cos\psi}{1 - \cos\psi}, so vκ=DP2πR ψ1−cos⁡ψv_\kappa = \frac{DP}{2\pi R}\,\frac{\psi}{1 - \cos\psi}, and DhψR(1−cos⁡ψ)\frac{Dh\psi}{R(1 - \cos\psi)} is the same since h=P/(2π)h = P/(2\pi). For t=2ψt = 2\psi: u=Dcot⁡ψu = D\cot\psi, so vκ=DP2πR ψ(1+cot⁡2ψ)=DP2πR ψsin⁡2ψv_\kappa = \frac{DP}{2\pi R}\,\psi(1 + \cot^2\psi) = \frac{DP}{2\pi R}\,\frac{\psi}{\sin^2\psi}, and 2DhψR(1−cos⁡2ψ)=DhψRsin⁡2ψ\frac{2Dh\psi}{R(1 - \cos 2\psi)} = \frac{Dh\psi}{R\sin^2\psi} is the same. □\square

So vκ(⋅,ψ)v_\kappa(\cdot, \psi) is the projection of Katsevich's kappa-plane through y(s)y(s), y(s+ψ)y(s + \psi) and y(s+2ψ)y(s + 2\psi). The limit ψ→0\psi \to 0 is the line v=P2πRuv = \frac{P}{2\pi R}u. For ∣u∣|u| in the range of the detector of the page, vκv_\kappa increases with ψ\psi, so bisection on ψ∈(−π/2,π/2)\psi \in (-\pi/2, \pi/2) finds the kappa-line through (u∗,v∗)(u^*, v^*). The test checks Lemma 3 and the inverse.

Part 3. The derivative at a fixed direction

Lemma 4. For a fixed unit vector θ\theta,

∂∂qDf(y(q),θ)∣q=s=(∂s+u2+D2D ∂u+uvD ∂v)g(s,u,v),\frac{\partial}{\partial q} D_f(y(q), \theta)\Big|_{q = s} = \left(\partial_s + \frac{u^2 + D^2}{D}\,\partial_u + \frac{uv}{D}\,\partial_v\right) g(s, u, v),

where (u,v)(u, v) is the detector point of θ\theta at the view ss.

Proof. Let (u(q),v(q))(u(q), v(q)) be the detector point of the fixed θ\theta at the view qq. Then Df(y(q),θ)=g(q,u(q),v(q))D_f(y(q), \theta) = g(q, u(q), v(q)), and the chain rule gives ∂sg+u′ ∂ug+v′ ∂vg\partial_s g + u'\,\partial_u g + v'\,\partial_v g. The vector W(q)=ueu+vev−DewW(q) = u e_u + v e_v - D e_w must stay parallel to θ\theta, so W′=cWW' = cW for some cc. Since eu′=−ewe_u' = -e_w and ew′=eue_w' = e_u, W′=(u′−D)eu+v′ev−u ewW' = (u' - D)e_u + v' e_v - u\,e_w. Comparing with cW=cu eu+cv ev−cD ewcW = cu\,e_u + cv\,e_v - cD\,e_w gives c=u/Dc = u/D, u′=D+u2/Du' = D + u^2/D and v′=uv/Dv' = uv/D. □\square

Lines L1 and L2 compute this with central differences of step Δs\Delta s, Δu\Delta u and Δv\Delta v, which have the error O(Δs2+Δu2+Δv2)O(\Delta s^2 + \Delta u^2 + \Delta v^2) for smooth data. Line L3 multiplies by D/u2+v2+D2D/\sqrt{u^2 + v^2 + D^2}, which gives g2g_2. The test compares g2g_2 with the derivative computed along the source path for a fixed direction.

Part 4. The formula

Theorem (Katsevich 2002, cited). For ff as above and xx in the cylinder of radius rr,

f(x)=−12π2∫IPI(x)1∣x−y(s)∣∫02π∂∂qDf(y(q),cos⁡γ β+sin⁡γ e)∣q=s dγsin⁡γ ds,f(x) = -\frac{1}{2\pi^2}\int_{I_{PI}(x)} \frac{1}{|x - y(s)|}\int_0^{2\pi} \frac{\partial}{\partial q} D_f\big(y(q), \cos\gamma\,\beta + \sin\gamma\,e\big)\Big|_{q = s}\,\frac{d\gamma}{\sin\gamma}\,ds,

where β=(x−y(s))/∣x−y(s)∣\beta = (x - y(s))/|x - y(s)|, ee is a unit vector orthogonal to β\beta in the kappa-plane of xx at ss (the plane through y(s)y(s) whose detector line is the kappa-line through (u∗,v∗)(u^*, v^*)), and the inner integral is a principal value. The orientation of ee and the sign go together, so we do not rely on the sign in this form. The code uses the detector form below, whose constant and sign the page confirms numerically.

Proposition 1 (detector form). The theorem is equivalent to

f(x)=12π∫IPI(x)1R−x⋅ew(s) p.v. ⁣∫1π(u∗−u) g2(s,u,vκ(u,ψ∗)) du dsf(x) = \frac{1}{2\pi}\int_{I_{PI}(x)} \frac{1}{R - x\cdot e_w(s)}\,\mathrm{p.v.}\!\int \frac{1}{\pi(u^* - u)}\,g_2\big(s, u, v_\kappa(u, \psi^*)\big)\,du\,ds

up to the sign convention of ee, where ψ∗\psi^* is the angle of the kappa-line through (u∗,v∗)(u^*, v^*).

Proof of the change of variables. Fix ss. The directions cos⁡γ β+sin⁡γ e\cos\gamma\,\beta + \sin\gamma\,e for γ∈(−π/2,π/2)\gamma \in (-\pi/2, \pi/2) point to the detector, and they meet it on the kappa-line. The directions of the other half have θ⋅ew(s)>0\theta\cdot e_w(s) > 0. For such a θ\theta and for qq near ss, θ⋅ew(q)>0\theta\cdot e_w(q) > 0, so every point y(q)+tθy(q) + t\theta with t>0t > 0 has (y(q)+tθ)⋅ew(q)>R(y(q) + t\theta)\cdot e_w(q) > R and lies outside the cylinder of radius rr. So Df(y(q),θ)=0D_f(y(q), \theta) = 0 for qq near ss, and its derivative in qq vanishes. Let ℓ\ell be the arc length on the kappa-line and pp the distance from y(s)y(s) to that line in the kappa-plane. A direction with the angle ϕ\phi from the foot of the perpendicular hits the point ℓ=ptan⁡ϕ\ell = p\tan\phi, and β\beta hits ℓ∗=ptan⁡ϕ∗\ell^* = p\tan\phi^* with γ=ϕ−ϕ∗\gamma = \phi - \phi^*. Then dℓ=p dϕ/cos⁡2ϕd\ell = p\,d\phi/\cos^2\phi and ℓ−ℓ∗=psin⁡(ϕ−ϕ∗)/(cos⁡ϕcos⁡ϕ∗)\ell - \ell^* = p\sin(\phi - \phi^*)/(\cos\phi\cos\phi^*), so

dγsin⁡γ=cos⁡ϕcos⁡ϕ∗ dℓℓ−ℓ∗.\frac{d\gamma}{\sin\gamma} = \frac{\cos\phi}{\cos\phi^*}\,\frac{d\ell}{\ell - \ell^*}.

Here cos⁡ϕ=p/∣P−y∣\cos\phi = p/|P - y| for the detector point PP, so cos⁡ϕ/cos⁡ϕ∗=∣P∗−y∣/∣P−y∣\cos\phi/\cos\phi^* = |P^* - y|/|P - y|. The kappa-line has a constant slope in the (u,v)(u, v) plane, so dℓ/(ℓ−ℓ∗)=du/(u−u∗)d\ell/(\ell - \ell^*) = du/(u - u^*). The point xx lies on the ray to P∗P^* at the depth R−x⋅ewR - x\cdot e_w along −ew-e_w, and P∗P^* at the depth DD, so ∣P∗−y∣/∣x−y∣=D/(R−x⋅ew)|P^* - y|/|x - y| = D/(R - x\cdot e_w). Finally ∣P−y∣=u2+v2+D2|P - y| = \sqrt{u^2 + v^2 + D^2}. Putting these together, with Lemma 4 for the derivative,

1∣x−y∣∫∂qDfsin⁡γ dγ=1R−x⋅ew p.v. ⁣∫Du2+v2+D2 g1(s,u,vκ(u))u−u∗ du=−πR−x⋅ew p.v. ⁣∫g2π(u∗−u) du.\frac{1}{|x - y|}\int \frac{\partial_q D_f}{\sin\gamma}\,d\gamma = \frac{1}{R - x\cdot e_w}\,\mathrm{p.v.}\!\int \frac{D}{\sqrt{u^2 + v^2 + D^2}}\,\frac{g_1(s, u, v_\kappa(u))}{u - u^*}\,du = \frac{-\pi}{R - x\cdot e_w}\,\mathrm{p.v.}\!\int \frac{g_2}{\pi(u^* - u)}\,du.

Multiplying by −1/(2π2)-1/(2\pi^2) gives the factor 12π\frac{1}{2\pi} of the proposition. □\square

The detector form does not depend on DD. If DD changes to cDcD, then uu, vv and u∗u^* scale by cc, g2g_2 does not change at corresponding points, and du/(u∗−u)du/(u^* - u) does not change. The prototype for this page checked this with D=RD = R and D=2RD = 2R and got the same values.

Why the formula is exact (sketch, not a full proof). The 3D Radon inversion formula writes f(x)f(x) as an integral over all planes through xx of the second derivative of the plane integrals of ff (see Grangeat's formula). Grangeat's identity gives the first derivative from the cone-beam data of one source point in the plane, and the derivative along the helix at a fixed direction gives the second. Every plane through xx meets the PI-segment of the helix, y(IPI(x))y(I_{PI}(x)), in one or three points. If one assigns to each meeting point a weight so that the weights of each plane add to 1, the inversion formula becomes an integral over s∈IPI(x)s \in I_{PI}(x). Katsevich chose the weights so that they jump only where the plane contains a kappa-line, and then the integral over the planes through xx and y(s)y(s) becomes a single Hilbert transform along one line in the detector. The proof that the weights add to 1 for almost every plane is the main geometric step of Katsevich's paper. We do not reproduce it.

Part 5. The discrete algorithm

Line L4 finds IPI(x)I_{PI}(x) (Part 1). For each view sks_k with sk∈[sb−Δs,st+Δs]s_k \in [s_b - \Delta s, s_t + \Delta s], line L5 computes (u∗,v∗)(u^*, v^*) and the depth R−x⋅ewR - x\cdot e_w (Lemma 2). Line L6 reads g2g_2 along the kappa-line through (u∗,v∗)(u^*, v^*) at the detector columns uju_j, by linear interpolation in vv. Line L7 applies the discrete Hilbert kernel 2πn\frac{2}{\pi n} for odd nn and 0 for even nn, which is Δu\Delta u times the band-limited kernel 1−cos⁡(π(u∗−u)/Δu)π(u∗−u)\frac{1 - \cos(\pi(u^* - u)/\Delta u)}{\pi(u^* - u)} at the sample points, at the two columns next to u∗u^*. Line L8 interpolates linearly to u∗u^* and divides by the depth. Line L9 integrates the piecewise linear interpolant of these values over [sb,st][s_b, s_t] exactly and multiplies by 12π\frac{1}{2\pi}. Each step has an error that goes to 0 with the steps for smooth data, so the output converges to the right side of Proposition 1. The page measures the error on a Gaussian blob: it is 0.031 at the peak with 41 columns and 0.011 with 81 columns.

Locality in vv (exact). For a point xx, line L6 reads g2g_2 only at the heights vκ(uj,ψ)v_\kappa(u_j, \psi) with ∣ψ∣<π/2|\psi| < \pi/2, and with the detector columns ∣uj∣≤umax⁡|u_j| \le u_{\max} these heights satisfy ∣vκ∣≤DP2πR(π/2+umax⁡/D)|v_\kappa| \le \frac{DP}{2\pi R}(\pi/2 + u_{\max}/D), because ∣ψ/tan⁡ψ∣≤1|\psi/\tan\psi| \le 1. Linear interpolation uses the two rows next to that height, and the central difference in vv uses one more row on each side. So the output does not depend on the data in rows more than 2Δv2\Delta v away from this band. The test changes these rows at random and gets the same output. This is the reason why a helical detector needs only a few rows: the data outside the band around the kappa-lines, which lie near the Tam-Danielsson window, is never read.

Complexity

In the real-RAM model:

  • Lines L1 to L3 take O(md)O(md) for each view, so O(amd)O(amd) in total.
  • Line L4 takes a fixed number of bisection steps for each point.
  • Lines L5 to L8 take O(d)O(d) for each point and view: O(d)O(d) to read the kappa-line and O(d)O(d) for each of the two Hilbert sums. With KK views in a PI-interval this is O(Kd)O(Kd) per point.
  • Line L9 takes O(K)O(K) per point.

The total for VV points is O(amd+VKd)O(amd + VKd), and the extra space is O(amd)O(amd) for g2g_2. This point-wise form is simple and fits a small test. A volume code filters each view once along a family of kappa-lines: it rebins g2g_2 to (u,ψ)(u, \psi) coordinates, filters each line with an FFT, and rebins back. That costs O(mdlog⁡d)O(m d \log d) per view, and the back-projection then costs O(1)O(1) per voxel and view, as in FDK. For a cube of N3N^3 voxels with KK of order NN the back-projection dominates with O(N4)O(N^4).

Properties

  • Exact for smooth ff inside the helix cylinder in the continuous limit (theorem, cited). FDK is not.
  • Linear in the data.
  • Shift-invariant 1D filter. The filter along each kappa-line is the Hilbert kernel, which does not depend on the position. The kappa-line itself depends on the view and on the point only through ψ∗\psi^*.
  • Local in vv. The algorithm reads only a band of rows around the kappa-lines, so a detector a little taller than the band is enough (proved for the discrete code, and tested).
  • Long objects. The data for a point comes from its PI-interval, which is less than one turn. The object may extend far beyond the scanned region along the axis, and the method still works inside it.
  • Not local in uu. The Hilbert kernel decays like 1/u1/u, so every column of the kappa-line is needed. A detector cut short in uu gives errors.

Variants and improvements

  • Curved detector. Noo, Pack and Heuscher give the same steps for the cylindrical detector of clinical scanners.
  • Derivative at a fixed direction. Computing g1g_1 by the chain rule, as here, or by a difference of rays with the same direction from two nearby source points, changes the accuracy. Katsevich's 2004 paper gives an improved form of the algorithm.
  • Approximate methods. FDK adapted to the helix is simpler and is still used, at the cost of cone-beam errors at large cone angles.
  • Iterative methods. SART handles any orbit and noise models, at a much higher cost.

When to use it

Use it for helical cone-beam CT when exactness matters: a large cone angle, a large pitch, or objects with fast changes along the axis, where FDK-type methods show cone-beam errors. It needs a detector that covers the band of the kappa-lines in vv and the whole object in uu. For a circular orbit it does not apply, and FDK or an iterative method is the choice.

Pitfalls

  • Filtering along the rows. The Hilbert filter must run along the kappa-lines. Filtering the rows mixes data from different planes, and the result is no longer exact.
  • The wrong derivative. The derivative in ss must be taken for a fixed ray direction, not at a fixed detector point. Without the terms in ∂u\partial_u and ∂v\partial_v of g1g_1 the result is wrong everywhere.
  • The wrong PI-interval. Using [x3/h−π/2,x3/h+π/2][x_3/h - \pi/2, x_3/h + \pi/2] for every point, as for the axis, is wrong off the axis. The interval of (0.6,0,0)(0.6, 0, 0) above is shorter than π\pi.
  • Ends of the interval. The integrand does not vanish at sbs_b and sts_t. A sum over the whole views in the interval, without the partial cells at the two ends, gives an error of order Δs\Delta s.
  • Sign conventions. The sign of the result depends on the orientation of uu, of the helix and of the Hilbert kernel. Check it on a known blob, as the test does.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

katsevich_algorithm.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/katsevich-algorithm/. The authors are listed in prov/KKE2E7.jsonl.
"""Katsevich's exact reconstruction for helical cone-beam CT, in the flat-detector form.

Conventions:
- The source is on the helix y(s) = (R cos s, R sin s, H s) with H = P / (2 pi),
  where P is the pitch (the rise per turn).
- e_u(s) = (-sin s, cos s, 0), e_v = (0, 0, 1), e_w(s) = (cos s, sin s, 0).
- A flat detector at the distance D from the source is normal to e_w(s). Its
  point (u, v) is y(s) + u e_u + v e_v - D e_w. The data g[k][r][j] is the line
  integral of f along the ray from y(s_k) through the detector point (u_j, v_r),
  with s_k = s0 + k ds, u_j = (j - (d - 1) / 2) du and v_r = (r - (m - 1) / 2) dv.
- Geometry holds (R, P, D, s0, ds, du, dv).
"""

import math
from collections import namedtuple

Geometry = namedtuple("Geometry", "R P D s0 ds du dv")


def helix_ray(geo, s, u, v):
    """The source y(s) and the unit direction of the ray to the detector point (u, v)."""
    c, sn = math.cos(s), math.sin(s)
    src = (geo.R * c, geo.R * sn, geo.P * s / (2.0 * math.pi))
    w = (-u * sn - geo.D * c, u * c - geo.D * sn, v)
    nn = math.sqrt(u * u + v * v + geo.D * geo.D)
    return src, (w[0] / nn, w[1] / nn, w[2] / nn)


def project(geo, x, s):
    """(u*, v*, depth): the detector point of the ray through x, and depth = R - x . e_w(s)."""
    c, sn = math.cos(s), math.sin(s)
    depth = geo.R - x[0] * c - x[1] * sn
    u = geo.D * (-x[0] * sn + x[1] * c) / depth
    v = geo.D * (x[2] - geo.P * s / (2.0 * math.pi)) / depth
    return u, v, depth


def pi_interval(geo, x):
    """The ends (s_b, s_t) of the PI-line of x: x is on the chord from y(s_b) to y(s_t), s_t - s_b < 2 pi."""
    h = geo.P / (2.0 * math.pi)

    def other_end(sb):
        ax, ay = geo.R * math.cos(sb), geo.R * math.sin(sb)
        dx, dy = x[0] - ax, x[1] - ay
        mu = -2.0 * (ax * dx + ay * dy) / (dx * dx + dy * dy)  # the chord meets the circle again at mu
        st = math.atan2(ay + mu * dy, ax + mu * dx)
        st += 2.0 * math.pi * math.ceil((sb - st) / (2.0 * math.pi))
        if st <= sb:
            st += 2.0 * math.pi
        return st, (1.0 - 1.0 / mu) * h * sb + (1.0 / mu) * h * st - x[2]

    lo, hi = x[2] / h - 2.0 * math.pi, x[2] / h
    for _ in range(80):
        mid = 0.5 * (lo + hi)
        if other_end(mid)[1] > 0.0:
            hi = mid
        else:
            lo = mid
    sb = 0.5 * (lo + hi)
    return sb, other_end(sb)[0]


def kappa_v(geo, u, psi):
    """The height of the kappa-line with the angle psi at the column u."""
    c = geo.D * geo.P / (2.0 * math.pi * geo.R)
    if psi == 0.0:
        return c * u / geo.D
    return c * (psi + psi / math.tan(psi) * u / geo.D)


def kappa_psi(geo, u, v):
    """The angle psi in (-pi/2, pi/2) of the kappa-line through (u, v), by bisection, clamped at the ends."""
    lo, hi = -math.pi / 2.0 + 1e-9, math.pi / 2.0 - 1e-9
    if v <= kappa_v(geo, u, lo):
        return lo
    if v >= kappa_v(geo, u, hi):
        return hi
    for _ in range(60):
        mid = 0.5 * (lo + hi)
        if kappa_v(geo, u, mid) < v:
            lo = mid
        else:
            hi = mid
    return 0.5 * (lo + hi)


def derivative_view(geo, g, k):
    """g2 of view k: the derivative at a fixed ray direction, times D / sqrt(u^2 + v^2 + D^2)."""
    m, d, dd = len(g[0]), len(g[0][0]), geo.D
    out = []
    for r in range(m):
        v = (r - (m - 1) / 2.0) * geo.dv
        row = []
        for j in range(d):
            u = (j - (d - 1) / 2.0) * geo.du
            gs = (g[k + 1][r][j] - g[k - 1][r][j]) / (2.0 * geo.ds)  # @line L1
            gu = ((g[k][r][j + 1] if j + 1 < d else 0.0) - (g[k][r][j - 1] if j > 0 else 0.0)) / (2.0 * geo.du)
            gv = ((g[k][r + 1][j] if r + 1 < m else 0.0) - (g[k][r - 1][j] if r > 0 else 0.0)) / (2.0 * geo.dv)
            g1 = gs + (u * u + dd * dd) / dd * gu + u * v / dd * gv  # @line L2
            row.append(dd / math.sqrt(u * u + v * v + dd * dd) * g1)  # @line L3
        out.append(row)
    return out


def _height_interp(g2, j, v, dv):
    m = len(g2)
    fr = v / dv + (m - 1) / 2.0
    r0 = math.floor(fr)
    w = fr - r0
    a = g2[r0][j] if 0 <= r0 < m else 0.0
    b = g2[r0 + 1][j] if 0 <= r0 + 1 < m else 0.0
    return (1.0 - w) * a + w * b


def katsevich_point(geo, g2s, x):
    """f(x) = (1 / (2 pi)) integral over the PI-interval of (H g2 along the kappa-line)(u*) / depth ds."""
    sb, st = pi_interval(geo, x)  # @line L4
    k0, k1 = math.floor((sb - geo.s0) / geo.ds), math.ceil((st - geo.s0) / geo.ds)
    vals = {}
    for k in range(k0, k1 + 1):
        g2 = g2s(k)
        d = len(g2[0])
        us, vs, depth = project(geo, x, geo.s0 + k * geo.ds)  # @line L5
        psi = kappa_psi(geo, us, vs)
        line = [_height_interp(g2, j, kappa_v(geo, (j - (d - 1) / 2.0) * geo.du, psi), geo.dv) for j in range(d)]  # @line L6
        fj = us / geo.du + (d - 1) / 2.0
        j0 = math.floor(fj)
        hil = [sum(2.0 / (math.pi * (jj - l)) * line[l] for l in range(d) if (jj - l) % 2) for jj in (j0, j0 + 1)]  # @line L7
        vals[k] = ((j0 + 1 - fj) * hil[0] + (fj - j0) * hil[1]) / depth  # @line L8
    total = 0.0
    for k in range(k0, k1):
        a = geo.s0 + k * geo.ds
        lo, hi = max(a, sb), min(a + geo.ds, st)
        if hi > lo:
            mid = 0.5 * (lo + hi - 2.0 * a) / geo.ds
            total += (hi - lo) * (vals[k] + (vals[k + 1] - vals[k]) * mid)
    return total / (2.0 * math.pi)  # @line L9


def katsevich(geo, g, points):
    """Reconstruct f at each point. The views s_k needed by the PI-intervals and their neighbours must be in g."""
    cache = {}

    def g2s(k):
        if k not in cache:
            cache[k] = derivative_view(geo, g, k)
        return cache[k]

    return [katsevich_point(geo, g2s, x) for x in points]
test_katsevich_algorithm.py 99 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/katsevich-algorithm/. The authors are listed in prov/KKE2E7.jsonl.

import math
import random

from katsevich_algorithm import Geometry, derivative_view, helix_ray, kappa_psi, kappa_v, katsevich, pi_interval, project

R, P, DIST = 3.0, 2.0, 3.0
D_COLS, M_ROWS = 41, 41
CENTER, ALPHA = (0.1, 0.05, 0.0), 10.0
POINTS = [(0.1, 0.05, 0.0), (0.2, 0.05, 0.0), (0.1, 0.05, 0.15), (0.0, 0.0, 0.0), (-0.2, 0.1, -0.1), (0.6, 0.0, 0.0)]
DS = 2.0 * math.pi / 64
GEO = Geometry(R, P, DIST, -2.2, DS, 2.2 / (D_COLS - 1), 2.0 / (M_ROWS - 1))
VIEWS = 48


def gauss3(src, v, c=CENTER, alpha=ALPHA):
    """Line integral of exp(-alpha |x - c|^2) along the line src + t v, with v a unit vector."""
    w = [c[i] - src[i] for i in range(3)]
    t = sum(w[i] * v[i] for i in range(3))
    d2 = sum(w[i] ** 2 for i in range(3)) - t * t
    return math.sqrt(math.pi / alpha) * math.exp(-alpha * d2)


def helix_data(geo=GEO, views=VIEWS):
    return [
        [
            [gauss3(*helix_ray(geo, geo.s0 + k * geo.ds, (j - (D_COLS - 1) / 2.0) * geo.du, (r - (M_ROWS - 1) / 2.0) * geo.dv)) for j in range(D_COLS)]
            for r in range(M_ROWS)
        ]
        for k in range(views)
    ]


DATA = helix_data()


def test_pi_interval() -> None:
    sb, st = pi_interval(GEO, (0.0, 0.0, 0.0))
    assert abs(sb + math.pi / 2.0) < 1e-9 and abs(st - math.pi / 2.0) < 1e-9
    rng = random.Random(5)
    h = P / (2.0 * math.pi)
    for _ in range(30):
        x = (rng.uniform(-1, 1), rng.uniform(-1, 1), rng.uniform(-1, 1))
        sb, st = pi_interval(GEO, x)
        assert 0.0 < st - sb < 2.0 * math.pi
        a = (R * math.cos(sb), R * math.sin(sb), h * sb)
        b = (R * math.cos(st), R * math.sin(st), h * st)
        # x is on the segment from a to b
        lam = sum((x[i] - a[i]) * (b[i] - a[i]) for i in range(3)) / sum((b[i] - a[i]) ** 2 for i in range(3))
        assert 0.0 < lam < 1.0
        assert max(abs(a[i] + lam * (b[i] - a[i]) - x[i]) for i in range(3)) < 1e-9


def test_kappa_line_through_helix_points() -> None:
    # The kappa-line with the angle psi at the view s passes through the projections of y(s + psi) and y(s + 2 psi).
    h = P / (2.0 * math.pi)
    for s in (0.0, 0.7):
        for psi in (-1.2, -0.4, 0.3, 1.0):
            for t in (psi, 2.0 * psi):
                y = (R * math.cos(s + t), R * math.sin(s + t), h * (s + t))
                u, v, _ = project(GEO, y, s)
                assert abs(kappa_v(GEO, u, psi) - v) < 1e-12
                if abs(u) < 1.2:
                    # on the detector the height grows with psi, so bisection finds psi again
                    assert abs(kappa_psi(GEO, u, v) - psi) < 1e-9


def test_derivative_at_fixed_direction() -> None:
    # Compare g1 with the derivative of the line integral along the source path for a fixed ray direction.
    k, eps = 30, 1e-5
    g2 = derivative_view(GEO, DATA, k)
    s = GEO.s0 + k * GEO.ds
    for r, j in ((20, 20), (15, 26), (24, 12), (18, 30)):
        u, v = (j - (D_COLS - 1) / 2.0) * GEO.du, (r - (M_ROWS - 1) / 2.0) * GEO.dv
        _, direction = helix_ray(GEO, s, u, v)
        h = P / (2.0 * math.pi)

        def line_from(sp):
            return gauss3((R * math.cos(sp), R * math.sin(sp), h * sp), direction)

        g1 = (line_from(s + eps) - line_from(s - eps)) / (2.0 * eps)
        want = DIST / math.sqrt(u * u + v * v + DIST * DIST) * g1
        assert abs(g2[r][j] - want) < 0.02 * max(1.0, abs(want))


def test_gaussian_values() -> None:
    vals = katsevich(GEO, DATA, POINTS)
    for x, val in zip(POINTS, vals):
        want = math.exp(-ALPHA * sum((x[i] - CENTER[i]) ** 2 for i in range(3)))
        assert abs(val - want) < 0.05


def test_rows_far_from_the_kappa_lines_are_not_used() -> None:
    # Every kappa-line with |psi| < pi/2 and |u| <= 1.1 stays within |v| < (D P / (2 pi R)) (pi/2 + 1.1 / D) < 0.62.
    rng = random.Random(9)
    changed = [[row if abs((r - (M_ROWS - 1) / 2.0) * GEO.dv) < 0.75 else [rng.uniform(-9, 9) for _ in row] for r, row in enumerate(p)] for p in DATA]
    assert katsevich(GEO, changed, POINTS[:3]) == katsevich(GEO, DATA, POINTS[:3])

History

Tuy showed in 1983 that exact cone-beam inversion needs every plane through the object to meet the source path, and a helix meets this condition. Grangeat gave in 1991 the link between cone-beam data and the derivative of the 3D Radon transform. Katsevich published in 2002 an exact formula of the filtered back-projection type with a 1D shift-invariant filter, and in 2004 an improved form. Noo, Pack and Heuscher wrote it in 2003 for the flat and curved detectors of real scanners.

References

  1. A. Katsevich, Theoretically exact filtered backprojection-type inversion algorithm for spiral CT, SIAM Journal on Applied Mathematics 62(6), 2002, pp. 2012 to 2026 (the inversion formula with filtering along kappa-lines)
  2. A. Katsevich, An improved exact filtered backprojection algorithm for spiral computed tomography, Advances in Applied Mathematics 32(4), 2004, pp. 681 to 697
  3. F. Noo, J. Pack and D. Heuscher, Exact helical reconstruction using native cone-beam geometries, Physics in Medicine and Biology 48(23), 2003, the implementation for flat and curved detectors, with the derivative at a fixed ray direction and the kappa-line rebinning
  4. H. K. Tuy, An inversion formula for cone-beam reconstruction, SIAM Journal on Applied Mathematics 43(3), 1983, the data condition that a helix satisfies

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of correctness
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example