Skip to main content

A python package for fitting splines.

Project description

splinebox

A python package for fitting splines. Developed by the EPFL Center for Imaging as part of a collaboration with the Uhlmann Group at EMBL-EBI in Feb 2024.

Documentation Status License BSD-3 PyPI Python Version tests codecov

Features

  • Flexible spline fitting for various applications.
  • Support for many spline types in any dimesnionality.
  • High-perfomance implementation in Python
  • Extensive documentation with examples

Installation

You can install splinebox via pip:

pip install splinebox

Usage

Here is a minimal example of cubic B-spline in 2D with 3 knots.

import splinebox
import numpy as np
import matplotlib.pyplot as plt

n_knots = 4
spline = splinebox.spline_curves.Spline(M=n_knots, basis_function=splinebox.basis_functions.B3(), closed=True)
spline.knots = np.array([[1, 2], [3, 2], [4, 3], [1, 1]])

t = np.linspace(0, n_knots, 100)
vals = spline.eval(t, derivative=0)

plt.scatter(spline.knots[:, 0], spline.knots[:, 1])
plt.plot(vals[:, 0], vals[:, 1])
plt.show()

Support

If you encounter any problems, please file and issue describing the issue and include minimal example to reproduce the issue.

Contributing

We welcome contributions! Before you submit a pull request, please ensure that the tests are passing. You can run the tests with pytest. If you are unsure how to implement something, feel free to open an issue to discuss.

License

This is an open source project licensed under the BSD-3-Clause License.

Project details


Download files

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

Source Distribution

splinebox-0.0.5a1.tar.gz (252.3 kB view details)

Uploaded Source

Built Distribution

splinebox-0.0.5a1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file splinebox-0.0.5a1.tar.gz.

File metadata

  • Download URL: splinebox-0.0.5a1.tar.gz
  • Upload date:
  • Size: 252.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for splinebox-0.0.5a1.tar.gz
Algorithm Hash digest
SHA256 551ae434d89ff1c5499d7b495aab48d85d27a15c6e24e8202d30f2f7e8ef6867
MD5 0bcef8b3d9c6bdf74d9e0682dba35898
BLAKE2b-256 022f867f54c27994afe5a9f4d7f158f77a7290aabe5b803017869226c99c8811

See more details on using hashes here.

File details

Details for the file splinebox-0.0.5a1-py3-none-any.whl.

File metadata

  • Download URL: splinebox-0.0.5a1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for splinebox-0.0.5a1-py3-none-any.whl
Algorithm Hash digest
SHA256 703a87690141c31de4ad38e7249a89279ac450c8132b65214c361e690a4ecf4a
MD5 486bc6f6971b8a5dbb6d2736e46e22b6
BLAKE2b-256 c961128b532e27f8cb7f43a968b8cff60e7951c6dc473c05202eab32a9c4ddb7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page