API Reference
Ossify is a Python package for working with neuromorphological data, providing tools for analyzing and visualizing neuron structures across multiple geometric representations.
Quick Start
import ossify
example_cell_path = "https://github.com/ceesem/ossify/raw/refs/heads/main/864691135336055529.osy"
# Load a cell from file locally or in the cloud
cell = ossify.load_cell(example_cell_path)
# Create from CAVE client (requires caveclient)
cell = ossify.load_cell_from_client(root_id=12345, client=cave_client)
# Analyze morphology
strahler = ossify.strahler_number(cell)
is_axon = ossify.label_axon_from_synapse_flow(cell)
# Create visualizations
fig, ax = ossify.plot_cell_2d(cell, color="compartment")
Package Structure
Core Classes
The foundation classes for representing neuromorphological data:
Cell: Main container for morphological data with multiple data layersLink: Manages relationships between different data layers
Data Layer Classes
Specialized classes for different geometric representations:
SkeletonLayer: Rooted tree-structured neuronal skeletonsGraphLayer: Graph-based representation for spatial connectivityMeshLayer: 3D mesh surfaces with face-based geometryPointCloudLayer: Sparse point annotations and markers
Analysis & Algorithms
Computational methods for morphological analysis:
- Morphological Analysis: Strahler number, compartment classification
Visualization & Plotting
Plotting and visualization utilities:
- Cell Plotting: Integrated cell visualization with multiple projections
- Figure Management: Multi-panel layouts and precise sizing
File I/O Operations
Loading and saving morphological data:
- Core I/O Functions:
load_cell(),save_cell() - File Management:
CellFilesfor cloud and local storage
External Integrations
Interfaces with external data sources and tools:
- CAVE Integration:
cell_from_client()for connectome data
Key Features
Multi-Scale Data Integration
Seamlessly work with data at different scales - from high resolution meshes to coarse skeletons, with automatic mapping between representations.
Flexible Analysis Pipeline
Chain operations across different data types with consistent APIs and automatic data propagation between layers.
Publication-Ready Visualization
Create high-quality figures with precise unit control, multiple projections, and customizable styling.
Cloud-Native I/O
Load and save data from local files, cloud storage (S3, GCS) via cloud-files, or directly from CAVE.
Navigation
| Module | Description | Key Classes |
|---|---|---|
| Core Classes | Foundation classes and containers | Cell, Link |
| Data Layers | Spatial and graph representation classes | SkeletonLayer, GraphLayer, MeshLayer, PointCloudLayer |
| Algorithms | Analysis and computation functions | strahler_number, label_axon_*, smooth_features |
| Plotting | Visualization and figure creation | plot_cell_*, plot_morphology_* |
| File I/O | Data loading and saving | load_cell, save_cell, CellFiles |
| External | Third-party integrations | cell_from_client |
Best Practices
- Use
Cell.apply_mask()for non-destructive filtering - Use
mask_context()for temporary operations - Use annotations for sparse point-like data and features for dense data where every vertex has a value.
- Leverage
Linkobjects for complex data relationships - Take advantage of method chaining for concise workflows