Multiplexed Tissue Imaging: Tools and Approaches
I2K 2024, October 24th 2024
SciLifeLab BioImage Informatics Facility
Multiplexed Tissue Imaging: Tools and Approaches © 2024 by The SciLifeLab BioImage Informatics Facility is licensed under CC BY-SA 4.0
Workshop information
Goals:
Target audience:�Novices in multiplexed imaging data processing / analysis
Questions welcome after theory / during hands-on session
Workshop material:�https://github.com/BIIFSweden/I2K2024-MTIWorkshop
2
Agenda
Theory session:
Hands-on session:
PIPEX, TissUUmaps, SpatialData
3
SciLifeLab BioImage Informatics Unit (BIIF)
4
Support, Training, and Tools for Image Data Analysis.
State-of-the-art analysis on image data using computer vision, machine learning, and bioinformatics.
Help to deploy computational methods.
Contact: biif@scilifelab.se
Jan Ellenberg, SciLifeLab director since July 2024
Open positions @ BIIF
www.scilifelab.se/units/bioimage-informatics/
SciLifeLab BIIF-based
EMBL-Heidelberg (2 years) + SciLifeLab BIIF-based (up to a year)�Postdoc within the ARISE2 program (3 years): �“Developing scalable and reusable analysis pipelines for spatial omics”�Together with Christian Tischer (EMBL)
5
Introduction
Multiplexed tissue imaging
6
Motivation
Conventional fluorescence microscopy:
Spectral overlap�→ limited # targets
7
Image source: https://imagej.net/plugins/lumos-spectral-unmixing
Multiplexed tissue imaging
Workshop focus:
Many destructive,�some non-destructive
Targeted, but often analyzed “as if untargeted”
8
Image source: de Souza, Zhao & Bodenmiller. Multiplex protein imaging in tumour biology. Nat Rev Cancer (2024).
Multiplexed tissue imaging data
One-shot readout
Mass spectrometry-based
Single CYX image (50+ channels)
No image co-registration needed
Iterative readout
Fluorophores / oligonucleotides
Several (C)YX images (iterations)
Iterations may require co-registration
9
Single 2D image stack, one channel per target
Many (mostly proprietary) file formats
OME Bio-Formats → (OME-)TIFF
OME-NGFF: https://ngff.openmicroscopy.org
Motivation
Conventional fluorescence microscopy
Structures within biological samples are made visible by
Optical microscopy readout recorded by camera/detector
Spectral overlap�→ limited # targets
10
Image source: https://imagej.net/plugins/lumos-spectral-unmixing
Multiplexed tissue imaging
One-shot readout
Mass spectrometry-based
Single CYX image (50+ channels)
No image co-registration needed
Iterative readout
Fluorophores / oligonucleotides
Several (C)YX images (iterations)
Iterations may require
co-registration
11
Image source: de Souza, Zhao & Bodenmiller. Multiplex protein imaging in tumour biology. Nat Rev Cancer (2024).
Image processing
Stitching & registration, segmentation, quantification
12
Overview
13
Spatial single-cell�data analysis
Data transformation
Batch effect corr.
Cell phenotyping
Spatial analysis
…
Image pre-processing
Stitching
Registration
Illumination corr.
De-arraying
…
Image segmentation
Object (e.g. cell) segmentation
Object (e.g. cell) quantification
Image visualization & quality control
Stitching & registration
Combine tiles & co-register channels
Frequently used:
ASHLAR (Muhlich et al., 2022)�Combined stitching & registration�of multiplexed tissue imaging data
14
Image source: Muhlich et al. Stitching and registering highly multiplexed�whole-slide images of tissues and tumors using ASHLAR. Bioinformatics (2022).
Image segmentation
Segmentation of nuclei, cells, regions, … in (dense) tissue sections
Perfect 2D segmentation unattainable* → aim for “good enough”!
Classical algorithms (e.g. Watershed):
– Cannot leverage multi-channel information
Supervised pixel classification + classical algorithms�(e.g. random forests/Ilastik + CellProfiler’s IdentifyPrimaryObjects)
+ Can leverage multiple channels
~ Tailored to dataset (how to re-use?)� – Requires training data (manual annotations)
15
Image source: Zhang et al.Segmentation of overlapping cells in cervical smears based on spatial relationship and Overlapping Translucency Light Transmission Model. Pattern Recognition (2016).
Image segmentation - classical approaches
Nuclei segmentation
Problems:
Cell segmentation
Problems:
Signal distributed over multi-channel → channel aggregation
No clear cell borders
other (e.g. vessel, tumor regions)
Problems:
Tailored to dataset (how to re-use?)
Requires training data (manual annotations)
16
Nuclei segmentation + expansion may be sufficient!
Deep learning-based image segmentation
Pre-trained models (e.g., Cellpose, Mesmer, StarDist)
+ Large and diverse training data → high accuracy
+ Can be fine-tuned to new annotations (transfer learning)�– Cannot leverage multi-channel → channel aggregation
– Only work for intended task (e.g. nuclei segmentation)
Models trained from scratch (e.g., U-Nets, Mask R-CNNs)�→ require large training data; cf. supervised pixel classification
Novel approaches:�Channel-invariant methods (e.g. InstanSeg/ChannelNet)�Foundation models (e.g. vision transformers, Segment Anything)
17
Cell quantification
Relies on accurate segmentation; often scripted (e.g. scikit-image regionprops)
Cell intensities: aggregate pixel values (summary statistic)
Nuclei segmentation + expansion may be sufficient!
Cell morphology: size, shape, …�2D imaging of thin tissue sections → cells not fully captured!
18
Image source: https://x.com/zanotellivrt/status/1187299455822901248
Cell quantification
Relies on accurate segmentation; often scripted (e.g. scikit-image regionprops)
Cell intensities: aggregate pixel values (summary statistic)
Cell morphology: size, shape, …�2D imaging of thin tissue sections → cells not fully captured!
19
Image source: https://x.com/zanotellivrt/status/1187299455822901248
Image visualization
20
Image source: https://napari.org/0.5.0/guides/layers.html
Image source: https://imagej.net/ij/plugins/multi-channel-helper/index.html
Image source: https://qupath.readthedocs.io�/en/0.5/docs/tutorials/multiplex_analysis.html
Multiplexed imaging and TissUUmaps
21
Toolkits & pipelines
MCMICRO, Steinbock, PIPEX
22
Overview
Terminology:
Toolkits & pipelines “make tools interact” and enable batch processing
Selected toolkits/pipelines:
23
MCMICRO
Schapiro, Sokolov & Yapp et al. MCMICRO: a scalable, modular image-processing pipeline for multiplexed tissue imaging. Nature Methods, 2022.
Nextflow pipeline�Configuration file → “end-to-end” execution
Technology-agnostic, many modules (containers)
Primarily developed at Harvard Medical School / Heidelberg University�(nf-core/mcmicro is work in progress)
24
MCMICRO
25
Image source: Schapiro, Sokolov & Yapp et al. MCMICRO: a scalable, modular image-processing pipeline for multiplexed tissue imaging. Nature Methods (2022).
Steinbock
Windhager et al. An end-to-end workflow for multiplexed image processing and analysis. Nature Protocols, 2023.
https://bodenmillergroup.github.io/steinbock/
Single container / Python package�Command-line interface → “stepwise” execution
Imaging Mass Cytometry (IMC) focus, multi-channel TIFF input
R/Bioconductor imcRtools package support, various export formats
Maintained by the Bodenmiller Lab (ETH / University of Zurich)
26
Steinbock
27
Image source: Windhager et al. An end-to-end workflow for multiplexed image processing and analysis. Nature Protocols (2023).
PIPEX
“A collection of commands, scripts and utilities to transform CODEX images into valuable analysis items” (public GitHub repository, manuscript in preparation)
https://github.com/CellProfiling/pipex/
Python scripts → “end-to-end” execution�Graphical user interface for configuration
CODEX/PhenoCycler focus, several supported input formats
“Standard analysis” (e.g. unsupervised clustering) report
Maintained by the Lundberg Lab (Stanford University)
28
Comparison
29
| Pre-processing | Segmentation | Quantification | Other (selection) |
MCMICRO�Nextflow pipeline | BaSiC (illum. corr.) Ashlar (stitching, registration) Coreograph�(TMA de-arraying) | Mesmer Cellpose Ilastik + S3seg. UnMICST + S3seg. | Cell intensities Cell morphology | CyLinter (QC) Scimap�(spatial analysis) … |
Steinbock�Container�toolkit/CLI | IMC-specific functionality | Mesmer Cellpose (beta) Ilastik + CellProfiler | Cell intensities Cell morphology Spatial cell graphs | Direct export to imcRtools (spatial analysis) and others … |
PIPEX�Python scripts | PhenoCycler focus, selected image/tile processing steps | StarDist, Watershed | Cell intensities | ComBat (batch corr.) Clustering … |
Spatial single-cell analysis
Tools & approaches
30
Overview
31
Spatial single-cell�data analysis
Data transformation
Batch effect corr.
Cell phenotyping
Spatial analysis
…
Image pre-processing
Stitching
Registration
Illumination corr.
De-arraying
…
Image segmentation
Object (e.g. cell) segmentation
Object (e.g. cell) quantification
Image visualization & quality control
Overview
Field of active research!
“Traditional” single-cell analysis (cf. scRNA-seq) + spatial analysis
R:�Seurat�Bioconductor SingleCellExperiment/SpatialExperiment�https://bioconductor.org/books/release/OSCA/ (non-spatial)
Python:�scverse anndata/SpatialData
32
Single-cell data transformation
Transform skewed cell intensity distributions�(e.g. for visualization, thresholding):
Dimensionality reduction:
Do NOT cluster on nonlinear embeddings!
33
Image source: https://github.com/maxentile/advanced-ml-project/issues/2
Image source: https://bodenmillergroup.github.io/IMCDataAnalysis/single-cell-visualization.html
Batch effect correction
Remove between-sample variation, but retain within-sample variation�(e.g. to facilitate cell phenotyping)
Frequently used (cell level):
On pixel level (i.e. before segmentation) or on cell level (i.e. after quantification)?
34
Image source: https://www.10xgenomics.com/analysis-guides/introduction-batch-effect-correction
Cell phenotyping
Assign a cell type (?) to each cell
Frequently used:
Often, a combined approach is most effective, e.g.
35
Spatial cell graphs
Nodes represent cells in space
Edges connect cells in spatial proximity
Frequently used:
36
Spatial single-cell analysis
See also: https://bodenmillergroup.github.io/IMCDataAnalysis/performing-spatial-analysis.html
37
Hands-on session
PIPEX, TissUUmaps, SpatialData
38
Frederic Ballllosera �Navarro (Stanford)
Workshop material:�https://github.com/BIIFSweden/I2K2024-MTIWorkshop