API Reference¶
Welcome to the sleap-roots API reference documentation. This page provides an overview of the entire API organized by functional area.
Quick Links¶
- New to sleap-roots? Start with the Quick Start Guide
- Ready to analyze? Check out Common Workflows
- Need a specific function? Browse by category below
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
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
Angles¶
Analyze root growth angles and gravitropism.
Functions: get_root_angle, get_vector_angle_from_gravity, get_node_ind
Tips¶
Detect and analyze root tips for growth tracking.
Functions: get_tips, get_tip_xs, get_tip_ys
Bases¶
Analyze lateral root emergence patterns and density.
Functions: get_bases, get_base_length, get_base_ct_density, get_root_widths
Convex Hull¶
Compute spatial coverage and distribution metrics.
Functions: get_convhull, get_convhull_features, get_chull_area, get_chull_perimeter
Ellipse¶
Fit ellipses to root point distributions.
Functions: get_ellipse, fit_ellipse
Network Length¶
Analyze whole-plant network-level metrics.
Functions: get_network_length, get_network_width_depth_ratio, get_network_distribution, get_bbox
Scanline¶
Count root intersections with horizontal scan lines.
Functions: count_scanline_intersections, get_scanline_first_ind, get_scanline_last_ind
Points¶
Utility functions for manipulating root point arrays.
Functions: join_pts, get_all_pts_array, associate_lateral_to_primary, filter_roots_with_nans
Utilities¶
Summary Statistics¶
Compute comprehensive summary statistics for trait distributions.
Function: get_summary - Calculate min, max, mean, median, std, and percentiles
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
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...
- Load SLEAP predictions → Series
- Extract traits automatically → Pipelines
- Measure root lengths → Lengths
- Analyze growth angles → Angles
- Track tip movement → Tips
- Study lateral emergence → Bases
- Measure spatial coverage → Convex Hull
- Analyze network architecture → Network Length
- Process multiple plants → Common Workflows
- Get summary statistics → Summary Statistics
Complete Function Reference¶
For auto-generated documentation from source code, see the reference/ section.
See Also¶
- Getting Started Guide - Your first sleap-roots analysis
- Tutorials - Step-by-step pipeline guides
- User Guide - In-depth explanations
- Cookbook - Recipes for common tasks