### Install SplineBox with Example Dependencies Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Installs SplineBox along with the necessary dependencies to run the provided examples. Use this if you plan to follow along with the example code. ```bash pip install "splinebox[examples]" ``` -------------------------------- ### Install SplineBox with All Dependencies Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Installs SplineBox along with all available optional dependencies, including those for examples, testing, and documentation. This provides a complete development environment. ```bash pip install "splinebox[all]" ``` -------------------------------- ### Install SplineBox with Minimal Dependencies Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Installs the SplineBox library with its core functionalities. This is the basic installation command. ```bash pip install splinebox ``` -------------------------------- ### Install SplineBox with Documentation Dependencies Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Installs SplineBox and the dependencies needed for building the project's documentation. This is relevant if you intend to regenerate or modify the documentation. ```bash pip install "splinebox[docs]" ``` -------------------------------- ### Install SplineBox with Test Dependencies Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Installs SplineBox and the dependencies required for running the library's test suites. This is useful for developers who want to verify the library's integrity. ```bash pip install "splinebox[test]" ``` -------------------------------- ### Construct a Cubic B-Spline Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Demonstrates the creation of a cubic B-spline with 5 knots that is not closed. It initializes a Spline object with specified parameters. ```python import splinebox spline = splinebox.Spline(M=5, basis_function=splinebox.B3(), closed=False) ``` -------------------------------- ### Sample an Open Spline Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Evaluates the spline at a series of parameter values (`t`) to obtain points along the spline curve. For an open spline with `M` knots, the parameter `t` typically ranges from 0 to `M-1`. ```python t = np.linspace(0, M-1, 100) vals = spline(t) ``` -------------------------------- ### Sample a Closed Spline Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Evaluates a closed spline at parameter values that cover the entire loop. For a closed spline, the parameter `t` ranges from 0 to `M` to complete the cycle. ```python t = np.linspace(0, M, 100) vals = spline(t) ``` -------------------------------- ### Approximate Data with Spline Least Squares Fit Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Fits the spline to a dataset using a least squares approximation. This method adjusts the spline's control points to best match the provided data points. ```python spline.fit(np.random.rand(100, ndim)) ``` -------------------------------- ### Set Spline Knots Directly Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Assigns random values to the knots of a spline. The number of knots must match the `M` parameter used during spline initialization. The shape of the knots array should be (M, ndim). ```python spline.knots = np.random.rand(5, ndim) ``` -------------------------------- ### Install splinebox Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/README.md Installs the splinebox package using pip. ```bash pip install splinebox ``` -------------------------------- ### Get splinebox Version Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/README.md Retrieves the currently installed version of the splinebox package. ```python import splinebox print(splinbox.__version__) ``` -------------------------------- ### Retrieve Splinebox Version Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/citation.rst This Python code snippet shows how to import the splinebox library and print its installed version. This is useful for ensuring compatibility or for citation purposes. ```python import splinebox print(splinebox.__version__) ``` -------------------------------- ### Set Spline Control Points Directly Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/index.rst Assigns random values to the control points of a spline. Note that the number of control points is typically `M + degree` for open splines, hence 7 for a cubic spline (degree 3) with 5 knots. ```python spline.control_points = np.random.rand(7, ndim) ``` -------------------------------- ### Basis Function Definition Example Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/basis_function.rst Illustrates a basic basis function definition where the function is 1 within a specific interval and 0 elsewhere. This example helps understand the concept of 'support'. ```math \phi(t)=\begin{cases} 1, \quad t\in [-\frac{1}{2}, \frac{1}{2}] \\ 0, \quad \mathrm{elsewhere} \end{cases} ``` -------------------------------- ### Minimal 2D Cubic B-Spline Example Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/README.md Demonstrates the creation and plotting of a 2D cubic B-spline with 4 knots. It initializes a closed B-spline, sets its knots, samples points along the spline, and visualizes the knots and the spline curve using matplotlib. ```python 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(t, derivative=0) plt.scatter(spline.knots[:, 0], spline.knots[:, 1]) plt.plot(vals[:, 0], vals[:, 1]) plt.show() ``` -------------------------------- ### Spline Fitting in SplineBox Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/index.rst Demonstrates fitting a closed spline with a specified number of knots and basis function using SplineBox. This method is straightforward and requires minimal setup. ```python import splinebox M = 10 basis_function = splinebox.B3() spline = splinebox.Spline( M, basis_function, closed=True ) spline.fit(contour) ``` -------------------------------- ### Spline Fitting with SplineBox Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/index.rst Demonstrates the basic usage of the SplineBox library for fitting splines. It involves initializing a basis function, creating a Spline object, fitting it to data, and evaluating the spline. ```python import splinebox import numpy as np # number of knots M = 10 basis_function = splinebox.B3() spline = splinebox.Spline(M, basis_function) spline.fit(data) t = np.linspace(0, M - 1, 1000) vals = spline(t) ``` -------------------------------- ### Spline Fitting in SciPy Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/index.rst Illustrates fitting a spline using SciPy, which requires manual pre-computation of parameter values for knots and data points, including handling padding and periodicity. This process can be complex. ```python import scipy.interpolate M = 10 N = len(data) k = 3 t = np.arange(-k, M + k + 1) / M * N u = np.linspace(0, N, N, endpoint=True) tck, u = scipy.interpolate.splprep( contour, u=u, k=k, task=-1, s=0, t=t, per=N ) ``` -------------------------------- ### Setting Control Points with Padding Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/padding.rst Demonstrates how to manually set control points for a spline, requiring explicit handling of padding. The number of control points needs to account for the padding required by the basis function. ```python import splinebox import numpy as np # Assuming ndim is defined elsewhere, e.g., ndim = 2 ndim = 2 spline = splinebox.Spline(M=5, basis_function=splinebox.B3(), closed=False) spline.control_points = np.random.rand((7, ndim)) ``` -------------------------------- ### Splinebox Basis Functions API Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/api/index.rst API documentation for the basis_functions module within the splinebox project. This section details the available functions and classes for working with basis functions. ```APIDOC splinebox.basis_functions - Module for basis functions used in spline interpolation. - Contains classes and functions for defining and evaluating various basis functions. ``` -------------------------------- ### Helper Functions p(M) and q(M) Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/exponentialhermite.rst Defines the helper functions p(M) and q(M) used in the calculation of the Exponential Hermite coefficients, involving complex exponentials. ```math p(M) = j*(2*pi/M)+1 + exp(j*(4*pi/M)) * (j*(2*pi/M)-1) q(M) = j*(2*pi/M)+2 + exp(j*(2*pi/M)) * (j*(2*pi/M)-2) ``` -------------------------------- ### splinebox Citation (BibTeX) Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/README.md Provides the BibTeX entry for citing the splinebox package in academic publications. Users should replace 'V.V.Vb1' with the actual version number. ```bibtex @misc{splinebox, author = {Aymanns, Florian and Andò, Edward and Uhlmann, Virginie}, title = {{S}pline{B}ox}, url = {https://pypi.org/project/splinebox/}, doi = {10.5281/zenodo.13358354}, note = {{V}ersion V.V.Vb1}, year = 2024, } ``` -------------------------------- ### Splinebox BibTeX Citation Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/getting_started/citation.rst This BibTeX entry provides the necessary information for citing the splinebox project in academic papers. It includes author names, title, URL, DOI, and a placeholder for the version. ```bibtex @misc{splinebox, author = {Aymanns, Florian and Andò, Edward and Uhlmann, Virginie}, title = {{S}pline{B}ox}, url = {https://pypi.org/project/splinebox/}, doi = {10.5281/zenodo.13358354}, note = {{V}ersion V.V.Vb1}, year = 2024, } ``` -------------------------------- ### Splinebox Spline Curves API Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/api/index.rst API documentation for the spline_curves module within the splinebox project. This section details the available functions and classes for creating and manipulating spline curves. ```APIDOC splinebox.spline_curves - Module for spline curve functionalities. - Provides tools for defining, evaluating, and manipulating spline curves. ``` -------------------------------- ### Matrix Representation of Spline Approximation Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/data_approximation.rst This snippet shows the matrix form of the spline approximation equation, \(\mathbf{\Phi}\mathbf{C} = \mathbf{P}\), which is used to solve for the control points. ```math \mathbf{\Phi}\mathbf{C} = \mathbf{P} ``` -------------------------------- ### Plotting B-spline Basis Functions Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/polynomial.rst Python code to generate plots for the linear, quadratic, and cubic B-spline basis functions. These plots visualize the shapes defined in the mathematical equations. ```python import matplotlib.pyplot as plt import numpy as np def plot_b1(): t = np.linspace(-2, 2, 400) b1 = np.zeros_like(t) mask = (np.abs(t) >= 0) & (np.abs(t) <= 1) b1[mask] = 1 - np.abs(t[mask]) plt.figure() plt.plot(t, b1) plt.title(r'Linear (1st order) B-spline Basis $eta_1(t)$') plt.xlabel('t') plt.ylabel(r'$eta_1(t)$') plt.grid(True) plt.show() # plot_b1() ``` ```python import matplotlib.pyplot as plt import numpy as np def plot_b2(): t = np.linspace(-2, 2, 400) b2 = np.zeros_like(t) mask1 = (t >= -1.5) & (t < -0.5) b2[mask1] = 0.5 * t[mask1]**2 + 1.5 * t[mask1] + 9/8 mask2 = (t >= -0.5) & (t < 0.5) b2[mask2] = 0.75 - t[mask2] mask3 = (t >= 0.5) & (t <= 1.5) b2[mask3] = 0.5 * t[mask3]**2 - 1.5 * t[mask3] + 9/8 plt.figure() plt.plot(t, b2) plt.title(r'Quadratic (2nd order) B-spline Basis $eta_2(t)$') plt.xlabel('t') plt.ylabel(r'$eta_2(t)$') plt.grid(True) plt.show() # plot_b2() ``` ```python import matplotlib.pyplot as plt import numpy as np def plot_b3(): t = np.linspace(-2, 2, 400) b3 = np.zeros_like(t) mask1 = (np.abs(t) >= 0) & (np.abs(t) < 1) b3[mask1] = 2/3 - t[mask1]**2 + 0.5 * np.abs(t[mask1])**3 mask2 = (np.abs(t) >= 1) & (np.abs(t) <= 2) b3[mask2] = (1/6) * (2 - np.abs(t[mask2]))**3 plt.figure() plt.plot(t, b3) plt.title(r'Cubic (3rd order) B-spline Basis $eta_3(t)$') plt.xlabel('t') plt.ylabel(r'$eta_3(t)$') plt.grid(True) plt.show() # plot_b3() ``` -------------------------------- ### Plot Exponential Basis Function Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/exponential.rst Generates a plot of the exponential basis function using a Python script. This visualization helps understand the function's shape and behavior. ```python import matplotlib.pyplot as plt import numpy as np def exponential_basis(t, M): abs_t = np.abs(t) cos_term_M = np.cos(2 * np.pi / M) phi_t = np.zeros_like(t, dtype=float) mask1 = (abs_t >= 0) & (abs_t < 0.5) phi_t[mask1] = (np.cos(2 * np.pi * abs_t[mask1] / M) * np.cos(np.pi / M) - np.cos(2 * np.pi / M)) / (1 - cos_term_M) mask2 = (abs_t >= 0.5) & (abs_t < 1.5) phi_t[mask2] = (1 - np.cos(2 * np.pi * (1.5 - abs_t[mask2]) / M)) / (2 * (1 - cos_term_M)) return phi_t # Example usage: M = 10 # Number of control points t_values = np.linspace(-2, 2, 400) phi_values = exponential_basis(t_values, M) plt.figure(figsize=(10, 6)) plt.plot(t_values, phi_values, label=f'Exponential Basis (M={M})') plt.title('Exponential Basis Function') plt.xlabel('t') plt.ylabel('phi(t)') plt.grid(True) plt.legend() plt.show() ``` -------------------------------- ### Exponential Hermite Coefficients Calculation Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/exponentialhermite.rst Provides the complex mathematical formulas for calculating the coefficients a1, b1, c1, d1, a2, b2, c2, and d2, which depend on the number of control points M and the constant pi. ```math a1(M) = (j*(2*pi/M)+1 + exp(j*(2*pi/M)) * (j*(2*pi/M)-1)) / q(M) b1(M) = -(j*(2*pi/M) * (exp(j*(2*pi/M)) + 1)) / q(M) c1(M) = 1 / q(M) d1(M) = -exp(j*(2*pi/M)) / q(M) a2(M) = p(M) / (j*(2*pi/M) * (exp(j*(2*pi/M))-1) * q(M)) b2(M) = -(exp(j*(2*pi/M))-1) / q(M) c2(M) = (exp(j*(2*pi/M)) - j*(2*pi/M) - 1) / (j*(2*pi/M) * (exp(j*(2*pi/M))-1) * q(M)) d2(M) = -exp(j*(2*pi/M)) * (exp(j*(2*pi/M))*(j*(2*pi/M)-1) + 1) / (j*(2*pi/M) * (exp(j*(2*pi/M)) - 1) * q(M)) ``` -------------------------------- ### Least-Squares Minimization for Control Points Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/data_approximation.rst This snippet describes the objective function to be minimized to find the best-fit control points \(\mathbf{C}\). It uses the L2 norm to minimize the difference between the approximated and actual data points. ```math \| \mathbf{P} - \mathbf{\Phi} \mathbf{C} \|^2_2 ``` -------------------------------- ### Control Point Matrix \(\mathbf{C}\) Definition Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/data_approximation.rst Defines the control point matrix \(\mathbf{C}\), which is a column vector of size \(M \times 1\) containing the spline control points \(c[k]\). ```math \mathbf{C} = \begin{bmatrix} c[0] \\ \vdots \\ c[M-1] \end{bmatrix} ``` -------------------------------- ### Data Points Matrix \(\mathbf{P}\) Definition Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/data_approximation.rst Defines the data points matrix \(\mathbf{P}\), which is a column vector of size \(N \times 1\) containing the data points \(p[i]\) to be approximated. ```math \mathbf{P} = \begin{bmatrix} p[0] \\ \vdots \\ p[N-1] \end{bmatrix} ``` -------------------------------- ### Plot Cubic Hermite Basis Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/cubichermite.rst Generates a plot for the Cubic Hermite basis functions. ```python import pyplots.plot_cubichermite ``` -------------------------------- ### Spline Approximation Equation Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/data_approximation.rst This snippet represents the fundamental equation for spline approximation, where data points \(p[i]\) are approximated by a spline model with control points \(c[k]\). It assumes a periodic spline model. ```math p[i] = \sum_{k=0}^{M-1}c[k]\phi\left(\frac{Mi}{N}-k\right). ``` -------------------------------- ### Basis Matrix \(\mathbf{\Phi}\) Definition Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/data_approximation.rst Defines the basis matrix \(\mathbf{\Phi}\) used in the spline approximation. This matrix is of size \(N \times M\) and its elements are derived from the spline basis function \(\phi\). ```math \mathbf{\Phi} = \begin{bmatrix} \phi(0) & \phi(-1) & \dots & \phi(-(M-1)) \\ \phi\left(\frac{M}{N}\right) & \phi\left(\frac{M}{N}-1\right) & \dots & \phi\left(\frac{M}{N}-(M-1)\right) \\ \vdots & \vdots & \ddots & \vdots \\ \phi\left(\frac{(N-1)M}{N}\right) & \phi\left(\frac{(N-1)M}{N}-1\right) & \dots & \phi\left(\frac{(N-1)M}{N}-(M-1)\right) \end{bmatrix} ``` -------------------------------- ### B-spline Basis Functions Definitions Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/polynomial.rst Mathematical definitions of B-spline basis functions of orders 0, 1, 2, and 3. These are fundamental in spline interpolation and approximation. ```latex \beta_0(t)=\begin{cases} 1, \quad t\in [-\frac{1}{2}, \frac{1}{2}] \\ 0, \quad \mathrm{elsewhere} \end{cases} ``` ```latex \beta_1(t)=\begin{cases} 1-|t|, \quad |t|\in [0, 1] \\ 0, \quad \mathrm{elsewhere} \end{cases} ``` ```latex \beta_2(t)=\begin{cases} \frac{1}{2}t^2 + \frac{3}{2}t + \frac{9}{8}, \quad t\in [-\frac{3}{2}, -\frac{1}{2}[ \\ \frac{3}{4}-t, \quad t\in [-\frac{1}{2}, \frac{1}{2}[ \\ \frac{1}{2}t^2 - \frac{3}{2}t + \frac{9}{8}, \quad t\in [\frac{1}{2}, \frac{3}{2}] \\ 0, \quad \mathrm{elsewhere} \end{cases} ``` ```latex \beta_3(t)=\begin{cases} \frac{2}{3} - |t|^2 + \frac{1}{2}|t|^3, \quad |t|\in [0, 1[ \\ \frac{1}{6}(2 - |t|)^3, \quad |t| \in [1, 2] \\ 0, \quad \mathrm{elsewhere} \end{cases} ``` -------------------------------- ### Plot Exponential Hermite Basis Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/exponentialhermite.rst Generates a plot of the Exponential Hermite basis functions. This is typically implemented in Python using libraries like matplotlib. ```python import matplotlib.pyplot as plt import numpy as np # Assuming the functions and coefficients are defined elsewhere in the script # For example: # def calculate_coefficients(M): # # ... calculations for a1, b1, c1, d1, a2, b2, c2, d2 ... # return a1, b1, c1, d1, a2, b2, c2, d2 # def phi_1(t, M, coeffs): # # ... implementation using coeffs ... # pass # def phi_2(t, M, coeffs): # # ... implementation using coeffs ... # pass # M = 5 # Example number of control points # coeffs = calculate_coefficients(M) # t_values = np.linspace(-2, 2, 400) # plt.figure() # plt.plot(t_values, [phi_1(t, M, coeffs) for t in t_values], label='phi_1,M') # plt.plot(t_values, [phi_2(t, M, coeffs) for t in t_values], label='phi_2,M') # plt.xlabel('t') # plt.ylabel('Basis Function Value') # plt.title(f'Exponential Hermite Basis Functions (M={M})') # plt.legend() # plt.grid(True) # plt.show() print('Plotting code for Exponential Hermite basis functions.') ``` -------------------------------- ### g_1,M(t) and g_2,M(t) Definitions Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/exponentialhermite.rst Defines the core exponential polynomial functions g_1,M(t) and g_2,M(t) for the interval [0, 1[, involving coefficients a, b, c, d and complex exponentials. ```math g_1,M(t) = { a_1(M) + b_1(M) t + c_1(M) e^(j * 2*pi/M * t) + d_1(M) e^(-j * 2*pi/M * t) t in [0,1[ 0 elsewhere } g_2,M(t) = { a_2(M) + b_2(M) t + c_2(M) e^(j * 2*pi/M * t) + d_2(M) e^(-j * 2*pi/M * t) t in [0,1[ 0 elsewhere } ``` -------------------------------- ### Cubic Hermite Basis Function Phi_2 Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/cubichermite.rst Defines the second Cubic Hermite basis function, phi_2(t), which is non-zero for |t| in the range [0, 1]. ```math \phi_2(t)=\begin{cases} t(|t|-1)^2 & |t| \in [0,1] \\ 0 & \mathrm{elsewhere} \end{cases} ``` -------------------------------- ### Cubic Hermite Basis Function Phi_1 Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/cubichermite.rst Defines the first Cubic Hermite basis function, phi_1(t), which is non-zero for |t| in the range [0, 1]. ```math \phi_1(t)=\begin{cases} (2|t|+1)(|t|-1)^2 & |t| \in [0,1] \\ 0 & \mathrm{elsewhere} \end{cases} ``` -------------------------------- ### Exponential Hermite Basis Function Definitions Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/exponentialhermite.rst Defines the piecewise mathematical structure of the Exponential Hermite basis functions, phi_1,M(t) and phi_2,M(t), based on the g_1,M(t) and g_2,M(t) functions. ```math phi_1,M(t) = { g_1,M(t) t >= 0 g_1,M(-t) t < 0 } phi_2,M(t) = { g_2,M(t) t >= 0 -g_2,M(-t) t < 0 } ``` -------------------------------- ### Catmull Rom Basis Mathematical Definition Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/catmullrom.rst The mathematical definition of the Catmull Rom basis function, used in spline interpolation. This function defines the shape and behavior of the spline segments. ```math \phi(t)=\begin{cases} \frac{3}{2}|t|^3 - \frac{5}{2}|t|^2 + 1, \quad |t| \in [0,1[ \\ -\frac{1}{2}|t|^3 + \frac{5}{2}|t|^2 - 4|t| + 2, \quad |t| \in [1,2] \\ 0, \quad \mathrm{elsewhere} \end{cases} ``` -------------------------------- ### Exponential Basis Function Definition Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/exponential.rst Defines the exponential basis function mathematically. The function's behavior depends on the absolute value of 't' relative to 'M', the number of control points. ```math \phi(t)=\begin{cases} \frac{\cos\frac{2\pi|t|}{M}\cos\frac{\pi}{M}-\cos\frac{2\pi}{M}}{1-\cos\frac{2\pi}{M}}, & |t| \in [0,\frac{1}{2}[\\ \frac{1-\cos\frac{2\pi\left(\frac{3}{2}-|t|\right)}{M}}{2\left(1-\cos\frac{2\pi}{M}\right)}, & |t| \in [\frac{1}{2}, \frac{3}{2}[\\ 0, & \mathrm{elsewhere} \end{cases} ``` -------------------------------- ### Interpolatory Basis Function Condition Source: https://github.com/epfl-center-for-imaging/splinebox/blob/main/docs/theory/basis_function.rst Defines the condition for a basis function to be interpolatory, where the function value is 1 at integer 0 and 0 at all other integers. This property relates control points and spline values at integer locations. ```math \phi(k) =\begin{cases} 1, \quad k=0 \\ 0, \quad k \in \mathbb{Z}_{\ne 0}. \end{cases} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.