Skip to main content

sleap-roots

CI codecov Release PyPI

Analysis tools for SLEAP-based plant root phenotyping.


📦 Installation

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

🌱 Usage

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 only
  • LateralRootPipeline – Lateral roots only
  • MultipleDicotPipeline – Multi-plant dicot setup (batch from a single image)

🔁 Example: Dicot Pipeline

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)

📓 Notebooks & Tutorials

Explore tutorials under notebooks/:

cd notebooks
jupyter lab

You can use the test data in tests/data or replace it with your own.


🧪 Development

  1. Clone the repository:
git clone https://github.com/talmolab/sleap-roots && cd sleap-roots
  1. 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]).

  1. Run tests:
pytest tests
  1. Remove the environment (optional):
conda env remove -n sleap-roots

📖 Trait Reference

See the latest trait documentation here:

👉 HackMD: sleap-roots Trait Docs


🤝 Acknowledgments

Created by the Talmo Lab and Busch Lab at the Salk Institute, as part of the Harnessing Plants Initiative.

Contributors

  • Elizabeth Berrigan
  • Lin Wang
  • Andrew O'Connor
  • Talmo Pereira

Citation

E.M. Berrigan et al., "Fast and Efficient Root Phenotyping via Pose Estimation", Plant Phenomics.
DOI: 10.34133/plantphenomics.0175

Release files for sleap-roots 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for sleap-roots 0.1.4
File Interpreter ABI Platform
sleap_roots-0.1.4-py3-none-any.whl Python 3 none any Details

Release files / sleap_roots-0.1.4-py3-none-any.whl

Download URL sleap_roots-0.1.4-py3-none-any.whl
Size 45.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e51dc83cb879d2563dd8adbda58890e154c5fd6290dc21e8cfa3c51301a76efa
BLAKE2b-256 checksum
How to use checksums
274c70e936e37d28fb9222bb61e88410fa76b08f91d71f246686caaf0feeb973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release history Release notifications | RSS feed

This release

0.1.4 This release

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.0

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page