Skip to content

API Reference

Welcome to the sleap-roots API reference documentation. This page provides an overview of the entire API organized by functional area.


Core Modules

The foundation of sleap-roots: loading data and running analysis pipelines.

Series

Load and manage SLEAP predictions

The Series class is your primary interface for working with SLEAP root tracking data. Load predictions from .slp files and access point arrays for analysis.

Key methods: - Series.load() - Load single plant - get_primary_points() - Extract primary root coordinates - get_lateral_points() - Extract lateral root coordinates - get_crown_points() - Extract crown root coordinates

View Series documentation →


Pipelines

Pre-built trait extraction workflows

Choose from 7 specialized pipelines for different root system architectures. Each pipeline automatically computes dozens of relevant traits.

Available pipelines: - DicotPipeline - Primary + lateral roots (canola, Arabidopsis) - YoungerMonocotPipeline - Primary + crown roots (young rice, wheat) - OlderMonocotPipeline - Crown roots only (mature monocots) - MultipleDicotPipeline - Multiple dicot plants per image - PrimaryRootPipeline - Single primary root analysis - MultiplePrimaryRootPipeline - Multiple primary roots per image - LateralRootPipeline - Individual lateral root analysis

View Pipelines documentation →


Trait Computation Modules

Individual functions for computing specific root traits. Use these for custom analysis workflows.

Lengths

Measure root lengths and curvature.

Functions: get_root_lengths, get_curve_index, get_max_length_pts

View documentation →


Angles

Analyze root growth angles and gravitropism.

Functions: get_root_angle, get_vector_angle_from_gravity, get_node_ind

View documentation →


Tips

Detect and analyze root tips for growth tracking.

Functions: get_tips, get_tip_xs, get_tip_ys

View documentation →


Bases

Analyze lateral root emergence patterns and density.

Functions: get_bases, get_base_length, get_base_ct_density, get_root_widths

View documentation →


Convex Hull

Compute spatial coverage and distribution metrics.

Functions: get_convhull, get_convhull_features, get_chull_area, get_chull_perimeter

View documentation →


Ellipse

Fit ellipses to root point distributions.

Functions: get_ellipse, fit_ellipse

View documentation →


Network Length

Analyze whole-plant network-level metrics.

Functions: get_network_length, get_network_width_depth_ratio, get_network_distribution, get_bbox

View documentation →


Scanline

Count root intersections with horizontal scan lines.

Functions: count_scanline_intersections, get_scanline_first_ind, get_scanline_last_ind

View documentation →


Points

Utility functions for manipulating root point arrays.

Functions: join_pts, get_all_pts_array, associate_lateral_to_primary, filter_roots_with_nans

View documentation →


Utilities

Summary Statistics

Compute comprehensive summary statistics for trait distributions.

Function: get_summary - Calculate min, max, mean, median, std, and percentiles

View documentation →


Examples and Workflows

Common Workflows

Complete end-to-end examples for typical analysis tasks.

Workflows included: 1. Quick pipeline analysis 2. Custom trait computation 3. Lateral root analysis 4. Temporal growth tracking 5. Network-level spatial analysis 6. Batch processing multiple plants 7. Quality control and filtering 8. Multiple dicot plants

View workflows →


API Organization

The sleap-roots API is organized hierarchically:

sleap_roots/
├── Series                    # Data loading
├── DicotPipeline            # Pre-built pipelines
├── YoungerMonocotPipeline
├── OlderMonocotPipeline
├── MultipleDicotPipeline
├── PrimaryRootPipeline
├── MultiplePrimaryRootPipeline
├── LateralRootPipeline
│
├── get_root_lengths()       # Individual trait functions
├── get_root_angle()
├── get_tips()
├── get_bases()
├── get_convhull()
├── get_ellipse()
├── get_network_length()
├── count_scanline_intersections()
│
├── join_pts()               # Utility functions
├── get_all_pts_array()
├── filter_roots_with_nans()
└── get_summary()

Finding What You Need

I want to...


Complete Function Reference

For auto-generated documentation from source code, see the reference/ section.

See Also