Stereo3D is an open-source Python tool designed to automate 3D spatiotemporal reconstruction of tissues and organs, leveraging deep learning and image processing. It addresses the high labor costs, long cycles, and inefficiencies of traditional 3D reconstruction by integrating seamlessly with outputs from the ultra-high-resolution spatial omics technology Stereo-seq and cell bin—the core image processing module in Stereo-seq workflows. By directly utilizing single-cell expression matrices and subcellular spatial coordinates generated by CellBin, Stereo3D enables automated mapping of gene expression data to 3D biological structures, bridging the gap from raw omics data to actionable 3D spatial insights.
There are options:
You need install Anaconda, then run below:
# Clone the repository and navigate to the directory
git clone https://github.com/STOmics/stereo3d
cd stereo3d
# Create and activate the Conda environment
conda create --name=stereo3d python=3.8
conda activate stereo3d
# Install dependencies
pip install -r requirements.txtThe main functionalities of Stereo3D are implemented via the following scripts:
stereo3d/stereo3d_with_matrix.py # Main script for 3D reconstruction from matrix dataKey parameters:
--matrix_pathThe saw input files(gene matrix)--tissue_maskThe saw output files(<SN>_<staintype>_tissue_cut.tif), details--record_sheetRecord sheet file. We provide you with a sample, click for detail--outputOutput directory
Run python stereo3d_with_matrix.py --help for detail.
python stereo3d_with_matrix.py \
--matrix_path E:\3D_demo\Drosophila_melanogaster\00.raw_data_matrix\Drosophila_melanogaster_demo\00.gem \
--tissue_mask E:\3D_demo\Drosophila_melanogaster\00.raw_data_matrix\Drosophila_melanogaster_demo\00.mask \
--record_sheet E:\3D_demo\Drosophila_melanogaster\00.raw_data_matrix\Drosophila_melanogaster_demo\E-ST20220923002_slice_records_E14_16.xlsx \
--output E:\3D_demo\Drosophila_melanogaster\00.raw_data_matrix\Drosophila_melanogaster_demo\outputDownload the complete demo dataset (~90MB) from:
Drosophila_melanogaster_demo.zip Extraction password:FJrY
| File Name | Description |
|---|---|
| 02.register | Registered tissue mask images after alignment |
| 03.gem | Spatial expression matrix after registration |
| 04.mesh | 3D mesh model reconstructed from clustered point clouds |
| 05.transform | Annotated H5AD file containing spatial coordinates and cell metadata |
| 06.color | H5AD file with unified color mapping for visualization |
| 07.organ | Segmented organ-specific mesh models |
The following GIF demonstrates the 3D spatial distribution of single-cell clustering results:
Stereo3D includes a suite of modular tools for spatial data analysis, visualization, and integration with SAW/Spateo workflows. Explore our full suite of tools and their documentation here.
For more detailed instructions, you need to visit here