The package comprises of a graphical utility to place uniform B-spline control points and see how the B-spline is redrawn as control points or control point weights are adjusted, and functions to estimate B-splines with known knot vector, given a set of noisy data points either with known or unknown associated parameter values.As regards the interactive interface, the user is shown a figure window with axes in which to choose control points of a uniform B-spline. As points are placed in the axes, the B-spline of specified order is drawn progressively. The user may terminate adding control points by pressing ENTER or ESC, or may place the last control point with a right mouse button click.Once done, control points may be adjusted with drag-and-drop. Hold down the left mouse button over any control point and drag it to another location. Control point adjustment works in 3D; use the rotation tool to set a different camera position. It is also possible to explicitly set the x, y and z coordinates as well as the weight of a control point: click on the point, enter new values and hit ENTER.As regards the non-interactive interface, functions include calculating and drawing basis functions, computing points of a (weighted or unweighted) B-spline curve with de Boor's algorithm, and estimating B-spline control points given noisy data, either with or without parameter values associated with the observed data points.From a programmers' perspective, this example illustrates how to use nested functions to extend variable scope, implement drag-and-drop operations, combine normalized and pixel units for control docking and register multiple callbacks for a single event in an interactive user interface.USAGEThe simplest way to get started is to run "bspline_gui", which activates the figure window to place B-spline control points interactively. Examples are bundled to illustrate various B-spline curve computation and approximation methods.

Affine and B-spline grid based registration and data-fitting of two 2D color/grayscale images or 3D volumes or point-data. Registration can be done intensity / pixel based, or landmark / corresponding points based (See OpenSurf), or a combination.Description Pixel-based registration:This function is an (enhanced) implementation of the b-spline registration algorithm in D. Rueckert et al. "Nonrigid Registration Using Free-Form Deformations: Application to Breast MR Images". Including the smoothness penalty of Rueckert (thin sheet of metal bending energy), and Jacobian (diffeomorphic) function. Also including, localized normalized mutual information as registration error, allowing the images or volumes to be of a different type/modality for instance a MRI T1 and T2 patient scan.How it works:A grid of b-spline control points is constructed which controls the transformation of an input image. An error measure is used to measure the registration error between the moving and static image. The quasi newton Matlab optimizer fminlbfgs (also on Mathworks) is used to move the control points to achieve the optimal registration between both images with minimal registration error.Usage:- The function image_registration.m is easy to use, and contains examples in the help, and will fit most applications. (If you want to write your own specialized registration code study the registration examples)- The function point_registration is fast fitting of a b-spline grid to 2D/3D corresponding points, for landmark based registration.- There is also the function manually_warp_images which allow control grid changes with the mouse, to get better registration.First, you need to compile mex / C code with compile_c_files.m. (2D registration also works without mex files but will be slower)The multi-threaded mex code supports Windows, Linux (and Mac OS?)Some Features:- 2-D / 3-D Eulerian strain tensor images can be made from the transformations fields. For example to describe cardiac motion in the images.- Landmarks can be used for already known corresponding points (for example from Sift). Influence of every landmark on the registration process can be adjust. - It is possible to register a number of movie frames by using the registration grid of previous two images as initial registration grid of the next two images.- It is possible to mask parts of the images, to decrease or increase the influence of an image structure on the registration result.Literature:- D. Rueckert et al. "Nonrigid Registration Using Free-Form Deformations: Application to Breast MR Images". - Seungyong Lee, George Wolberg, and Sung Yong Shing, "Scattered Data interpolation with Multilevel B-splines"note:- B-spline registration is slower and more complex than demon registration see:http://www.mathworks.fr/matlabcentral/fileexchange/loadFile.do?objectId=21451 - Why still use B-spine registration?, because the resulting transformation-field corresponds better to real-live deformation than transformation fields from fluid registration.Please report bugs, successes and questions.

A numerical experiment described in http://dx.doi.org/10.1109/TIE.2007.909064 [*] is reproduced here. In [*] the forgetting mechanism is employed to robustify the control scheme. By contract, in http://dx.doi.org/10.1109/IECON.2013.6700120 [**] weight constraints are used instead of forgetting and that turns out to robustify the controller. Hence, the same idea has been tested also in the B-spline based repetitive neurocontroller proposed in [*]. To be clear, I haven't invented the controller introduced in this model. I've just modified the robustification mechanism used in [*]. You can play here with both mechanisms and decide for yourself which one of them is more suitable for your application. You can even combine them. It should be noted that [**] uses a global update rule and not necessarily the same robustification mechanisms are equally effective in both controllers. For more information please see m-files and our conference paper: M. Malkowski, B. Ufnalski and L. M. Grzesiak, B-spline based repetitive controller revisited: error shift, higher-order polynomials and smooth pass-to-pass transition, ICSTCC 2015, http://ufnalski.edu.pl/proceedings/icstcc2015/ .

Using Implicit B-Splines for Surface Reconstruction out of 3D point clouds.Please cite the following paper, in case of using the code:Rouhani M. and Sappa A.D., Implicit B-spline fitting using the 3L algorithm, IEEE Conference on on Image Processing (ICIP'11), 2011.

fastBSpline - A fast, lightweight class that implements non-uniform B splines of any order Matlab's spline functions are very general. This generality comes at the price of speed. For large-scale applications, including model fitting where some components of the model are defined in terms of splines, such as generalized additive models, a faster solution is desirable. The fastBSpline class implements a lightweight set of B-spline features, including evaluation, differentiation, and parameter fitting. The hard work is done by C code, resulting in up to 10x acceleration for evaluating splines and up to 50x acceleration when evaluating of spline derivatives. Nevertheless, fastBSplines are manipulated using an intuitive, high- level object-oriented interface, thus allowing C-level performance without the messiness. Use CompileMexFiles to compile the required files. If mex files are not available, evaluation will be done in .m code, so you may still use the code if you can't use a compiler for your platform. B splines are defined in terms of basis functions: y(x) = sum_i B_i(x,knots)*weights_i B (the basis) is defined in terms of knots, a non-decreasing sequence of values. Each basis function is a piecewise polynomial of order length(knots)-length(weights)-1. The most commonly used B-spline is the cubic B-spline. In that case there are 4 more knots than there are weights. Another commonly used B-spline is the linear B-spline, whose basis function are shaped like tents, and whose application results in piecewise linear interpolation. The class offers two static functions to fit the weights of a spline: lsqspline and pspline. It includes facilities for computing the basis B and the derivatives of the spline at all points. Constructor: sp = fastBSpline(knots,weights); Example use: %Fit a noisy measurement with a smoothness-penalized spline (p-spline) x = (0:.5:10)'; y = sin(x*pi*.41-.9)+randn(size(x))*.2; knots = [0,0,0,0:.5:10,10,10,10]; %Notice there are as many knots as observations %Because there are so many knots, this is an exact interpolant sp1 = fastBSpline.lsqspline(knots,3,x,y); %Fit penalized on the smoothness of the spline sp2 = fastBSpline.pspline(knots,3,x,y,.7); clf; rg = -2:.005:12; plot(x,y,'o',rg,sp1.evalAt(rg),rg,sp2.evalAt(rg)); legend('measured','interpolant','smoothed'); fastBSpline properties: outOfRange - Determines how the spline is extrapolated outside the range of the knots knots - The knots of the spline (read only) weights - The weights of the spline (read only) fastBSpline Methods: fastBSpline - Construct a B spline from weights at the knots lsqspline - Construct a least-squares spline from noisy measurements pspline - Construct a smoothness-penalized spline from noisy measurements evalAt - Evaluate a spline at the given points getBasis - Get the values of the underlying basis at the given points Btimesy - Evaluate the product getBasis(x)'*y dx - Returns another fastBSpline object which computes the derivative of the original spline Disclaimer: fastBSpline is not meant to replace Matlab's spline functions; it does not include any code from the Mathworks

A MATLAB toolbox 'bsspdfest' implementing nonparametric probability function estimation using normalized B-splines was developed. The toolbox implements nonparametric probability function estimation procedures for one or more dimensions using a B-spline series for one-dimensional data and a tensor product B-spline series for multi-dimensional data. The toolbox takes advantage of the direct addressing of MATLAB arrays up to three dimensions and various vectorization approaches to speed up the computations. For data dimensions greater than three indirect addressing is used, converting multi-dimensional indices into linear array addressing, making this function slower.The toolbox supports the computation of the PDF, CDF, and survivor functions for data of all dimensions as well as the inverse CDF (ICDF) and cumulative hazard functions for one dimensional data. The toolbox also supports the creation and use of gridded interpolants to provide very fast approximate evaluation of the B-spline series or tensor product series for the probability functions. Bounded domains are also now supported for all dimensions.Version 3.1.0 of the bsspdfest toolbox has just been released! The major changes were to the interfaces for the estimation and evaluation functions. They were changed from using positional arguments to varargin. In addition, a memory saving evaluation of gridded interpolants was introduced to avoid generating the entire grid of points before creating the gridded interpolant. A variety of minor improvements and corrections to the documentation in the headers were also made. See the Changes.txt file for details.

Computes the B-spline approximation from a set of coordinates (knots).The number of points per interval (default: 10) and the order of the B-spline (default: 3) can be changed. Periodic boundaries can be used.It works on any dimension (even larger than 3...).This code is inspired from that of Stefan Hueeber and Jonas Ballani [1].Example (see image):%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%rng(1) % Set random seed for reproductility XY=rand(5,2); % Random set of 5 points in 2D BS2=BSpline(XY); % Default order=3 (quadratic) BS3=BSpline(XY,'order',4); % order=4 -> cubic B-splineBSper=BSpline(XY,'periodic',true);h=plot(XY(:,1),XY(:,2),'-o',BS2(:,1),BS2(:,2),BS3(:,1),BS3(:,2),'--',BSper(:,1),BSper(:,2),'-.'); legend('Control polygon','Quadratic','Cubic','Quadratic periodic')set(h, 'LineWidth',2)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%[1] http://m2matlabdb.ma.tum.de/download.jsp?MC_ID=7&SC_ID=7&MP_ID=485

B-splines is a natural signal representation for continous signals, wheremany continous-domain operations can be carried out exactly once theB-spline approximation has been done.The B-spline estimation procedure in this toolbox using allpole filtersis based on the classic papers by M. Unser and others [1,2,3], it allowsvery fast estimation of B-spline coefficients when the sampling grid isuniform. Evaluation/interpolation is also a linear filter operation.The toolbox has two layers; a set of functions for the fundamentaloperations on polynomial B-splines, and an object-oriented wrapper whichkeeps track of the properties of a spline signal and overload commonoperators.The representation is dimensionality-independent, and much of the code isvectorized.Units tests are included, these require the MATLAB xunit toolbox.[1] M. Unser, A. Aldroubi, M. Eden, "B-Spline Signal Processing: PartI-Theory", IEEE Transactions on Signal Processing, vol. 41, no. 2, pp.821-833, February 1993[2] M. Unser, A. Aldroubi, M. Eden, "B-Spline Signal Processing: PartII-Efficient Design and Applications", IEEE Transactions on SignalProcessing, vol. 41, no. 2, pp. 834-848, February 1993[3] M.Unser, "Splines: A Perfect Fit for Signal and Image Processing",IEEE Signal Processing Magazine, vol. 16, no. 6, pp. 22-38, 1999

The Spline toolbox allows the definition, evaluation and visualization of spline curves and surfaces based on standard B-splines. Furthermore, it provides an approximation algorithm with the possibility to consider additional smoothing or interpolation conditions.

A fast surface reconstruction is implemented in this set of codes. Given a 3D cloud of points accompanied by normal vectors an implicit b-spline surface will be reconstructed.Please cite the following paper, in case of using the code:Rouhani M. and Sappa A.D., Implicit B-spline fitting using the 3L algorithm, IEEE Conference on on Image Processing (ICIP'11), 2011.Mohammad Rouhani, Angel Domingo Sappa: Implicit B-spline fitting using the 3L algorithm. ICIP 2011: 893-896

Interpolación por basic splines. Para apoyo en las clases de creación de videojuegos de la Universidad Loyola, en Sevilla.

2D Digital Image Correlation Matlab Software. The most up to date code now uses my github: justinblaber/ncorr_2D_matlab

Computes the H-infinity optimal causal filter (indirect B-spline filter) for the cubic spline.[INPUT]d: delay[OUTPUT]psi: the optimal filter psi(z) in a TF objectgopt: optimal valueThis file is based on the following paper:M. Nagahara and Y. Yamamoto,H-infinity optimal approxmation for causal spline interpolation,Signal Processing, Vol. 91, No. 2, pp. 176-184, 2011.

Class to enable BSpline signal and image processing. Based off of the papers:M. Unser, A. Aldroubi, and M. Eden, "B-Spline Signal Processing: Part I - Theory," IEEE Trans Sig Proc, 41(2):821-833, Feb 1993.M. Unser, A. Aldroubi, and M. Eden, "B-Spline Signal Processing: Part II - Efficient Design and Applications," IEEE Trans Sig Proc, 41(2):834-848, Feb 1993.The class constructor, bsarray.m, takes as input a n-dimensional array, and computes B-spline coefficients for interpolating or smoothing splines of any order less than or equal to 7.Other member functions enable various computations/manipulations:indirectFilter.m: reconstructs a signal from BSpline coefficients stored in a bsarray objectpartial.m: analytically computes the partial derivative, returning a bsarray object of one less degree in the desired dimensioninterp1.m, interp2.m, interp3.m: overloaded versions of interp1, interp2, and interp3, that operate on bsarray objects to interpolate the original data.See help on each of these functions for instructions on how to call them.

a function to compute the b-spline points on a gridusage y = spline_recursion (u,n)n is the order of the spline u is the grid pointexample:t=linspace(-2,10,10000);y1=spline_recursion (t,2);y2=spline_recursion (t,3);y3=spline_recursion (t,4);y4=spline_recursion (t,10);subplot(2,2,1), plot(t,y1), title('b-spline order = 2');subplot(2,2,2), plot(t,y2), title('b-spline order = 3');subplot(2,2,3), plot(t,y3), title('b-spline order = 4');subplot(2,2,4), plot(t,y4), title('b-spline order = 10');

The code implements the B-Spline curve and surface encryption method proposed in the following work:Moysis, L., Lawnik, M., Antoniades, I. P., Kafetzis, I., Baptista, M. S., & Volos, C. (2023). Chaotification of 1D maps by multiple remainder operator additions—application to B-spline curve encryption. Symmetry, 15(3), 726.https://www.mdpi.com/2073-8994/15/3/726 Please cite this work if you use the code below.The code is broken in sections. Run each section separately using ctr+enter, or by clicking the 'run section' button.Details about the encryption process are provided in the paper.The teapot data are available from the following link: https://people.sc.fsu.edu/~jburkardt/data/bezier_surface/bezier_surface.html Please also cite the link above if you intend to use the data.The codes for generating the B-spline curves and surfaces are taken from this work: https://www.researchgate.net/publication/329337381_Introduction_to_Computer_Aided_Geometric_Design_-_A_student's_companion_with_Matlab_examples_2nd_Edition Lazaros MoysisYoutube channel: https://www.youtube.com/@lazarosmoysis5095 RG: https://www.researchgate.net/profile/Lazaros-Moysis

bsn1.m implements a zerophase low pass filter using a novel structure called B-Spline Networks (BSN).This function was originally developed for use with the LFFC (learning feedforward control).A nice aspect is that, a parametric transfer functon can be obtained for BSN.For details, see Chen Y, Moore KL, Bahl V, "Improved Path Following of USU ODIS by Learning Feedforward Controller Using Dilated B-Spline Network," IEEE International Symposium on Computational Intelligence in Robotics and Automation, Banff, Alberta, Canada, July-August 2001, PDF file is athttp://www.csois.usu.edu/publications/pdf/pub049.pdf

This model employs the idea presented in http://dx.doi.org/10.1109/TNN.2004.824268 . Some modifications described in http://www.mathworks.com/matlabcentral/fileexchange/49023-b-spline-based-repetitive-neurocontroller are implemented. A very concise C-code (yet still readable) developed by Michal Malkowski for http://www.mathworks.com/matlabcentral/fileexchange/49077-b-spline-network-based-repetitive-controller--c-code- is used. The plant is identical as in http://www.mathworks.com/matlabcentral/fileexchange/48791-iterative-learning-motion-control . This solution comes with some drawbacks. I encourage you to identify their roots on your own -- and fix them :). The quadratic spline is more smooth than the linear one but is it better? When testing electric drives always examine the shape of the current(s). And remember to click the Build button in the S-Function block before attempting to run the model. More info: M. Malkowski, B. Ufnalski and L. M. Grzesiak, B-spline based repetitive controller revisited: error shift, higher-order polynomials and smooth pass-to-pass transition, 19th International Conference on System Theory, Control and Computing (ICSTCC), 2015, http://ufnalski.edu.pl/proceedings/icstcc2015/ .

This function evaluates a B-spline at a given point. It performs De Boor's algorithm in reverse order, increasing the calculation speed.

Similar to "bsn1.m", "bsn2.m" provides dilation 2 in the B-Spline network (BSN) which are used as a new way of performing approximate zero-phase low pass filtering.The transfer function of the dilated BSN filter can be derived with one parameter.For more details, check the paperhttp://www.csois.usu.edu/publications/pdf/pub049.pdf

First, Turn On the select points, then select any numbers of points as you wish.To finish selection procedure, must to select the fitsr point.finally by selecting any types of curve, it would plot it.notice: it is possible to move the points and curve automatically will change.

In this code, the image is defined using B-spline level set functions and they are deformed by using a composition approach. The computation composed of efficient algorithms for calculating the B-spline coefficients and gradients of the images by using B-spline filters.

Given the number of control points(N), the order of Splines (K), a sequence of knot vector (T), and the file name of txt format, the function basisfunc_NBS computes the nonrational (unweighted) basis functions N_ik(t) for each segment up to the Kth order, and writes the data to the txt file.Add an input variable w for weights, the function basisfunc_NURBS computes the rational (weighted) basis functions R_ik(t) for each segment at the Kth order.

The program splineLength.m calculates numerically the arc length of an arbitrary B-spline. Numerical integration uses "waypoints" for high precision.

This model is a C-code version of http://www.mathworks.com/matlabcentral/fileexchange/49023-b-spline-based-repetitive-neurocontroller uploaded by Bartlomiej Ufnalski.

The main file interpMatrix.m in this package creates a sparse Toeplitz-like matrix representing a regularly-spaced interpolation operation between a set of control points. The user can specify the interpolation kernel, the number of control points, the spacing between the control points, and certain boundary conditions governing the behavior at the first and last control point. The tool has obvious applications to interpolation, curve fitting, and signal reconstruction. More generally, the ability to represent interpolation as a matrix is useful for minimizing cost functions involving interpolation operations. For such functions, the interpolation matrix and its transpose inevitably arise in the gradient. The file Example1D.m in the package gives an example application of the tool to upsampling/signal reconstruction using cubic B-splines with different possible boundary conditions. The screenshot above shows the output of this example, and illustrates how improved signal reconstruction is obtained using boundary extrapolation by mirroring. Although the matrix generated by interpMatrix() is for 1D interpolation, it can be generalized to n-dimensional tensorial interpolation using kron(). However, a more efficient alternative to kron() is this tool, http://www.mathworks.com/matlabcentral/fileexchange/25969-efficient-object-oriented-kronecker-product-manipulationwhose usage in conjunction with interpMatrix() is illustrated in the file Example2D.m, a generalization of Example1D.m to two dimensions. USAGE: T=interpMatrix(kernel, origin, numCtrlPoints, CtrlPointSep, extraprule) out: T: sparse output matrix. The columns of T are copies of a common interpolation kernel (with adjustments for boundary conditions), but shifted in increments of the CtrlPointSep parameter (see below) to different control point locations. The result is that if x is a vector of coefficients, then T*x is the interpolation of these coefficients on the interval enclosed by the control points. in: kernel: vector containing samples of an interpolation function, shifted copies of which will be used to create the columns of T. This vector never needs to be zero-padded. Zero-padding is derived automatically from the other input arguments below. origin: Index i such that kernel(i) is located at the first control point. It is also possible to specify the origin using the following string options: 'max': origin i will be selected where kernel(i) is maximized. 'ctr': origin i will be selected as ceil((length(kernel)+1)/2). numCtrlPoints: number of control points in the system. CtrlPointSep: a stricly positive integer indicating the number of samples between control points. extraprule: Initially, the shifted copies of "kernel" form the columns of T. The columns are then modified to satisfy edge conditions indicated by the "extraprules" parameter. Options for this parameter are the strings 'zero', 'mirror','rep', 'circ', or 'allcontrib'. These are explained in the help doc.

Coefficients of the Cubics For Nonuniform Cubic Spline InterpolationIncludes first or second derivative end conditions (so, as special cases, it includes natural and clamped cubic splines)If you want to evaluate the spline, use splineA.m

This GUI visualizes the basis functions of spline spaces. Different bases can be chosen from the following: 1) B-Splines 2) Cardinal Splines

This model merges ideas presented in https://www.mathworks.com/matlabcentral/fileexchange/49023-b-spline-based-repetitive-neurocontroller and https://www.mathworks.com/matlabcentral/fileexchange/47847-plug-in-direct-particle-swarm-repetitive-controller. The novelty is that B-spline based repetitive controller has weights trained using PSO.

ffts, Performs the fast Fourier transform (FFT) on scatter data. Yq = ffts(X,V,Xq) or Yq = ffts(X,V,Xq, method, window) inputs, X : Array with positions [m x 1] V : Array with values [m x 1] Xq : Node locations [ n x 1], with equally spaced points (see linspace) (optional) method : 1. 'grid', gridding (Default) 2. 'fit' , b-spline fit window : 1. 'bspline', bspline (default) 2. 'kaiser', kaiser Bessel function outputs, Fq : The Fourier spectrum of the scatter data [ n x 1]. Gridding: 1. The scattered values (V) at positions (X) are smoothed ( convolution ) by a kernel to a regular grid. With the grid a 2 times oversampled version of Xq 2. The data is multiplied with a set of density compensation weights. Calculate as in step 1, but instead all values are set to 1. The density compensation is 1 divided by this result. 3. The values on the regular grid are converted to the fourier domain using a FFT. 4. Trim field of view, to size of Xq. This compensates the oversampling of step 2. The sidelobes due to finite window size are now clipped off. 5. The fourier domain is multipled by an apodization correction function. Which is the 1/Fourier Transform of the kernel of step 1 to remove the effect of the kernel. B-spline fit: 1. B-splines sampled on a regular grid are fitted to the values (V) at positions (X), so they least squares approximate the data. 2. At the regular grid (Xq), values are interpolated using the fitted B-splines 3. The FFT is done on the b-spline interpolated points

This is a function to draw a closed cubic B-Spline, based on by David Salomon (great book!), page 261 (closed cubic B-Spline curve).usage:closed_cubic_bspline(P,1) will compute and plot the closed B-Spline.closed_cubic_bspline(P) will only compute the interpolated points.notes:In my program, I used a step of 1/100; if you need higher density, you could modify the value of nj (set to 100) on line 35.

A little piece of code enabling quick modification of spline objects: clipping, shifting, and scaling in both x, and y.

"Sines and Splines - Variable Projection" demonstrates the separation of a signal into its periodic and aperiodic portions, whereby the period of the periodic portion is unknown. Therfore the signal is modelled by a linear combination of nonlinear basis functions. The separation is done via the variable projection method, which splits the problem into a one-dimensional nonlinear optimization, combined with a linear least-squares computation.This toolbox also provides a procedure for choosing an appropriate inital value for the nonlinear optimization.An added benefit of this method is, that it also permits calculating the covanriances of the linear coefficients of the model, enabling the calculation of confidence and prediction intervals.The periodic component is modelled by a set of harmonic basis functions. In this way any periodic shape can be modelled. The aperiodic component is modelled by a B-Spline.The toolbox contains the following support functions:harmonicBasis.m: creates a matrix with harmonic basis functions.bSplineBasis.m: creates a matrix with the B-Spline basis functions.bSplineBfn.m: support function for bSplineBasis.mFFTReal.m: computes the positive half spectrum for a real input signal; this is needed for the selection of a suitable initial value of the nonlinear optimization This code can also be considered as supplemental Material to the Paper:"Modelling Periodic Measurement Data Having a Piecewise Polynomial Trend Using the Method of Variable Projection"by: Johannes Handler, Dimitar Ninevski and Paul O'LearyOctober 2023https://arxiv.org/pdf/2109.07289.pdfThis paper presents a method for modelling periodic signals having an aperiodic trend using the method of variable projection. In particular, this paper focuses on using B-Splines to model the a-periodic portion. The MATLAB files presented here implement the numerical testing of the method with specific examples.Additionally, the paper presents a thorough algebraic formulation of the method, as well as a comparison to using global polynomial approximation. It is proven that splines work better for modelling a more complicated aperiodic portion when compared to higher order polynomials. An added benefit of using the method of variable projection is the possibility to calculate the covariances of the linear coefficients of the model, which enable the calculation of confidence and prediction intervals.@INPROCEEDINGS{Handler2023, author={Handler, Johannes and Ninevski, Dimitar and O’Leary, Paul}, booktitle={IECON 2023- 49th Annual Conference of the IEEE Industrial Electronics Society}, title={Modelling Periodic Measurement Data Having a Piecewise Polynomial Trend Using the Method of Variable Projection}, year={2023}, pages={1-8}, doi={10.1109/IECON51785.2023.10312537}}Further information about this topic can also be found in,@inproceedings{OLeary2021, author={O'Leary, Paul and Ninevski, Dimitar}, booktitle={2021 IEEE International Instrumentation and Measurement Technology Conference (I2MTC)}, title={Estimating Parameters of a Sine Wave by the Method of Variable Projection}, year={2021}, pages={1-6}, doi={10.1109/I2MTC50364.2021.9459842}} @INPROCEEDINGS{Handler2021, author={Handler, Johannes and Ninevski, Dimitar and O’Leary, Paul}, booktitle={2021 7th International Conference on Mechanical Engineering and Automation Science (ICMEAS)}, title={Decomposition of a Periodic Perturbed Signal with Unknown Perturbation Frequency by the Method of Variable Projection}, year={2021}, pages={44-49}, doi={10.1109/ICMEAS54189.2021.00019}}

Direct spline interpolation of noisy data may result in a curve with unwanted oscillations. This is particularly bad if the slope of the curve is important. A better approach is to reduce the degrees of freedom for the spline and use the method of least squares to fit the spline to the noisy data. The deegres of freedom are connected to the number of breaks (knots), so the smoothing effect is controlled by the selection of breaks. SPLINEFIT:- A curve fitting tool based on B-splines- Splines on ppform (piecewise polynomial)- Any spline order (cubic splines by default)- Periodic boundary conditions- Linear constraints on function values and derivatives- Robust fitting scheme- Operates on ND arrays in the same way as SPLINE- Nonuniform distributions of breaksM-FILES ALSO INCLUDED:examples - Examples for splinefitppdiff - Differentiate piecewise polynomialppint - Integrate piecewise polynomial

This is a class for efficiently representing and manipulating N-fold Kronecker products of matrices (or of objects that behave like matrices) in terms of their operands only. Given matrices {A,B,C,D,...} and a scalar s, an object M of this class can be used to represent Matrix = s * A kron B kron C kron D kron ... (Eq. 1) where "A kron B" denotes kron(A,B), the Kronecker product of A and B. Internally, however, M stores the operands {s,A,B,C,D,...} separately, which is typically far more byte-compact than numerically expanding out the RHS of Eq. 1. Furthermore, many mathematical manipulations of Kronecker products are more efficient when done in terms of {s,A,B,C,D,...} separately than when done with the explicit numerical form of M as a matrix. The class overloads a number of methods and math operators in a way that exploits the Kronecker product structure accordingly. Among these methods/operators are: mtimes (*), times (.*) , tranpose (.') , ctranpose (') , rdivide (./), ldivide (.\), mldivide (\), mrdivide (/), inv, pinv, power, mpower, norm, sum, cond, eig, svd, abs, nnz, orth, chol, lu, qr, full, sparse, ... Some restrictions apply to these overloads. In particular, bi-operand math operations involving two KronProd objects, e.g. M1*M2, typically require the operands of each KronProd to be of compatible sizes. However, I find these restrictions to be satisfied often in applications. Consult "help KronProd/methodname" for more info on each method. Optionally also, read krontest.m for demonstrations of their use. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EXAMPLE #1: A primary application of this class is to efficiently perform separable tensorial operations, i.e., where a linear transform is applied to all columns of an array, then all rows, and so on. The following example is of a separable transformation of a 3D array X that transforms all of its columns via multiplication with a non-square matrix A, then transforms all rows by multiplication with B, then finally transforms all 3rd-dimensional axes by multiplication with C. Two approaches to this are compared. The first approach uses kron(). The second uses the KronProd class. Other operations are also shown for illustration purposes. Notice the orders of magnitude reduction both in CPU time and in memory consumption, using the KronProd object. %DATA m=25; n=15; p=40; mm=16; nn=n; pp=10; A=rand(mm,m); B=pi*eye(n); C=rand(pp,p); s=4; % a scalar X=rand(m,n,p); %METHOD I: based on kron() tic; Matrix = s*kron(C,kron(B,A)); y1 = Matrix*X(:); %The tensorial transformation y1=reshape(y1,[mm,nn,pp]); z1 = Matrix.'*y1(:); w1 = Matrix.'\z1; toc; %Elapsed time is 78.729007 seconds. %METHOD II: based on KronProd object tic; Object = KronProd({A,pi,C},[1 2 3],[m,n,p],s); %equivalent to Matrix above y2 = Object*X; % This operation could also have been implemented % as y2=reshape( Object*X(:) , [mm,nn,pp]); z2 = Object.'*y1; w2 = Object.'\z1; toc % Elapsed time is 0.003958 seconds. %%%ERROR ANALYSIS PercentError=@(x,y) norm(x(:)-y(:),2)/norm(x(:),'inf')*100; PercentError(y1,y2), % = 3.0393e-012 PercentError(size(y1),size(y2)), % = 0 PercentError(z1,z2), % = 1.3017e-012 PercentError(w1,w2), % = 4.3409e-011 %%%MEMORY FOOTPRINT >> whos Matrix Object Name Size Bytes Class Attributes Matrix 2400x15000 288000000 double Object 2400x15000 8102 KronProd %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%EXAMPLE #2: As a more practical example, the KronProd class is very useful in conjunction with the following tool for signal interpolation/reconstruction:http://www.mathworks.com/matlabcentral/fileexchange/26292-regular-control-point-interpolation-matrix-with-boundary-conditionsAn example involving 2D signal reconstruction using cubic B-splines is provided in the file Example2D.m at the above link.

NURBS Toolbox official site ishttp://www.aria.uklinux.net/nurbs.php3% NURBS Toolbox. % Version 1.0 % % demos - NURBS demonstrations % % nrbmak - Construct a NURBS from control points and knots. % nrbtform - Applying scaling, translation or rotation operators. % nrbkntins - Knot insertion/refinement. % nrbdegelev - Degree elevation. % nrbderiv - NURBS representation of the derivative. % nrbdeval - Evaluation of the NURBS derivative. % nrbkntmult - Find the multiplilicity of a knot vector. % nrbreverse - Reverse evaluation direction of the NURBS. % nrbtransp - Swap U and V for NURBS surface. % nrbline - Construct a straight line. % nrbcirc - Construct a circular arc. % nrbrect - Construct a rectangle. % nrb4surf - Surface defined by 4 corner points. % nrbeval - Evalution of NURBS curve or surface. % nrbextrude - Extrude a NURBS curve along a vector. % nrbrevolve - Construct surface by revolving a profile. % nrbruled - Ruled surface between twp NURBS curves. % nrbcoons - Construct Coons bilinearly blended surface patch. % nrbplot - Plot NURBS curve or surface. % % bspeval - Evaluate a univariate B-Spline. % bspderiv - B-Spline representation of the derivative % bspkntins - Insert a knot or knots into a univariate B-Spline. % bspdegelev - Degree elevation of a univariate B-Spline. % % vecnorm - Normalise the vectors. % vecmag - Magnitaude of the vectors. % vecmag2 - Squared Magnitude of the vectors. % vecangle - Alternative to atan2 (0 <= angle <= 2*pi) % vecdot - Dot product of two vectors. % veccross - Cross product of two vectors. % vecrotx - Rotation matrix around the x-axis. % vecroty - Rotation matrix around the y-axis. % vecrotz - Rotation matrix around the z-axis. % vecscale - Scaling matrix. % vectrans - Translation matrix. % % deg2rad - Convert degrees to radians. % rad2deg - Convert radians to degrees.

Get startedThe easiest way to test the provided code is to run the script "test_step_import". Plotting functions are illustrating your import and help to check whether the import worked correctly. A set of really simple geometries is provided - they start with "geometry_". The import was also tested for more complex geometries. However, these files cannot be provided due to licensing reasons.Import functionThe main contribution is the step import function "import_STEP.m". It reads a geometry from a .stp/.step file. The type of geometry is limited to NURBS surfaces (including B-splines of course). Multiple patches and trimmed patches are recognized. The aim of the code is to make the NURBS description of geometries created in CAD available and usable in Matlab.Plotting of imported geometryWhen running the script "test_step_import", you see automatically plots in the parametric and physical space. Thereby, you can easily check whether your import worked correctly. You can change the resolution of the plots:resolution_param = 10; % resolution of trimming curves in the parametric spaceresolution_phys.surf = 2; % resolution of surfaces in the physical spaceresolution_phys.curv = 10; % resolution of curves in the physical spaceCreating a step fileI created my step files with Rhino 7, but hopefully every other CAD software should work as well. Important is that the parametric description of your trimming curves is included in the step file. In Rhino, this is an extra option in the export menu. Furthermore, I select the AP214 AutomativeDesign format when exporting my geometries.Problems with your importIn case your geometry cannot be imported but is a NURBS surface, please contact me. I can try to extend the import function for your geometry.

Implementation of the Borges-Pastva algorithm for fitting a single segment Bezier curve to an ordered set of data so as to minimize the total least squares distance. See Total least squares fitting of Bézier and B-spline curves to ordered dataCF Borges, T PastvaComputer Aided Geometric Design 19 (4), 275-289

Programs to1.Plot a Triangular Patch2.To Draw Parametric Surface 3.To Draw Ruled Surface4.To Draw Parametric Line5.To Draw Parametric Ellipse6.To Draw Inclined Parametric Ellipse 7.To Draw Parametric Circle8.Midpoint Line Algorithm9.Midpoint Circle Algorithm10.Plot Parallel Line Parametric11.Plot Hermite Curve 12.Inscribe Ellipse Circle Inside Rectangle13.DDA Line Algorithm14.Plot Bezier Curve15.Plot Bezier Surface16.Plot B-Spline Curve

MOMS (maximal-order-minimal-support) functions give the least number of supports for a given approximation order L. The stringent requirement of number of supports is critical to real-time signal processing, which is why sinc (the kernel that gives ideal reconstruction) is not used in practice. B-spline based interpolating kernels are usually used in spline interpolation. MOMS functions are constructed by b-spline functions. Here we provide an implementation of O-MOMS (optimal MOMS), which outperforms b-spline kernels of the same degree. This implementation uses DTFT to compute the coefficients in the prefiltering step [Thevenaz 2000]. For boundary condition, we assume periodic, which is scheduled to be changed to mirroring in the next release.Degrees of 0 through 5 are supported.Related papers:T. Blu et al.Minimal Support Interpolators with Optimum Approximation Properties, ICIP 1998;MOMS: Maximal-Order Interpolation of Minimal Support, IEEE Transactions on Image Processing Vol. 10, No.7, 2001;Phillippe Thevenaz et al.Interpolation Revisited, IEEE Transactions on Medical Imaging, Vol. 19, No. 7, 2000.

The purpose of this function is to provide a flexible and robust fit to one-dimensional data using free-knot splines. The knots are free and able to cope with rapid change in the underlying model. Knot removal strategy is used to fit with only a small number of knots.Optional L2-regularization on the derivative of the spline function can be used to enforce the smoothness.Shape preserving approximation can be enforced by specifying the lower and upper bounds of the derivative(s) of the spline function on sub-intervals. Furthermore specific values of the spline function and its derivative can be specified on a set of discrete data points.

This function "refinepatch" can refine any triangular mesh surface ( patch) with 4-split spline interpolation, see screenshot.Literature:The spline interpolation of the face edges is done by the Opposite Edge Method, described in: "Construction of Smooth Curves and Surfaces from Polyhedral Models" by Leon A. ShirmanHow it works:The tangents (normals) and velocity on the edge points of all edges are calculated. Which are later used for b-spline interpolation when splitting the edges.A tangent on an 3D line or edge is under defined and can rotate along the line, thus an (virtual) opposite vertex is used to fix the tangent and make it more like a surface normal.B-spline interpolate a half way vertices between all existing vertices using the velocity and tangent from the edge points. After splitting a new face list is constructed with 4 times as many faces.Implementation:Some Matlab files are also available as MEX files to allow quick refinement of large meshes.Please Leave a comment, if you find a bug, like the code or know improvements.

Stand-alone script file to trace rays through a refractive optical system. Only on-axis systems that have spherical and flat surfaces can be modeled. The code represents surface geometry by using rational Bezier patches which is a special case of the two parameter non-uniform rational b-spline. Two tables of input data are required. "Surfaces" is the first table and includes the system prescription (similar to lens editors used with other software). "InputRays" is the second table and includes the starting position and direction of rays to be traced. Example tables are included in the code for a Double Gauss Photographic Objective. Rays outside the aperture of any surface are ignored.

The sifting process is completed using a time varying filter technique.The local cut-off frequency is adaptively designed by fully facilitating the instantaneous amplitude and frequency information. Then nonuniform B-spline approximation is adopted as a time varying filter. In order to solve the intermittence problem, a cut-off frequency realignment algorithm is also introduced. Aimed at improving the performance under low sampling rates, a bandwidth criterion for intrinsic mode function (IMF) is proposed. TVF-EMD is fully adaptive and suitable for the analysis of linear and non-stationary signals. Compared with EMD, the proposed method is able to improve the frequency separation performance, as well as the stability under low sampling rates. Besides, the proposed method is robust against noise interference.TVF-EMD is from http://www.sciencedirect.com/science/article/pii/S0165168417301135To use this code, please cite our work: Li, Heng, Zhi Li, and Wei Mo. "A time varying filter approach for empirical mode decomposition." Signal Processing 138 (2017): 146-158.

A common request is to interpolate a set of points at fixed distances along some curve in space (2 or more dimensions.) The user typically has a set of points along a curve, some of which are closely spaced, others not so close, and they wish to create a new set which is uniformly spaced along the same curve.When the interpolation is assumed to be piecewise linear, this is easy. However, if the curve is to be a spline, perhaps interpolated as a function of chordal arclength between the points, this gets a bit more difficult. A nice trick is to formulate the problem in terms of differential equations that describe the path along the curve. Then the interpolation can be done using an ODE solver.As an example of use, I'll pick a random set of points around a circle in the plane, then generate a new set of points that are equally spaced in terms of arc length along the curve, so around the perimeter of the circle.theta = sort(rand(15,1))*2*pi;theta(end+1) = theta(1);px = cos(theta);py = sin(theta); 100 equally spaced points, using a spline interpolant.pt = interparc(100,px,py,'spline');% Plot the resultplot(px,py,'r*',pt(:,1),pt(:,2),'b-o')axis([-1.1 1.1 -1.1 1.1])axis equalgrid onxlabel Xylabel Ytitle 'Points in blue are uniform in arclength around the circle'You can now also return a function handle to evaluate the curve itself at any point. As well, CSAPE is an option for periodic (closed) curves, as long as it is available in your matlab installation.[~,~,foft] = interparc([],px,py,'spline');foft(0:0.25:1)ans = 0.98319 0.18257 -0.19064 0.98151 -0.98493 -0.17486 0.18634 -0.98406 0.98319 0.18257

I uploaded a zip file contains T-spline LAB app, a text file and .mat file. The .mat (SURFCACE) file is a created T-spline surface by this app and you just write its name and push botton Load T-spline surface.The text file (first model) is a vector of control points of a b-spline surface. you should write the name the file and size of the control point tensor product. then push botton Load B-spline Control Points vector.enjoy

Shape Context is a method to get an unique descriptor (feature vector) for every point of an object contour or surface. This descriptor is used in combination with a b-spline free form deformation grid, for fully automatic creation of point mappings between surfaces of patient datasets (2D/3D). The 2D Example will create a corresponding point model (PCM) for a set of 10 2D hand contours.The 3D Example will create a PCM for a set of 10 3D jaw triangulated surfaces.There are also examples using the PCM's to train and use 2D/3D Active Shape Models (ASM) and Active Appearance Models (AAM). (folder "ActiveModels_version7") The 2D example takes a couple of minutes. The 3D-example about 7 hours, and requires 64bit Matlab.The non-rigid mapping between datasets is kept Diffeomorphic to prevent mesh folding. But the optimizer doesn't succeeded in all cases of the 3D-example (maybe in next update)Notes:- The examples, will compile some c-coded functions into MEX files. In case of failure slower Matlab coded functions will be used.- Most functions in this zip-archive are also available as standalone files on the File-Exchange, and can be newer/updated.

Brief introduction==================nu_corrector is a tool for correcting intensity non-uniformity artifact of image. Here, non-uniformity refers to image artifacts of vignetting and bias (e.g. intensity inhomogeneity, illumination etc.). This tool is an implementation of our single-image based vignetting or bias correction systems based on the sparsity property of image gradient distribution.nu_corrector can correct vignetting with about 0.7 second and bias with about 0.9 second for an image in size of 750x580 through my experiments using a common computer.Information=================="Definition of vignetting and bias":Vignetting refers to the phenomenon of brightness attenuation away from the image center, and is an artifact that is prevalent in photography. Vignetting is generally assumed to be radially symmetric.Bias of image denotes the spatial variations of intensity/color caused by illumination changes for images taken by a digital camera, by in-homogenious magnetic field for MR images obtained with an MRI machine, or by non-uniform X-ray beam for CT images acquired with a CT scanner. Bias is a smooth field in any format, which can be represented by for example a bipoly model, B-Spline, etc."Harm of vignetting and bias":Vignetting and bias can significantly impair computer vision algorithms that rely on precise intensity data. They include photometric methods such as shape from shading, appearance-based techniques such as object recognition and image mosaicing, and many other applications such as image segmentation, image registration, and feature extraction.

Description:This function OPENSURF, is an implementation of SURF (Speeded Up Robust Features). SURF will detect landmark points in an image, and describe the points by a vector which is robust against (a little bit) rotation ,scaling and noise. It can be used in the same way as SIFT (Scale-invariant feature transform) which is patented. Thus to align (register) two or more images based on corresponding points (see example3.m), or make 3D reconstructions. Implementation:This Matlab implementation of Surf is a Matlab optimized translation of the OpenSurf C# code of Chris Evans, and gives exactly the same answer. Chris Evans wrote one of the best, well structured all inclusive SURF implementations. On his site you can find Evaluations of OpenSURF and the C# and C++ code. http://www.chrisevansdev.com/opensurf/Chris Evans gave me permisson to publish this code under the (Mathworks) BSD license..Usage : Ipts = OpenSurf(I, Options) inputs, I : The 2D input image color or greyscale (optional) Options : A struct with options (see below).Examples:Type "help OpenSurf" or "doc OpenSurf" for a basic surf example, and try the example2.m and example3.m for more advanced point matching and affine registration examples..Note:If you want to use opensurf for nonrigid registration, see "B-spline Grid, Image and Point based Registration" on Mathworks..Please leave a comment if you find a bug, like the code, or have a question. Visit the page of Chris Evans if you want more detailed information about the algorithm.

Introduction to Computer Aided Geometric Design - A student's companion with Matlab examples (2nd Edition)This book can serve as a companion manual to all undergraduate and postgraduate students who are taking a course in Computer Aided Geometric Design and want to see examples and algorithms implemented in Matlab. People who aren’t overly familiar with programming will hopefully find these examples easy to understand and implement in their own computerAlso available in: https://www.researchgate.net/publication/329337381_Introduction_to_Computer_Aided_Geometric_Design_-_A_student's_companion_with_Matlab_examples_2nd_Edition

This function takes a bunch of IGES-Files, looks for rational B-Splines (IGES entity 126) and makes a bending table out of each of the splines. If end and start point have the same coordinates, these splines get connected. Parameters control the way the splines get discretized and simplified. For each spline the bend table gets written as [filename]_bend_table_spline_[#].csv and for each file a summary gets written as [filename]_summary.txt, both in the same location as the IGES file.If there is a valid parameter file with the same name as a processed IGES file and extension .csv, the parameters from inside this file are used. If this file doesn't exist or You agree to overwrite it, it gets written with the parameters used in this run. Open the file to see the format. Parameters passed to the function overwrite the ones from the parameter file.To make things easier, export only the center lines of the hoses or tubes into the IGES file. Only curves, no surfaces, no bodies etc. Use attached Demo files for Solid Edge. To get the displacement angle of elbow fittings of crimped hose assemblies, model each fitting as a line perpendicular and connected to the end of the hose center line, showing in the direction of the fitting. Take care the the length of this line is longer than the minimal feed parameter (see below), otherwise this segment gets dropped.In the result summary, the desired value is the 'rotation angle between first and last spline segment', measured counterclockwise from the near end to the far end.see help for usage.This program is in a very early stage and probably won't get developed further. Not much testing occurred. Only tested with IGES export out of Solid Edge ST8. Use with caution. Check all results twice, before using them!

Wavelet neural network (WNN) proposed by Zhang and Benveniste (1992) is a hybrid of wavelet transform (WT) and multilayer perceptron (MLP). WNN inherits the strengths of WT and MLP. ReferenceZhang Q, Benveniste A (1992) Wavelet networks. ITNN 3(6):889-898. DOI: 10.1109/72.165591

NURBS are industry standard tools for the representation and design of geometry. They offer one common mathematical form for both, standard analytical shapes (e.g. conics) and free form shapes, morover provide the flexibility to design a large variety of shapes.

Usage: [mfRefinedMesh, mnTriangulation] = LoopSubdivisionLimited( mfMeshPoints, mnTriangulation, fMinResolution, vbBoundaryEdges) This function sub-divides surface meshes, using the Loop subdivision algorithm [1]. This algorithm is based on B-spline curve continuity, leading to good shape-maintaining smoothing of a surface. The algorithm attempts to leave the boundary of the surface essentially undistorted.'mfMeshPoints' is an Nx3 matrix, each row of which ['x' 'y' 'z'] defines a point in three-dimensional space. 'mnTriangulation' is a Mx3 matrix, each row of which ['m' 'n' 'p'] defines a triangle existing on the surface, where 'm', 'n' and 'p' are indices into 'mfMeshPoints'.'fMinResolution' defines the desired minimum length of an edge in the final subdivision. Edges shorter than 'fMinResolution' will not be divided further.The optional argument 'vbBoundaryEdges' identifies which edges should be treated as boundary edges (and so should their locations should be attempted to be maintained by the algorithm). This argument will be calculated by the algortihm, if it is not supplied.'mfRefinedMesh' will be a Px3 matrix, each row of which specifies a vertex in the subdivided mesh. 'mnTringulation' will be a Rx3 matrix, each row of which specifies a surface triangle in the subdivided mesh.Algorithm from [1].*ROOM FOR IMPROVEMENT*If you work out how to maintain the vertex and edge adjacency matrices through a full subdivision run, then great! That would speed up subsequent runs a great deal, since a lot of the time is spent computing the edge adjacency matrix...References[1] Loop, C 1987. "Smooth subdivision surfaces based on triangles." M.S. Mathematics thesis, University of Utah. http://research.microsoft.com/en-us/um/people/cloop/thesis.pdf

The NURBS toolbox, created by Mark Spink, is a very useful tool. However, some of the routines were written in C. This is not necessarily a bad thing as long as you know how to compile them to mex files for your machine. If you don't want to mess with mex files, or you want to be able to edit the code and don't know anything about C, I've rewritten the C code in MATLAB. You can find the original toolbox athttp://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=312&objectType=fileThe included files replace the following mex files with the m-file equivalent.basisfunbspevalbspdegelevbspderivbspkntinsfindspanIn addition, I've included the translated C code in the comments, line for line.This does not include every file in the NURBS toolbox, just the mex files. You will still want to download the toolbox and replace the mex files with the included files.

For use with the NURBS toolbox, GNURBS allows the user to have an intuitive manipulation of a NURBS surface/curve via control points. example:% Graphically manipulate test surfacegnurbs

EvaluateCardinal2D.m--------------------Evaluates 2D Cardinal Spline at parameter value u.EvaluateCardinal2DAtNplusOneValues.m------------------------------------Evaluate cardinal spline for given four points and tesion at N+1 values of u (parameter u vareis b/w 0 and 1). Uniform parameterization is used. TestEvaluateCardinal2D.m------------------------A Simple Test program to evalute Cardinal Spline for given set of data with Tension=0 (Catmull-Rom) and Tension=0.5.

We propose PRIMOR method that combines image reconstruction and motion estimation in a single algorithm. It extends previous prior-based reconstruction methods by including a model of the motion between consecutive frames into the cost functional. The resulting optimization problem is efficiently solved with the split Bregman formulation. Motion is estimated using a nonrigid registration method based on hierarchical B-splines. In this paper we compare PRIMOR with a prior-based reconstruction algorithm for respiratory gated CT, resulting in a significant reduction of artefacts and improved image quality. If you use this code, please reference the publication JFPJ Abascal et al. A novel prior- and motion-based compressed sensing method for small-animal respiratory gated CT. PLOS ONE 9;11(3):e0149841, 2016. If you need to contact the author, please do so at mabella@hggm.es, juanabascal78@gmail.comData, code and results for prior- and motion-based reconstruction (PRIMOR) method for respiratory gated CT

This optical flow program shows how "optical flow" block from Video and image processing blockset of Simulink is capable dealing with BOTH rigid and non rigid optical flow!The advantage using this block for optical flow is it's speed and the reason you can easly export it to c (using real time workshop)To run this demo------------------1. run the run_first.m file once2. run the run_second.mdl file (press play several times)*press play again and again and again.. every time you hit play the i1 picture will be registered better to i2*you can change the images in the run_first.m file, using pictures of both rigid and non rigid motion between*you can change the parameters of the optical flow in the optical flow block in the model run_second.mdlmore info-----------1)please see the stop function of the model to understand the whole process: file->model properties->callback->StopFcn2)the reason you have to press play several times (as you want more accuracy) is that: to warp the image, i use function interp2() (within the function ImWarp).if you know how to implement 2-D data interpolation in simulink (instead uinterp2() function) , please post a modified model.pictures taken from:----------------------1)non-rigid b-spline grid image registrationhttp://www.mathworks.com/matlabcentral/fileexchange/200572)High accuracy optical flowhttp://www.mathworks.com/matlabcentral/fileexchange/17500ImWarp function taken from:-----------------------------Iterative Pyramidal LK Optical Flowhttp://www.mathworks.com/matlabcentral/fileexchange/23142*By Assaf Lauferhaoman17@gmail.com

Nonuniform Cubic Spline InterpolationIncludes first or second derivative end conditions (so, as special cases, it includes natural and clamped cubic splines)If you want the formulas for the resulting cubics, use splineB.m