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.0

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.0
File Size Uploaded Provenance Actions
skeliner-0.4.0.tar.gz 701.1 kB With provenance Details for skeliner-0.4.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for skeliner 0.4.0
File Actions
skeliner-0.4.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for skeliner-0.4.0-cp311-abi3-win_amd64.whl
skeliner-0.4.0-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.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
skeliner-0.4.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for skeliner-0.4.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
skeliner-0.4.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for skeliner-0.4.0-cp311-abi3-macosx_11_0_arm64.whl
skeliner-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for skeliner-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 13.5 MB

Release files / skeliner-0.4.0.tar.gz

Download URL skeliner-0.4.0.tar.gz
Size 701.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a6e765cb0ed416e42e094945875ab25b30c0195cc2428c4ea14c9fca887e4615
BLAKE2b-256 checksum
How to use checksums
8279019fbc73584604e6b6881ed76036716cc76fe4f7dfca783473cf3584dc98
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 12, 2026.

Transparency log

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

Download URL skeliner-0.4.0-cp311-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4c55b06c0d09c05409ffd3635d691790f786969785e3ae8baba3039d6b4dbef1
BLAKE2b-256 checksum
How to use checksums
0d6033ed925f3e9bf0c1fcc7bda874898a3a929100e3ed30d8df5599f6aba753
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 12, 2026.

Transparency log

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

Download URL skeliner-0.4.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 3.0 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a4e9184e836ff3b64120318019b9276efdfa5b9d4a0453f59ac19cc688371142
BLAKE2b-256 checksum
How to use checksums
241a2515805e9532a451c2961ea99c96014cecf45b8c841255fab34b767d1f51
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 12, 2026.

Transparency log

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

Download URL skeliner-0.4.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 2.8 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
eae311dd4a2c1aaa594af963b9a5d238ed29a88f3001eab9ec0d0e232f8c0345
BLAKE2b-256 checksum
How to use checksums
87f41d60e629a19b9c37dbf9d93de0e6f9d87555c2b465b523de54d25bc1afbe
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 12, 2026.

Transparency log

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

Download URL skeliner-0.4.0-cp311-abi3-macosx_11_0_arm64.whl
Size 2.3 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
51672cda28048879befa56b2e81c7b540958331ebe9126aa589f537461fc891c
BLAKE2b-256 checksum
How to use checksums
cbc0832c9d56eb2b54830c4b0d3bb68a84e274632358d6f9ce1ab3538510fc70
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 12, 2026.

Transparency log

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

Download URL skeliner-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
13192d5dd5c6192c58422a5a64513ff41619919f729dcdd142af20b583ad8947
BLAKE2b-256 checksum
How to use checksums
69a738fe298d3baf16409e8454819fae4fcf3d558b846384404dd8a85f07b0a2
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 12, 2026.

Transparency log

Security for skeliner 0.4.0

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.0.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 12, 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