Clear Sky Science · en

SHI: a framework for spatial harmonic imaging

· Back to index

Seeing More with Everyday X‑rays

Modern X‑ray machines can do far more than show broken bones. They can reveal how materials bend, scatter and shift the beam, uncovering fine structure that ordinary images miss. This article introduces SHI, an open‑source software framework that turns a once‑specialized lab method—spatial harmonic imaging—into a practical tool. SHI helps researchers extract several kinds of X‑ray contrast from the same exposure and even build 3D scans, opening doors for clearer medical, industrial and materials imaging with lower radiation doses.

Figure 1
Figure 1.

From Simple Shadows to Richer X‑ray Pictures

Conventional X‑rays mostly measure how much of the beam a sample absorbs, producing familiar light‑and‑dark shadows. But X‑rays are also gently bent and scattered as they pass through tissues or materials. Spatial harmonic imaging takes advantage of this by placing a finely patterned mask—similar to a mesh or grid—into the X‑ray beam. The mask splits the beam into many narrow beamlets that pass through the sample and land on the detector. Seen raw, the detector records a regular pattern modulated by the sample. In the computer, this structured pattern is analyzed using a mathematical tool called the Fourier transform to separate out different “harmonics,” each linked to a specific type of contrast: absorption, refraction (phase) and small‑angle scattering.

A Unified Software Tool for a Complex Workflow

Until now, spatial harmonic imaging has been held back by complicated, home‑grown processing scripts that differ from lab to lab. SHI (short for Spatial Harmonic Imaging) fills this gap. It is a Python‑based, open‑source package that handles the full journey from raw data to finished images. With a simple graphical interface, users acquire four basic images: a dark frame (detector noise), a bright frame (bare beam), a reference frame of the mask alone, and a sample frame with both mask and object. SHI automatically organizes these files, corrects for noise and background, and prepares them for detailed analysis without requiring the user to write code.

Turning Patterns into Multiple Views Inside Objects

Once the images are collected, SHI performs a series of processing steps. It first cleans the data by subtracting dark noise and normalizing with the bright frame. Then it applies the Fourier transform to both the reference and sample images, isolating a grid of harmonic peaks that reflect the periodic mask. By cutting out each peak and transforming it back, SHI recovers images that emphasize different physical effects. One harmonic gives a classic absorption image; others highlight how much the beam is deflected (phase contrast) or scattered by tiny internal features (scattering contrast). SHI can also tap into higher‑order harmonics to access finer directional details. All of these outputs are sorted into folders and saved as standard image files, ready for inspection or further analysis.

Figure 2
Figure 2.

Building 3D Views Faster and with Less Dose

The same approach extends naturally to 3D imaging. By rotating a sample—here, a hazelnut chosen for its intricate internal structure—and repeating the acquisition, SHI produces a series of multicontrast projections suitable for computed tomography (CT). A key finding is that because spatial harmonic imaging effectively reduces the resolution to what the patterned mask can support, fewer projections are needed to reconstruct a clear 3D volume. Tests using standard CT algorithms showed that going from nearly 3000 views down to a few hundred caused only minor loss of detail, while greatly cutting data volume and potential radiation exposure. The harmonic filtering also softens geometric distortions from the cone‑shaped X‑ray beam, allowing the system to be treated almost like a simpler parallel‑beam setup in software.

Why This Matters for Future Imaging

In plain terms, SHI makes an advanced but unwieldy X‑ray technique practical. By packaging device control, data management and sophisticated math into one open, well‑documented framework, it lowers the barrier for labs that want to see more than just shadows in their X‑rays. Researchers can now obtain absorption, phase and scattering information—and even 3D reconstructions—from the same measurements, often with fewer angles and reduced dose. As the software grows to support more hardware and real‑time processing, it could help bring richer, safer X‑ray imaging into routine use in medicine, materials science and industry.

Citation: Diaz, J.L.B., Korvink, J.G. & Kunka, D. SHI: a framework for spatial harmonic imaging. Sci Rep 16, 4338 (2026). https://doi.org/10.1038/s41598-026-37029-5

Keywords: spatial harmonic imaging, multicontrast X-ray, computed tomography, open-source imaging software, phase contrast