Skip to content

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 layers
  • Link: Manages relationships between different data layers

Data Layer Classes

Specialized classes for different geometric representations:

Analysis & Algorithms

Computational methods for morphological analysis:

Visualization & Plotting

Plotting and visualization utilities:

File I/O Operations

Loading and saving morphological data:

External Integrations

Interfaces with external data sources and tools:

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.


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 Link objects for complex data relationships
  • Take advantage of method chaining for concise workflows