Skip to main content

A package for managing multilayer morphology data

Project description

MorphSync

MorphSync is a Python library for working with multi-layered morphological data. It provides a unified framework for managing and synchronizing different representations of morphological data such as meshes, point clouds, graphs, and tabular data.

Key Features

  • Multi-layer data management: Handle meshes, point clouds, graphs, and tables in a unified framework
  • Linking: Create and manage mappings between different data layers
  • Link-based operations: Apply masks/selections or features from one data layer to another
  • Transitivity: Easily apply transitive mappings across multiple layers
  • Lightweight: Intentionally light on algorithms, use your own tools but stop worrying about mappings

Quick Start

from morphsync import MorphSync

# Create a new morphology container
morphology = MorphSync(name=12345678)

mesh_data # object with vertices and faces
point_data # dataframe of points with optional features
graph_data # object with nodes and edges, either with optional features

# Add different layers
morphology.add_mesh("mesh", mesh_data)
morphology.add_points("synapses",
    point_data, 
    spatial_columns=["x", "y", "z"],
)
morphology.add_graph("skeleton",
    graph_data,
    spatial_columns=["x", "y", "z"],
    relation_columns=["source", "target"],
)

synapse_to_mesh_mapping # series mapping synapse indices to mesh indices
mesh_to_skeleton_mapping # series mapping mesh indices to skeleton indices

# Create mappings between layers
morphology.add_link("synapses", "mesh", mapping=synapse_to_mesh_mapping)
morphology.add_link("mesh", "skeleton", mapping=mesh_to_skeleton_mapping)

# Select all aspects of the morphology that map to the skeleton's axon labeling
# Note that transitive mapping (synapses <-> mesh <-> skeleton) works here!
mapping = morphology.query_nodes("skeleton", "compartment == 'axon'")

# Add a column to synapses which indicates the local skeleton radius
morphology.assign_from_mapping("synapses", "skeleton", ["radius"])

Core Concepts

Layers

MorphSync organizes data into layers, where each layer represents a different aspect of morphological data:

  • Table: Tabular data without a spatial component
  • Points: Point clouds such as annotations
  • Graph: Network structures like skeletons or connectivity graphs
  • Mesh: 3D surface representations with vertices and faces

Note that it's possible to have multiple layers of the same type (e.g., multiple skeleton layers).

Links

Links define relationships and mappings between layers. They enable you to:

  • Use one layer to query or filter another layer
  • Find features from one layer based on mappings; for instance, finding the radius of skeleton nodes that synapses map to
  • Perform transitive mappings across multiple layers

Installation

pip install morphsync

or, to add to a uv managed project or environment:

uv add morphsync

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

morphsync-0.1.2.tar.gz (11.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

morphsync-0.1.2-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file morphsync-0.1.2.tar.gz.

File metadata

  • Download URL: morphsync-0.1.2.tar.gz
  • Upload date:
  • Size: 11.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for morphsync-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0db24ac1cc4b16961e3004c4587e6b268ee6e96f84eeec1d1ffeadca967c1102
MD5 637fb70a2a6c429194b001da3b7a7562
BLAKE2b-256 3f30a1c798da1aa698c717042954890cdc40070c7472590ca1bb40e795062f56

See more details on using hashes here.

Provenance

The following attestation bundles were made for morphsync-0.1.2.tar.gz:

Publisher: publish.yml on bdpedigo/morphsync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file morphsync-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: morphsync-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for morphsync-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 457a777f9649a35e684ad6a46fa10a23c11d28e158ab54e845f1388a6590fff4
MD5 83e7fa417a34659fa8defa8da987b0ca
BLAKE2b-256 dce5fa24ca64aa901955dd213e8e94da41f06352728de09ee412eda7387f8de5

See more details on using hashes here.

Provenance

The following attestation bundles were made for morphsync-0.1.2-py3-none-any.whl:

Publisher: publish.yml on bdpedigo/morphsync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page