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
- Model
- Real RAM
- Properties
- deterministicnot in placenot iterativelineariterative
- Evidence
- Proof sketchCode in 1 languages
- 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 , a helix of radius and pitch , the rise per turn. Put , and . A flat detector at the distance from the source is normal to . Its point is . The data is the integral of the attenuation along the ray from through the point . This is the cone-beam X-ray transform. The unknown is smooth with support inside the cylinder of radius around the axis. The views are , the columns and the rows .
The PI-line. For a point inside the helix there are such that lies on the segment from to . This segment is the PI-line of , and it is unique. The PI-interval is . A helix meets every plane through the object, so it satisfies the Tuy condition.
The kappa-lines. In the detector of the view , the kappa-line with the angle is
It is the projection of the plane through , and .
The formula. For and , let be the detector point of the ray through and the angle of the kappa-line through it. Let
Here is the derivative of the data along the source path for a fixed ray direction. Then
The inner integral is the Hilbert transform of along the kappa-line, read at . 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
KATSEVICH(g, geometry, x) ▷ g[k][r][j]: view s_k, detector point (u_j, v_r); one point x▷ for each view k: g₂ from central differences- 1
g_s ← (g[k+1][r][j] - g[k-1][r][j]) / (2Δs), and g_u, g_v in the same way - 2
g₁ ← g_s + ((u_j² + D²)/D) g_u + (u_j v_r / D) g_v - 3
g₂[k][r][j] ← D / sqrt(u_j² + v_r² + D²) · g₁ - 4
(s_b, s_t) ← the PI-interval of x, by bisection for each view k with s_k in [s_b - Δs, s_t + Δs] do- 5
(u*, v*, depth) ← the projection of x; ψ* ← the kappa-line angle through (u*, v*), by bisection - 6
ℓ[j] ← g₂[k] at (u_j, v_κ(u_j, ψ*)), by linear interpolation in v - 7
H[j] ← Σ_l (2 / (π (j - l))) ℓ[l] over odd j - l, for the two columns j next to u* - 8
val[k] ← H interpolated at u*, divided by depth - 9
return (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 for a view the first time a point needs it and keeps it. Line L7 is the band-limited discrete Hilbert kernel: times 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 , and , so and .
PI-interval of a point on the axis. For every chord through the axis is a diameter, so and is at the middle of the segment. Its height is , so . For this is , and for it is . The code gives these values. A point off the axis has a different interval: for the code gives , which is shorter than .
The filtering line. Take and the view . The depth is , and . On the column the kappa-line has the height , so . With , the kappa-line is
So at the filter reads the data at . 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 with , on exact data with 64 views per turn, rows with , and columns with or columns with . These are measurements, not bounds.
| point | true | ||
|---|---|---|---|
| 1.0000 | 0.9692 | 0.9888 | |
| 0.9048 | 0.8778 | 0.8952 | |
| 0.7985 | 0.7756 | 0.7912 | |
| 0.8825 | 0.8643 | 0.8751 | |
| 0.3588 | 0.3566 | 0.3573 | |
| 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 and when and scale with , 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 . It derives the kappa-line formula, by checking that the line passes through the projections of and . It proves that 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 , into the Hilbert transform along the kappa-line on the flat detector, which gives the factors and . The reason why the formula is exact is sketched there. The 3D Radon inversion writes as an integral over all planes through (Grangeat's formula gives the plane integrals from the data). Every plane through 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 with . The vectors , and are orthonormal, and the flat detector point is . The cone-beam data is for a unit vector , and with . The object is smooth with support in the cylinder , .
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 and the sign.
Part 1. The PI-line
Lemma 1 (existence). For every with there are such that lies on the open segment from to .
Proof. For , the line in the plane through and meets the circle of radius at a second point, since is inside. Let be its angle in , and let be the position of on the chord. Both depend continuously on . The point of the 3D segment from to over has the height . It lies between and . At we have . At we have . By the intermediate value theorem for some in between, and then is on the segment.
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 by bisection on in the range of the proof, and the test checks that lies on the computed segment. The interval is the PI-interval.
For a point on the axis, , every chord is a diameter, and , so and .
Part 2. Projections and kappa-lines
Lemma 2. The ray from through meets the detector at
Proof. , because and . The detector point is . The two vectors are parallel when and .
Lemma 3. For , the line in the detector of view
passes through the projections of and .
Proof. Put . Here , and the height difference is . Lemma 2 gives and . For : , so , and is the same since . For : , so , and is the same.
So is the projection of Katsevich's kappa-plane through , and . The limit is the line . For in the range of the detector of the page, increases with , so bisection on finds the kappa-line through . The test checks Lemma 3 and the inverse.
Part 3. The derivative at a fixed direction
Lemma 4. For a fixed unit vector ,
where is the detector point of at the view .
Proof. Let be the detector point of the fixed at the view . Then , and the chain rule gives . The vector must stay parallel to , so for some . Since and , . Comparing with gives , and .
Lines L1 and L2 compute this with central differences of step , and , which have the error for smooth data. Line L3 multiplies by , which gives . The test compares with the derivative computed along the source path for a fixed direction.
Part 4. The formula
Theorem (Katsevich 2002, cited). For as above and in the cylinder of radius ,
where , is a unit vector orthogonal to in the kappa-plane of at (the plane through whose detector line is the kappa-line through ), and the inner integral is a principal value. The orientation of 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
up to the sign convention of , where is the angle of the kappa-line through .
Proof of the change of variables. Fix . The directions for point to the detector, and they meet it on the kappa-line. The directions of the other half have . For such a and for near , , so every point with has and lies outside the cylinder of radius . So for near , and its derivative in vanishes. Let be the arc length on the kappa-line and the distance from to that line in the kappa-plane. A direction with the angle from the foot of the perpendicular hits the point , and hits with . Then and , so
Here for the detector point , so . The kappa-line has a constant slope in the plane, so . The point lies on the ray to at the depth along , and at the depth , so . Finally . Putting these together, with Lemma 4 for the derivative,
Multiplying by gives the factor of the proposition.
The detector form does not depend on . If changes to , then , and scale by , does not change at corresponding points, and does not change. The prototype for this page checked this with and and got the same values.
Why the formula is exact (sketch, not a full proof). The 3D Radon inversion formula writes as an integral over all planes through of the second derivative of the plane integrals of (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 meets the PI-segment of the helix, , 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 . Katsevich chose the weights so that they jump only where the plane contains a kappa-line, and then the integral over the planes through and 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 (Part 1). For each view with , line L5 computes and the depth (Lemma 2). Line L6 reads along the kappa-line through at the detector columns , by linear interpolation in . Line L7 applies the discrete Hilbert kernel for odd and 0 for even , which is times the band-limited kernel at the sample points, at the two columns next to . Line L8 interpolates linearly to and divides by the depth. Line L9 integrates the piecewise linear interpolant of these values over exactly and multiplies by . 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 (exact). For a point , line L6 reads only at the heights with , and with the detector columns these heights satisfy , because . Linear interpolation uses the two rows next to that height, and the central difference in uses one more row on each side. So the output does not depend on the data in rows more than 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 for each view, so in total.
- Line L4 takes a fixed number of bisection steps for each point.
- Lines L5 to L8 take for each point and view: to read the kappa-line and for each of the two Hilbert sums. With views in a PI-interval this is per point.
- Line L9 takes per point.
The total for points is , and the extra space is for . 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 to coordinates, filters each line with an FFT, and rebins back. That costs per view, and the back-projection then costs per voxel and view, as in FDK. For a cube of voxels with of order the back-projection dominates with .
Properties
- Exact for smooth 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 .
- Local in . 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 . The Hilbert kernel decays like , so every column of the kappa-line is needed. A detector cut short in 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 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 and the whole object in . 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 must be taken for a fixed ray direction, not at a fixed detector point. Without the terms in and of the result is wrong everywhere.
- The wrong PI-interval. Using for every point, as for the axis, is wrong off the axis. The interval of above is shorter than .
- Ends of the interval. The integrand does not vanish at and . A sum over the whole views in the interval, without the partial cells at the two ends, gives an error of order .
- Sign conventions. The sign of the result depends on the orientation of , 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.
# 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
- 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)
- A. Katsevich, An improved exact filtered backprojection algorithm for spiral computed tomography, Advances in Applied Mathematics 32(4), 2004, pp. 681 to 697
- 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
- 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.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag KKE2E7 Edit this page History Report an error Markdown