Skip to main content

fibrs

A fast drop-in for avf-spline-generator 0.2.0, Qual's AFV fibre tracer (Qualzz/AVF_SPLINE_GENERATOR @ bee798f). Same flags, same .afv output.

  • fibrs predict runs Qual's AFV fibre model V2 on an NVIDIA GPU, without PyTorch.
  • fibrs join joins a scroll's Z bands into one .afv.

Fibre sets for whole scrolls, traced with fibrs: praveenperera/afv-v2-fibers.

Speed

CT to .afv on three 512-plane bands, one RTX 5090, fp32:

Pipeline Time
villa's prediction + original tracer about 35,000 s
fibrs 0.4.0 800 s

About 44× faster. A whole scroll takes fibrs an estimated 2.6–3 hours, against 80–140. Benchmarks.

Install

pip install fibrs
pip install "fibrs[predict]"   # adds cuDNN and cuBLAS for fibrs predict

Install into the environment that has numpy. fibrs uses numpy's OpenBLAS.

Standalone binaries are on the releases page, or:

cargo binstall fibrs
cargo install fibrs --locked

A standalone binary needs the numpy environment active, or FIBRS_LAPACK set. Install details.

Trace

fibrs --predictions P --array semantic --channel-order VH --tracing-predictions P \
  --tracing-array tracing --voxel-size-um 9.362 --storage compressed --threads 4 \
  --output fibers.afv --work-dir work

Or from Python: python -m fibrs ARGS.

  • Uses an NVIDIA GPU when available, otherwise the CPU. Force one with --device cpu or --device cuda.
  • Output is the same at any --threads.
  • Resume an interrupted run with --resume.
  • --tiles-yx NY NX traces a dense window as tiles, to use less memory.

To make an existing avf-spline-generator run fibrs:

scripts/install-dropin.sh VENV            # install
scripts/install-dropin.sh --restore VENV  # undo

Tracing details.

Join

fibrs join --manifest bands.json --output fibers-scroll.afv --stats fibers-scroll.json
{
  "bands": [
    {"afv": "trace/z08448-08960/fibers.afv", "core_z": [8448, 8960], "window_z": [8192, 9216]},
    {"afv": "trace/z08960-09472/fibers.afv", "core_z": [8960, 9472], "window_z": [8704, 9728]}
  ],
  "coordinate_space": "PHerc1545/20250821151648",
  "source_path": "https://vesuvius-challenge-open-data.s3.amazonaws.com/PHerc1545/volumes/....zarr",
  "provenance": {"operation": "halo_band_trace_join", "haloPlanes": 256}
}

core_z is the planes a band keeps, window_z the planes it was traced from.

Subset

# the fibres with a point in a box of native level-0 voxels: X0 X1 Y0 Y1 Z0 Z1
fibrs subset --input fibers-scroll.afv --output region.afv --box 2500 3524 3600 4624 8000 9024

# every fibre of 2.5 mm or more, the sheet-strip runner's default minimum
fibrs subset --input fibers-scroll.afv --output long.afv --min-length-mm 2.5

Writes a smaller .afv that villa's AFV importers read like the whole set. Fibres are kept whole and keep their ids, and the file keeps the set's uuid, so an imported fibre has the same UUID as in a whole-scroll import. --box, --min-length-mm and --family V|H combine: a fibre is kept only when it passes each one given. A box of a 27.6 GB scroll set takes about 20 s and under 1 GB of memory.

Predict

# whole array, matching villa's output
fibrs predict --mode villa --ct scroll.zarr/0 --model-dir afv_fiber_9um_v2 --out pred.zarr

# one z band, resumable
fibrs predict --ct scroll.zarr/0 --z0 12032 --z1 12544 --model-dir afv_fiber_9um_v2 --out band.zarr

Needs Linux or Windows x86-64, an RTX 30-series or newer GPU, cuDNN 9, cuBLAS 12, and the model from Qualzz20/afv_fiber_9um_v2. Predict details.

Build

cargo build --release
FIBRS_LAPACK=/path/to/libscipy_openblas64_.so cargo test --release

Rust 1.100+.

Licence

Apache-2.0. See NOTICE and licenses/.

Metadata

Release files for fibrs 0.5.0

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

Built distributions (wheels)

Table of built distributions (wheels) for fibrs 0.5.0
File Interpreter ABI Platform Actions
fibrs-0.5.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for fibrs-0.5.0-py3-none-win_amd64.whl
fibrs-0.5.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for fibrs-0.5.0-py3-none-manylinux_2_28_x86_64.whl
fibrs-0.5.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for fibrs-0.5.0-py3-none-macosx_11_0_arm64.whl

Total release size: 10.0 MB

Release files / fibrs-0.5.0-py3-none-win_amd64.whl

Download URL fibrs-0.5.0-py3-none-win_amd64.whl
Size 3.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
76459919eedffbb76e6c7690a61a9a2d7055c7a7bf3fb3ec6c371a714b5afa23
BLAKE2b-256 checksum
How to use checksums
0f8803326c7cd929e1e8b8a188e09510f136e7273b53356cf288f80e0cc5f8a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 22, 2026.

Transparency log

Release files / fibrs-0.5.0-py3-none-manylinux_2_28_x86_64.whl

Download URL fibrs-0.5.0-py3-none-manylinux_2_28_x86_64.whl
Size 3.8 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
fa335bbe29f771f65f0710643845258e3c0a9c1a5515163e180d184f20e5770d
BLAKE2b-256 checksum
How to use checksums
54b7071a8a8b5c176facf0058964b36f75d61c95326d39279276d83293c46140
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 22, 2026.

Transparency log

Release files / fibrs-0.5.0-py3-none-macosx_11_0_arm64.whl

Download URL fibrs-0.5.0-py3-none-macosx_11_0_arm64.whl
Size 2.5 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d104ee8f5e1379224bb679326143c30f4f911157c58b503889bdb6e44e5aea95
BLAKE2b-256 checksum
How to use checksums
e4101cb4493f64a3e94db470382bf3967bb4248b93bfeff92bd91dbb6a248b60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 22, 2026.

Transparency log

Security for fibrs 0.5.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 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for fibrs-0.5.0-py3-none-win_amd64.whl

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 22, 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