Chapter 2: The Geometry of Line Integrals

Understand how to represent lines and the geometric meaning of the line integral.

2.1 Parametrizing Lines

The Radon transform is a "line integral along a line," so we first need a way to describe every line in the plane systematically.

Why $y = mx + b$ does not work

The slope-intercept form $y = mx + b$, using the slope $m$ and intercept $b$, is convenient, but it has a fatal flaw: it cannot represent a vertical line (one of the form $x = c$). Since the Radon transform deals with lines in every direction, this representation is not enough.

The normal form (Hesse normal form)

A representation that handles all lines uniformly is the normal form. For any line $L$, drop a perpendicular from the origin $O$ onto $L$; then the line is uniquely determined by the following two quantities.

  • $s$: the length of the perpendicular (the distance from the origin to the line)
  • $\theta$: the angle the direction of the perpendicular makes with the $x$ axis
$x$ $y$ $O$ $L$ $s$ $\theta$ $H$ $P=(x,y)$
Figure 1: The normal form of a line. The perpendicular dropped from the origin $O$ to the line $L$ (red) has foot $H$, length $s$, and makes angle $\theta$ with the $x$ axis. $P$ is a point on $L$, with $\overrightarrow{OH}\perp\overrightarrow{HP}$.

As in Figure 1, let the foot of the perpendicular dropped from the origin $O$ to $L$ be $H = (s\cos\theta,\ s\sin\theta)$, and let any point on the line $L$ be $P = (x, y)$. The perpendicular $\overrightarrow{OH}$ and the along-the-line vector $\overrightarrow{HP}$ are orthogonal, so their dot product is $0$.

$$\overrightarrow{OH}\cdot\overrightarrow{HP}=0$$

This is the condition for "the point $P$ lies on the line $L$." Writing the two vectors in components,

$$\overrightarrow{OH}=(s\cos\theta,\ s\sin\theta), \qquad \overrightarrow{HP}=(x-s\cos\theta,\ \ y-s\sin\theta)$$

so computing the dot product (the sum of the products of the components),

$$s\cos\theta\,(x-s\cos\theta) + s\sin\theta\,(y-s\sin\theta) = 0$$

Each term on the left has a common factor $s$, so when $s\neq 0$ we can divide both sides by $s$:

$$\cos\theta\,(x-s\cos\theta) + \sin\theta\,(y-s\sin\theta) = 0$$

Expanding the parentheses and collecting the terms containing $s$,

$$\cos\theta\,x + \sin\theta\,y - s\,(\cos^2\theta+\sin^2\theta) = 0$$

Using the basic identity $\cos^2\theta+\sin^2\theta = 1$, the coefficient of $s$ becomes exactly $1$, giving

$$\cos\theta\,x + \sin\theta\,y - s = 0$$

that is, we obtain the following equation of the line (the normal form).

Normal form of a line (Hesse normal form)

$$\boxed{x \cos\theta + y \sin\theta = s}$$
  • $\theta \in [0, \pi)$: the angle the line's normal direction makes with the $x$ axis
  • $s \in \mathbb{R}$: the signed distance from the origin to the line

If $s > 0$ the line lies on the side of the normal direction $(\cos\theta, \sin\theta)$; if $s < 0$ it lies on the opposite side; if $s = 0$ the line passes through the origin.

Why is the range of $\theta$ equal to $[0, \pi)$?

$(s, \theta)$ and $(-s, \theta + \pi)$ represent the same line. To avoid this duplication, we restrict $\theta$ to $[0, \pi)$ (verified in Exercise 3).

Parametrizing the points on a line

Let us express the points on the line $L$. To move along $L$, we go in the direction perpendicular to the normal direction $(\cos\theta, \sin\theta)$. A vector perpendicular to a given vector $(a, b)$ can be made by swapping the two components and flipping the sign of one of them. For instance, $(b, -a)$ does it; computing the dot product,

$$(a, b)\cdot(b, -a) = a\cdot b + b\cdot(-a) = ab - ab = 0$$

so it is indeed orthogonal (the vector $(-b, a)$, with the sign on the other component, is also perpendicular). Applying this operation to the normal $(\cos\theta, \sin\theta)$ gives two perpendicular unit vectors, $(\sin\theta, -\cos\theta)$ and $(-\sin\theta, \cos\theta)$. Both lie along the line, and the former would not be wrong, but here we take the latter, because its signs match the standard formula for the Radon transform used later, and we call the along-the-line direction vector $\boldsymbol{d}$ (see the note below for the reason):

$$\boldsymbol{d} = (-\sin\theta, \; \cos\theta)$$

Its length is $|\boldsymbol{d}| = \sqrt{(-\sin\theta)^2 + (\cos\theta)^2} = \sqrt{\sin^2\theta+\cos^2\theta} = 1$, so $\boldsymbol{d}$ is a unit vector along the line.

Choosing the direction of $\boldsymbol{d}$

Choosing the other vector $(\sin\theta, -\cos\theta)$ only reverses the direction; it is still a unit vector along the same line. Reversing the direction amounts to the substitution $t \to -t$ in the line integral, and since we integrate $t$ from $-\infty$ to $\infty$, the result does not change. We still take $(-\sin\theta, \cos\theta)$ because it is the normal $(\cos\theta, \sin\theta)$ rotated by $+90^\circ$, and its signs match the standard Radon-transform formula $f(s\cos\theta - t\sin\theta,\ s\sin\theta + t\cos\theta)$ used from §2.3 onward.

A point $P$ on the line is the point reached from the foot $H=(s\cos\theta,\ s\sin\theta)$ by going a distance $t$ in the direction $\boldsymbol{d}$. That is, with $t\in(-\infty,\infty)$ we can write $P = H + t\,\boldsymbol{d}$. In components,

$$P = (x,\ y) = (s\cos\theta,\ s\sin\theta) + t\,(-\sin\theta,\ \cos\theta)$$

Reading off each component gives the following parametric representation.

Parametric representation of points on a line

$$\begin{cases} x = s\cos\theta - t\sin\theta \\ y = s\sin\theta + t\cos\theta \end{cases}$$

$t = 0$ is the foot of the perpendicular $H$, and the direction of increasing $t$ is that of $\boldsymbol{d} = (-\sin\theta, \cos\theta)$.

Before dealing with the line integral along this line, we pin down the geometric meaning of the parameter $t$ (the next figure).

$x$ $y$ $O$ $L$ $s$ $\theta$ $\boldsymbol{d}$ $2$ $1$ $0$ $-1$ $-2$ $t$
Figure 2: Parametrizing the points on a line $L$. The line is fixed by $(s,\theta)$ ($s$ = signed distance from the origin $O$ to $L$, $\theta$ = angle the normal makes with the $x$ axis), and the points on it are described by the parameter $t$ along the unit direction vector $\boldsymbol{d}=(-\sin\theta,\cos\theta)$. $t=0$ is the foot of the perpendicular, and each step of $\boldsymbol{d}$ increases $t$ by $1$, so the integer-$t$ points (blue) are equally spaced. A general point is $P(t)=(s\cos\theta-t\sin\theta,\ s\sin\theta+t\cos\theta)$.

$t$ is the distance along the line

As in Figure 2, a point on the line moves at constant speed along the unit direction vector $\boldsymbol{d} = (-\sin\theta,\ \cos\theta)$. Indeed, the velocity is $(x'(t), y'(t)) = (-\sin\theta,\ \cos\theta)$, and its speed is

$$\sqrt{x'(t)^2 + y'(t)^2} = \sqrt{\sin^2\theta + \cos^2\theta} = 1$$

which is constant (Exercise 2).

Therefore $t$ equals the signed distance (arc length) measured along the line from the foot $H$ (at $t = 0$). This is why the points obtained by changing $t$ by $1$ in Figure 2 are equally spaced. This property (that $t$ is exactly the distance along the line) plays an essential role in the line integral of the next section.

2.2 Defining the Line Integral

The line integral along a line

The line integral of a function $f(x, y)$ along the line $L$ is

$$\displaystyle\int_L f(x,y) \, dl = \displaystyle\int_{-\infty}^{\infty} f(x(t), y(t)) \, dt$$

where $(x(t), y(t))$ is the parametric representation of the line $L$, and $t$ is the distance along the line (hence $dl = dt$).

A 3D rendering of the attenuation-coefficient (density-like) distribution f(x,y) over the x-y plane (height = value of f), with the cross-section cut along a line L on the plane exposed (corresponding to the line integral ∫_L f dl) $f(x,y)$ $L$ $\displaystyle\int_L f(x,y)\,dl$
Figure 3: The geometric meaning of the line integral. The function $f(x,y)$ is the distribution of the attenuation coefficient at each point of the $x$-$y$ plane, and here the height represents its value (an example with two peaks). Cutting $f$ along the line $L$ (pink) in the plane reveals a cross-section (dark blue), and as in the figure, when $f \geq 0$ the area of that cross-section equals the line integral $\int_L f(x,y)\,dl$ (in general it is a signed area, where the part with $f<0$ contributes negatively). Since the attenuation coefficient satisfies $f \geq 0$, this is the value of $f$ accumulated along $L$ (the projection value).

Physical interpretation: when $f$ represents a "quantity per unit length," like an attenuation coefficient, $\int_L f(x,y)\,dl$ is that quantity summed up along the path $L$. In the X-ray CT of Chapter 1, regarding $f$ as the attenuation coefficient of the material, this line integral is exactly the projection data (the value of the Radon transform), and the denser the path a line passes through, the larger the line integral. For the relation to the transmitted X-ray intensity $I$ (since $I=I_0e^{-\int_L f(x,y)\,dl}$, the projection value is obtained from the measurement as $-\ln(I/I_0)$), see Chapter 1, §1.2.

2.3 The Radon Transform as a Line Integral

Combining the parametrization of lines from §2.1 with the line integral from §2.2, we can define the Radon transform. As introduced intuitively in Chapter 1, it is the collection, over all lines $(s,\theta)$, of the line integral of $f$ along each line.

The Radon transform (definition via the line integral)

The Radon transform is the line integral of $f$ along the line $L_{s,\theta}$, and using the distance $t$ along the line it can be written

$$p(s, \theta) = \mathcal{R}f(s, \theta) = \displaystyle\int_{L_{s,\theta}} f(x,y) \, dl = \displaystyle\int_{-\infty}^{\infty} f(s\cos\theta - t\sin\theta,\ s\sin\theta + t\cos\theta) \, dt$$

Here let us confirm that this $s$ (the normal distance from the origin to the line) is the same as the $s$ (the position on the detector) of the projection $p(s)$ that was measured in Chapter 1, §1.2. In a parallel beam the detector array is lined up exactly in the normal direction, so the position on the detector is itself the normal distance $s$. Therefore the projection $p(s)=-\ln(I(s)/I_0)$ obtained from the detector is precisely the Radon transform $p(s,\theta)$ in that direction $\theta$.

center normal distance detector position detector array $O$ $f(x,y)$ $s$ $s$
Figure 4: For parallel X-rays, the detector array is lined up in the normal direction. The normal distance from the origin $O$ to the X-ray of interest (green) and the position from the center of the detector array to that detector (blue) are the same length $s$, measured in the same direction. So "the position $s$ on the detector" and "the normal distance $s$ of the line" coincide, and the projection $p(s)$ measured in Chapter 1, §1.2 is the Radon transform $p(s,\theta)$ of the line at normal distance $s$.

On notation

  • $p(s, \theta)$: the projection data
  • $\mathcal{R}$: the Radon transform operator
  • some references also write $\hat{f}(s, \theta)$ or $Rf(s, \theta)$

Collecting the function $p(s, \theta)$ over all $(s, \theta)$ gives two-dimensional data on the $(s, \theta)$ plane, called the sinogram. A CT scanner collects the projection data $p(s, \theta)$ from various angles $\theta$, and by inverting this it reconstructs the cross-sectional image $f(x,y)$ inside the body.

The remarkable fact proved by Radon in 1917 is that a sufficiently well-behaved function $f$ can be completely recovered from its Radon transform $p$. The theory of this inverse transform is treated in detail in Chapter 3.

2.4 Examples

Example 1: A disk centered at the origin

Let $f = 1$ inside the disk of radius $R$ and $f = 0$ outside:

$$f(x, y) = \begin{cases} 1 & x^2 + y^2 \leq R^2 \\ 0 & \text{otherwise} \end{cases}$$

Computing the Radon transform:

By symmetry, $p(s, \theta)$ does not depend on $\theta$. Computing with $\theta = 0$, the line is $x = s$.

When $|s| \leq R$, the line meets the disk, and the range of $y$ at the intersection is $-\sqrt{R^2 - s^2} \leq y \leq \sqrt{R^2 - s^2}$.

$$p(s, 0) = \displaystyle\int_{-\sqrt{R^2-s^2}}^{\sqrt{R^2-s^2}} 1 \, dy = 2\sqrt{R^2 - s^2}$$

When $|s| > R$, $p(s, 0) = 0$.

$x$ $y$ $O$ $x=s$ $s$ $R$ original function $f$ $\mathcal{R}$ $s$ $p$ $-R$ $R$ $2R$ $p(s)=2\sqrt{R^2-s^2}$
Figure 5: The Radon transform of a uniform disk of radius $R$ centered at the origin ($f=1$). At $\theta=0$ the line is $x=s$ (pink), and the length of the chord (thick line) it cuts through the disk is itself the projection value. The chord length is $2\sqrt{R^2-s^2}$, so as $s$ varies the projection $p(s)$ traces the upper half of an ellipse (horizontal semi-axis $R$, vertical semi-axis $2R$), and is $0$ for $|s|>R$. By symmetry $p$ does not depend on $\theta$.

Example 2: A point-like object

Consider an object that exists only at the point $(a, b)$. In the projection at angle $\theta$, the value concentrates only on the line through that point. The normal distance of that line is obtained by substituting $(a,b)$ into the normal form $x\cos\theta + y\sin\theta = s$:

$$s = a\cos\theta + b\sin\theta$$

Therefore the projection of this point traces, in the $(s, \theta)$ plane, the curve $s = a\cos\theta + b\sin\theta$, that is, a sine curve. The fact that a point becomes a sine (sinusoid) in this way is the origin of the name sinogram touched on in §2.3 (see Chapter 3 for details).

Left: a distribution f(x,y) consisting of three points (red, blue, green) inside the unit circle. Right: its sinogram, where each point traces the sine curve s=a cosθ + b sinθ in the (s,θ) plane, with the color of each point matching the color of its sine curve.
Figure 6: An example of a sinogram. Left = a distribution $f(x,y)$ consisting of three points (color-coded); right = its sinogram $p(s,\theta)$. Each point $(a,b)$ traces the sine curve $s = a\cos\theta + b\sin\theta$ in the $(s,\theta)$ plane, and the color of each point matches the color of its sine curve. For a smoothly spread-out $f$ like the one in Figure 3 the contributions of the individual points overlap and blur, but when there are point-like features the curves appear clearly.

2.5 Exercises

Exercise 1

Express the line $x + y = 1$ in the $(s, \theta)$ parametrization.

Solution

In the normal form $x \cos\theta + y \sin\theta = s$, the coefficients $(\cos\theta, \sin\theta)$ of $x, y$ form a unit vector of length $1$ ($\cos^2\theta + \sin^2\theta = 1$). On the other hand, the coefficients $(1, 1)$ of $x + y = 1$ have length $\sqrt{1^2 + 1^2} = \sqrt{2}$, which is not $1$. So we divide both sides by $\sqrt{2}$ to make the coefficients a unit vector:

$$\dfrac{1}{\sqrt{2}}x + \dfrac{1}{\sqrt{2}}y = \dfrac{1}{\sqrt{2}}$$

Now the coefficients are $\left(\dfrac{1}{\sqrt{2}}, \dfrac{1}{\sqrt{2}}\right)$. Since $\cos 45° = \sin 45° = \dfrac{1}{\sqrt{2}}$, we have $\theta = 45° = \dfrac{\pi}{4}$ and $s = \dfrac{1}{\sqrt{2}} = \dfrac{\sqrt{2}}{2}$.

Exercise 2

For the parametric representation $(x(t), y(t)) = (s\cos\theta - t\sin\theta, s\sin\theta + t\cos\theta)$ of the line $L_{s,\theta}$, verify that the speed is constant, $\sqrt{x'(t)^2 + y'(t)^2} = 1$ (so that $t$ is the distance along the line).

Solution

$x'(t) = -\sin\theta$, $y'(t) = \cos\theta$

$$\sqrt{x'(t)^2 + y'(t)^2} = \sqrt{\sin^2\theta + \cos^2\theta} = 1$$

So the speed is constant, and $t$ is the distance along the line ($dl = dt$).

Exercise 3

Explain why the range of $\theta$ is restricted to $[0, \pi)$.

Solution

$(s, \theta)$ and $(-s, \theta + \pi)$ represent the same line:

$$x\cos(\theta+\pi) + y\sin(\theta+\pi) = -s \;\Longrightarrow\; -x\cos\theta - y\sin\theta = -s \;\Longrightarrow\; x\cos\theta + y\sin\theta = s$$

To avoid the duplication, we restrict $\theta \in [0, \pi)$.

Exercise 4

Find the equation of the line represented by $(s, \theta) = (2, 60°)$.

Solution

$x \cos 60° + y \sin 60° = 2$, that is, $\dfrac{1}{2}x + \dfrac{\sqrt{3}}{2}y = 2$, so $x + \sqrt{3}y = 4$.

Exercise 5

Compute the Radon transform $p(s, 0)$ at $\theta = 0$ of the function $f(x, y) = e^{-(x^2+y^2)}$ (a Gaussian).

Solution

At $\theta = 0$ the line is $x = s$.

$$p(s, 0) = \displaystyle\int_{-\infty}^{\infty} e^{-(s^2+y^2)} \, dy = e^{-s^2} \displaystyle\int_{-\infty}^{\infty} e^{-y^2} \, dy = \sqrt{\pi} e^{-s^2}$$

Using the Gaussian integral $\displaystyle\int_{-\infty}^{\infty} e^{-y^2} dy = \sqrt{\pi}$.

Exercise 6

Verify by direct computation, in the case $\theta = \dfrac{\pi}{4}$, that the Radon transform of $f(x, y) = 1$ (the constant function) restricted to the disk of radius $R$ centered at the origin is $p(s) = 2\sqrt{R^2 - s^2}$.

Solution

At $\theta = \dfrac{\pi}{4}$, a point on the line is

$$x = \dfrac{s - t}{\sqrt{2}}, \quad y = \dfrac{s + t}{\sqrt{2}}$$

The condition $x^2 + y^2 \leq R^2$ becomes

$$\dfrac{(s-t)^2 + (s+t)^2}{2} = s^2 + t^2 \leq R^2$$

so $|t| \leq \sqrt{R^2 - s^2}$ (when $|s| \leq R$)

$$p\!\left(s, \dfrac{\pi}{4}\right) = \displaystyle\int_{-\sqrt{R^2-s^2}}^{\sqrt{R^2-s^2}} 1 \, dt = 2\sqrt{R^2 - s^2}$$

Frequently Asked Questions

What is the $(s,\theta)$ parametrization of a line?

It is a way of describing a line by two numbers: the normal distance $s$ from the origin ($-\infty \lt s \lt \infty$) and the direction $\theta$ of that normal ($0 \le \theta \lt \pi$). The line's equation is $x\cos\theta+y\sin\theta=s$. This $(s,\theta)$ is the coordinate of the sinogram, that is, the domain of the projection data $p(s,\theta)$.

How are the line integral and the Radon transform related?

The Radon transform $\mathcal{R}f(s,\theta)$ is exactly the line integral of $f$ along the line $L_{s,\theta}$ fixed by direction $\theta$ and distance $s$. Using the distance $t$ it is $\mathcal{R}f(s,\theta)=\displaystyle\int_{-\infty}^{\infty} f(s\cos\theta - t\sin\theta,\ s\sin\theta + t\cos\theta)\,dt$. The denser the path a line passes through, the larger the value.

What does the Radon transform of a point-like object look like?

The projection of a point $(a,b)$ concentrates on the lines through that point, so it traces the sine curve $s=a\cos\theta+b\sin\theta$ in the $(s,\theta)$ plane. This is the origin of the name "sinogram." A general object is a superposition of points, so its sinogram is many sine curves overlaid.