Analysis tools for SLEAP-based plant root phenotyping.
pip install sleap-roots
If you are using conda
(recommended):
conda create -n sleap-roots python=3.11
conda activate sleap-roots
pip install sleap-roots
Trait pipelines supported:
DicotPipeline
– Primary + lateral roots (e.g. soy, canola)YoungerMonocotPipeline
– Primary + crown roots (e.g. early rice)OlderMonocotPipeline
– Crown roots only (e.g. later rice)PrimaryRootPipeline
– Primary root onlyLateralRootPipeline
– Lateral roots onlyMultipleDicotPipeline
– Multi-plant dicot setup (batch from a single image)
1. Compute traits for a single plant
import sleap_roots as sr
series = sr.Series.load(
series_name="919QDUH",
h5_path="tests/data/canola_7do/919QDUH.h5",
primary_path="tests/data/canola_7do/919QDUH.primary.slp",
lateral_path="tests/data/canola_7do/919QDUH.lateral.slp"
)
pipeline = sr.DicotPipeline()
traits = pipeline.compute_plant_traits(series, write_csv=True)
2. Compute traits for a batch
paths = sr.find_all_slp_paths("tests/data/soy_6do")
plants = sr.load_series_from_slps(paths, h5s=True)
pipeline = sr.DicotPipeline()
batch_df = pipeline.compute_batch_traits(plants, write_csv=True)
3. Use a single trait utility
from sleap_roots.lengths import get_root_lengths
pts = series.get_primary_points(frame_idx=0)
lengths = get_root_lengths(pts)
Explore tutorials under notebooks/
:
cd notebooks
jupyter lab
You can use the test data in tests/data
or replace it with your own.
- Clone the repository:
git clone https://github.com/talmolab/sleap-roots && cd sleap-roots
- Create the conda environment:
conda env create -f environment.yml
conda activate sleap-roots
This includes dev dependencies and installs the package in editable mode (--editable=.[dev]
).
- Run tests:
pytest tests
- Remove the environment (optional):
conda env remove -n sleap-roots
See the latest trait documentation here:
👉 HackMD: sleap-roots Trait Docs
Created by the Talmo Lab and Busch Lab at the Salk Institute, as part of the Harnessing Plants Initiative.
- Elizabeth Berrigan
- Lin Wang
- Andrew O'Connor
- Talmo Pereira
E.M. Berrigan et al., "Fast and Efficient Root Phenotyping via Pose Estimation", Plant Phenomics.
DOI: 10.34133/plantphenomics.0175