Skip to main content

VesselKnit

Voxelize vessel STL meshes into NIfTI masks — without breakage.

PyPI Python License: Apache 2.0

Rasterizing a thin vessel STL onto a CT/MR grid usually fractures it into disconnected blobs at narrow junctions. VesselKnit keeps the vessel a single connected structure — faithful to the original mesh in morphology and calibre — via progressive gap-bridging during voxelization plus 26-/6-connectivity repair. Built for medical-imaging workflows; coordinate alignment (LPS/RAS, Z-reflection, direction matrix) is automatic.

Install

pip install vesselknit

Optional extras: [dicom] for DICOM input, [all] for everything. Python ≥ 3.9.

Usage

vesselknit --stl vessel.stl --reference ct_scan/ --output vessel.nii.gz

Multiple STLs into one multi-label volume, with connectivity repair:

vesselknit \
  --stl portal_vein.stl --label 1 \
  --stl hepatic_vein.stl --label 2 \
  --reference ct_scan/ --output vessels.nii.gz \
  --bridge-26conn
from vesselknit import load_reference_image, stl_to_mask, save_nifti

ref = load_reference_image("ct_scan/")      # DICOM dir or .nii.gz
mask = stl_to_mask("vessel.stl", ref)       # (z, y, x) uint8
save_nifti(mask, ref, "vessel.nii.gz")

See examples/basic_usage.py for multi-label and connectivity-repair examples.

License

Apache 2.0 © 2026 Justin

Metadata

Release files for vesselknit 1.0.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 vesselknit 1.0.0
File Size Uploaded Provenance Actions
vesselknit-1.0.0.tar.gz 26.8 kB With provenance Details for vesselknit-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vesselknit 1.0.0
File Interpreter ABI Platform Actions
vesselknit-1.0.0-py3-none-any.whl Python 3 none any Details for vesselknit-1.0.0-py3-none-any.whl

Total release size: 50.8 kB

Release files / vesselknit-1.0.0.tar.gz

Download URL vesselknit-1.0.0.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bf368d57fb54412aca490ddd5bb622b28d9206a2cb688a07458a74e5ccef7726
BLAKE2b-256 checksum
How to use checksums
8c816e725bcb61ec96731087a73f4864d623a5392d2a88d3f9ad209ae15f2a5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 19, 2026.

Transparency log

Release files / vesselknit-1.0.0-py3-none-any.whl

Download URL vesselknit-1.0.0-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98c798a638a8262e87d6a6bb6f2a3fbeba7d3e2947982309b7a09d12d44af4ee
BLAKE2b-256 checksum
How to use checksums
c8e2c9b6a66372f21eec43a3fbdce7883bdcc0cdc864f5e0efc343e05f8a1af5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 19, 2026.

Transparency log

Security for vesselknit 1.0.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vesselknit-1.0.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 Jun 19, 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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

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