ImagePseudo: Image-based inference of tumor cell trajectories enables large-scale cancer progression analysis
Author: Yang Liu (Yang.Liu2@utsouthwestern.edu)
An AI-powered approach transforms routine pathology slides into dynamic maps of tumor evolution, enabling large-scale analysis of cancer progression without the need for costly single-cell sequencing.

Liu Y, Cai L, Rong R, Wang S, Jia L, Quan P, Zhou Q, Xiao G, Xie Y. Image-based inference of tumor cell trajectories enables large-scale cancer progression analysis. Sci Adv. 2025 Jul 18;11(29):eadv9466. doi: 10.1126/sciadv.adv9466. Epub 2025 Jul 18. PMID: 40680117; PMCID: PMC12273761. Pubmed
- Feature extraction from pretained model and tumor grade prediction
- Estimating pseudotime from extracted features
- Inference tumor growth speed, diversity and tumor progression fitness
The pathology image types as input.
- svs
- tif
- tiff
- dicom
- ndpi
You can put the pathology image files into one folder. Use the folder path as the input for this project.
- numpy==1.26.4
- pandas==2.2.1
- torch
- torchvision
- transformers==4.38.2
- scanpy==1.9.8
- opencv-python==4.9.0.80
- openslide-python
- openslide-bin
- lifelines==0.28.0
- scikit-learn==1.4.1
- scikit-image==0.22.0
- scipy==1.12.0
- matplotlib==3.8.3
- seaborn==0.13.2
- anndata==0.10.6
- numexpr==2.9.0
You can install them to your conda environment by
pip install requirement.txt
- openslide
- igraph
- leidenalg
Your can install them into your conda environment by
conda install -c conda-forge openslide conda install -c conda-forge python-igraph conda install -c conda-forge leidenalg
You can skip the installation of conda if already installed
- Create conda environment 'imagepseudo' using requirement.txt
conda create --name imagepseudo python=3.9 conda activate imagepseudo pip install -r requirement.txt conda install -c conda-forge openslide conda install -c conda-forge python-igraph conda install -c conda-forge leidenalg
- Example data and pretrained model are available at Zenode: https://zenodo.org/records/16376974
- [option] Choose Version v2 on right-side link if v1 is chosen
- Download "example.svs" and "model.tar.gz" to this project directory
- Unzip "model.tar.gz" under this project directory, and move to the subfolder "model" (create this folder if not exists)
tar -xvf model.tar.gz mkdir model mv model.pt model/
Input
Input a folder containing all SVS files to proceed.
mkdir input_folder # create a folder mv example.svs input_folder/ # move svs file under it. Can be many python GradePrediction.py --data_path ./input_folder --model model/model.pt --output_path feature/
Input Parameters:
| Parameter | Description | Default Value |
|---|---|---|
| data_path | single image file path or a folder path containing image files, support svs, tiff, tif, dicom, and ndpi | |
| model | the path of mdoel file 'model.pt' | |
| pixel_step | pixel step for patch extraction | 400 |
| output_path | the relative path to output the feature |
Output files
-
example.svs_286cols_210rows.png
python Pseudotime.py --feature_path feature/ --output_path pseudotime/
Input Foler (the folder 'feature' from step 1)
The code will scan the folder 'feature' to deal with all CSV files
Output file
python Fitness.py --input_path pseudotime/ --output_file results.csv
Input Foler (the folder 'pseudotime' from step 2)
The code will scan the folder 'pseudotime' to deal with all h5ad files
Output File
Following UT Southwestern Office for Technology Development, the project is using the license from The University of Texas Southwestern Medical Center.



