Skip to main content

SplineOps

Projection-based antialiased resizing for N-D scientific arrays.

SplineOps is designed for precise, repeatable downsampling of regular-grid 2-D images and 3-D volumes. It combines explicit coordinate semantics, a readable Python reference implementation, a native CPU backend, and reusable plans for fixed-geometry workloads.

Installation

SplineOps requires Python 3.11 or newer:

python -m pip install splineops

Published wheels include the native resize extension on supported platforms.

Quick start

import numpy as np
from splineops import resize

volume = np.random.default_rng(0).random((64, 192, 192), dtype=np.float32)
coarse = resize(
    volume,
    output_size=(32, 96, 96),
    method="cubic-antialiasing",
)

The *-antialiasing methods project the input spline onto a coarser spline space instead of treating downsampling as interpolation alone. For repeated arrays with the same geometry, ResizePlan reuses setup and workspace state.

When to use SplineOps

SplineOps is a good fit when:

  • continuous-valued 2-D or 3-D NumPy data must be downsampled;
  • coordinate, boundary, and output-shape semantics must be explicit;
  • aliasing matters; or
  • many arrays share one resize geometry.

Another tool may be a better fit when:

  • differentiable GPU execution is required;
  • physical-space image metadata must be managed automatically;
  • ordinary display-image scaling is the only goal; or
  • categorical labels are being resampled, where nearest-neighbour semantics are normally appropriate.

Public maturity

Module Status Public position
resize, ResizePlan Stable Native N-D interpolation and projection antialiasing with a Python reference path
TensorSpline Stabilizing Continuous tensor-product models evaluated at arbitrary coordinates
Affine, differentials, smoothing, regression, pyramids, wavelets Experimental Available for research while their contracts and reference coverage mature

Experimental describes API and validation maturity, not the importance of the underlying methods. See the project status for exact evidence and remaining graduation work.

Numerical and performance position

SplineOps does not claim to be the fastest generic 2-D image resizer. OpenCV, PyTorch, or other libraries can be faster when their coordinate, boundary, kernel, and antialiasing conventions are acceptable.

SplineOps is strongest when the spline model matters: defined grids and boundaries, N-D projection antialiasing, native/reference parity, and repeated fixed-geometry execution. Cross-library reports include semantic differences as well as timings; numerical difference from SplineOps is not treated as an independent accuracy metric.

The flagship SELMA3D microvessel validation uses 18 held-out expert-labelled 3-D microscopy patches. For the tested lateral 2x coarsening, SplineOps had higher mean vessel-ranking ROC AUC than the named SciPy, scikit-image, and PyTorch pipelines under a predeclared family-wise rule. It was 12.49x, 15.17x, and 1.36x faster, respectively, on the recorded one-thread CPU run. This is narrow preprocessing superiority—not segmentation or universal resampling superiority.

Explore that result interactively with the installed SELMA3D napari comparison demo. It downloads one checksum-verified public patch, runs the named methods locally, and provides a curtain slider over their outputs and expert vessel labels. The default demo extra avoids PyTorch; install selma3d-demo-all when the PyTorch-area comparison is required.

The exact approved public wording and its limits are maintained in Claims and evidence.

The 3-D microscopy case study tests that position on a public two-channel volume. It publishes the input checksum, code, raw results, local timings, and the limits of each metric.

The stricter BBBC050 segmentation validation uses manual labels and embryo-level held-out evaluation. SplineOps was fast and competitive, but the predeclared quality-superiority criterion was not met.

The controlled 3-D spectral-coarsening validation uses analytical targets rather than a library output. Its frozen criterion passed against six generic resize alternatives: projection reduced mean NRMSE by 54% versus the nearest frozen baseline over 72 smooth field cases. A post-hoc polyphase FIR audit was far more accurate, so this is not evidence of broad scientific-resampling or downstream-task superiority.

Backends

  • NumPy is supported across the package.
  • The native C++ backend accelerates resize on CPU.
  • CuPy interoperability is experimental and limited to parts of TensorSpline.

Set SPLINEOPS_ACCEL=never to force the Python resize reference or SPLINEOPS_ACCEL=always to require the native extension. See the backend contract for exact scope.

Documentation

SplineOps modernizes spline methods developed across the Biomedical Imaging Group at EPFL and its collaborators. Method citations, implementation history, and source provenance are recorded explicitly.

Development

git clone https://github.com/splineops/splineops.git
cd splineops
python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'
python -m pytest -q

Reproducible resize evidence commands include:

python scripts/benchmark_resize_pr.py --profile smoke --output-dir /tmp/splineops-smoke
python scripts/benchmark_resize_native.py --backend both --output-csv /tmp/splineops-native.csv
python scripts/benchmark_resize_libraries.py --output-csv /tmp/splineops-libraries.csv

Download files

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

Source Distribution

splineops-2.2.0.tar.gz (6.1 MB view details)

Uploaded Source

Built Distributions

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

splineops-2.2.0-cp313-cp313-win_amd64.whl (609.7 kB view details)

Uploaded CPython 3.13Windows x86-64

splineops-2.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (534.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

splineops-2.2.0-cp313-cp313-macosx_11_0_arm64.whl (416.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

splineops-2.2.0-cp313-cp313-macosx_10_13_x86_64.whl (476.0 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

splineops-2.2.0-cp312-cp312-win_amd64.whl (609.7 kB view details)

Uploaded CPython 3.12Windows x86-64

splineops-2.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (534.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

splineops-2.2.0-cp312-cp312-macosx_11_0_arm64.whl (416.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

splineops-2.2.0-cp312-cp312-macosx_10_13_x86_64.whl (475.9 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

splineops-2.2.0-cp311-cp311-win_amd64.whl (606.1 kB view details)

Uploaded CPython 3.11Windows x86-64

splineops-2.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (533.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

splineops-2.2.0-cp311-cp311-macosx_11_0_arm64.whl (414.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

splineops-2.2.0-cp311-cp311-macosx_10_13_x86_64.whl (474.3 kB view details)

Uploaded CPython 3.11macOS 10.13+ x86-64

File details

Details for the file splineops-2.2.0.tar.gz.

File metadata

  • Download URL: splineops-2.2.0.tar.gz
  • Upload date:
  • Size: 6.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for splineops-2.2.0.tar.gz
Algorithm Hash digest
SHA256 b926a8b9a709acbebdff03faff48e0d765243298558332f36cf036b9569a7c98
MD5 8487731d6bcb790ed1c8e497e63aebd6
BLAKE2b-256 01af819bb298efa8b22648dfd42b46e0fc01d5212b66896f92ffb27e76de90b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0.tar.gz:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: splineops-2.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 609.7 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for splineops-2.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2b058f1bb535b7c81a26307e8b959e6a85b37640fc44ce1560d791bc04e025c4
MD5 07e244d775b16cdb7f31fd83fdf69658
BLAKE2b-256 e08ff3ae40d4e9e91079c788219f2145276348e030ed39f2294c4b25e41ea149

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for splineops-2.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6b988674a3d75fe04d59126258d2ac98fa47b6f74effd5b207123e9f96e0a8df
MD5 2123319560692a28fdc51bc6e965a216
BLAKE2b-256 70465dcbae3be4af31eba3e88231fc925577b1c7f2defb3da246fa747977919a

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for splineops-2.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 131f4080952c69601107b8bccef0545e8c571c78647e80a3a6c8d0f8aa12e89e
MD5 4f9a052950ac2197d0188b7d9d622ed6
BLAKE2b-256 c615a1f3714ee4779b2918acd6df392489b4f7376ac3e55b54340f1131563d83

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for splineops-2.2.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 cf76fe9f764a8fb1b1dc1097baeefe5444c16c79e6cf8e423226a5a695a1d187
MD5 6cb1a0ebc9a9cc1f52384427fd40b66e
BLAKE2b-256 317c5f5745a5f5940ff63cd5b59abfffdbee2583c44a73b2ca2997977a1c64b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp313-cp313-macosx_10_13_x86_64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: splineops-2.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 609.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for splineops-2.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ed23306388b90ac29f80874a349c3cac12c04f3f9620d6c78fc30a970f4a5ef6
MD5 d8e7474168c8310ec2b20e0aad3fcf13
BLAKE2b-256 a4a74884bed40a32ff87e1f170b156f63aaf3e6f857f7d0b11d469bf49e6adeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for splineops-2.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f7750e3f735070bc9e8f82321084d039df9818a4eebe54602a9e3da1baedf667
MD5 df99458bc9e38779a12cb5ef0643f365
BLAKE2b-256 2b9d7cbb7e4420754eca3270be38ff638087ce77ef414c691554a654b82973f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for splineops-2.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5d3a4a8e3b9640f0a8db348c2e2f9bae09fb00ba30bec8a0d2e39a104f162563
MD5 4629be66c39b74f9dee08540150be128
BLAKE2b-256 b6ec75c28d8f5dd092055db4cb8be38cc40d27357b881aa5fa8ec2f0f0df1e26

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for splineops-2.2.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 81e542cc20c256d4c284ed51aae65feba414d7536f5712379192dc8656ff48d8
MD5 a6d155deda7027310cd815c4884fca96
BLAKE2b-256 7d4cbae9e5a7e5a1f698c33b340b85a81853a5869f1e8c9fb8540bac34c665b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp312-cp312-macosx_10_13_x86_64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: splineops-2.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 606.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for splineops-2.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e2ef9ca2b2015474473562666f7014c1d50c4d802b1b5ccec0a9271f80bfbb50
MD5 04e5022cb759f0837708f66e4443ced2
BLAKE2b-256 a85c336317fbc4e71d4ccd648cd0d1f402747b23e666bdb4e921f8e0f21dd7ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for splineops-2.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9d9f61335cb778d731098e1d1429c7d3786eeb8a9fb4cbf48c89f0a1261dce58
MD5 94133aff5991f4df4cbc25e33317355b
BLAKE2b-256 9535a75ac2522f8ba61c285c934a9c91ed54e93e41eaa54686d2d1838a7e8f9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for splineops-2.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d24eee91502bb58a53cf5d2aceaba30e060fdf5ae868c42c56548a17a340f112
MD5 9ac558fd79ddd0ed02e9924fd3c8ec97
BLAKE2b-256 600f48f173d1abc16239c2f0f40f41b3ea8a34d8be1b6d0c13d3d069f307b9a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on splineops/splineops

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

File details

Details for the file splineops-2.2.0-cp311-cp311-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for splineops-2.2.0-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 834b0c715155cc680ef0ebb6969d9de5c753f42430af1dc2ae93f15e45588232
MD5 e2cc7b2202f46dd080fd570ad9c1ce70
BLAKE2b-256 e7ebe1ea6998ebff2f18644a36bfd473d2beb5d9218c4d0d9d34f80de63c370e

See more details on using hashes here.

Provenance

The following attestation bundles were made for splineops-2.2.0-cp311-cp311-macosx_10_13_x86_64.whl:

Publisher: release.yml on splineops/splineops

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