Woolz Image Processing  Version 1.8.3
WlzBSpline.c File Reference

Functions to create and compute B-spline domain objects. More...

Functions

WlzBSplineWlzMakeBSpline (WlzObjectType type, int order, int maxKnots, WlzErrorNum *dstErr)
 Creates a new B-spline domain. This can be freed using using WlzFreeDomain(). More...
 
WlzErrorNum WlzFreeBSpline (WlzBSpline *bs)
 Frees a B-spline domain. More...
 
WlzBSplineWlzBSplineCopy (WlzBSpline *srcBS, WlzErrorNum *dstErr)
 Copies a B-spline domain. More...
 
WlzBSplineWlzBSplineFromObj (WlzObject *gObj, int order, int closed, double sm, WlzErrorNum *dstErr)
 Creates a new B-spline domain from the given object. More...
 
WlzPointsWlzBSplineEvalPoints (WlzBSpline *bs, int n, int deriv, WlzErrorNum *dstErr)
 Creates a new Woolz points domain bt evaluating the given B-spline at equal intervals along the parametrised curve. More...
 
WlzBSplineWlzBSplineFromVertices (WlzVertexType vType, int nV, WlzVertexP vtx, int k, int periodic, double sm, WlzErrorNum *dstErr)
 Creates a new B-spline domain by fitting a B-spline to the given vertices. More...
 
WlzErrorNum WlzBSplineEval (WlzBSpline *bs, int n, double *x, int deriv, WlzVertexP eval)
 Evaluates a B-spline at a specified number of points. More...
 
WlzObjectWlzBSplineToDomain (WlzBSpline *bs, double tB, double tE, int paramVal, WlzErrorNum *dstErr)
 Makes a new interval or plane domain object corresponding to the evaluation of the given B-spline in the given parametric coordinate range. The returned object may have pixel/voxels which are disconnected unless dilated by 1. More...
 
WlzErrorNum WlzBSplineEvalSP (WlzBSpline *bs, double x, int deriv, WlzVertexP eval)
 Evaluates a B-spline at a single specified point. More...
 
WlzErrorNum WlzBSplineTangent (WlzBSpline *bs, int n, double *x, WlzVertexP dstPos, WlzVertexP dstTnt)
 Compute the (optional) position and (optional) tangent to the B-spline at points along the path of it's curve. More...
 
WlzObjectWlzBSplineCut (WlzObject *iObj, WlzBSpline *bs, int cutOrthog, int noGrey, int radius, double tB, double tE, WlzDVertex3 up, WlzInterpolationType interp, WlzErrorNum *dstErr)
 Cuts regions from a spatial domain using a B-spline to define the region cut. The region may be the domain of the B-spline or planes orthogonal to the B-spline. More...
 
double WlzBSplineDistance (WlzBSpline *bs, double tg, double dg, double sz, double sy, double sx, double tol, WlzErrorNum *dstErr)
 Computes the parametric coordinate which is the given distance from the given origin parametric coordinate. This function uses a binary search to find the parametric cordinate for the given distance from the start calling WlzBSplineLength(). Coordinates outside of the spline domain are clamped to the range of the spline domain [0.0-1.0]. More...
 
double WlzBSplineLength (WlzBSpline *bs, double tB, double tE, double sz, double sy, double sx, WlzErrorNum *dstErr)
 Computes the length of a path along a spline's curve between a pair of parametric coordinates. Given a parametric curve \(c(t)\) then the length \(l\) of a segment on that curve between \(t_a\) and \(t_b\) is given by

\[ l = \int_{t_a}^{t_b}\sqrt{ {\acute{x} s_x}^2 + {\acute{y} s_y}^2 + \ldots}dt \]

where \(\acute{x}, \acute{y}, \ldots\) are the first derivatives of coordinates \(x, y, \ldots\) with respect to \(t\). Step sizes ( \(s_x, s_y, \ldots\)) allow lengths to be computed for an domain with non-unit pixel/voxel size. Because the integral is an elliptic integral, then Legendre- Gauss quadrature is used for numerical integration with each spline segment integrated using it's own points and weights. More...

 

Detailed Description

Functions to create and compute B-spline domain objects.

Author
Bill Hill
Date
June 2020
Version
Id
d3958405f9bb4860c5ef4a92f226569b409041b8
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2016], The University Court of the University of Edinburgh, Old College, Edinburgh, UK.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.