Woolz Image Processing  Version 1.7.5
WlzBasisFnTransform.c File Reference

Functions for computing and applying basis function transforms. More...

Functions

WlzBasisFnTransformWlzMakeBasisFnTransform (WlzErrorNum *dstErr)
 Makes a new basis function transform. The transform will be returned with a NULL basis function pointer which needs to be set along with all the other fields of the transform structure. More...
 
WlzErrorNum WlzBasisFnFreeTransform (WlzBasisFnTransform *basisTr)
 Free's the given basis function transform. More...
 
WlzBasisFnTransformWlzBasisFnTrFromCPts2D (WlzFnType type, int order, int nDPts, WlzDVertex2 *dPts, int nSPts, WlzDVertex2 *sPts, WlzCMesh2D *mesh, WlzErrorNum *dstErr)
 Creates a new basis function transform of the given type, which will transform an object with the given source verticies into an object with the given destination verticies. See WlzBasisFnTrFromCPts2DParam(). More...
 
WlzBasisFnTransformWlzBasisFnTrFromCPts2DParam (WlzFnType type, int order, int nDPts, WlzDVertex2 *dPts, int nSPts, WlzDVertex2 *sPts, WlzCMesh2D *mesh, int nParam, double *param, WlzErrorNum *dstErr)
 Creates a new basis function transform of the given type, which will transform an object with the given source verticies into an object with the given destination verticies. If a constraining object is given all distances will be computed within the given object for those basis functions which support constrained evaluation (Gauss, multi-quadric and thin-plate spline). Additional basis functions parameters may be supplied via the nParam and param parameters. Currently this is only used to supply the multi-quadric delta or gauss parameter scaling. The default values of multi-quadric delta = 0.001 and gauss param = 0.9 are used if nParam <= 0 or param == NULL. More...
 
WlzBasisFnTransformWlzBasisFnTrFromCPts3DParam (WlzFnType type, int order, int nDPts, WlzDVertex3 *dPts, int nSPts, WlzDVertex3 *sPts, WlzCMesh3D *mesh, int nParam, double *param, WlzErrorNum *dstErr)
 Creates a new basis function transform of the given type, which will transform an object with the given source verticies into an object with the given destination verticies. If a constraining object is given all distances will be computed within the given object for those basis functions which support constrained evaluation (Gauss, multi-quadric and thin-plate spline). Additional basis functions parameters may be supplied via the nParam and param parameters. Currently this is only used to supply the multi-quadric delta or gauss parameter scaling. The default values of multi-quadric delta = 0.001 and gauss param = 0.9 are used if nParam <= 0 or param == NULL. More...
 
WlzErrorNum WlzBasisFnTPS2DChangeCPts (WlzBasisFnTransform *basisTr, int nDPts, WlzDVertex2 *dPts, int nSPts, WlzDVertex2 *sPts, WlzObject *cObj)
 Changes control points in an existing basis function transform. Using this function to add, move or delete control points avoids recomputing distance transforms when using basis functions which use constrained distances. Because distances transforms are very expensive to compute calling this function can be far more efficient, but when non-constrained (Euclidean) distances are used then there is no benefit in using this function as opposed to WlzBasisFnTPS2DFromCPts(). The full list of control points must be given. More...
 
WlzErrorNum WlzBasisFnTPS2DChangeCPtsParam (WlzBasisFnTransform *basisTr, int nDPts, WlzDVertex2 *dPts, int nSPts, WlzDVertex2 *sPts, WlzObject *cObj, int nParam, double *param)
 Changes control points in an existing basis function transform. Using this function to add, move or delete control points avoids recomputing distance transforms when using basis functions which use constrained distances. Because distances transforms are expensive to compute calling this function can be more efficient, but when non-constrained (Euclidean) distances are used then there is no benefit in using this function as opposed to WlzBasisFnTPS2DFromCPts(). The full list of control points must be given. Additional basis functions parameters may be supplied via the nParam and param parameters. Currently this is only used to supply the multi-quadric delta or gauss parameter scaling. The default values of multi-quadric delta = 0.001 and gauss param = 0.9 are used if nParam <= 0 or param == NULL. More...
 
WlzBasisFnTransformWlzBasisFnTrFromCPts3D (WlzFnType type, int order, int nDPts, WlzDVertex3 *dPts, int nSPts, WlzDVertex3 *sPts, WlzCMesh3D *mesh, WlzErrorNum *dstErr)
 Creates a new basis function transform of the given type, which will transform an object with the given source verticies into an object with the given destination verticies. More...
 
WlzErrorNum WlzBasisFnSetMesh (WlzMeshTransform *mesh, WlzBasisFnTransform *basisTr)
 Sets the displacements of the given mesh transform according to the basis function transform. More...
 
WlzErrorNum WlzBasisFnSetCMesh (WlzObject *mObj, WlzBasisFnTransform *basisTr)
 Sets the displacements of the given conforming mesh transform according to the basis function transform. This function just calls either WlzBasisFnSetCMesh2D() or WlzBasisFnSetCMesh3D() see these functions for their conforming mesh transform object requirements. More...
 
WlzErrorNum WlzBasisFnSetCMesh2D (WlzObject *mObj, WlzBasisFnTransform *basisTr)
 Sets the displacements of the given 2D conforming mesh transform object according to the basis function transform. The conforming mesh object must have a valid 2D conforming mesh and indexed values. The indexed values will be expanded to cover the nodes of the mesh if required, but they must have a rank of 1, a dimension of >= 2 and be of type double. More...
 
WlzErrorNum WlzBasisFnSetCMesh3D (WlzObject *mObj, WlzBasisFnTransform *basisTr)
 Sets the displacements of the given 3D conforming mesh transform object according to the basis function transform. The conforming mesh object must have a valid 3D conforming mesh and indexed values. The indexed values will be expanded to cover the nodes of the mesh if required, but they must have a rank of 1, a dimension of >= 3 and be of type double. More...
 
WlzObjectWlzBasisFnMakeCMeshTr (WlzBasisFnTransform *basisTr, WlzCMeshP mesh, WlzErrorNum *dstErr)
 Uses the given source mesh to create a mesh transform object which transforms the source to target. See the functions WlzBasisFnMakeCMeshTr2D() and WlzBasisFnMakeCMeshTr3D() for details of the returned objects. More...
 
WlzObjectWlzBasisFnMakeCMeshTr2D (WlzBasisFnTransform *basisTr, WlzCMesh2D *mesh, WlzErrorNum *dstErr)
 Uses the given 2D target mesh to create a 2D mesh transform which transforms the source to target. Unlike WlzBasisFnMakeCMeshTr() this function does not check it's given parameters. The new object's indexed values have; rank = 1, dim = 2, attach = WLZ_VALUE_ATTACH_NOD and double values. More...
 
WlzObjectWlzBasisFnMakeCMeshTr3D (WlzBasisFnTransform *basisTr, WlzCMesh3D *mesh, WlzErrorNum *dstErr)
 Uses the given 3D target mesh to create a 3D mesh transform which transforms the source to target. Unlike WlzBasisFnMakeCMeshTr() this function does not check it's given parameters. The new object's indexed values have; rank = 1, dim = 3, attach = WLZ_VALUE_ATTACH_NOD and double values. More...
 
WlzObjectWlzBasisFnInvertMakeCMeshTr (WlzBasisFnTransform *basisTr, WlzCMeshP mesh, WlzErrorNum *dstErr)
 Copies the given target mesh and uses it to create a mesh transform object which transforms the source to target. See the functions WlzBasisFnInvertMakeCMeshTr2D() and WlzBasisFnInvertMakeCMeshTr3D() for details of the returned objects. More...
 
WlzObjectWlzBasisFnInvertMakeCMeshTr2D (WlzBasisFnTransform *basisTr, WlzCMesh2D *mesh, WlzErrorNum *dstErr)
 Copies the given 2D target mesh and uses it to create a 2D mesh transform which transforms the source to target. Unlike WlzBasisFnInvertMakeCMeshTr() this function does not check it's given parameters. The new object's indexed values have; rank = 1, dim = 2, attach = WLZ_VALUE_ATTACH_NOD and double values. More...
 
WlzObjectWlzBasisFnInvertMakeCMeshTr3D (WlzBasisFnTransform *basisTr, WlzCMesh3D *mesh, WlzErrorNum *dstErr)
 Copies the given 3D target mesh and uses to create a 3D mesh transform which transforms the source to target. Unlike WlzBasisFnInvertMakeCMeshTr() this function does not check it's given parameters. The new object's indexed values have; rank = 1, dim = 3, attach = WLZ_VALUE_ATTACH_NOD and double values. More...
 
WlzObjectWlzBasisFnTransformObj (WlzObject *srcObj, WlzBasisFnTransform *basisTr, WlzInterpolationType interp, WlzErrorNum *dstErr)
 Transforms a woolz object using a the given basis function transform. This function has been written as an example of how to transform an object using a basis function and mesh. In most cases WlzMeshFromObj(), WlzBasisFnSetMesh() and WlzMeshTransformObj() would be called allowing a mesh to be reused. More...
 
WlzPolygonDomainWlzBasisFnTransformPoly2 (WlzPolygonDomain *srcPoly, WlzBasisFnTransform *basisTr, int newPoly, WlzErrorNum *dstErr)
 Transforms a 2D polygon domain using a the given basis function transform. More...
 
WlzBoundListWlzBasisFnTransformBoundList (WlzBoundList *srcBnd, WlzBasisFnTransform *basisTr, int newBnd, WlzErrorNum *dstErr)
 Transforms a 2D boundary list using a the given basis function transform. More...
 
WlzContourWlzBasisFnTransformContour (WlzContour *srcCtr, WlzBasisFnTransform *basisTr, int newCtr, WlzErrorNum *dstErr)
 Transforms a contour using a the given basis function transform. See WlzBasisFnTransformGMModel(). More...
 
WlzGMModelWlzBasisFnTransformGMModel (WlzGMModel *srcM, WlzBasisFnTransform *basisTr, int newModel, WlzErrorNum *dstErr)
 Transforms a Woolz GMModel using a the given basis function transform. This function assumes that the transformation does not change the topology of the model, watch out that this willnot always be true! More...
 
WlzDVertex2 WlzBasisFnTransformNormalD (WlzBasisFnTransform *basisTr, WlzDVertex2 srcVx, WlzDVertex2 srcNr, WlzDVertex2 *dstVx, WlzErrorNum *dstErr)
 Transforms the given vertex and it's normal which is unit length and directed from the given vertex. More...
 
WlzDVertex2 WlzBasisFnTransformVertexD (WlzBasisFnTransform *basisTr, WlzDVertex2 srcVx, WlzErrorNum *dstErr)
 Transforms the given WlzDVertex2. More...
 
WlzFVertex2 WlzBasisFnTransformVertexF (WlzBasisFnTransform *basisTr, WlzFVertex2 srcVxF, WlzErrorNum *dstErr)
 Transforms the given WlzFVertex2. More...
 
WlzIVertex2 WlzBasisFnTransformVertexI (WlzBasisFnTransform *basisTr, WlzIVertex2 srcVxI, WlzErrorNum *dstErr)
 Transforms the given WlzIVertex2. More...
 

Detailed Description

Functions for computing and applying basis function transforms.

Author
Bill Hill, Jianguo Rao
Date
March 1999
Version
Id
459f619e4b7470e7c0d102daca60cdb37b356d0a
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2012], 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.

Todo:
The mesh generation is fairly poor. This could be revisited but for most off line use external applications can be used.