Skip to main content

Cubic B-spline interpolation on multidimensional grids in PyTorch

Project description

torch-cubic-b-spline-grid

License PyPI Python Version CI codecov

Cubic B-spline interpolation on multidimensional grids in PyTorch.

The primary goal of this package is to provide a learnable, continuous parametrization of 1-4D spaces.


This is a PyTorch implementation of the model used in Warp for continuous deformation fields and locally variable optical parameters in cryo-EM images. The approach is described in Dimitry Tegunov's paper:

Many methods in Warp are based on a continuous parametrization of 1- to 3-dimensional spaces. This parameterization is achieved by spline interpolation between points on a coarse, uniform grid, which is computationally efficient. A grid extends over the entirety of each dimension that needs to be modeled. The grid resolution is defined by the number of control points in each dimension and is scaled according to physical constraints (for example, the number of frames or pixels) and available signal. The latter provides regularization to prevent overfitting of sparse data with too many parameters. When a parameter described by the grid is retrieved for a point in space (and time), for example for a particle (frame), B-spline interpolation is performed at that point on the grid. To fit a grid’s parameters, in general, a cost function associated with the interpolants at specific positions on the grid is optimized.

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

torch_cubic_b_spline_grid-0.0.2.tar.gz (148.6 kB view hashes)

Uploaded Source

Built Distribution

torch_cubic_b_spline_grid-0.0.2-py3-none-any.whl (11.1 kB view hashes)

Uploaded Python 3

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