Skip to main content

skeliner

PyPI version

A lightweight skeletonizer that converts neuron meshes into biophysical‑modelling‑ready morphologies. Built for Eyewire II, in Rust, with Python binding.

Features

  • Mesh Preprocessing
    • remove mesh anomolies such as parallel faces due to chunk merging failures, gaps (broken neurites), fusions (wrong connections)
    • find and classify soma, organelles, and neurites (and also fragments that should be descarded)
disconnected components
Disconnected Mesh
detecing gaps
Gaps Detection
bridging gaps Gaps Bridging
original mesh
Original Mesh
detecting organelles
Organelles Detection
classifying components Mesh breakdown into components
  • Mesh → SWC skeletons
    • Center‑line, acyclic skeleton.
    • Per‑node radii with multiple estimators (centerline/median/mean/trim) and an automatic recommendation.
    • Ellipsoidal soma detection near the soma centroid.
    • Bridges disconnected mesh components back to the soma (gap‑closing) and prunes tiny peri‑soma artefacts.
    • SWC and NPZ export with metadata;
Origin components
Origin Mesh
detecing gaps
Geodesic Binnings
bridging gaps Skeleton
  • Pairwise contact sites (two cells)
    • Skeleton‑based seeding: fast KD‑tree search finds node↔node proximity pairs with tolerance; returns contact midpoints and per‑node loci.
    • Mesh‑based patches: around seeds, projects to both meshes and extracts touching triangle patches; returns per‑site areas on A/B and their mean, plus compact AABBs for downstream use.
    • Optional skeleton‑only approximation of contact sites/areas when meshes are unavailable.
contact sites between two cells
All contacts sites of two cells
zoomed in to the contact sites (opaque)
Contact sites with mesh
zommed in to the contact sites (transparent) Contact sites only
  • I/O, visualization, diagnostics and post-processing
    • Read/write SWC and compact NPZ;
    • 2D projections and 3D viewers for meshes, skeletons, and contact patches.
    • Various diagnostics and post-processing tools.

Installation

pip install skeliner

or from source, which builds the Rust core and so needs a Rust toolchain (rustup):

git clone https://github.com/berenslab/skeliner.git

# with uv
uv sync --all-extras

# or not
pip install -e "skeliner[dev]"

Quickstart

Mesh preprocessing and skeletonization

Since v0.4.0, the preprocessing pipeline is the recommended route, while the original raw mesh direct skeletonization route is kept as a faster but less accurate alternative. The mesh preprocessing will clean up most artifacts that would potentially degrade the quality of the skeletons, which includes identifying internal organelles surfaces, locating the soma, and also bridging disconnected paths. All these are done in one call automatically. The skeleton then can be estimated from the cleaned mesh and the identified components (organelles, soma, and neurites):

import skeliner as sk

mesh = sk.io.load_mesh("cellA.obj") 
mesh, components = sk.preprocess(mesh, compact=True, verbose=True)
skel = sk.skeletonize(mesh, components, unit="nm", verbose=True)

# Save SWC (e.g. convert nm → µm on write)
skel.to_swc("cellA.swc", scale=1e-3)
# Also persist a compact NPZ for fast reload
skel.to_npz("cellA.npz")

Find contact sites between two cells (skeleton + mesh)

import skeliner as sk

meshA = sk.io.load_mesh("cellA.obj")
meshB = sk.io.load_mesh("cellB.obj")

sites = sk.pair.scan_contact(meshA, meshB, unit="nm^2")
print("contact patches:", len(sites.faces_A))
print("mean areas (mesh units^2):", sites.area_mean)

# Optional: visualize patches
# sk.view.view_contacts(meshA, meshB, sites, sides="A")

Threads

The Rust core runs its heaviest loops on every core by default. To use fewer (a shared machine, or several cells at once on one node), set RAYON_NUM_THREADS before Python starts, or in a notebook's first cell (%env RAYON_NUM_THREADS=4), or switch at any time from Python:

sk.threads(4)          # from now on
with sk.threads(2):    # for this block only
    mesh, components = sk.preprocess(mesh)
sk.threads(None)       # back to the default: every core, or RAYON_NUM_THREADS
sk.threads.get()       # how many threads the next parallel loop runs on

See example notebooks for more usage.

Metadata

Release files for skeliner 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skeliner 0.4.1
File Size Uploaded Provenance Actions
skeliner-0.4.1.tar.gz 747.2 kB With provenance Details for skeliner-0.4.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for skeliner 0.4.1
File Actions
skeliner-0.4.1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for skeliner-0.4.1-cp311-abi3-win_amd64.whl
skeliner-0.4.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for skeliner-0.4.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
skeliner-0.4.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for skeliner-0.4.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
skeliner-0.4.1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for skeliner-0.4.1-cp311-abi3-macosx_11_0_arm64.whl
skeliner-0.4.1-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for skeliner-0.4.1-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 14.2 MB

Release files / skeliner-0.4.1.tar.gz

Download URL skeliner-0.4.1.tar.gz
Size 747.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4c35564d3a152615f138b66e0a6967e14e6dd9b1a02c46cd49f18fe18c70490b
BLAKE2b-256 checksum
How to use checksums
329f3ca544254b2d9089f19aa5cf881b30dd43cf77c68b176228eecc10e51b75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / skeliner-0.4.1-cp311-abi3-win_amd64.whl

Download URL skeliner-0.4.1-cp311-abi3-win_amd64.whl
Size 2.5 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3fe15268b29cf47151e71d88acb177e4ee30ec55749fc6c505c45663c8be8969
BLAKE2b-256 checksum
How to use checksums
6c2be3bfa5ec9b04f16296772953bb34c1619ff3506294a88a803bf404790112
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / skeliner-0.4.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL skeliner-0.4.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 3.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
f3df9412b0f7e709f86f9fab3c36592970ee0520890bd9a501646dd2d7822323
BLAKE2b-256 checksum
How to use checksums
1ddd0574cdc528789d69886260da93769e1ee2f18535213d50df3db578d9c9a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / skeliner-0.4.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL skeliner-0.4.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 2.9 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
57631adf59748303e7b691f06f605fe1eec5619068e9cbe7f6ba63a8fc2c0958
BLAKE2b-256 checksum
How to use checksums
92169361275bebb04b09abde4cb4a29da0eefabf723d028f5635470b71f9f34f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / skeliner-0.4.1-cp311-abi3-macosx_11_0_arm64.whl

Download URL skeliner-0.4.1-cp311-abi3-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8986c0933b149ecbf3c5f9ddd8a7b223afe6376938398036fb466cc6e106b5be
BLAKE2b-256 checksum
How to use checksums
c62e0934392353c534f862dd22e8ababe3accd87ce1d5d01f4b4eaebd5f9ca29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / skeliner-0.4.1-cp311-abi3-macosx_10_12_x86_64.whl

Download URL skeliner-0.4.1-cp311-abi3-macosx_10_12_x86_64.whl
Size 2.5 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8bf895f21bf5f03b1c1499e71553be65f63bbf65457cf3a2229e2122b550f5e8
BLAKE2b-256 checksum
How to use checksums
3150cc1ee21196631dd2a019bc2a8d5a59cff6bf0cbc2e6216cab68c1e0c1ac4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for skeliner 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for skeliner-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page