Multiplex Immunofluorescence Image Analysis Workflow
A multiplex immunofluorescence image analysis workflow with quality gates at every stage, defensible spatial metrics, and correct patient-level statistics.
Multiplex immunofluorescence analysis is not a single step but a chain, and most disappointing results come from a break somewhere in the middle rather than from a bad algorithm. The workflow that holds up has six stages — image and channel checks, cell segmentation, single-cell marker quantification, phenotype assignment, spatial feature calculation, and sample-level aggregation — and a quality gate at the end of each one. Two ideas do most of the work: every stage has an acceptance criterion you can fail deliberately, and the statistical unit is the patient, not the cell. Get those two right and the analysis becomes defensible; get them wrong and a technically flawless pipeline will still produce a number that cannot be defended in review.

What the analysis needs before it starts
Before any analysis begins, four things have to be settled, and finding them out halfway through is what causes projects to stall. The first is the raw multi-channel image data: format, export method, pixel scale, channel names, tissue extent, and, for multi-round data, whether the rounds have already been registered. A colour composite JPEG is not a substitute for the original channels, and it cannot support per-marker quantification, however good it looks in a slide deck.
The second is the panel itself: which marker sits in which channel, what subcellular location each is expected to occupy, which channels carry a nuclear or membrane reference, and any known anomalies. The third is the sample table — the mapping from patient to slide to region of interest, the grouping, the batch, and the endpoints available. This is where independent samples are defined, and it is the item most often assembled retrospectively, which is exactly why it needs to exist first. The fourth is the research question itself, stated as a question rather than a wish.
| Material | What it needs to state | What it lets you judge |
|---|---|---|
| Raw multi-channel images | File format, export method, pixel scale, channel names, tissue extent, and whether multi-round data is registered | Readability, usable scale, channel correspondence, and how much conversion is needed |
| Marker panel | The marker in each channel, expected subcellular location, nuclear and membrane references, known anomalies | Whether segmentation and cell-type identification have enough evidence to work from |
| Sample and grouping table | Patient to slide to region relationships, grouping, batch, and available endpoints | What counts as an independent sample, and at which statistical level comparisons are made |
| Research question | Target cells, tissue compartments, the metric to compare, and the intended figure | Whether the analysis needs proximity, infiltration, clustering, or neighbourhood composition |
Working out what the data can support before committing to a full analysis is not a formality. Whether a set of files is readable, whether conversion is needed, and what scale of analysis is realistic should be established on one representative set of raw files, because different platforms, export routes, and software environments behave differently and a file extension alone promises nothing. The acquisition side matters here too: the pixel scale and the per-channel exposure settings of the digital pathology slide scanner that produced the images determine the smallest structure you can legitimately measure downstream, so it is worth establishing what your instrument actually resolved before you design a metric around it.
For multi-round data there is one further question to settle at the start, and it is easier to answer before staining than after: have the rounds already been registered into a common coordinate frame, and if not, how reliably can they be? Registration quality determines whether cell-level spatial metrics mean anything. TerryDR’s TR-ASTRA Flow addresses this by pairing cyclic staining with imaging in one closed workflow, but the underlying question stands for any platform, and it is cheaper to answer during setup than to discover it at stage five.
Six stages, six quality gates
Each stage has an output and an acceptance criterion. The criteria are not bureaucratic; they are what stops a subtle error from propagating through five more stages and into a figure.
| Stage | Main output | Quality gate |
|---|---|---|
| 1. Image and channel check | Analysable regions, anomalous channels, a record of preprocessing | Background, crosstalk, defocus, folds, saturation, and batch differences |
| 2. Cell segmentation | Nucleus and cell objects with coordinates and morphology | Over-segmentation in dense regions and missed cells in weak membrane signal |
| 3. Single-cell marker quantification | A cell by marker matrix linked to samples and regions | Signal localisation, the region measured, thresholds, and outliers |
| 4. Phenotype assignment and subpopulation exploration | Cell type or candidate subpopulation labels that map back to tissue | Review against expression, position, and the original image; unknown categories are kept |
| 5. Spatial feature calculation | Distance, proximity, infiltration, and neighbourhood metrics | Distance units, tissue compartment boundaries, and method parameters |
| 6. Sample-level aggregation and comparison | Sample summary tables, figures, and process files | Multiple regions from one case are not counted as independent cases |

Stage two is where many workflows quietly lose their foundation. Dense regions are prone to over-segmentation, and areas with weak or incomplete membrane signal are prone to missed cells, and both errors propagate into every downstream count. Stage three is where the measurement definition matters more than the threshold value: which compartment of a cell you measure, and what the positive rule actually is, will change your phenotype percentages more than any adjustment to the cutoff.
Stage four carries the constraint most often forgotten. A phenotype label has to be explainable in the marker matrix and checkable against the tissue. Why does this cell type appear in this region, does it match the expected marker localisation and morphology, and is it a real population or an artefact of background and segmentation error? When rules are already defined, classify first; when they are not, explore. The separation of the two is deliberate. Cluster separation on its own does not name a cell type, and it does not establish what that cell does.
Classify first, explore second
Unsupervised clustering is genuinely useful for discovering populations nobody anticipated, and it is also the easiest way to produce a beautiful map of a segmentation artefact. The two uses are not in conflict, but they require different handling, and running them in the wrong order is a common and expensive error.
Classification comes first because it is falsifiable. If you define a phenotype by a combination of markers, localisation, and morphology, you can check every assignment against the original image and find the ones that do not hold. Discovery comes second because it is generative: it proposes candidate populations that then have to be validated against expression, against tissue location, and against the original image. A cluster that separates cleanly in a dimensionality-reduction plot may correspond to nothing more than a stain gradient, a region with different autofluorescence, or a systematic segmentation failure in dense areas.
Keeping the two paths visibly separate also protects the downstream statistics. A phenotype discovered by clustering inherits the instability of the clustering parameters, and if it then defines a spatial metric, that instability propagates into a number that looks precise. TerryDR separates the two in its own tooling for this reason, with one module handling rule-based phenotype classification and a separate one for exploratory subpopulation discovery alongside the original QuPath image, and the same discipline applies whatever software you use.
The practical test is simple: can you show, for every label you report, the marker expression, the tissue location, and the original image pixels that support it? If the answer is only a cluster centroid, the label is a hypothesis, and it should be described as one.
Pick the spatial metric that matches the question
Spatial analysis is not one technique but a family of methods that answer different questions, and the most common failure is applying a method that answers a nearby but different question. Before computing anything, it helps to state which of these you are asking.
| The question you are asking | The method family | What you must fix first |
|---|---|---|
| Who is near whom | Nearest-neighbour distance, or proximity within a fixed radius | The cell pair being tested, and the distance convention (nucleus centre, centroid, or boundary) |
| Does it enter a region | Infiltration measures and distance gradients | How the region boundary is defined |
| What is the local environment made of | A neighbourhood construction rule, then composition comparison | The neighbourhood radius, and the denominator for composition |
| Do cells of the same type cluster | Scale-dependent clustering tests | The sampling extent, the null model, and sensitivity to free parameters |
Two details in that table cause disproportionate confusion. The distance convention is not a detail: distance between cell nuclei, between cell centroids, and between cell boundaries give different numbers from the same tissue, and a result is only reproducible if the convention travels with it. And the last row is where under-specification does the most damage, because clustering results depend on parameters that nobody wrote down, and on a null model that has to be defensible. A statement that cells cluster, without specifying the scale, the null model, or how sensitive the result is to those choices, is not a reproducible finding.
Proximity is worth separating out as well, because it is where spatial analysis most often overreaches. Proximity describes position. It does not demonstrate interaction, contact, or function, and no amount of statistical significance changes that. If the question involves activation or exhaustion, that requires the corresponding markers and their own validation, which is a panel design question rather than an analysis question.
Two neighbour metrics that are not interchangeable
Closeness between two cell populations can be expressed in more than one way, and the two common formulations have different denominators and answer different questions. This is easy to miss because both are called “neighbour analysis” and both are reported as a number near the tumour.
| Mean neighbour count | Fraction of cells with at least one neighbour | |
|---|---|---|
| How it is computed | Count the neighbours of each target cell, then average across target cells | Count the target cells that have at least one neighbour, divide by the total number of target cells |
| The question it answers | How crowded is a target cell on average | What proportion of target cells are not isolated |
| What it hides | A small number of very dense clusters are averaged away | Completely invisible to changes in density |
| Sensitivity to the threshold | High | Low |
| Can one substitute for the other | No | No |
The two are not two estimates of the same quantity, and converting one into the other is not possible. A tissue where most cells sit alone but a few sit in a dense cuff produces a low mean count and a low fraction; a tissue where every cell has a handful of neighbours produces similar values in both. A dense cuff sitting inside a sea of isolated cells produces a high mean count and a low fraction, which is precisely the configuration that distinguishes the two, and it is a common one in infiltrating immune cell patterns.
The same caution applies to distance thresholds generally. A specific cut-off in micrometres is a property of a particular study design, not a universal biological constant, and a result reported against one threshold does not transfer to another without recomputation. The right habit is to report the continuous distribution alongside any thresholded version, and to state the convention that produced the number.
Cells are not patients
The single most common statistical error in multiplex imaging analysis is treating the number of measured cells as the number of samples. A slide containing fifty thousand segmented cells still comes from one patient. Counting cells as independent observations inflates the apparent sample size, shrinks confidence intervals, and produces results that cannot be reproduced on a new cohort.
| Level | What it is | Can it act as an independent sample |
|---|---|---|
| Cell | One segmented analysis object | No. Cells within one tissue are correlated observations |
| Region of interest or tissue core | A selected area within a slide | No. Multiple regions from one patient are nested, not independent |
| Slide | One physical slide | Rarely. Usually a repeated observation within a patient |
| Patient | One individual | Yes. This is the unit for inference |

The correction is straightforward once you have the sample table: aggregate to the patient level first, and treat everything below as a within-patient structure. If a patient contributed several tissue cores, decide in advance how they combine — averaged, counted, or modelled as repeated measurements — and apply the same rule to every group. Deciding after seeing the numbers is how a defensible analysis becomes indefensible.
The same discipline applies to the temptation to raise the sample size by adding cells, regions, or slides. It genuinely does not work. A cohort of forty patients with one region each is a stronger design than a cohort of eight patients with five regions each, and the first is usually the one that survives review. When more material is genuinely available, the useful move is to collect more patients rather than more fields per patient.
One further point concerns the unit of the outcome. A per-cell metric and a per-patient metric answer different questions, and the per-patient one is usually the one that can be reported. The path from the cell to the patient is a defined calculation, and it should be written down before the analysis rather than reconstructed for the figure at the end.
Deliverables that survive a second look
The difference between an analysis that holds up and one that does not often comes down to what was kept. A merged image plus a results table is not enough to re-check anything, because it does not record what was excluded, what was decided, or on what basis. Three linked tables are enough, and they are cheap to produce if the sample table was built at the start.
The cell table holds one row per analysed object with its sample identifier, region identifier, coordinates, per-marker intensities, and assigned phenotype, so every row maps back to something visible in the original image. The region table holds the region definitions, the effective area, the cell count, target cell density, and the spatial metrics computed for that region, with the exclusions recorded. The sample table holds the patient identifier, the sample identifier, the grouping, and each pre-specified summary metric, preserving the nesting of regions within patients.
The properties that make a deliverable survive a second look are unglamorous. Every metric is traceable to the objects it came from. Every excluded region has a recorded reason rather than a silent absence. Every threshold and parameter is written down where a second analyst would find it. And metrics that were not supported by quality control are described with their limitations rather than quietly reported as if they were sound.
TerryDR treats this as part of the deliverable rather than a courtesy, handing over original images, the analysed regions, the identification results and the intermediate data alongside the final tables through its mIF image analysis service, with the panel and acquisition parameters retained for re-checking. The QuPath plugins are built to produce the same structure when the analysis is run in-house, and Patho Axis sets out the same split for teams comparing solutions for pharma and research labs.
Related reading
The analysis is only as good as the panel behind it, and the panel is only as good as the constraints it was designed against. If the workflow above shows which measurements your current data can support, How to Design a Multiplex Immunofluorescence Panel is where to work backwards from the question to the marker set.
Frequently Asked Questions
What does a multiplex immunofluorescence image analysis workflow involve?
Six stages, in order: image and channel checks, cell segmentation, single-cell marker quantification, phenotype assignment, spatial feature calculation, and sample-level aggregation. The value of treating it as a chain is that each stage has an output you can inspect and a criterion you can fail, rather than one large step where an early error only shows up at the end.
Can unsupervised clustering identify cell types in mIF images?
It can propose candidate populations, which is a different claim. Cluster separation on its own does not name a cell type or establish what that cell does, because it can equally reflect a stain gradient, a region of high autofluorescence, or a segmentation failure. Treat discovered populations as hypotheses and validate each one against marker expression, tissue location, and the original image.
How do I choose between distance metrics in spatial analysis?
Choose by the question you are asking, then fix the conventions before computing. Nearest-neighbour distance answers how close the closest partner is, proximity within a radius answers how many partners fall inside a circle, and infiltration answers whether cells enter a defined region. Whichever you choose, record the distance convention you used, because distances between nuclei, centroids, and boundaries are different numbers from the same tissue.
Why should I report a continuous distance distribution rather than only a threshold?
Because a thresholded result depends on a cut-off that is a property of a particular study design rather than a biological constant, and a reader cannot tell whether a result is robust or an artefact of where you drew the line. Reporting the continuous distribution alongside the thresholded version lets readers see the effect of the cut-off, and it makes the result reproducible against a different threshold later.
How do I report results when several slides come from one patient?
Aggregate to the patient level first and treat slides and regions as within-patient structure, with the rule for combining them decided in advance and applied identically to every group. Reporting cells, regions, or slides as independent observations inflates the apparent sample size and is one of the most common reasons a spatial analysis fails to replicate on a new cohort.
Sources
- https://www.frontiersin.org/journals/oncology/articles/10.3389/fonc.2022.889886/full — competitor: the closest tutorial-format competitor
- https://www.nature.com/articles/s41592-026-03155-1 — competitor: reference for method density and spatial metrics
- https://github.com/GPEC/Multiplex-immunofluorescence-image-analysis-with-QuPath — competitor: the QuPath ecosystem entry point
- https://cellcarta.com/science-hub/mif-analysis-framework/ — competitor: framework-format page
- https://oraclebio.com/digital-pathology-spatial-phenotyping-multiplex-if-analysis-workflow/ — competitor: the only page with an explicit pass/fail quality gate
- https://qupath.readthedocs.io — terminology alignment for the QuPath workflow
- https://www.thermofisher.com/io/en/home/life-science/cell-analysis/cellular-imaging/immunofluorescence/multiplex-immunofluorescence.html — competitor: category page