Discover our new platform: Learn more

Realtime Non-Linear Image Alignment/Registration in SpatialX

jessie nguyen
jessie nguyen
December 30, 2025

1. The Alignment/Registration Problem in Spatial Imaging

In spatial imaging, researchers often analyze more than one representation of the same tissue. An H&E image provides structural context, while an IF image highlights specific markers. Many workflows even use a series of adjacent sections, where each section serves a different purpose. Simple linear transforms such as rotation and scaling rarely correct these localized distortions, so alignment requires more flexible, non-linear methods.

Current non-linear implementations of image alignments take a long time to finish and are not suitable for putting humans in the loop to help adjust and refine local misalignment results. 

To address this challenge, we implement Thin Plate Spline (TPS) – a nonlinear transformation method that works in real time for aligning large scale images, and can be used in SpatialX

2. BioTuring’s Non-Linear, User-Guided Alignment with Real-Time Preview

The alignment workflow in SpatialX is guided through landmark points that the user places on both images. One image is set as the reference, and the other adjusts to match it. The first few landmarks set the global orientation by enabling rotation, scaling, and overlap for a quick initial, broad alignment that can be adjusted immediately. Additional landmarks refine correspondence in specific regions, allowing alignment to be built gradually from tissue structures the researcher already recognizes, which is especially helpful with large images.

A key feature is the real-time preview. As each new landmark is placed or adjusted, the overlay updates immediately, even for large images.This makes it possible to check alignment at the same moment the adjustment is made, rather than performing a step and then waiting to see if the result worked. Researchers can zoom in to the scale where interpretation happens and confirm that boundaries, nuclei clusters, or region outlines align consistently before moving on.

Figure 1. Non-linear transformation with real-time preview in SpatialX. Users select pairs of equivalent points on the two images, and in real time, see the results of the TPS transformation alignment, and can further add more points if needed.


Methods

TPS transformation enables flexible, non-linear alignment. TPS works by smoothly bending one image to match another based on landmarks that the user selects.

Figure 2. The first panel (top left) shows pairs of matching landmarks, where gray dots represent the reference points and black dots represent the image being aligned. The next three panels illustrate how the TPS transformation changes with different regularization values (λ = 0, 0.001, 0.1). These regularization values affect the cost of energy to bend the grid lines.

With no regularization (λ = 0), the image bends exactly through all landmarks. As the value increases, the transformation becomes smoother and less tightly fitted to each point. Our current configuration uses λ = 0.

TPS is designed to minimize unnecessary distortion, meaning it only bends the image where needed to match the landmarks. This keeps the transformation as simple and natural as possible, preserving overall tissue structure while accurately aligning key features. In our implementation, the landmarks are matched exactly, giving users precise control over the result.

TPS is efficient enough for real-time updates with thousands of landmarks, allowing researchers to see alignment results instantly as they adjust points. While it works well for most biological tissue, areas with very strong or irregular bending can sometimes appear distorted. Adding more landmarks in those regions usually resolves the issue and helps maintain smooth, natural alignment.

3. The Result: Aligned Images That Support Interpretation and Analysis

After alignment, the overlay holds from whole-slide to cell scale, so landmarks, boundaries, and signals remain in register as you zoom and pan. You can save the transformation, export or import landmark points, and share the transformation file to reproduce the setup. This gives a clean, comparable view for tasks like reviewing segmentation against morphology or checking protein signal placement without forcing a specific downstream analysis.

If you are evaluating alignment methods and want to see SpatialX on images like yours, our team can run a 20-min complimentary walkthrough, tailored to your requests!

Share your details here and we will follow up with scheduling: https://bioturing.com/spatialx

0 comments