NMR and MRI physics · Advanced

Spiral k-space sampling

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

Spiral k-space sampling traverses k-space along an Archimedean or variable-density spiral, driven by time-varying gradients whose integral gives the k-space trajectory. It covers k-space efficiently with smooth gradient waveforms, enabling very fast single-shot or few-shot imaging, but is sensitive to off-resonance and gradient imperfections.

Intuition

In MRI the position in k-space is the running integral of the gradient waveform, so any smooth path can be traced if the gradients can produce it. A spiral starts at the center, where most signal energy and contrast reside, and winds outward. Because the path curves continuously, the gradients never need abrupt reversals as in echo-planar imaging, and the readout time is used almost fully for acquisition. The limits are the gradient amplitude and slew rate: near the center the spiral can wind tightly and fast, but as the radius grows the required gradient speed rises until it hits the amplitude limit. The spacing between turns must satisfy Nyquist for the field of view, so the turn spacing is set by 1/FOV. Since samples fall on non-Cartesian points, reconstruction needs gridding with density compensation, and off-resonance appears as blurring rather than geometric shift.

Key equations

𝐤(t)=γ2π∫0t𝐆(τ)dτ
(1)

k-space position is the time integral of the gradient waveform.

k(θ)=N2FOVθ2πNturn⋅2i.e. k=aθ,a=1NintFOV⋅11
(2)

Archimedean spiral: radius grows linearly with angle, with turn spacing 1/(N_int FOV) per turn after scaling by 2π.

kr(θ)=θ2πNintFOV,kmax⁡=12Δx
(3)

Radius per angle for N_int interleaves; the spacing between turns is 1/(N_int FOV), and the spiral ends at kmax set by resolution.

|d𝐆dt|≤Smax⁡,|𝐆|≤Gmax⁡
(4)

Hardware limits on slew rate and amplitude constrain how fast the spiral can be traced.

ΔfTread
(5)

Off-resonance phase accumulated over the readout controls spiral blurring.

Derivation

  1. Start from the gradient-to-k relation k(t)=γ2π∫Gdτ, so G(t)=2πγdkdt.
  2. Choose an Archimedean spiral k(θ)=aθ e^{iθ}, with radial increase per turn 2πa.
  3. Nyquist for a field of view FOV requires turn spacing Δk≤1/FOV; for N_int interleaves each spacing is N_int/FOV, so a=1/(2π FOV) times N_int per interleave.
  4. Resolution Δx sets kmax=1/(2Δx), so the number of turns per interleave is N_turn=kmax/(2πa)≈ FOV/(2Δx N_int).
  5. Readout time follows from tracing the path at the maximum allowed speed; the gradient is the derivative of k, with magnitude growing with θ̇ and radius.
  6. Impose |G|≤Gmax and |dG/dt|≤Smax; solve for θ˙(t) giving slew-limited acceleration in the center and then amplitude-limited constant-speed tracing outward.
  7. Reconstruct by density compensation (weights proportional to the local Jacobian, about k for constant angular speed) followed by gridding and an inverse FFT.

Worked example

Problem

Design a single-interleaved spiral with FOV=24 cm and 1.5 mm resolution. Estimate the number of turns and the turn spacing in k-space.

  1. Turn spacing must be Δk=1/FOV=1/0.24 m=4.17 m⁻¹ (0.0417 cm⁻¹).
  2. kmax=1/(2Δx)=1/(2×0.0015 m)=333 m⁻¹.
  3. Number of turns ≈ kmax/Δk=333/4.17≈80 turns.
  4. Matrix size is FOV/Δx=240/1.5=160, consistent with about N/2=80 turns radially.

Answer About 80 turns with spacing 4.17 m⁻¹, reaching kmax of 333 m⁻¹.

Common mistakes

  • Assuming the spiral sampling is uniform: samples are non-Cartesian and need density compensation before the FFT.
  • Forgetting that the gradient limits, not the spiral formula, set readout duration.
  • Confusing the center-out and the outward spiral-in directions, which change off-resonance and T2* weighting.
  • Treating off-resonance as geometric distortion as in EPI; in spirals it causes blurring.
  • Using a plain FFT without gridding.

Animation

Animation coming soon

The animated version of this lesson is being prepared for the web. In the Signals AI app, lessons are drawn step by step.

Code

scene.py(115 lines)
import sys
import numpy as np
from manim import *
from blocks import *

# Spiral k-space sampling parameters
N_POINTS = 400
TURNS = 3.0
MAX_K = 1.0


def spiral_k(t):
    """
    Compute k-space coordinates for a spiral trajectory.
    k(t) = t * (cos(2*pi*turns*t), sin(2*pi*turns*t))
    where t ranges from 0 to 1.
    """
    r = t
    theta = 2 * np.pi * TURNS * t
    kx = r * np.cos(theta)
    ky = r * np.sin(theta)
    return np.column_stack([kx, ky])


class Main(Scene):
    def construct(self):
        self.camera.background_color = "#101418"

        # Title
        TitleCard(self, "Spiral k-space", "Trajectory sampling")

        # Setup axes
        axes = Axes(
            x_range=[-1.2, 1.2, 0.5],
            y_range=[-1.2, 1.2, 0.5],
            x_length=7.0,
            y_length=7.0,
            axis_config={"color": C_DIM, "include_tip": False}
        )
        axes.to_edge(LEFT, buff=0.5).shift(DOWN * 0.2)

        # Labels
        x_label = Text("kx", font_size=24, color=WHITE).next_to(axes.x_axis.get_end(), RIGHT, buff=0.2)
        y_label = Text("ky", font_size=24, color=WHITE).next_to(axes.y_axis.get_end(), UP, buff=0.2)
        origin_label = Text("0", font_size=20, color=C_DIM).next_to(axes.c2p(0, 0), LEFT, buff=0.15)

        self.play(Create(axes), FadeIn(x_label), FadeIn(y_label), FadeIn(origin_label))

        # Compute spiral points
        t_vals = np.linspace(0, 1, N_POINTS)
        k_points = spiral_k(t_vals)

        # Convert to manim coordinates
        manim_points = [axes.c2p(k[0], k[1]) for k in k_points]

        # Create the spiral line using a VMobject for smooth drawing
        spiral_vmobject = VMobject()
        spiral_vmobject.put_start_and_end_on(manim_points[0], manim_points[1])
        # Actually, for a curve, we should use a Path or Line with many points.
        # The best way in Manim to draw a complex path is to set the points directly.
        spiral_vmobject.points = np.array(manim_points)
        spiral_vmobject.set_color(C_MAIN)
        spiral_vmobject.set_stroke(width=2)

        # Draw the full path faintly first? No, let's draw it progressively.
        # We can use Create on the VMobject.
        self.play(Create(spiral_vmobject), run_time=4)

        # Highlight the center (k=0)
        center_dot = Dot(axes.c2p(0, 0), color=C_ACCENT, radius=0.1)
        self.play(FadeIn(center_dot))

        # Highlight the outer edge
        outer_dot = Dot(manim_points[-1], color=C_BAD, radius=0.1)
        self.play(FadeIn(outer_dot))

        # Equation
        eq = MathTex(r"k(t) = t \cdot e^{i 2\pi \nu t}", font_size=30)
        eq.to_edge(RIGHT, buff=0.5).shift(UP * 1.5)
        self.play(Write(eq))

        # Explanation text
        text = Text("Efficient coverage of k-space", font_size=24, color=C_ACCENT)
        text.next_to(eq, DOWN, buff=0.3)
        self.play(FadeIn(text))

        StepCaption(self, "Spiral trajectories provide efficient, motion-robust k-space coverage.")
        self.wait(2)


if __name__ == "__main__" and "--selftest" in sys.argv:
    # Test spiral generation
    t_test = np.array([0.0, 0.5, 1.0])
    k_test = spiral_k(t_test)

    # At t=0, k should be (0,0)
    assert np.allclose(k_test[0], [0, 0]), f"Start point should be origin, got {k_test[0]}"

    # At t=1, radius should be 1.0
    r_end = np.linalg.norm(k_test[-1])
    assert abs(r_end - 1.0) < 1e-6, f"End radius should be 1.0, got {r_end}"

    # At t=0.5, radius should be 0.5
    r_mid = np.linalg.norm(k_test[1])
    assert abs(r_mid - 0.5) < 1e-6, f"Mid radius should be 0.5, got {r_mid}"

    # Check angle at t=1: should be 2*pi*turns
    angle_end = np.arctan2(k_test[-1][1], k_test[-1][0])
    expected_angle = 2 * np.pi * TURNS
    # Normalize angle to [0, 2pi)
    angle_end_norm = angle_end % (2 * np.pi)
    expected_angle_norm = expected_angle % (2 * np.pi)
    assert abs(angle_end_norm - expected_angle_norm) < 1e-6, f"Angle mismatch: {angle_end_norm} vs {expected_angle_norm}"

    print("ok")

The Manim scene code that draws this lesson's animation in the Signals AI app (Python, Manim Community).

ccBYNC© 2026 SignalsLab. Lesson text shared as is under CC BY-NC 4.0.