Skip to content

STOmics/stereo3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Stereo3D: Auto get stereo 3D data with Python

Introduction

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.

Installation

There are options:

Anaconda

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.txt

Usage

Core Scripts

The main functionalities of Stereo3D are implemented via the following scripts:

stereo3d/stereo3d_with_matrix.py        # Main script for 3D reconstruction from matrix data

Parameter Documentation

Key parameters:

  • --matrix_path The saw input files(gene matrix)
  • --tissue_mask The saw output files(<SN>_<staintype>_tissue_cut.tif), details
  • --record_sheet Record sheet file. We provide you with a sample, click for detail
  • --output Output directory

Run python stereo3d_with_matrix.py --help for detail.

Demo Case

Drosophila Embryo 3D Reconstruction Example

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\output

Download the complete demo dataset (~90MB) from:

Drosophila_melanogaster_demo.zip Extraction password:FJrY

Output

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

Expected Results

3D Visualization of Clustering Results

The following GIF demonstrates the 3D spatial distribution of single-cell clustering results:

3D visualization of cell clusters

Reference

Related Tools

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published