splinebox.basis_functions.

B3#

class splinebox.basis_functions.B3#

Basis function for a cubic (\(3^{\text{rd}}\) order) polynomial basis spline.

For a detailed theoretical description – including the equation and a plot of the function – refer to the Polynomial basis (B-spline) section in the documentation.

The constructor does not require any arguments.

Methods

__call__(t[, derivative])

Evaluate the function at position(s) t.

filter_periodic(s)

Returns a filtered version of the input s, used to convert knots into control points for a closed spline.

filter_symmetric(s)

Returns a filtered version of the input s, used to convert knots into control points for an open spline.

refinement_mask()

This function is needed for local refinement (see [Badoual2016]).

Examples

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

Create a basis function object:

>>> basis_function = splinebox.basis_functions.B3()

Evaluate the basis function at a single position:

>>> basis_function(0.5)
0.47916666666666663

Evaluate the basis function at multiple positions simultaneously:

>>> t = np.array([-0.2, 0, 0.5])
>>> basis_function(t)
array([0.631, 0.667, 0.479])

Compute the first derivative of the basis function at multiple positions:

>>> basis_function(t, derivative=1)
array([ 0.34 ,  0.   , -0.625])
>>> t = np.linspace(-2.1, 2.1, 500)
>>> plt.plot(t, basis_function(t))
>>> plt.show()
../../_images/splinebox-basis_functions-B3-1.png

Plot 3D curvature

Plot 3D curvature

Active Contours

Active Contours

Generate the splinebox documentation background

Generate the splinebox documentation background

Fit boundary conditions

Fit boundary conditions

Curvature combs

Curvature combs

Dendrite-Centric Coordinate System

Dendrite-Centric Coordinate System

Distance between splines

Distance between splines

Closed interpolating splines

Closed interpolating splines

Moving Frames

Moving Frames

Saving and loading splines

Saving and loading splines

Spline to mesh

Spline to mesh

Multivariate splines

Multivariate splines

Measure the curvature of a peptide

Measure the curvature of a peptide

Performance Comparison: splinebox vs scipy

Performance Comparison: splinebox vs scipy

Comparison splinebox and scipy: contour approximation

Comparison splinebox and scipy: contour approximation

Comparison of splinebox and scipy: Edge Fitting

Comparison of splinebox and scipy: Edge Fitting

<no title>

Code to measure performance for tabel in publication.