An Introduction to Spatial Proteomics: From Raw Images to Spatial Analysis
How multiplexed protein imaging data are shaped, the three families of platforms, the preprocessing pipeline, and how the analysis differs from spatial transcriptomics
Spatial proteomics means staining a single tissue section with dozens of antibodies, each "painting" a different protein, imaging it, and then segmenting the image into individual cells. The end product is a quantitative answer to "how much of each protein is in each cell, and where that cell is".
This post uses real data from SPORA, a public collection hosted by EMBL-EBI (35 cohorts), together with other public repositories such as Zenodo. Following the data format, the imaging platforms, the underlying image structure and the analysis pipeline, it lays out the main path from a tissue section to spatial analysis.
The post has seven parts:
- Why keeping spatial coordinates matters.
- Comparing the three platform families: mass spectrometry, cyclic fluorescence, and single-round multispectral imaging.
- Breaking an image down into pixels, channels and bit depth.
- Walking through the pipeline from preprocessing and cell segmentation to annotation.
- File sizes, pyramids, and the four-layer data structure.
- Comparing spatial transcriptomics and spatial proteomics point by point on real data.
- A checklist of the most common mistakes when standardizing data.
Why must we keep the spatial position of cells?
- Dissociation-based sequencing loses the spatial relationships between cells in their microenvironment
- Only original coordinates can reconstruct tumor nests and immune infiltration
- Spatial proteomics quantifies protein abundance and cell boundaries directly on the section
Before encountering multiplexed imagingdetecting many proteins on one section, simultaneously or over several rounds, many researchers know single-cell sequencing better. Conventional single-cell sequencing dissociates tissue into a suspension. You can still count the proportions of each cell type, but once cells leave their microenvironment, the information about which cells were next to which is lost completely.
The figure below comes from SPORA (a public data collection hosted by EMBL-EBI; names in parentheses below such as allam2022 are its cohort IDs). It shows one lung cancer core from the allam2022 cohort's tissue microarraydozens of ~1 mm tissue cores stained and imaged on one slide (TMA): about 1.5 mm across, 1 µm/pixel, 26 channels, segmented into 17,388 cells. 2,500 randomly sampled cells are shown:
- Left: original coordinates discarded and cells scattered randomly in a disk, mimicking the loss of spatial relationships after dissociation.
- Right: each cell keeps its original coordinates, recovering the real arrangement in the tissue.
Put the two side by side and the difference is obvious:
- Shuffled positions: epithelial/tumor, T, B, myeloid and stromal cells are simply mixed in the disk in proportion. You cannot tell which cells surround which.
- Real coordinates restored: on the right, orange epithelial/tumor cells form clear tumor nests, blue T cells gather mostly between the nests, green B cells are scattered, and stromal cells run in between.
The two answer questions at different levels:
- Transcriptomics: good for genome-wide discovery, but sequencing-based single-cell methods lose spatial coordinates after dissociation, and imaging-based spatial transcriptomics detects only RNA.
- Spatial proteomics: each experiment focuses on 20–60 validated antibody markers (some cyclic platforms reach over a hundred). Directly on FFPE or frozen sections (about 4–5 µm thick), it quantifies the molecules that actually do the work: protein abundance. Its clear cell boundaries reveal immune infiltration, tumor compartments and the cellular microenvironment.
How do the three imaging platforms get past the color bottleneck?
- Spectral overlap limits conventional filters to 4–5 colors per acquisition
- Mass spectrometry, cyclic fluorescence and single-round multispectral imaging each solve this differently
- Choosing a platform trades off channel count, pixel size and field of view
If spatial proteomics needs dozens of antibodies to "paint" a section, why not stain everything at once and image it once on an ordinary fluorescence microscope? The bottleneck is a physical one: spectral overlap. A microscope separates signals with color filters, but each fluorescent dye emits over a fairly broad peak, not a thin line.
Put 40 dyes in at once and their spectra crowd together and bleed into each other, as on the right of the figure below. A conventional filter set can barely separate about 4–5 colors at a time. To read dozens or even hundreds of proteins on one section, you have to get around the need to resolve 40 spectra at once, and this has given rise to three technical routes.
Grouped by how they read out the signals carried by dozens of antibodies, mainstream imaging-based spatial proteomics platforms fall into three routes: mass spectrometry imaging, cyclic fluorescence and single-round multispectral imaging. The three cards below compare their tagging, readout, channel capacity, pixel size and main cost. These are also what ultimately determine image size and the preprocessing steps later on.
- Mass spectrometry imaging (IMC, MIBI): metal isotopes as tags, ablated point by point and read by mass, with no autofluorescence. One run measures about 40 channelsone grayscale layer, usually one marker (mostly proteins, plus DNA dyes and background channels), but it is slow and a single field is usually about 1 mm across.
- Cyclic fluorescence (CODEX, CyCIF, Cell DIVE, MACSima, COMET): reads 3–4 proteins per round, then elutes or bleaches and repeats. The total can reach 20–100+ proteins (depending on the platform) over a whole slide, at the cost of time and the need for per-round registrationaligning the coordinates of each round.
- Single-round multispectral (Orion, Vectra): one scan reads fluorescence from about 6–20 proteins, followed by spectral unmixingsplitting mixed signal using reference spectra. Scanning is fast and suits large cohorts, but the channel count is limited.
The square cost of pixel size
Figure 7 shows the pixel-size trade-off. The same 50 µm square of tissue (about 4–5 cells across) takes 294×294 pixels on MACSima (0.17 µm/pixel), 50×50 on IMC (1 µm/pixel), and only 33×33 in the low-resolution TIFF the author exported with ImageJ (1.517 µm/pixel). Smaller pixels give sharper cell boundaries, but the number of pixels for the same area grows with the square.
Choosing a platform
Choosing a platform means trading off channel count, resolution and field of view:
- Large whole-slide cohorts: Orion or Vectra are common choices.
- Deep whole-slide profiling of dozens to hundreds of proteins: cyclic platforms such as CODEX or CyCIF.
- Small TMA fields: IMC and MIBI are common.
What is a multiplexed image inside a computer?
- A multiplexed image is a stack of 2D grayscale matrices of identical size
- Channel count matches the number of markers; bit depth sets intensity precision
- JPG/PNG cannot hold dozens of channels; research uses TIFF-type formats
The colorful tissue images in software are pseudocolor overlays made for human eyes. In storage, a spatial proteomics image is really a stack of 2D grayscale images with exactly the same height and width.
Figure 8 shows 12 of the 26 channels from the IMC lung cancer core in Section 01, all protein channels: epithelial (E-cadherin, PanKeratin), stromal (Vimentin, SMA), immune (CD3, CD8a, CD4, FoxP3, CD20, CD68, CD163) and proliferation (Ki-67), one image each. Each channel corresponds to one protein, and brighter means stronger local signal.

Zoom in to the pixel level and a grayscale image is really a table of numbers. Take the DNA channel of a real CyCIF file (exemplar-001): in a 4×4 block at the edge of a nucleus, each cell of the grid stores an integer from 0 to 65,535 (from 60,580 inside the nucleus to 36,678 at the edge). The computer records protein signal as numbers: a larger value means a brighter pixel, meaning more protein or dye at that spot.
Two things need to be kept apart here: channel count and bit depththe number of intensity levels a pixel can take. An everyday RGB photo stores only 3 numbers per pixel (red, green, blue), while this CyCIF dataset stores 12 numbers per pixel, one for each of 12 markers.
Precision depends on bit depth: 8-bit gives only 0–255 (256 levels), 16-bit gives 0–65,535 (65,536 levels). On the right of the figure below, the same dim region of weak FOXP3 signal keeps 534 distinct values at 16 bits, but compressed to 8 bits over the full image range only 68 remain, and weak positive detail collapses into coarse banding.
This is why spatial proteomics analysis cannot use everyday image formats such as JPG or PNG. There are three reasons:
- They are designed for RGB display to the human eye and cannot hold dozens of independent channels.
JPGis only 8-bit and uses lossy compression.- They lack standard fields for channel names and the physical pixel size.
OME-TIFF) or chunked multidimensional array formats (e.g. OME-Zarr).How does an image become a single-cell table, step by step?
- Preprocessing differs by platform; once artifacts are removed, all data join one workflow
- Cell segmentation produces a mask; averaging each channel within it gives the single-cell table
- Over-wide segmentation lets neighbor signal spill over and creates false double positives
Images straight off the instrument cannot be analyzed directly: post-acquisition preprocessing depends on how the platform works (Figure 11):
- Mass spectrometry imaging: split acquisition regions (ROIs), read metal channels, remove outlier bright spots (hot pixels), compensate isotope spillover, and drop background metal channels.
- Cyclic fluorescence: correct uneven illumination, stitch small fields of view, register each round to align the section across rounds, and subtract per-round background.
- Single-round multispectral: centered on spectral unmixing, autofluorescence subtraction, and registration to an H&Ehematoxylin and eosin, the routine pathology stain image of the same section.
Once these platform-specific noise sources and offsets are removed, all data join the same downstream analysis path.
The first step after preprocessing is cell segmentationmarking the boundary of each cell in the image. Common models include Mesmer and Cellpose (pipelines such as steinbock and MCMICRO integrate them). The algorithm combines nuclear stain and membrane protein signals and outputs an integer label image with the same height and width as the original, called a maskpixel integers give the cell ID; 0 is background.
Figure 13 shows a three-panel comparison of a real tile, which makes it easy to check whether the segmentation follows the cell outlines:
- Left: four-channel overlay.
- Middle: mask with each cell in a different color.
- Right: boundaries overlaid on the original image.

With a mask you can do single-cell quantificationaveraging each channel over a cell's pixels. As Figure 14 shows, the program takes every pixel labeled 1777 in the mask, averages them in each channel (E-cadherin, CD3, CD68 and so on), and that gives one row of the table (E-cad 2.04, CD3 2.42, CD68 3.16), together with coordinates and area. IMC pixel values are ion counts, so they are much smaller than the 16-bit grayscale values in the tens of thousands in the CyCIF fluorescence image above. A whole slide often has hundreds of thousands of cells, beyond the 16-bit integer limit of 65,535, so masks are usually stored as 32-bit integers.
With the single-cell table in hand, each cell still needs a cell type annotation. The usual approach is unsupervised clustering followed by naming clusters by their highly expressed markers, or the gatingmanually drawing regions on 2D scatter plots to select positive populations used in mass cytometry (CyTOF). Figure 15 takes 250 random cells from the full single-cell table of this core and sorts them by their top marker. Epithelial (E-cadherin/PanKeratin), stromal (Vimentin/SMA), T cell (CD3/CD8a/CD4), B cell (CD20), macrophage (CD68/CD163) and proliferating (Ki-67) cells appear one block after another.

The single-cell table averages the pixels inside each mask boundary, so if a boundary takes in a few extra pixels from a neighbor, that neighbor's strong signal "spills over" into it. For example, when a T cell sits right against a tumor cell, an over-wide segmentation gives the T cell both high CD3 and high E-cadherin, creating a false "double positive".
Why is the data so large? Four layers and metadata
- Single images range from tens of MB to tens of GB; whole slides take most of the storage
- Pyramids and tiling let you read a 100 GB image one field of view at a time
- A sample contains images, masks, tables and metadata; metadata is the most error-prone
Spatial proteomics data sizes vary enormously (Figure 16):
- Small-field samples: an IMC core is only about 20 MB (
allam2022) to 40 MB (cords2024); a MIBI field (greenwald2026) is about 170 MB. - Resampled large tissue: a CODEX intestine section (
hickey2023) resampled to 1 µm/pixel is about 0.6 GB. - Whole-slide images: covering 1–2 cm of tissue at 0.3–0.5 µm/pixel gives about 2 billion pixels per channel. CODEX liver cancer whole slides (
ruf2023) average about 35 GB, and Orion whole slides (lin2023) about 50 GB.
Of SPORA's 4.9 TB in total, just 4 whole-slide cohorts account for 73%.
At 20–60 channels and 16 bits, an uncompressed whole-slide image can reach about 170 GB, far too large to load into the memory of an ordinary computer. For smooth viewing and computation, mainstream formats use pyramidmultiple copies of the image at progressively lower resolution and tilingeach level cut into fixed-size tiles compressed separately structures.
As Figure 17 shows, when you view the whole slide the software reads only the smallest thumbnail level, and when you zoom in it reads only the few tiles that fall in the field of view. Both OME-TIFF and OME-Zarr, which suits on-demand loading from the cloud, rely on this "read only what you need" mechanism.
A complete spatial proteomics sample is not just images. As Figure 18 shows, it consists of four layers:
- Multichannel images (
images) - Segmentation masks (
labels) - Single-cell table (
tables): e.g..h5adan HDF5-based AnnData single-cell table file. - Metadatathe "manual" describing sample and image properties: records each channel's antibody and target protein UniProt ID, physical pixel size, sample information, and registration to H&E.
Modern container formats such as SpatialData are built on OME-Zarr and use images, labels, tables and attrsglobal attributes and metadata fields to put the four layers into one folder with a shared coordinate system, so images, masks and tables can be queried together.
When analyzing public data, the most common problem is usually not the pixel matrix but metadata that is missing or easy to misread. Figure 19 compares three real cases:
- Complete file: correct channel names and pixel size.
- Unnamed channels: some public MIBI files have all 20 channels unnamed (the pixel size is there: 0.39 µm). You can only match them to the antibody table in the paper, and one row off means every channel is mislabeled.
- Unusual units: a CODEX file records pixel size in centimeters (5.065E-5 cm, i.e. 0.5065 µm). This is legal in the OME standard, but software that ignores the unit and assumes micrometers will be off by a factor of 10,000.
So when you get a file from a public download or straight off the instrument, do a round of metadata checks:
- Check channel order and protein names against the paper's methods section, and flag and exclude antibody-free background metal channels such as
ArAr80andXe131. - Check the pixel size value and its unit.
- Confirm that the bit depth has not been silently reduced, and whether multiple ROIs or TMA cores have been split into separate samples.
How do spatial proteomics and spatial transcriptomics compare?
- They start from opposite data shapes and sparsity; preprocessing and normalization must differ
- Proteomics has few, dense features and often skips PCA for direct clustering or gating
- After annotation both are stored with coordinates, and spatial tools are fully shared
Researchers with spatial transcriptomics experience often ask whether their existing pipeline carries over. The answer is: the second half is shared; the first half must be handled separately. Below, the same pipeline is run on a Xenium whole-slide breast cancer sample, an imaging-based spatial transcriptomics method (GSM9509156, 69,009 cells × 498 genes), and on the SPORA allam2022 IMC lung cancer cohort (26 TMA cores, 187,028 cells in total).
Difference 1: the shape of the raw data
The first difference is in the raw form (Figure 20):
- Xenium: produces coordinates of RNA molecules labeled with gene names, which must be assigned to cells. (Sequencing-based Visium has capture spots that cover several cells, so it also needs deconvolutionestimating the proportions of cells within one spot.)
- IMC: continuous grayscale pixel images; cell segmentation must draw the boundaries before averaging.
Different starting data lead directly to single-cell tables with opposite sparsity. Figure 21 takes 8 cells × 10 features from each of two real samples:
- Xenium: stores integer counts of RNA molecules captured in each cell. The median cell has only 88 molecules and 41 genes, and 91.6% of the full table is 0, so it suits a sparse matrix.
- IMC: stores the mean ion intensity within each cell boundary. The background itself carries weak signal, so only 0.7% of the full table is 0; it is a dense, continuous matrix with almost no zeros.
Because the value distributions differ, normalizationremoving scale differences and extreme values to make data comparable must also be handled differently (Figure 22):
- Transcriptomics: in Xenium,
EPCAMis 0 in 77% of cells. The usual practice is to scale by each cell's total molecule count, then apply alog1ptransform (i.e. ln(x+1)). - Proteomics: only a few dozen antibodies are measured and total signal differs greatly between cell types, so you cannot scale by the total. Instead,
arcsinh(inverse hyperbolic sine; log-like in shape but defined at 0, usually applied after dividing by a cofactor) is used to compress the long high tail, and each marker is then clipped at its 99th percentile and scaled to 0–1, so that a few extremely high cells do not push most cells toward 0.

Dimensionality also affects dimension reduction and clustering. Figure 23 runs the same PCAprincipal component analysis, compressing high-dimensional features first and UMAPa dimension reduction method that places cells on a 2D plane workflow on quality-controlled Xenium data (cells with fewer than 10 molecules removed, leaving 68,196 cells × 498 genes) and on subsampled IMC data (the 18 proteins measured in all 26 cores, 60,000 random cells). With 498 genes the cell populations separate very cleanly. With 18 proteins there is less information, the clusters run into each other, and the "other" fraction is higher.
That is why proteomics often skips PCA and clusters or gates directly on the markers. And if the panel has no endothelial marker, there is no way to find an endothelial population.


Once cells are annotated and placed back at their in situ coordinates, spatial analysis methods are fully shared between the two data types. Take neighborhood enrichmentcomparing how often each cell type occurs among neighbors versus after random shuffling as an example: take the 10 nearest neighbors of each cell, count them, and compute a z-score (positive/red means a tendency to cluster, negative/blue means mutual avoidance).
As Figure 24 shows, although the tissues differ, the pattern of results is strikingly similar: positive values on the diagonal show same-type cells clustering, and tumor and T cells show strongly negative values on both sides (Xenium −79, IMC −90; strongly negative in both the row and column direction).

AnnData (or as the table layer in a SpatialData container), downstream clustering and spatial statistics can share one set of tools.Run through a checklist before you start analyzing
- Standardization errors mostly come from metadata and precision checks
- Before ingestion, check channel mapping, background removal and pixel units one by one
- Keep the matrix, the pipeline and the metadata in view and you avoid most detours
When organizing spatial proteomics data from many sources into a standard container (for example into SpatialData), errors usually come not from the algorithms but from details that were not checked. The table below lists the five most common pitfalls and how to check for each.
| Misordered channels or inconsistent protein names | E.g. PanCK and Pan-Keratin used interchangeably, or mass spec export files ordered by metal isotope mass rather than antibody name; map each to a UniProt ID using the metadata |
| Non-protein background or blank channels mixed into the table | E.g. IMC argon/xenon background channels ArAr80 and Xe131, or blank background rounds in CyCIF; mark them as non-protein channels and remove them before single-cell quantification |
| Missing pixel size or units easy to misread | E.g. no µm information, or a value recorded in cm (5.065E-5 cm = 0.5065 µm) that software reads as µm; go back to the raw file or the paper and record the source |
| Reduced numeric precision or accidentally changed data type | E.g. a 16-bit image compressed to 8 bits, or integers (counts, mask IDs) saved as floating point float64; compare value ranges and types against the source file value by value |
| Several samples in one file or mismatched mask IDs | E.g. raw IMC .mcd files often bundle several acquisition regions (ROIs) and laser test areas; split them by region, and check that mask IDs and the cell IDs in the single-cell table (cell_id) match one to one |
Whether you are reusing a large public collection like SPORA or analyzing fresh sections from your own lab, at the start you do not need to memorize byte-level format details. Keep these three core ideas in mind and you will avoid most detours when reading images, choosing a platform and running the analysis.