Woolz Image Processing
Version 1.7.5
|
Files | |
file | Wlz3DProjection.c |
Generates the projection or back-projection of a domain object from 3D to 2D and visa versa. | |
file | Wlz3DViewTransformObj.c |
View transformation functions. | |
file | Wlz3DWarpMQ_S.c |
Generates a regular tetrahedral mesh for a 3D domain. | |
file | WlzAffineTransform.c |
Functions for computing affine transforms and applying them to objects. | |
file | WlzAffineTransformLSq.c |
Functions for computing Woolz affine transforms that give the best fit, in a least squares sense, when used to transform one set of vertices to another. | |
file | WlzBasisFnTransform.c |
Functions for computing and applying basis function transforms. | |
file | WlzCMeshSurfMap.c |
Functions for computing surface mappings that are based on conformal transformations and other mappings between surfaces and planes. | |
file | WlzCMeshTransform.c |
Functions for creating and applying 2D and 3D conforming mesh transforms. | |
file | WlzFitPlane.c |
Functions for computing best fit planes. | |
file | WlzIntRescaleObj.c |
Rescales a Woolz object using an integral scale. | |
file | WlzMakeAffineTransform.c |
Allocation and freeing of affine transforms. | |
file | WlzMatchICP.c |
Functions to match objects using ICP based registration, providing a set of corresponding points. | |
file | WlzMeshTransform.c |
Functions for computing mesh transforms. | |
file | WlzMeshUtils.c |
Utility functions for manipulating Woolz mesh transforms. | |
file | WlzProj3DToSection.c |
Functions for projecting 3D domains onto sections. | |
file | WlzRegICP.c |
Functions for the registration of two objects using an implementation of the iterative closest point algorithm. See. | |
file | WlzSampleObj.c |
Subsamples objects using an integer sampling factor and a convolution kernel. | |
file | WlzShift.c |
Functions for shifting (applying efficient integer translations) to objects, domains and values. | |
file | WlzSnapFit.c |
Functions to compute correspondences between a pair of objects using closest points. | |
file | WlzTransform.c |
Functions operating on Woolz transform unions. | |
file | WlzTransposeObj.c |
Transposes objects (ie interchanges row and column coordinates). | |
file | WlzTransRANSAC.c |
Code based on RANSAC (Random Sample Consensus) for computing transforms from paired correspondences. | |
Data Structures | |
struct | _WlzCMeshScanElm2D |
Conforming mesh scanning element for 2D mesh. More... | |
struct | _WlzCMeshScanElm3D |
Conforming mesh scanning element for 2D5 or 3D mesh. More... | |
struct | _WlzCMeshScanItv2D |
Scan interval within a 2D conforming mesh element. More... | |
struct | _WlzCMeshScanItv3D |
Scan interval within a 3D conforming mesh element. More... | |
struct | _WlzCMeshScanWSp2D |
Conforming mesh scanning workspace for a 2D mesh. More... | |
struct | _WlzCMeshScanWSp3D |
Conforming mesh scanning workspace for a 3D mesh. More... | |
struct | _WlzMatchICPShell |
A single matched shell. Typedef: WlzMatchICPShell. More... | |
struct | _WlzMatchICPShellListElm |
List element for list of matched shells. Typedef: WlzMatchICPShellListElm. More... | |
struct | _WlzMatchICPShellList |
List element of matched shells. Typedef: WlzMatchICPShellList. More... | |
struct | _WlzMatchICPCbData |
Data structure for GM model element creation and destruction callbacks. Typedef: WlzMatchICPCbData. More... | |
struct | _WlzMatchICPTPPair2D |
A single 2D tiepoint pair. More... | |
struct | _WlzMeshScanDElm |
Mesh scanning element. More... | |
struct | _WlzMeshScanItv |
Scan interval within an element. More... | |
struct | _WlzMeshScanWSp |
Mesh scanning workspace. More... | |
struct | _WlzMeshPolyVx |
Linked list based polygon data structure. More... | |
struct | _WlzRegICPWSp |
A workspace data structure for use in the ICP functions. More... | |
struct | _WlzTransRANSACVtx |
Vertex pairs as used by the transform RANSAC functions. Typedef: WlzTransRANSACVtx. More... | |
struct | _WlzGreyTransformParam |
Grey-level transform parameters. Typedef: WlzGreyTransformParam. More... | |
union | _WlzTransform |
A union of all valid transforms. Typedef: WlzTransform. More... | |
struct | _WlzCoreTransform |
The core transform, with members common to all transforms. Typedef: WlzCoreTransform. More... | |
struct | _WlzEmptyTransform |
An empty transform, with members common to all transforms. An empty transform is a compact represetation of a zero transform avoiding the use of NULL which implies an error. Typedef: WlzCoreTransform. More... | |
struct | _WlzAffineTransform |
Either a 2D or 3D affine transform. The homogeneous matrix (mat) is always allocated as a 4x4 AlcDouble2Alloc style array. It is used as a 3x3 matrix for 2D and as a 4x4 matrix for 3D affine transforms. Typedef: WlzAffineTransform. More... | |
struct | _WlzAffineTransformPrim |
Affine tranform primitives. Typedef: WlzAffineTransformPrim. More... | |
struct | _WlzBasisFnTransform |
A basis function transform. The delta is used by the MQ and Gauss basis functions: For the MQ basis function delta = \(R^2\), and for the Gaussian basis function delta = \(1/s^2\). Typedef: WlzBasisFnTransform. More... | |
struct | _WlzMeshNode |
Defines a node within a mesh transform. Typedef: WlzMeshNode. More... | |
struct | _WlzMeshNode3D |
Defines a 3D node within a mesh transform. added by J. Rao 10/09/2001. More... | |
struct | _WlzMeshNode2D5 |
Defines a 2D5 node within a mesh transform. added by J. Rao 23/10/2001. More... | |
struct | _WlzMeshElem |
Defines an triangular mesh element within a mesh transform. The nodes and neighbours are indexed such that: Neighbour 0 shares nodes 1 and 2, neighbour 1 shares nodes 2 and 0 and neighbour 2 shares nodes 0 and 1. All the nodes are stored in counter clockwise (CCW) order. Typedef: WlzMeshElem. More... | |
struct | _WlzMeshElem3D |
Defines an tetrahedral mesh element within a mesh transform. The nodes and neighbours are indexed such that: Neighbour 0 shares surface ( nodes 0, 1 and 2), neighbour 1 shares surface (nodes 1, 3 and 2), neighbour 2 shares surface (nodes 2, 3 and 0 ) and neighbour 3 shares surface (nodes 0, 3 and 1 ) All the nodes stored in the following sequence: 0-1-2 formed a counter clockwise (CCW) order using the dircection of a surface outwards from the tetrahedron. 0-2-3 are also stored in counter clockwise (CCW) order. added by J. Rao 10/09/2001. More... | |
struct | _WlzMeshTransform |
A mesh convex transform. Typedef: WlzMeshElem. More... | |
struct | _WlzMeshTransform3D |
Defines a mesh transform. added by J. Rao 10/09/2001. More... | |
struct | _WlzMeshTransform2D5 |
Defines a mesh transform. added by J. Rao 23/10/2001. More... | |
struct | _WlzTElement |
Triangular finite element warping mesh element. Typedef: WlzTElement. More... | |
struct | _WlzRElement |
Rectangular finite element warping mesh element. Typedef: WlzRElement. More... | |
struct | _WlzWarpTrans |
Finite element warp transformation. Typedef: WlzWarpTrans. More... | |
Typedefs | |
typedef double(* | WlzTransformRANSACErrFn) (WlzTransform, WlzVertexType, WlzVertexP, WlzVertexType, WlzVertexP, int, void *) |
Pointer to a function called for user code to evaluate error distance between the transformed source vertex and the target vertex where these are selected from arrays of vertices uning the index. Example: More... | |
typedef WlzErrorNum(* | WlzTransformRANSACFitFn) (WlzTransform *, WlzVertexType, WlzVertexP, WlzVertexType, WlzVertexP, int, int *, void *) |
Pointer to a function called for user code to fit a model transform to the indexed paried source and target vertices. Example: More... | |
typedef WlzErrorNum(* | WlzTransformRANSACDegFn) (WlzTransform *, WlzVertexType, WlzVertexP, WlzVertexType, WlzVertexP, int, int *, void *) |
Pointer to a function called for user code to test a model transform for degeneracy, returning non-zero if the given transform is degenerate. In some cases (as in the example) it my be possible to simply inspect the transform, in others it may be necessary to transform the source vertices. Example: More... | |
typedef double(* | WlzRegICPUsrWgtFn) (WlzVertexType, WlzAffineTransform *, AlcKDTTree *, WlzVertexP, WlzVertexP, WlzVertex, WlzVertex, double, double, void *) |
A pointer to a function called for user code weighting of the matched vertices. More... | |
typedef struct _WlzMatchICPWeightCbData | WlzMatchICPWeightCbData |
A data structure for wieghting vertex matches within WlzMatchICPWeightMatches(). Typedef: WlzMatchICPWeightCbData. More... | |
typedef WlzErrorNum(* | WlzAffineTransformCbFn) (void *cbData, struct _WlzGreyWSpace *gWSp, struct _WlzGreyValueWSpace *gVWSp, struct _WlzAffineTransform *invTr, int pln, int ln) |
Callback function for the WlzAffineTransformCb() which may be used for value interpolation of an interval of destination values. More... | |
typedef enum _WlzProjectIntMode | WlzProjectIntMode |
3D to 2D projection integration modes. More... | |
Functions | |
WlzObject * | WlzGetProjectionFromObject (WlzObject *obj, WlzThreeDViewStruct *viewStr, Wlz3DProjectionIntFn intFunc, void *intFuncData, WlzErrorNum *dstErr) |
Use the view transform to define a projection from 3D to 2D. Currently only the domain is projected as an opaque shadow. This is old code temporarily kept for compatibility. More... | |
WlzObject * | WlzProjectObjToPlane (WlzObject *obj, WlzThreeDViewStruct *vStr, WlzProjectIntMode intMod, WlzUByte denDom, WlzUByte *denVal, double depth, WlzErrorNum *dstErr) |
Use the view transform to define a projection from 3D to 2D and then project the object onto this plane. The object supplied to this function must be a 3D spatial domain object (WLZ_3D_DOMAINOBJ) with either no values or for integration WLZ_GREY_UBYTE values. Integration will assign each output pixel the sum of all input voxels mapped via either the domain density or the voxel density. The integration is controled by the integrate parameter with valid values: WLZ_PROJECT_INT_MODE_NONE - a "shadow domain" without values is computed, WLZ_PROJECT_INT_MODE_DOMAIN - the voxels of the domain are integrated using \[ p = \frac{1}{255} n d \] WLZ_PROJECT_INT_MODE_VALUES - the voxel values are integrated using \[ p = \frac{1}{255} \sum{l\left[v\right]}. \] Where \(p\) is the projected image value, \(n\) is the number of voxels projected for \(p\), \(d\) is the density of domain voxels, \(l\) is the voxel value density look up table and \(v\) is a voxel value. More... | |
WlzObject * | Wlz3DViewTransformObj (WlzObject *srcObj, WlzThreeDViewStruct *viewStr, WlzErrorNum *dstErr) |
Transform an object using the given view-transform. Typically this is for mapping section data back into the 3D space of the reference image/reconstruction. More... | |
WlzObject * | Wlz3DViewTransformBitmap (int sizeBitData, WlzUByte *bitData, int width, int height, int x_offset, int y_offset, double x, double y, double z, double theta, double phi, double distance, WlzErrorNum *dstErr) |
Gets a 3D section through a byte packed bitmap. More... | |
int | WlzAffineTransformDimension (WlzAffineTransform *tr, WlzErrorNum *dstErr) |
Computes the dimension of the given affine transform. More... | |
int | WlzAffineTransformIsTranslate (WlzAffineTransform *tr, WlzObject *obj, WlzErrorNum *dstErr) |
Tests whether the given affine transform is a simple integer translation. More... | |
WlzContour * | WlzAffineTransformContour (WlzContour *srcCtr, WlzAffineTransform *tr, int newModFlg, WlzErrorNum *dstErr) |
Transforms the given contour. More... | |
WlzPoints * | WlzAffineTransformPoints (WlzPoints *srcPts, WlzAffineTransform *tr, int newPtsFlg, WlzErrorNum *dstErr) |
Transforms the given contour. More... | |
WlzGMModel * | WlzAffineTransformGMModel (WlzGMModel *srcM, WlzAffineTransform *tr, int newModFlg, WlzErrorNum *dstErr) |
Transforms the given geometric model. More... | |
WlzErrorNum | WlzAffineTransformGMShell (WlzGMShell *shell, WlzAffineTransform *tr) |
Transforms the shell's geometry as well as the geometries of the verticies in the shell. All the transformations are done in place. More... | |
WlzErrorNum | WlzAffineTransformPrimSet (WlzAffineTransform *tr, WlzAffineTransformPrim prim) |
Sets the given transform's matrix from an affine transform primitives data structure. A composite transform \(A\) is built from the primitives with the order of composition being scale \(s\) (applied first), shear \(h\), rotation \(\theta\) and then translation \(t\) (applied last), ie: \[ A = t \theta h s, x' = A x \] . More... | |
WlzErrorNum | WlzAffineTransformTranslationSet (WlzAffineTransform *tr, double tx, double ty, double tz) |
Sets the given transform's matrix from the given translations. More... | |
WlzAffineTransform * | WlzAffineTransformFromTranslation (WlzTransformType type, double tx, double ty, double tz, WlzErrorNum *dstErr) |
Constructs a new affine transform from the given translations. More... | |
WlzErrorNum | WlzAffineTransformScaleSet (WlzAffineTransform *tr, double sx, double sy, double sz) |
Sets the given transform's matrix from the given scales. More... | |
WlzAffineTransform * | WlzAffineTransformFromScale (WlzTransformType type, double sx, double sy, double sz, WlzErrorNum *dstErr) |
Constructs a new affine transform from the given scales. More... | |
WlzErrorNum | WlzAffineTransformRotationSet (WlzAffineTransform *tr, double rx, double ry, double rz) |
Sets the given transform's matrix from the given rotations. Although the 3 rotations contain redundant information this may be a useful method for setting rotation transforms. The order of composition is R = Rz.Ry.Rx, x' = R.x. More... | |
WlzAffineTransform * | WlzAffineTransformFromRotation (WlzTransformType type, double rx, double ry, double rz, WlzErrorNum *dstErr) |
Constructs a new affine transform from the given rotations. More... | |
WlzErrorNum | WlzAffineTransformPrimGet (WlzAffineTransform *tr, WlzAffineTransformPrim *prim) |
Gets the given 2D transform's primitives from it's matrix. More... | |
WlzErrorNum | WlzAffineTransformMatrixSet (WlzAffineTransform *trans, double **matrix) |
Sets the given transform from the given matrix. More... | |
WlzErrorNum | WlzAffineTransformPrimValSet (WlzAffineTransform *tr, double trX, double trY, double trZ, double trScale, double trTheta, double trPhi, double trAlpha, double trPsi, double trXsi, int trInvert) |
Sets a 2D affine transform from the given primitives. More... | |
WlzAffineTransform * | WlzAffineTransformFromMatrix (WlzTransformType type, double **matrix, WlzErrorNum *dstErr) |
Makes a new affine transform of the given type and then sets it's matrix. More... | |
WlzAffineTransform * | WlzAffineTransformFromPrimVal (WlzTransformType type, double trX, double trY, double trZ, double trScale, double trTheta, double trPhi, double trAlpha, double trPsi, double trXsi, int trInvert, WlzErrorNum *dstErr) |
Makes a new affine transform from the given primitive transform properties. More... | |
WlzAffineTransform * | WlzAffineTransformFromSpin (double spX, double spY, double spTheta, WlzErrorNum *dstErr) |
Makes a new 2D affine transform from the given spin angle and centre of rotation. More... | |
WlzAffineTransform * | WlzAffineTransformFromSpinSqueeze (double spX, double spY, double spTheta, double sqX, double sqY, WlzErrorNum *dstErr) |
Makes a new 2D affine transform from the given spin angle, centre of rotation and scale factors. More... | |
WlzAffineTransform * | WlzAffineTransformCopy (WlzAffineTransform *tr, WlzErrorNum *dstErr) |
Copies the given affine transform. More... | |
WlzAffineTransform * | WlzAffineTransformProduct (WlzAffineTransform *tr0, WlzAffineTransform *tr1, WlzErrorNum *dstErr) |
Computes the product of the two given affine transforms \(T_1 T_0\). More... | |
WlzAffineTransform * | WlzAffineTransformInverse (WlzAffineTransform *tr, WlzErrorNum *dstErr) |
Computes the inverse of the given affine transform. More... | |
int | WlzAffineTransformIsIdentity (WlzAffineTransform *trans, WlzErrorNum *dstErr) |
Checks whether the given transform is an identity transform. This function is equivalent to WlzAffineTransformIsIdentityTol() with a tolerances of 1.0e-06. More... | |
int | WlzAffineTransformIsIdentityTol (WlzAffineTransform *trans, double tolTn, double tolTx, WlzErrorNum *dstErr) |
Checks whether the given transform is an identity transform using the given tolerance. If any of the transform parameters deviates from those an identity transform my more than +/- the given tolerance the transform is not considered an identity transform. More... | |
WlzObject * | WlzAffineTransformObj (WlzObject *srcObj, WlzAffineTransform *trans, WlzInterpolationType interp, WlzErrorNum *dstErr) |
Applies the given affine transform to the given Woolz object. More... | |
WlzObject * | WlzAffineTransformObjCb (WlzObject *srcObj, WlzAffineTransform *trans, WlzInterpolationType interp, void *cbData, WlzAffineTransformCbFn cbFn, WlzErrorNum *dstErr) |
Applies the given affine transform to the given Woolz object. The interpolation data and function may both be NULL unless the interpolation type is WLZ_INTERPOLATION_CALLBACK in which case the interpolation callback function will be called for each interpolated value. More... | |
WlzIVertex2 | WlzAffineTransformVertexI2 (WlzAffineTransform *trans, WlzIVertex2 srcVtx, WlzErrorNum *dstErr) |
Transforms the given WlzIVertex2. More... | |
WlzIVertex3 | WlzAffineTransformVertexI3 (WlzAffineTransform *trans, WlzIVertex3 srcVtx, WlzErrorNum *dstErr) |
Transforms the given WlzIVertex3. More... | |
WlzFVertex2 | WlzAffineTransformVertexF2 (WlzAffineTransform *trans, WlzFVertex2 srcVtx, WlzErrorNum *dstErr) |
Transforms the given WlzFVertex2. More... | |
WlzFVertex3 | WlzAffineTransformVertexF3 (WlzAffineTransform *trans, WlzFVertex3 srcVtx, WlzErrorNum *dstErr) |
Transforms the given WlzFVertex3. More... | |
WlzDVertex2 | WlzAffineTransformVertexD2 (WlzAffineTransform *trans, WlzDVertex2 srcVtx, WlzErrorNum *dstErr) |
Transforms the given WlzDVertex2. More... | |
WlzDVertex3 | WlzAffineTransformVertexD3 (WlzAffineTransform *trans, WlzDVertex3 srcVtx, WlzErrorNum *dstErr) |
Transforms the given WlzDVertex3. More... | |
WlzDVertex2 | WlzAffineTransformNormalD2 (WlzAffineTransform *trans, WlzDVertex2 srcNrm, WlzErrorNum *dstErr) |
Transforms the given WlzDVertex2 which is a normal. More... | |
WlzDVertex3 | WlzAffineTransformNormalD3 (WlzAffineTransform *trans, WlzDVertex3 srcNrm, WlzErrorNum *dstErr) |
Transforms the given WlzDVertex3 which is a normal. More... | |
WlzIBox2 | WlzAffineTransformBBoxI2 (WlzAffineTransform *tr, WlzIBox2 srcBox, WlzErrorNum *dstErr) |
Transforms the given WlzIBox2. More... | |
WlzDBox2 | WlzAffineTransformBBoxD2 (WlzAffineTransform *tr, WlzDBox2 srcBox, WlzErrorNum *dstErr) |
Transforms the given WlzDBox2. More... | |
WlzIBox3 | WlzAffineTransformBBoxI3 (WlzAffineTransform *tr, WlzIBox3 srcBox, WlzErrorNum *dstErr) |
Transforms the given WlzIBox3. More... | |
WlzDBox3 | WlzAffineTransformBBoxD3 (WlzAffineTransform *tr, WlzDBox3 srcBox, WlzErrorNum *dstErr) |
Transforms the given WlzDBox3. More... | |
WlzAffineTransform * | WlzAffineTransformLSq (WlzVertexType vType, int nVT, WlzVertexP vT, int nVS, WlzVertexP vS, int nVW, double *vW, WlzTransformType trType, WlzErrorNum *dstErr) |
Computes the Woolz affine transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices. The weights are optional but if givn must correspond to the vertices. This function calls either WlzAffineTransformLSq2D() or WlzAffineTransformLSq3D() depending on the given vertex type, see these functions of greater detail. More... | |
WlzAffineTransform * | WlzAffineTransformLSq2D (int nVT, WlzDVertex2 *vT, int nVTS, WlzDVertex2 *vS, int nVW, double *vW, WlzTransformType trType, WlzErrorNum *dstErr) |
Computes the affine transform which gives the best (least squares) fit when used to transform the 2D source vertices onto the target vertices. This function calls the appropriate 2D least squares affine transform function: More... | |
WlzAffineTransform * | WlzAffineTransformLSq3D (int nVT, WlzDVertex3 *vT, int nVS, WlzDVertex3 *vS, int nVW, double *vW, WlzTransformType trType, WlzErrorNum *dstErr) |
Computes the affine transform which gives the best (least squares) fit when used to transform the 3D source vertices onto the target vertices. This function calls the appropriate 3D least squares affine transform function: More... | |
WlzAffineTransform * | WlzAffineTransformLSqTrans2D (WlzDVertex2 *vT, WlzDVertex2 *vS, double *vW, int nV, WlzErrorNum *dstErr) |
Computes the 2D translation transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices. More... | |
WlzAffineTransform * | WlzAffineTransformLSqTrans3D (WlzDVertex3 *vT, WlzDVertex3 *vS, double *vW, int nV, WlzErrorNum *dstErr) |
Computes the 3D translation transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices. More... | |
WlzAffineTransform * | WlzAffineTransformLSqGen2D (WlzDVertex2 *vT, WlzDVertex2 *vS, double *vW, int nV, WlzErrorNum *dstErr) |
Computes the general 2D affine transform which gives the best (least squares) fit when used to transform the target vertices onto the source vertices. More... | |
WlzAffineTransform * | WlzAffineTransformLSqGen3D (WlzDVertex3 *vT, WlzDVertex3 *vS, double *vW, int nV, WlzErrorNum *dstErr) |
Computes the general 3D affine transform which gives the best (least squares) fit when used to transform the target vertices onto the source vertices. More... | |
WlzAffineTransform * | WlzAffineTransformLSqReg2D (WlzDVertex2 *vT, WlzDVertex2 *vS, double *vW, int nVtx, WlzErrorNum *dstErr) |
Computes the 2D registration transform which gives the best (weighted least squares) fit when used to transform the first set of vertices onto the second using the given match weights. The transform is constrained to rotation and translation only. The algorithm has been addapted from the algorithm: Arun K.S., Huang T.T. and Blostein S.D. "Least-Squares
Fitting of Two 3-D Point Sets" PAMI 9(5), 698-700, 1987, by transforming the problem to a 2D space, including vertex weights and computing the translation component of the transform using \[ \mathbf{T} = \frac{\sum_{i=0}^{N-1}{w_i^2 \mathbf{x}_i}} {\sum_{i=0}^{N-1}{w_i^2}} \] \[ \mathbf{x}_i = {\mathbf{p}_i}' - \mathbf{R}\mathbf{p}_i \] where \(w_i\) are the weights, \({\mathbf{p}_i}'\) are the target vertices, \(\mathbf{p}_i\) are the source vertices and \(\mathbf{R}\) is the rotation matrix. More... | |
WlzAffineTransform * | WlzAffineTransformLSqScale2D (WlzDVertex2 *vT, WlzDVertex2 *vS, double *vW, int nVtx, WlzErrorNum *dstErr) |
Computes the 2D transform to rescale the source vertices. The assumption is that the source vertices have a different "spread" to the target and this re-scaling transform can be used in conjunction with the rigid-body (registration) tansform to determine a re-scaled shape-preserving transform i.e. no-shear. It is called by WlzAffineTransformLSq2D when transform type WLZ_TRANSFORM_2D_NOSHEAR is requested. The algorithm compares the mean distance from the centroid of each set of vertices. More... | |
WlzAffineTransform * | WlzAffineTransformLSqReg3D (WlzDVertex3 *vT, WlzDVertex3 *vS, double *vW, int nV, WlzErrorNum *dstErr) |
Computes the Woolz 3D registration transform which gives the best (weighted least squares) fit when used to transform the first set of vertices onto the second using the given match weights. The transform is constrained to rotation and translation only. The algorithm has been addapted from the algorithm: Arun K.S., Huang T.T. and Blostein S.D. "Least-Squares
Fitting of Two 3-D Point Sets" PAMI 9(5), 698-700, 1987, by including vertex weights and computing the translation component of the transform using \[ \mathbf{T} = \frac{\sum_{i=0}^{N-1}{w_i^2 \mathbf{x}_i}} {\sum_{i=0}^{N-1}{w_i^2}} \] \[ \mathbf{x}_i = {\mathbf{p}_i}' - \mathbf{R}\mathbf{p}_i \] where \(w_i\) are the weights, \({\mathbf{p}_i}'\) are the target vertices, \(\mathbf{p}_i\) are the source vertices and \(\mathbf{R}\) is the rotation matrix. More... | |
WlzAffineTransform * | WlzAffineTransformLSqRegWlz2D (WlzDVertex2 *vT, WlzDVertex2 *vS, int nV, WlzErrorNum *dstErr) |
Computes the Woolz 2D registration transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices. This is an old function which should not be used in new code, use WlzAffineTransformLSqReg2D() instead. More... | |
WlzAffineTransform * | WlzAffineTransformLSqDQ2D (int nV, double *vW, WlzDVertex2 *vT, WlzDVertex2 *vS, int nN, double *nW, WlzDVertex2 *nT, WlzDVertex2 *nS, WlzErrorNum *dstErr) |
Computes the Woolz affine transform which gives the best (least squares) fit when used to transform the first set of vertices and normals onto the second set. The vertex and normal weighting factors must be in the range [0-1]. See WlzAffineTransformLSqDQ3D() from which this function has been derived. This algorithm may be less stable than the SVD algorithm particularly when the data are co–linear, use WlzAffineTransformLSq2D() instead. More... | |
WlzAffineTransform * | WlzAffineTransformLSqDQ3D (int nV, double *vW, WlzDVertex3 *vT, WlzDVertex3 *vS, int nN, double *nW, WlzDVertex3 *nT, WlzDVertex3 *nS, WlzErrorNum *dstErr) |
Computes the Woolz affine transform which gives the best (least squares) fit when used to transform the source vertices and normals onto the target vertices. The vertex and normal weighting factors must be in the range [0-1]. This algorithm may be less stable than the SVD algorithm particularly when the data are co–linear, use WlzAffineTransformLSq3D() instead. More... | |
WlzBasisFnTransform * | WlzMakeBasisFnTransform (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... | |
WlzBasisFnTransform * | WlzBasisFnTrFromCPts2D (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... | |
WlzBasisFnTransform * | WlzBasisFnTrFromCPts2DParam (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... | |
WlzBasisFnTransform * | WlzBasisFnTrFromCPts3DParam (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... | |
WlzBasisFnTransform * | WlzBasisFnTrFromCPts3D (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... | |
WlzObject * | WlzBasisFnMakeCMeshTr (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... | |
WlzObject * | WlzBasisFnMakeCMeshTr2D (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... | |
WlzObject * | WlzBasisFnMakeCMeshTr3D (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... | |
WlzObject * | WlzBasisFnInvertMakeCMeshTr (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... | |
WlzObject * | WlzBasisFnInvertMakeCMeshTr2D (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... | |
WlzObject * | WlzBasisFnInvertMakeCMeshTr3D (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... | |
WlzObject * | WlzBasisFnTransformObj (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... | |
WlzPolygonDomain * | WlzBasisFnTransformPoly2 (WlzPolygonDomain *srcPoly, WlzBasisFnTransform *basisTr, int newPoly, WlzErrorNum *dstErr) |
Transforms a 2D polygon domain using a the given basis function transform. More... | |
WlzBoundList * | WlzBasisFnTransformBoundList (WlzBoundList *srcBnd, WlzBasisFnTransform *basisTr, int newBnd, WlzErrorNum *dstErr) |
Transforms a 2D boundary list using a the given basis function transform. More... | |
WlzContour * | WlzBasisFnTransformContour (WlzContour *srcCtr, WlzBasisFnTransform *basisTr, int newCtr, WlzErrorNum *dstErr) |
Transforms a contour using a the given basis function transform. See WlzBasisFnTransformGMModel(). More... | |
WlzGMModel * | WlzBasisFnTransformGMModel (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... | |
WlzObject * | WlzCMeshCompSurfMapToDomain (WlzObject *mshObj, WlzObject *domObj, int nDV, WlzDVertex3 *dV, int nMV, WlzDVertex3 *mV, WlzErrorNum *dstErr) |
Computes a isomophic mapping of the given surface patch (which must be isomorphic to a disk) to the given spatial domain object (which must have a single 2D convex boundary polygon. More... | |
WlzObject * | WlzCMeshCompSurfMap (WlzObject *inObj, int nDV, WlzDVertex3 *dV, int nSV, WlzDVertex3 *sV, WlzErrorNum *dstErr) |
Computes a least squares conformal transformation which maps the source surface to a destination plane with z coordinate zero. When matching the mesh vertices from their position, the closest vertices to the given positions are used. See WlzCMeshCompSurfMapLevy(). More... | |
WlzObject * | WlzCMeshTransformInvert (WlzObject *gObj, WlzErrorNum *dstErr) |
Inverts the given constrained mesh transform in place. More... | |
WlzObject * | WlzCMeshTransformFromObj (WlzObject *srcObj, WlzMeshGenMethod method, double minDist, double maxDist, WlzObject **dstDilObj, int delOut, WlzErrorNum *dstErr) |
Creates a conforming mesh transform for the given object with all mesh displacements allocated but set to zero. A mesh transform is a conforming mesh object with indexed values such that the values are double precision displacements that are ordered x, y[, z]. More... | |
WlzErrorNum | WlzCMeshTransformVtxAry2I (WlzObject *mObj, int nVtx, WlzIVertex2 *vtx, int nInside, WlzUByte *inside) |
Transforms the vertices in the given integer vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2I(). More... | |
WlzErrorNum | WlzCMeshTransformVtxAry3I (WlzObject *mObj, int nVtx, WlzIVertex3 *vtx, int nInside, WlzUByte *inside) |
Transforms the vertices in the given integer vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze3I(). More... | |
WlzErrorNum | WlzCMeshTransformVtxAry2F (WlzObject *mObj, int nVtx, WlzFVertex2 *vtx, int nInside, WlzUByte *inside) |
Transforms the vertices in the given float vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2F(). More... | |
WlzErrorNum | WlzCMeshTransformVtxAry3F (WlzObject *mObj, int nVtx, WlzFVertex3 *vtx, int nInside, WlzUByte *inside) |
Transforms the vertices in the given float vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze3F(). More... | |
WlzErrorNum | WlzCMeshTransformVtxAry2D (WlzObject *mObj, int nVtx, WlzDVertex2 *vtx, int nInside, WlzUByte *inside) |
Transforms the vertices in the given double vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2D(). More... | |
WlzErrorNum | WlzCMeshTransformVtxAry2D5 (WlzObject *mObj, int nVtx, WlzDVertex3 *vtx, int nInside, WlzUByte *inside) |
Transforms the vertices in the given double vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2D(). More... | |
WlzErrorNum | WlzCMeshTransformVtxAry3D (WlzObject *mObj, int nVtx, WlzDVertex3 *vtx, int nInside, WlzUByte *inside) |
Transforms the vertices in the given double vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze3D(). More... | |
WlzObject * | WlzCMeshTransformObj (WlzObject *srcObj, WlzObject *mObj, WlzInterpolationType interp, WlzErrorNum *dstErr) |
Applies a conforming mesh transform to the given source object. More... | |
WlzCompoundArray * | WlzCMeshTransformManyObjAsIdx (WlzCompoundArray *srcObj, WlzObject *mObj, WlzInterpolationType interp, WlzErrorNum *dstErr) |
Applies a conforming mesh transform to all the domains of the given compound array, in a single pass, by creating an grey valued index object from the domains in the compound array; transforming the grey valued domain object and then extracting the domains from the grey valued index object. Because a conforming mesh transform can be comparatively slow this can reduce the time taken to apply the same transform to multiple domains. However it is assumed that none of the domains intersect. If they do then the domains with higher indices (later in the compound array) will overwrite those with lower indices (earlier in the compound array). In many cases this assumption may be valid, eg in the case of exclusive anatomy domains or gene expression strength domains where each is known to be a subset of the preceding strength domains. Even so the results of this function may not be identical to seperate calls at the boundaries of the domains. To distinguish the domains from the background value it may be useful to make the first object of the given compound array an empty object. More... | |
WlzErrorNum | WlzCMeshGetNodesAndEdges (WlzObject *mObj, int *dstNNod, WlzDVertex2 **dstNod, int *dstNDsp, WlzDVertex2 **dstDsp, int *dstNEdg, int **dstEdg) |
Gets the nodes, node displacements and edges of the mesh. The nodes and node displacements are returned as simple arrays of vertices. The edges are returned as a degenerate list of triples, with each triple being the indices of the nodes of an element. More... | |
WlzDBox2 | WlzCMeshTransformGetBBox2D (WlzObject *mObj, int trans, WlzErrorNum *dstErr) |
Computes the bounding box of the mesh in the given mesh transform, with or without applying the displacements according to the value of trans. More... | |
WlzDBox3 | WlzCMeshTransformGetBBox3D (WlzObject *mObj, int trans, WlzErrorNum *dstErr) |
Computes the bounding box of the mesh in the given mesh transform, with or without applying the displacements according to the value of trans. More... | |
WlzErrorNum | WlzScaleCMeshValue (double scale, WlzObject *obj) |
Scales index values pointed of a WoolzObject in place. More... | |
WlzObject * | WlzCopyScaleCMeshValue (double scale, WlzObject *obj, WlzErrorNum *dstErr) |
Creates an woolz CMesh transform object indentical with the input object, but with value scaled. More... | |
WlzErrorNum | WlzCMeshAffineProduct (WlzObject *trM, WlzAffineTransform *trA, int order) |
Computes the product of the given affine and conforming mesh transforms in place, ie the mesh transform has it's displacements overwritten. More... | |
WlzObject * | WlzCMeshMeshMeshProduct (WlzMeshTransform *tr0, WlzMeshTransform *tr1, WlzErrorNum *dstErr) |
Computes the product of the two given (convex) mesh transforms. This is computed within intersection of the two mesh transforms resulting in a conforming mesh transform. \[ \mathbf{T_R}(\mathbf{x}) = \mathbf{T_0}(\mathbf{T_1}(\mathbf{x})) \] Where possible the node positions of the second mesh \(\mathbf{T_1}\) are preserved in the output conforming mesh \(\mathbf{T_R}\). The displacements are given in the output conforming transform are given by \[ \mathbf{d_R}(\mathbf{x}) = \mathbf{d_1}(\mathbf{x}) + \mathbf{d_0}(\mathbf{d_1}(\mathbf{x})) - \mathbf{x} \] . More... | |
WlzObject * | WlzCMeshMeshProduct (WlzObject *tr0, WlzMeshTransform *tr1, int order, WlzErrorNum *dstErr) |
Computes the product of the two given (convex) mesh transforms. This is computed within intersection of the two mesh transforms resulting in a conforming mesh transform. \[ \mathbf{T_R}(\mathbf{x}) = \mathbf{T_1}(\mathbf{T_0}(\mathbf{x})) \] Where possible the node positions of the second mesh \(\mathbf{T_1}\) are preserved in the output mesh \(\mathbf{T_R}\). The displacements in the output transform are given by \[ \mathbf{d_R}(\mathbf{x}) = \mathbf{d_0}(\mathbf{x}) + \mathbf{d_1}(\mathbf{d_0}(\mathbf{x})) - \mathbf{x} \] . More... | |
WlzObject * | WlzCMeshProduct (WlzObject *tr0, WlzObject *tr1, WlzErrorNum *dstErr) |
Computes the product of the two given (conforming) mesh transforms. This is computed within intersection of the two mesh transforms resulting in another conforming mesh transform. \[ \mathbf{T_R}(\mathbf{x}) = \mathbf{T_1}(\mathbf{T_0}(\mathbf{x})) \] Where possible the node positions of the second mesh \(\mathbf{T_1}\) are preserved in the output mesh \(\mathbf{T_R}\). The displacements in the output transform are given by \[ \mathbf{d_R}(\mathbf{x}) = \mathbf{d_0}(\mathbf{x}) + \mathbf{d_1}(\mathbf{d_0}(\mathbf{x})) - \mathbf{x} \] . More... | |
WlzObject * | WlzCMeshExpansion (WlzObject *cObj, int inverse, int method, WlzErrorNum *dstErr) |
Compute the scalar expansion factors for the mesh elements of the given conforming mesh transform. The expansion factors are attached to the elements of the returned conforming mesh object. The expansion factor is defined to be the trace of the strain tensor but in many cases the maximum eigenvalue is a more sensitive feature. More... | |
WlzErrorNum | WlzFitPlaneSVD (WlzVertexType vtxType, int nVtx, WlzVertexP vtx, WlzDVertex3 *dstPinP, WlzDVertex3 *dstNrm) |
Fits a plane to the given vertices using singular value decomposition. The best fit plane is returned (provided there is no error) as a unit normal \(n\) and the centroid of the given vertices ( \(r_0\) ) which in a point in the plane, with the plane equation \[ \vec{n}\cdot(\vec{r} - \vec{r_0}) = \vec{0} \] . More... | |
WlzObject * | WlzIntRescaleObj (WlzObject *gObj, int scale, int expand, WlzErrorNum *dstErr) |
Rescales the given object using an integer scale. More... | |
WlzAffineTransform * | WlzMakeAffineTransform (WlzTransformType type, WlzErrorNum *dstErr) |
Allocates and initialises space for a 2D or 3D affine transform. Sufficient space is always allocated for a 3D transform. The transform should be freed using WlzFreeAffineTransform(). More... | |
WlzErrorNum | WlzFreeAffineTransform (WlzAffineTransform *trans) |
Frees an affine transform allocated by WlzMakeAffineTransform(). More... | |
WlzErrorNum | WlzMatchICPObjs (WlzObject *tObj, WlzObject *sObj, WlzAffineTransform *initTr, int *dstNMatch, WlzVertexP *dstTMatch, WlzVertexP *dstSMatch, int maxItr, int minSpx, int minSegSpx, int brkFlg, double maxDisp, double maxAng, double maxDeform, int matchImpNN, double matchImpThr, double delta) |
Finds matching points in two objects using an ICP based matching algorithm. On return the match points are ranked by plausibility with the most plausible matches first. If either the target or source object is a contour then it's model is modified in place. If this isn't wanted then use WlzCopyObj() to copy the contours before calling this function. More... | |
WlzErrorNum | WlzMatchICPCtr (WlzContour *tCtr, WlzContour *sCtr, WlzAffineTransform *initTr, int maxItr, int minSpx, int minSegSpx, int *dstNMatch, WlzVertexP *dstTMatch, WlzVertexP *dstSMatch, int brkFlg, double maxDisp, double maxAng, double maxDeform, int matchImpNN, double matchImpThr, WlzRegICPUsrWgtFn usrWgtFn, void *usrWgtData, double delta) |
Establishes matching points in two 2D contours using ICP based registration algorithm. The contours have been checked so that their models are neither NULL or of different types. The source contour's model is modified in place. More... | |
double | WlzMatchICPWeightMatches (WlzVertexType vType, WlzAffineTransform *curTr, AlcKDTTree *tree, WlzVertexP tVx, WlzVertexP sVx, WlzVertex tMVx, WlzVertex sMVx, double wVx, double wNr, void *data) |
Compute an the weighting for the matched pair of verticies. This function is called from WlzRegICPTreeAndVertices(). More... | |
void | WlzCMeshDbgOutVTK2D (FILE *fP, WlzCMesh2D *mesh) |
Debuging function for 2D mesh output in VTK format. More... | |
void | WlzCMeshDbgOutVTK3D (FILE *fP, WlzCMesh3D *mesh) |
Debuging function for 3D mesh output in VTK format. More... | |
WlzErrorNum | WlzMeshFreeTransform (WlzMeshTransform *mesh) |
Free's the given mesh transform. More... | |
WlzMeshTransform * | WlzMeshTransformNew (unsigned int nNode, unsigned int nElem, WlzErrorNum *dstErr) |
Creates a mesh transform data structure with the nodes, elements and displacements allocated and initialized to zero. More... | |
WlzMeshTransform * | WlzMeshTransformAdapt (WlzMeshTransform *gMesh, double minArea, WlzErrorNum *dstErr) |
Adapts the given mesh transform so that each of the elements in the displaced mesh has an area greater than the given minimum. More... | |
WlzMeshTransform * | WlzMeshTransformCopy (WlzMeshTransform *gMesh, WlzErrorNum *dstErr) |
Copies the given mesh transform. The copied mesh will have any zombie elements squeezed out. More... | |
WlzMeshTransform * | WlzMeshFromObj (WlzObject *srcObj, WlzMeshGenMethod method, double minDist, double maxDist, WlzErrorNum *dstErr) |
Creates a mesh transform for the given object with all mesh displacements zero. More... | |
WlzObject * | WlzMeshTransformObj (WlzObject *srcObj, WlzMeshTransform *gMesh, WlzInterpolationType interp, WlzErrorNum *dstErr) |
Transforms a woolz object using a the given mesh transform. More... | |
WlzMeshTransform * | WlzMeshTransformFromCPts (WlzObject *obj, WlzFnType basisFnType, int polyOrder, int nSPts, WlzDVertex2 *sPts, int nDPts, WlzDVertex2 *dPts, WlzMeshGenMethod meshGenMtd, double meshMinDist, double meshMaxDist, WlzErrorNum *dstErr) |
Computes a mesh transform for the given object and a set of control points using both an affine and a basis function transform to set the mesh displacements. More... | |
WlzErrorNum | WlzMeshAffineProduct (WlzMeshTransform *mTr, WlzAffineTransform *aTr, int order) |
Computes the product of the given affine and mesh transforms in place, ie the mesh transform has it's displacements overwritten. More... | |
WlzErrorNum | WlzMeshTransformVerify (WlzMeshTransform *mesh, int dispFlg, int *badElm, WlzMeshError *dstErrMsk) |
Checks that the given mesh transform is valid. More... | |
double | WlzClassValCon4 (double *g, double p, double q) |
Interpolate pixel value using maximum probability. More... | |
WlzMeshTransform * | WlzMeshFromObjBox (WlzObject *srcObj, WlzIBox2 *dstBox, int boxDilation, WlzErrorNum *dstErr) |
Creates a mesh transform for the given object where the mesh has just two elements which enclose the objects bounding box. All mesh displacements are zero. More... | |
WlzDVertex2 | WlzMeshTransformVtx (WlzDVertex2 vtx, WlzMeshTransform *mesh, WlzErrorNum *dstErr) |
Transform the vertex using the given mesh transform. More... | |
WlzErrorNum | WlzMeshDomainAdd (WlzMeshTransform *mesh, WlzObject *obj, double minDist, WlzDVertex2 scaleVx) |
Adds mesh nodes within the domain of the given 2D domain object. More... | |
WlzErrorNum | WlzMeshVxVecAdd (WlzMeshTransform *mesh, WlzDVertex2 *vxVec, int nVx, double minDistSq, unsigned int nodeFlags) |
Adds mesh nodes at the vertices of the given (2D) vertex vector. More... | |
static WlzErrorNum | WlzMeshIDomAdd (WlzMeshTransform *mesh, WlzObject *obj, double minDistSq, WlzDVertex2 scaleVx) |
Adds mesh nodes within the interval domain of the given 2D domain object. More... | |
static WlzErrorNum | WlzMeshPolyDomAdd (WlzMeshTransform *mesh, WlzObject *obj, double minDist, WlzDVertex2 scaleVx) |
Adds mesh nodes along the polygon domain of the given 2D domain object. More... | |
WlzErrorNum | WlzMeshElemVerify (WlzMeshTransform *mesh, int dispFlg, WlzMeshElem *elm, WlzMeshError *dstErrMsk) |
Checks that the given mesh transform is valid. More... | |
WlzErrorNum | WlzMeshExpand (WlzMeshTransform *mesh, int nElem, int nNodes) |
Expands a mesh to make sure that there are enough mesh elements and nodes available. More... | |
WlzErrorNum | WlzMeshSqueeze (WlzMeshTransform *mesh) |
Squeeze out any zombie nodes and/or elements so that they are available for reuse. More... | |
int | WlzMeshElemNodeIdxFromVx (WlzMeshTransform *mesh, WlzMeshElem *elm, WlzDVertex2 gVx) |
Finds which of the given elements nodes are coincident with the given vertex. More... | |
int | WlzMeshElemNodeIdxFromNodeIdx (int *nodes, int mNodId) |
Finds which of the given ear/element nodes has the given mesh node index. More... | |
int | WlzMeshElemNbrIdxFromNodes (WlzMeshElem *elm, int nodId0, int nodId1) |
Finds which neighbour of the given element would share the nodes has the given pair of nodes. More... | |
int | WlzMeshElemFindVx (WlzMeshTransform *mesh, WlzDVertex2 gvnVx, int startElm, int *lastElm, int *existsFlg, WlzErrorNum *dstErr) |
Searches the mesh for the element which contains the given vertex. It is NOT an error if the vertex is not within the mesh. More... | |
WlzErrorNum | WlzMeshElemSplit (WlzMeshTransform *mesh, int sElmId) |
Splits the given mesh element by placing a new node at it's circumcentre. More... | |
WlzErrorNum | WlzMeshNodeAdd (WlzMeshTransform *mesh, int startElm, WlzDVertex2 newVx, unsigned int nodeFlags) |
Adds a node to the given mesh, the new node must lie inside the existing mesh. More... | |
WlzErrorNum | WlzMeshNodeDelIdx (WlzMeshTransform *mesh, int startElm, int *nodIdP, int nNod) |
Deletes nodes, specified by their index, from the given mesh. More... | |
static void | WlzMeshNodeDelInit (WlzMeshIntVec *elmVec, WlzMeshIntVec *nodVec, WlzMeshEarList *earList) |
Initialize the element vector, node vector and ear list ready for node deletion. More... | |
static void | WlzMeshNodeDelFree (WlzMeshIntVec *elmVec, WlzMeshIntVec *nodVec, WlzMeshEarList *earList) |
Free storage allocated for the element vector, node vector and ear list after node deletion. More... | |
static WlzErrorNum | WlzMeshNodeDel (WlzMeshTransform *mesh, WlzMeshIntVec *elmVec, WlzMeshIntVec *nodVec, WlzMeshEarList *earList, int startElm, WlzDVertex2 nodVx) |
Deletes a node, specified by it's position, from the given mesh. More... | |
static WlzErrorNum | WlzMeshElemFindVxWalk (WlzMeshTransform *mesh, WlzDVertex2 gVx, int *elmId, int *foundFlg, int *existsFlg) |
Searches the mesh for the element which contains the given vertex. Walks from the given element in the direction of the given vertex until the element which encloses the given vertex is found. If the walk oscillates back and forth between two elements then either may be returned as the enclosing element. More... | |
static WlzErrorNum | WlzMeshQueConflictElem (WlzMeshIntVec *eCnfQVec, WlzMeshTransform *mesh, int srcElmId, int elmId, WlzDVertex2 newVx) |
Recursively builds a que of elements in conflict with the given new node vertex, all elements in conflict being marked using a flag. An element is in conflict with a new node vertex if the new node lies within the circumcircle of the element. More... | |
static WlzErrorNum | WlzMeshElemReplaceN (WlzMeshTransform *mesh, int *eCnfQ, int qCnt, WlzDVertex2 newVx, unsigned int nodeFlags) |
Replaces those mesh elements that are queued and flaged as zombies with new mesh elements which include the given new node vertex. More... | |
static WlzErrorNum | WlzMeshElemReplace1 (WlzMeshTransform *mesh, int eId, WlzDVertex2 newVx, unsigned int nodeFlags) |
Replaces a single mesh element with 1 element (no action), 2 elements (1 new and 1 recycled) or 3 elements (2 new and 1 recycled) using the new node to split the element. More... | |
static void | WlzMeshElemReplace1With1 (WlzMeshTransform *mesh, int eId0, int eId1) |
Replaces a single mesh element with another mesh element. More... | |
static void | WlzMeshElemReplace1With2 (WlzMeshTransform *mesh, int eId, int nod0, WlzDVertex2 newVx, unsigned int nodeFlags) |
Replaces a single mesh element with 2 mesh elements, (1 new and 1 recycled) which include the given new node vertex. More... | |
static void | WlzMeshElemReplace1With3 (WlzMeshTransform *mesh, int eId, WlzDVertex2 newVx, unsigned int nodeFlags) |
Replaces a single mesh element with 3 mesh elements, (2 new and 1 recycled) which include the given new node vertex. More... | |
static WlzErrorNum | WlzMeshElemReplaceNWithN (WlzMeshTransform *mesh, int *zElmIdVec, int zElmCnt, WlzDVertex2 newVx, unsigned int nodeFlags) |
Replaces all queued mesh elements (which always have a convex hull) with elements that use the new node vertex. This function is only ever called with more than one mesh element enqueued. Computing the number of nodes in the enqueued elements is easy because the region is always convex with all it's nodes on it's boundary. Every triangulation of a polygon with N nodes has N - 2 elements. More... | |
static WlzErrorNum | WlzMeshNodeDelVecBuild (WlzMeshIntVec *elmVec, WlzMeshIntVec *nodVec, WlzMeshTransform *mesh, int dElmId, int dElmNodId) |
Builds a vector of the id's of all the mesh elements which include given the node (to be deleted), and a vector to the id's of all the mesh nodes which lie around the perimeter of the polygon formed by the vector of elements. The element and node vectors are in ccw order around the given node. The vector of nodes does not include the given node. All the elements in the vector are marked as zombies ready for recycling. More... | |
static WlzErrorNum | WlzMeshEarListRealloc (WlzMeshEarList *earList, int maxEars) |
Realloc's a mesh ear list pool. More... | |
static void | WlzMeshEarPowerSet (WlzMeshTransform *mesh, WlzMeshEar *ear, int delNodId) |
Computes a power for the given ear, where the power is given by: \[ \frac { \left| \begin{array}{cccc} x_o & x_1 & x_2 & x_3 \\ y_0 & y_1 & y_2 & y_3 \\ x_0^2 + y_0^2 & x_1^2 + y_1^2 & x_2^2 + y_2^2 & x_p^2 + y_p^2 \\ 1 & 1 & 1 & 1 \end{array} \right| } { \left| \begin{array}{ccc} x_0 & x_1 & x_2 \\ y_0 & y_1 & y_2 \\ 1 & 1 & 1 \end{array} \right| } \] Where the given (CCW order) nodes are (x0,y0), (x1,y1) and (x2,y2). The node to be deleted is (xp, yp). In practice this function first checks that the nodes are not co-linear, then that the nodes are CCW and if all ok so far then computes the power. More... | |
static WlzErrorNum | WlzMeshEarsCreate (WlzMeshEarList *earList, WlzMeshIntVec *elmVec, WlzMeshIntVec *nodVec, WlzMeshTransform *mesh, int delNodId) |
Creates a list of mesh ears from a vector of nodes and the node to be deleted. The list is in the order of given nodes, ie CCW around the node to be deleted. More... | |
static void | WlzMeshEarMatchElm (WlzMeshTransform *mesh, WlzMeshEar *ear, WlzMeshIntVec *elmVec, int *elmVecIdP) |
Finds the indicies into the given element vector for the elements which connect to the given ear and sets the ear's neighbours and flags. More... | |
WlzErrorNum | WlzMeshGetNodesAndEdges (WlzMeshTransform *mesh, int *dstNNod, WlzDVertex2 **dstNod, int *dstNDsp, WlzDVertex2 **dstDsp, int *dstNEdg, int **dstEdg) |
Gets the nodes, node displacements and edges of the mesh. The nodes and node displacements are returned as simple arrays of vertices. The edges are returned as a degenerate list of triples, with each triple being the indices of the nodes of an element. More... | |
double | WlzMeshMaxEdgeLenSq (WlzMeshTransform *mesh, WlzErrorNum *dstErr) |
Computes the maximum squared edge length of the mesh elements. More... | |
int | WlzMeshClosestNod2D (WlzMeshTransform *mesh, WlzDVertex2 pos) |
Finds the closest node in the mesh to the given vertex position. More... | |
WlzObject * | WlzProj3DToSection (WlzObject *gvnObj, int nMask, WlzObject **maskObj, WlzThreeDViewStruct *prjView, int nPlnTr, WlzObject **plnTrObj, WlzThreeDViewStruct *secView, WlzErrorNum *dstErr) |
Projects the given 3D doimain onto a section using a given projection, set of mask domains and set of within section transforms and a section view. More... | |
WlzAffineTransform * | WlzRegICPObjsGrd (WlzObject *tObj, WlzObject *sObj, WlzAffineTransform *initTr, WlzTransformType trType, double ctrLo, double ctrHi, double ctrWth, int *dstConv, int *dstItr, int maxItr, double delta, double minDistWgt, WlzErrorNum *dstErr) |
Registers the two given objects using the iterative closest point algorithm. Maximal gradient contours and gradients are extracted from the two given domain objects with values. An affine transform is computed, which when applied to the source object takes it into register with the target object. More... | |
WlzAffineTransform * | WlzRegICPObjs (WlzObject *tObj, WlzObject *sObj, WlzAffineTransform *initTr, WlzTransformType trType, int *dstConv, int *dstItr, int maxItr, double delta, double minDistWgt, WlzErrorNum *dstErr) |
Registers the two given objects using the iterative closest point algorithm. An affine transform is computed, which when applied to the source object takes it into register with the target object. More... | |
WlzObject * | WlzRegICPObjWSD2D (WlzObject *tObj, WlzObject *sObj, WlzAffineTransform *initTr, double xMin, double xMax, double xStep, double yMin, double yMax, double yStep, double rMin, double rMax, double rStep, double minDistWgt, WlzErrorNum *dstErr) |
Computes a 3D domain object in which the double precission values are the weighted sums of distances as used by WlzRegICPObjs(). Thehese values are computed for the given range of translations and rotations. More... | |
WlzAffineTransform * | WlzRegICPVertices (WlzVertexP tVx, WlzVertexP tNr, int tCnt, WlzVertexP sVx, WlzVertexP sNr, int sCnt, WlzVertexType vType, int sgnNrm, WlzAffineTransform *initTr, WlzTransformType trType, int *dstConv, int *dstItr, int maxItr, double delta, double minDistWgt, WlzErrorNum *dstErr) |
Registers the two given sets of vertices using the iterative closest point algorithm. An affine transform is computed, which when applied to the source vertices takes it into register with the target vertices. The vertices and their normals are known to be either WlzDVertex2 or WlzDVertex3. More... | |
WlzObject * | WlzRegICPVerticesWSD2D (WlzVertexP tVx, WlzVertexP tNr, int tCnt, WlzVertexP sVx, WlzVertexP sNr, int sCnt, WlzVertexType vType, int sgnNrm, WlzAffineTransform *initTr, double xMin, double xMax, double xStep, double yMin, double yMax, double yStep, double rMin, double rMax, double rStep, double minDistWgt, WlzErrorNum *dstErr) |
Computes a 3D domain object in which the double precission values are the weighted sums of distances as used by WlzRegICPObjs(). Thehese values are computed for the given range of translations and rotations. More... | |
WlzAffineTransform * | WlzRegICPTreeAndVertices (AlcKDTTree *tree, WlzTransformType trType, WlzVertexType vType, int sgnNrm, int nT, WlzVertexP tVx, WlzVertexP tNr, int nS, int *sIdx, WlzVertexP sVx, WlzVertexP sNr, WlzVertexP tVxBuf, WlzVertexP sVxBuf, double *wgtBuf, int maxItr, WlzAffineTransform *initTr, int *dstConv, WlzRegICPUsrWgtFn usrWgtFn, void *usrWgtData, double delta, double minDistWgt, WlzErrorNum *dstErr) |
Registers the given vertices using the already built kD-tree and the given buffers. This function will attempt to find a rigid body registration before attempting a general affine registration. More... | |
WlzObject * | WlzSampleObj (WlzObject *srcObj, WlzIVertex3 samFac, WlzSampleFn samFn, WlzErrorNum *dstErr) |
Samples the given object using the given sampling factor and sampling method. More... | |
WlzObject * | WlzSampleObjPoint3D (WlzObject *srcObj, WlzIVertex3 samFac, WlzErrorNum *dstErr) |
Samples the given object's plane domain only using the given sampling factor. This function assumes it's parameters to be valid. More... | |
WlzObject * | WlzSampleObjPoint2D (WlzObject *srcObj, WlzIVertex2 samFac, WlzErrorNum *dstErr) |
Samples the given object using a simple point sampling method and the given sampling factor. This function assumes it's parameters to be valid. More... | |
WlzObject * | WlzShiftObject (WlzObject *inObj, int xShift, int yShift, int zShift, WlzErrorNum *dstErr) |
The external object shift interface function. Shifts a Woolz object in place, cf WlzAffineTransform() which always creates a new object with both a new domain and a new value table. WlzShiftObject always makes a new domain but keeps as much of the given object's value table as possible. More... | |
WlzDomain | WlzShiftDomain (WlzObjectType inObjType, WlzDomain inDom, int xShift, int yShift, int zShift, WlzErrorNum *dstErr) |
Creates a new shifted domain. More... | |
WlzValues | WlzShiftValues (WlzObjectType inObjType, WlzValues inVal, WlzDomain inDom, int xShift, int yShift, int zShift, WlzErrorNum *dstErr) |
Shifts the given objects values. More... | |
WlzErrorNum | WlzSnapFit (WlzObject *tObj, WlzObject *sObj, WlzAffineTransform *tr, WlzVertexType *vType, int *dstNVtx, WlzVertexP *dstTVtxP, WlzVertexP *dstSVtxP, double maxCDist, double minTDist, double minSDist) |
Computes correspondences between the given target and source objects, based only on closest points. These may be used to snap-fit one object to another when the alignment of the objects is known to be close. If the optional transform is given then all distances are with respect to the transformed source. More... | |
WlzEmptyTransform * | WlzMakeEmptyTransform (WlzErrorNum *dstErr) |
Makes a new empty transform. More... | |
WlzErrorNum | WlzFreeEmptyTransform (WlzEmptyTransform *tr) |
Frees the given empty transform. More... | |
WlzErrorNum | WlzFreeTransform (WlzTransform tr) |
Free's the given Woolz transform. More... | |
WlzTransform | WlzTransformProduct (WlzTransform tr0, WlzTransform tr1, WlzErrorNum *dstErr) |
Computes the product of the given transforms. The resulting transform's type depends on the given transform types: \[ \mathbf{T_r} = \mathbf{T_0} \mathbf{T_1} \] The product of any transform with an empty transform is an empty transform. More... | |
WlzObject * | WlzTransposeObj (WlzObject *obj, WlzErrorNum *dstErr) |
Transpose a woolz object. Currently implemented for 2D domain, boundary and polyline objects. Transpose means pixels/vertices at (k,l) are moved to (l,k). Domain, boundary and polyline objects can all be transposed. This is used in the WlzSepTrans procedure. More... | |
WlzTransform | WlzTransformRANSAC (int nVtx, WlzVertexType tType, WlzVertexP tVtx, WlzVertexType sType, WlzVertexP sVtx, int minPair, WlzTransformRANSACFitFn fitFn, WlzTransformRANSACErrFn errFn, WlzTransformRANSACDegFn degFn, double oTol, double eTol, double pTol, int dMax, int iMax, int rMax, int iMin, void *cData, int *dstNIn, int **dstIn, WlzErrorNum *dstErr) |
Function to compute a transform from paired correspondences using RANSAC (Random Sample Consensus) which returns the transform for which there are the most inlier vertex pairs. This function is based on the following papers: M.A. Fishler and R.C. Boles "Random Sample Concensus: A Paradigm for Model Fitting with Applications to Image Analysis and Automated Cartography" Communication of the ACM, Vol 24, No 6, pp 381-395, 1981. Ondrej Chum and Jiri Matas "Optimal Randomized RANSAC" PAMI, Vol 30, No 8, pp 1472-1482, 2008. More... | |
Woolz transforms are Woolz domains that define either 2D or 3D spatial transformation.
An affine transform is a transformation which preserves lines and the parralelism of lines, but not the lengths or the angles between (non parrallel) lines. The affine transform can be defined by a homogeneous matrix, which for 2D transforms is a 3x3 matrix and for 3D transforms is a 4x4 matrix. However in a Woolz affine transform the homogeneous matrix is always a allocated as a 4x4 matrix, with only the first 3 rows and columns used for a 2D transform.
A mesh transform defines an approximate topology preseving transformation within the region covered by the mesh. The mesh itself consists of a number of nodes which are connected by simplical elements. The transform displaces each node of the mesh according to the node displacement and interpolates displacements within the mesh elements. It is particularly useful for implementing other transforms such as the basis function transforms. In 2D a mesh transform is defined by a triangular mesh, in 3D it is defined by a tetrahedral mesh.
A basis function transform is the sum of a set of radialy symetric component transforms. With each component transform defined by node and some set of parameters which specify the displacement of points distant from the node, the displacements having radial symmetry.
WlzTransformRANSACErrFn |
Pointer to a function called for user code to evaluate error distance between the transformed source vertex and the target vertex where these are selected from arrays of vertices uning the index. Example:
double ErrFn(WlzTransform tx, WlzVertexType tVxType, WlzVertexP tVx, WlzVertexType sVxType, WlzVertexP sVx, int idx, void *myData) { double e; WlzDVertex2 del; del = WlzAffineTransformVertexD2(tx.affine, sVx.d2[idx], NULL); WLZ_VTX_2_SUB(del, del, tVx.d2); e = WLZ_VTX_2_LENGTH(del); return(e); }
WlzTransformRANSACFitFn |
Pointer to a function called for user code to fit a model transform to the indexed paried source and target vertices. Example:
double FitFn(WlzTransform *tx, WlzVertexType tVxType, WlzVertexP tVx, WlzVertexType sVxType, WlzVertexP sVx, int nIdx, int *idx, void *myData) { WlzErrorNum errNum = WLZ_ERR_NONE; WlzDVertex2 *s = NULL, *t = NULL; if((t = AlcAlloc(sizeof(WlzDVertex2) * nIdx * 2)) == NULL) { errNum = WLZ_ERR_MEM_ALLOC; } if(errNum == WLZ_ERR_NONE) { int i; s = t + nIdx; for(i = 0; i < nIdx; ++i) { s[i] = sVx.d2[idx[i]]; t[i] = tVx.d2[idx[i]]; } (*tx).affine = WlzAffineTransformLSq2D(nIdx, t, nIdx, s, 0, NULL, WLZ_TRANSFORM_2D_AFFINE, &errNum); } return(errNum); }
WlzTransformRANSACDegFn |
Pointer to a function called for user code to test a model transform for degeneracy, returning non-zero if the given transform is degenerate. In some cases (as in the example) it my be possible to simply inspect the transform, in others it may be necessary to transform the source vertices. Example:
double DegFn(WlzTransform *tx, WlzVertexType tVxType, WlzVertexP tVx, WlzVertexType sVxType, WlzVertexP sVx, int nIdx, int *idx, void *myData) { int deg; double t; const double eps = 1.0e-06; t = tx.affine->mat[0][0] * tx.affine->mat[1][1] * tx.affine->mat[2][2]; deg = fabs(t) < eps; return(deg); }
WlzRegICPUsrWgtFn |
A pointer to a function called for user code weighting of the matched vertices.
A data structure for wieghting vertex matches within WlzMatchICPWeightMatches(). Typedef: WlzMatchICPWeightCbData.
WlzAffineTransformCbFn |
Callback function for the WlzAffineTransformCb() which may be used for value interpolation of an interval of destination values.
The parameters are:
3D to 2D projection integration modes.
Flags for the conforming mesh scannning elements.
enum _WlzTransformType |
Types of spatial transformation. Typedef: WlzTransformType.
enum _WlzMeshElemType |
Mesh transform element types. Typedef: WlzMeshElemType.
Enumerator | |
---|---|
WLZ_MESH_ELEM_TRILINEAR | |
WLZ_MESH_ELEM_TRIINCOMPRESSIBLE | |
WLZ_MESH_ELEM_TRICOMPRESSIBLE |
enum _WlzMeshElemFlags |
Mesh transform element flag bit masks. Typedef: WlzMeshElemFlags.
enum _WlzMeshNodeFlags |
Mesh transform node flag masks. Typedef: WlzMeshNodeFlags.
enum _WlzMeshGenMethod |
Mesh generation methods. Typedef: WlzMeshGenMethod.
Enumerator | |
---|---|
WLZ_MESH_GENMETHOD_BLOCK |
Uniform (triangulated) block grid. |
WLZ_MESH_GENMETHOD_GRADIENT |
Triangulated grid based on image gradient. |
WLZ_MESH_GENMETHOD_CONFORM |
Mesh conforming to domain. |
enum _WlzMeshError |
Mesh error bit masks. Typedef: WlzMeshError.
Grey-level transform types. Typedef: WlzGreyTransformType.
enum _WlzSampleFn |
Sampling functions. Typedef: WlzSampleFn.
enum _WlzElementType |
The types of elements in a finite element warp mesh. Typedef: WlzElementType.
Mesh transform element flag bit masks. Typedef: WlzMeshElemFlags.
WlzObject* WlzGetProjectionFromObject | ( | WlzObject * | obj, |
WlzThreeDViewStruct * | viewStr, | ||
Wlz3DProjectionIntFn | intFunc, | ||
void * | intFuncData, | ||
WlzErrorNum * | dstErr | ||
) |
Use the view transform to define a projection from 3D to 2D. Currently only the domain is projected as an opaque shadow. This is old code temporarily kept for compatibility.
obj | source 3D object |
viewStr | view structure defining the projection |
intFunc | grey-value summation function |
intFuncData | data to be passed to the integration function |
dstErr | error return |
References AlcFree(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzThreeDViewStruct::dist, _WlzObject::domain, _WlzThreeDViewStruct::fixed, _WlzGreyP::flp, _WlzGreyV::flv, _WlzGreyValueWSpace::gVal, _WlzDomain::i, _WlzGreyP::inp, _WlzThreeDViewStruct::interp, _WlzGreyV::inv, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linpos, _WlzGreyP::lnp, _WlzGreyV::lnv, _WlzThreeDViewStruct::maxvals, _WlzThreeDViewStruct::minvals, _WlzPixelP::p, _WlzThreeDViewStruct::phi, _WlzGreyP::rgbp, _WlzGreyV::rgbv, _WlzIntervalWSpace::rgtpos, _WlzThreeDViewStruct::scale, _WlzGreyP::shp, _WlzGreyV::shv, _WlzThreeDViewStruct::theta, _WlzPixelV::type, _WlzPixelP::type, _WlzObject::type, _WlzCoreDomain::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzThreeDViewStruct::up, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, _WlzThreeDViewStruct::view_mode, _WlzThreeDViewStruct::voxelRescaleFlg, _WlzThreeDViewStruct::voxelSize, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, Wlz3DSectionTransformInvVtx(), WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_3D_VIEW_STRUCT, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_LONG, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_TAB_RECT, WLZ_GREY_UBYTE, WLZ_INTERVALDOMAIN_RECT, WLZ_NINT, WLZ_PLANEDOMAIN_DOMAIN, WLZ_THRESH_HIGH, WlzAssignObject(), WlzAssignValues(), WlzEndGreyScan(), WlzFree3DViewStruct(), WlzFreeDomain(), WlzFreeObj(), WlzGreyTypeFromObj(), WlzGreyValueGet(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzInit3DViewStruct(), WlzInitGreyScan(), WlzInsideDomain(), WlzMake3DViewStruct(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzNewValueTb(), WlzNextGreyInterval(), WlzThreshold(), _WlzThreeDViewStruct::xp_to_x, _WlzThreeDViewStruct::xp_to_y, _WlzThreeDViewStruct::xp_to_z, _WlzThreeDViewStruct::yp_to_x, _WlzThreeDViewStruct::yp_to_y, _WlzThreeDViewStruct::yp_to_z, and _WlzThreeDViewStruct::zeta.
WlzObject* WlzProjectObjToPlane | ( | WlzObject * | obj, |
WlzThreeDViewStruct * | vStr, | ||
WlzProjectIntMode | intMod, | ||
WlzUByte | denDom, | ||
WlzUByte * | denVal, | ||
double | depth, | ||
WlzErrorNum * | dstErr | ||
) |
Use the view transform to define a projection from 3D to 2D and then project the object onto this plane. The object supplied to this function must be a 3D spatial domain object (WLZ_3D_DOMAINOBJ) with either no values or for integration WLZ_GREY_UBYTE values. Integration will assign each output pixel the sum of all input voxels mapped via either the domain density or the voxel density. The integration is controled by the integrate parameter with valid values: WLZ_PROJECT_INT_MODE_NONE - a "shadow domain" without values is computed, WLZ_PROJECT_INT_MODE_DOMAIN - the voxels of the domain are integrated using
\[ p = \frac{1}{255} n d \]
WLZ_PROJECT_INT_MODE_VALUES - the voxel values are integrated using
\[ p = \frac{1}{255} \sum{l\left[v\right]}. \]
Where \(p\) is the projected image value, \(n\) is the number of voxels projected for \(p\), \(d\) is the density of domain voxels, \(l\) is the voxel value density look up table and \(v\) is a voxel value.
obj | The given object. |
vStr | Given view structure defining the projection plane. |
intMod | This may take three values: WLZ_PROJECT_INT_MODE_NONE, WLZ_PROJECT_INT_MODE_DOMAIN or WLZ_PROJECT_INT_MODE_VALUES. |
denDom | Density of domain voxels this value is not used unless the integration mode is WLZ_PROJECT_INT_MODE_DOMAIN. |
denVal | Density look up table for object voxel density values which must be an array of 256 values. This may be NULL if the integration mode is not WLZ_PROJECT_INT_MODE_VALUES. |
depth | If greater than zero, the projection depth perpendicular to the viewing plane. |
dstErr | Destination error pointer, may be NULL. |
References Alc2Free(), ALC_ER_NONE, ALC_TIMERSUB, AlcCalloc(), AlcFree(), AlcInt2Calloc(), AlcUnchar2Calloc(), _WlzValues::core, _WlzDomain::core, _WlzThreeDViewStruct::dist, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzThreeDViewStruct::fixed, _WlzGreyValueWSpace::gVal, _WlzThreeDViewStruct::initialised, _WlzGreyP::inp, _WlzThreeDViewStruct::interp, _WlzPlaneDomain::lastpl, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linpos, _WlzAffineTransform::mat, _WlzThreeDViewStruct::maxvals, _WlzThreeDViewStruct::minvals, _WlzDomain::p, _WlzThreeDViewStruct::phi, _WlzPlaneDomain::plane1, _WlzIntervalWSpace::rgtpos, _WlzThreeDViewStruct::scale, _WlzThreeDViewStruct::theta, _WlzThreeDViewStruct::trans, _WlzPixelV::type, _WlzObject::type, _WlzCoreDomain::type, _WlzCoreValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzThreeDViewStruct::up, _WlzPixelV::v, _WlzObject::values, _WlzVoxelValues::values, _WlzThreeDViewStruct::view_mode, _WlzValues::vox, _WlzThreeDViewStruct::voxelRescaleFlg, _WlzThreeDViewStruct::voxelSize, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, Wlz3DViewGetPlaneEqn(), Wlz3DViewStructTransformBB(), WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_3D_VIEW_STRUCT, WLZ_3DVIEWSTRUCT_INIT_NONE, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_TRANSFORM_NULL, WLZ_ERR_VALUES_NULL, WLZ_GREY_INT, WLZ_GREY_UBYTE, WLZ_INTERPOLATION_NEAREST, WLZ_NINT, WLZ_PLANEDOMAIN_DOMAIN, WLZ_PROJECT_INT_MODE_DOMAIN, WLZ_PROJECT_INT_MODE_NONE, WLZ_PROJECT_INT_MODE_VALUES, WLZ_RASTERDIR_ILIC, WLZ_THRESH_HIGH, WLZ_TRANSFORM_2D_AFFINE, WLZ_VTX_2_ABS, WLZ_VTX_2_LENGTH, WLZ_VTX_2_NINT, WLZ_VTX_2_SUB, WlzAffineTransformObj(), WlzAssignObject(), WlzEndGreyScan(), WlzFree3DViewStruct(), WlzFreeAffineTransform(), WlzFreeObj(), WlzFromArray2D(), WlzGreyTableIsTiled(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueMakeWSp(), WlzInit3DViewStructAffineTransform(), WlzInitGreyScan(), WlzInitRasterScan(), WlzMake3DViewStruct(), WlzMakeAffineTransform(), WlzMakeMain(), WlzNextGreyInterval(), WlzNextInterval(), WlzThreshold(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, _WlzIBox2::yMin, and _WlzThreeDViewStruct::zeta.
Referenced by WlzProj3DToSection().
WlzObject* Wlz3DViewTransformObj | ( | WlzObject * | srcObj, |
WlzThreeDViewStruct * | viewStr, | ||
WlzErrorNum * | dstErr | ||
) |
Transform an object using the given view-transform. Typically this is for mapping section data back into the 3D space of the reference image/reconstruction.
srcObj | Given source object. |
viewStr | Given view transform. |
dstErr | Destination error pointer, may be NULL. |
References ALC_ER_NONE, AlcFree(), AlcFreeStackPush(), AlcMalloc(), AlgSort(), _WlzIntervalWSpace::colpos, _WlzIntervalWSpace::colrmn, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzGreyV::flv, _WlzIntervalDomain::freeptr, _WlzGreyValueWSpace::gVal, _WlzDomain::i, _WlzInterval::ileft, _WlzGreyP::inp, _WlzGreyV::inv, _WlzInterval::iright, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linpos, _WlzGreyP::lnp, _WlzGreyV::lnv, _WlzThreeDViewStruct::maxvals, _WlzThreeDViewStruct::minvals, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzGreyP::rgbp, _WlzGreyV::rgbv, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzGreyV::shv, _WlzPixelV::type, _WlzObject::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, Wlz3DSectionTransformVtx(), WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_BOUNDLIST, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_GREY_BIT, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_LONG, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_INTERVALDOMAIN_INTVL, WLZ_NINT, WLZ_PLANEDOMAIN_DOMAIN, WLZ_RASTERDIR_ILIC, WLZ_TRANS_OBJ, WLZ_VOXELVALUETABLE_GREY, WlzArea(), WlzAssignDomain(), WlzAssignValues(), WlzFreeObj(), WlzGetBackground(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzInitRasterScan(), WlzIntervalCount(), WlzMakeEmpty(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakeVoxelValueTb(), WlzNewValueTb(), WlzNextGreyInterval(), WlzNextInterval(), _WlzThreeDViewStruct::xp_to_x, _WlzThreeDViewStruct::xp_to_y, _WlzThreeDViewStruct::xp_to_z, _WlzThreeDViewStruct::yp_to_x, _WlzThreeDViewStruct::yp_to_y, and _WlzThreeDViewStruct::yp_to_z.
Referenced by Wlz3DViewTransformBitmap(), WlzDrawDomainObj(), and WlzProj3DToSection().
WlzObject* Wlz3DViewTransformBitmap | ( | int | sizeBitData, |
WlzUByte * | bitData, | ||
int | width, | ||
int | height, | ||
int | x_offset, | ||
int | y_offset, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double | theta, | ||
double | phi, | ||
double | distance, | ||
WlzErrorNum * | dstErr | ||
) |
Gets a 3D section through a byte packed bitmap.
sizeBitData | Number of bytes in bitmap. |
bitData | Bitmap data. |
width | Bitmap width. |
height | Bitmap height. |
x_offset | Horizontal ofset into the bitmap. |
y_offset | Vertical offset into the bitmap. |
x | Fixed point x coordinate. |
y | Fixed point y coordinate. |
z | Fixed point z coordinate. |
theta | Angle of rotation about the z-axis (radians). |
phi | Angle between the viewing direction and the original z-axis (radians). |
distance | Perpendicular distance from the fixed point to the view plane. |
dstErr | Destination error pointer, may be NULL. |
References _WlzThreeDViewStruct::dist, _WlzThreeDViewStruct::fixed, _WlzThreeDViewStruct::phi, _WlzThreeDViewStruct::scale, _WlzThreeDViewStruct::theta, _WlzThreeDViewStruct::up, _WlzThreeDViewStruct::view_mode, _WlzIVertex2::vtX, _WlzDVertex3::vtX, _WlzIVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, Wlz3DViewTransformObj(), WLZ_3D_VIEW_STRUCT, WLZ_ERR_NONE, WLZ_M_PI, WLZ_UP_IS_UP_MODE, WlzAssignObject(), WlzFree3DViewStruct(), WlzFreeObj(), WlzFromBArray1D(), WlzInit3DViewStruct(), and WlzMake3DViewStruct().
int WlzAffineTransformDimension | ( | WlzAffineTransform * | tr, |
WlzErrorNum * | dstErr | ||
) |
Computes the dimension of the given affine transform.
tr | Given affine transform. |
dstErr | Destination error pointer, may be null. |
References _WlzAffineTransform::type, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_NOSHEAR, WLZ_TRANSFORM_2D_REG, WLZ_TRANSFORM_2D_TRANS, WLZ_TRANSFORM_3D_AFFINE, WLZ_TRANSFORM_3D_NOSHEAR, WLZ_TRANSFORM_3D_REG, and WLZ_TRANSFORM_3D_TRANS.
Referenced by WlzAffineTransformGMShell(), WlzAffineTransformInverse(), WlzAffineTransformIsIdentityTol(), WlzAffineTransformIsTranslate(), WlzAffineTransformNormalD2(), WlzAffineTransformNormalD3(), WlzAffineTransformPrimGet(), WlzAffineTransformPrimSet(), WlzAffineTransformRotationSet(), WlzAffineTransformScaleSet(), WlzAffineTransformTranslationSet(), WlzAffineTransformVertexD2(), WlzAffineTransformVertexD3(), WlzCMeshAffineTransformMesh2D(), WlzCMeshAffineTransformMesh2D5(), WlzCMeshAffineTransformMesh3D(), WlzInsideDomain(), WlzObjectFacts(), and WlzSnapFit().
int WlzAffineTransformIsTranslate | ( | WlzAffineTransform * | tr, |
WlzObject * | obj, | ||
WlzErrorNum * | dstErr | ||
) |
Tests whether the given affine transform is a simple integer translation.
tr | Given affine transform. |
obj | Optional object, may be NULL. |
dstErr | Destination error pointer, may be null. |
References AlcCalloc(), AlcVectorItemGet(), _WlzDomain::b, _WlzBoundList::down, _WlzCMeshNod2D::idx, _WlzCMeshNod2D5::idx, _WlzCMeshNod3D::idx, _WlzAffineTransform::mat, _WlzCMeshEntRes::maxEnt, _WlzBoundList::next, _WlzCMeshRes::nod, _WlzPolygonDomain::nvertices, _WlzBoundList::poly, _WlzCMeshNod2D::pos, _WlzCMeshNod2D5::pos, _WlzCMeshNod3D::pos, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzCMesh3D::res, _WlzPolygonDomain::type, _WlzBoundList::type, _WlzCMeshEntRes::vec, _WlzIVertex2::vtX, _WlzFVertex2::vtX, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzPolygonDomain::vtx, _WlzIVertex2::vtY, _WlzFVertex2::vtY, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WLZ_ERR_POLYGON_TYPE, WLZ_ERR_TRANSFORM_TYPE, WLZ_NINT, WLZ_POLYGON_DOUBLE, WLZ_POLYGON_FLOAT, WLZ_POLYGON_INT, WlzAffineTransformDimension(), WlzAffineTransformVertexD2(), WlzAffineTransformVertexD3(), WlzAssignDomain(), WlzBoundingBox2I(), WlzBoundingBox3I(), WlzCMeshCopy2D(), WlzCMeshCopy2D5(), WlzCMeshCopy3D(), WlzCMeshFree2D(), WlzCMeshFree2D5(), WlzCMeshFree3D(), WlzCMeshReassignGridCells2D(), WlzCMeshReassignGridCells2D5(), WlzCMeshReassignGridCells3D(), WlzCMeshUpdateBBox2D(), WlzCMeshUpdateBBox2D5(), WlzCMeshUpdateBBox3D(), WlzFreeBoundList(), WlzMakePolygonDomain(), WlzShiftObject(), _WlzBoundList::wrap, _WlzIBox2::xMax, _WlzIBox3::xMax, _WlzIBox2::xMin, _WlzIBox3::xMin, _WlzIBox2::yMax, _WlzIBox3::yMax, _WlzIBox2::yMin, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzAffineTransformObjCb().
WlzContour* WlzAffineTransformContour | ( | WlzContour * | srcCtr, |
WlzAffineTransform * | tr, | ||
int | newModFlg, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given contour.
srcCtr | Given contour. |
tr | Given affine transform. |
newModFlg | Make a new model if non-zero, otherwise transform the given model in place. |
dstErr | Destination pointer for error number. |
References _WlzContour::model, WLZ_ERR_NONE, WlzAffineTransformGMModel(), WlzAssignGMModel(), WlzFreeContour(), and WlzMakeContour().
Referenced by WlzAffineTransformObjCb(), and WlzContourFromPoints().
WlzPoints* WlzAffineTransformPoints | ( | WlzPoints * | srcPts, |
WlzAffineTransform * | tr, | ||
int | newPtsFlg, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given contour.
srcPts | Given points. |
tr | Given affine transform. |
newPtsFlg | Make a new points domain if non-zero, otherwise transform the given points in place. |
dstErr | Destination pointer for error number. |
References _WlzVertexP::d2, _WlzVertexP::d3, _WlzVertexP::i2, _WlzVertexP::i3, _WlzPoints::nPoints, _WlzPoints::points, _WlzDomain::pts, _WlzPoints::type, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_POINTS_2D, WLZ_POINTS_2I, WLZ_POINTS_3D, WLZ_POINTS_3I, WlzAffineTransformVertexD2(), WlzAffineTransformVertexD3(), WlzAffineTransformVertexI2(), WlzAffineTransformVertexI3(), WlzFreeDomain(), and WlzMakePoints().
Referenced by WlzAffineTransformObjCb().
WlzGMModel* WlzAffineTransformGMModel | ( | WlzGMModel * | srcM, |
WlzAffineTransform * | tr, | ||
int | newModFlg, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given geometric model.
srcM | Given geometric model. |
tr | Given affine transform. |
newModFlg | Make a new model if non-zero, otherwise transform the given model in place. |
dstErr | Destination pointer for error number. |
References AlcVectorItemGet(), _WlzGMShellG2I::bBox, _WlzGMShellG2D::bBox, _WlzGMShellG3I::bBox, _WlzGMShellG3D::bBox, _WlzGMElemP::core, _WlzGMCore::idx, _WlzGMVertexG2N::nrm, _WlzGMVertexG3N::nrm, _WlzGMResource::numIdx, _WlzGMModel::res, _WlzGMModelR::shellG, _WlzGMElemP::shellG2D, _WlzGMElemP::shellG2I, _WlzGMElemP::shellG3D, _WlzGMElemP::shellG3I, _WlzGMModel::type, _WlzGMResource::vec, _WlzGMModelR::vertexG, _WlzGMElemP::vertexG2D, _WlzGMElemP::vertexG2I, _WlzGMElemP::vertexG2N, _WlzGMElemP::vertexG3D, _WlzGMElemP::vertexG3I, _WlzGMElemP::vertexG3N, _WlzGMVertexG2I::vtx, _WlzGMVertexG2D::vtx, _WlzGMVertexG2N::vtx, _WlzGMVertexG3I::vtx, _WlzGMVertexG3D::vtx, _WlzGMVertexG3N::vtx, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_GMMOD_2D, WLZ_GMMOD_2I, WLZ_GMMOD_2N, WLZ_GMMOD_3D, WLZ_GMMOD_3I, WLZ_GMMOD_3N, WlzAffineTransformBBoxD2(), WlzAffineTransformBBoxD3(), WlzAffineTransformBBoxI2(), WlzAffineTransformBBoxI3(), WlzAffineTransformNormalD2(), WlzAffineTransformNormalD3(), WlzAffineTransformVertexD2(), WlzAffineTransformVertexD3(), WlzAffineTransformVertexI2(), WlzAffineTransformVertexI3(), WlzAssignGMModel(), WlzGMModelCopy(), and WlzGMModelRehashVHT().
Referenced by WlzAffineTransformContour(), WlzContourFromPoints(), and WlzMatchICPCtr().
WlzErrorNum WlzAffineTransformGMShell | ( | WlzGMShell * | shell, |
WlzAffineTransform * | tr | ||
) |
Transforms the shell's geometry as well as the geometries of the verticies in the shell. All the transformations are done in place.
shell | Given shell. |
tr | Given affine transform. |
References Alc2Free(), ALC_ER_NONE, AlcBit2Calloc(), _WlzGMShellG2I::bBox, _WlzGMShellG2D::bBox, _WlzGMShellG3I::bBox, _WlzGMShellG3D::bBox, _WlzGMShell::child, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGMVertexT::diskT, _WlzGMVertex::diskT, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGMLoopT::edgeT, _WlzGreyP::flp, _WlzGMVertex::geo, _WlzGMShell::geo, _WlzGreyValueWSpace::gVal, _WlzGreyP::inp, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linpos, _WlzAffineTransform::mat, _WlzGMEdgeT::next, _WlzGMLoopT::next, _WlzGMVertexG2N::nrm, _WlzGMVertexG3N::nrm, _WlzDomain::p, _WlzGMShell::parent, _WlzGreyWSpace::pixeltype, _WlzGreyP::rgbp, _WlzIntervalWSpace::rgtpos, _WlzGMShellGU::sg2D, _WlzGMShellGU::sg2I, _WlzGMShellGU::sg3D, _WlzGMShellGU::sg3I, _WlzGreyP::shp, _WlzPixelV::type, _WlzGMModel::type, _WlzCoreDomain::type, _WlzRagRValues::type, _WlzAffineTransform::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzGMDiskT::vertex, _WlzGMDiskT::vertexT, _WlzGMEdgeT::vertexT, _WlzGMVertexGU::vg2D, _WlzGMVertexGU::vg2I, _WlzGMVertexGU::vg2N, _WlzGMVertexGU::vg3D, _WlzGMVertexGU::vg3I, _WlzGMVertexGU::vg3N, _WlzValues::vox, _WlzIVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzGMVertexG2I::vtx, _WlzGMVertexG2D::vtx, _WlzGMVertexG2N::vtx, _WlzGMVertexG3I::vtx, _WlzGMVertexG3D::vtx, _WlzGMVertexG3N::vtx, _WlzIVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_CLAMP, WLZ_EMPTY_DOMAIN, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_INTERPOLATION_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, WLZ_ERR_UNIMPLEMENTED, WLZ_GMMOD_2D, WLZ_GMMOD_2I, WLZ_GMMOD_2N, WLZ_GMMOD_3D, WLZ_GMMOD_3I, WLZ_GMMOD_3N, WLZ_GREY_BIT, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_INTERPOLATION_CALLBACK, WLZ_INTERPOLATION_CLASSIFY_1, WLZ_INTERPOLATION_LINEAR, WLZ_INTERPOLATION_NEAREST, WLZ_NINT, WLZ_PLANEDOMAIN_DOMAIN, WLZ_RGBA_ALPHA_GET, WLZ_RGBA_ALPHA_SET, WLZ_RGBA_BLUE_GET, WLZ_RGBA_BLUE_SET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_GREEN_SET, WLZ_RGBA_RED_GET, WLZ_RGBA_RED_SET, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_NOSHEAR, WLZ_TRANSFORM_2D_REG, WLZ_TRANSFORM_2D_TRANS, WLZ_TRANSFORM_3D_AFFINE, WLZ_TRANSFORM_3D_NOSHEAR, WLZ_TRANSFORM_3D_REG, WLZ_TRANSFORM_3D_TRANS, WLZ_VOXELVALUETABLE_GREY, WlzAffineTransformBBoxD2(), WlzAffineTransformBBoxD3(), WlzAffineTransformBBoxI2(), WlzAffineTransformBBoxI3(), WlzAffineTransformDimension(), WlzAffineTransformInverse(), WlzAffineTransformNormalD2(), WlzAffineTransformNormalD3(), WlzAffineTransformVertexD2(), WlzAffineTransformVertexD3(), WlzAffineTransformVertexI2(), WlzAffineTransformVertexI3(), WlzAssignDomain(), WlzAssignValues(), WlzBoundingBox3I(), WlzClassValCon4(), WlzEndGreyScan(), WlzFreeAffineTransform(), WlzFreeObj(), WlzFreePlaneDomain(), WlzFromArray2D(), WlzGetBackground(), WlzGMModelAddVertexToHT(), WlzGMModelGetDimension(), WlzGMModelRemVertex(), WlzGreyTableTypeToGreyType(), WlzGreyTypeFromObj(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueGetCon(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzInsideDomain(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakeVoxelValueTb(), WlzNewValueTb(), WlzNextGreyInterval(), WlzStandardPlaneDomain(), WlzValueConvertPixel(), _WlzIBox3::xMax, _WlzIBox3::xMin, _WlzIBox3::yMax, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzMatchICPCtr().
WlzErrorNum WlzAffineTransformPrimSet | ( | WlzAffineTransform * | tr, |
WlzAffineTransformPrim | prim | ||
) |
Sets the given transform's matrix from an affine transform primitives data structure. A composite transform \(A\) is built from the primitives with the order of composition being scale \(s\) (applied first), shear \(h\), rotation \(\theta\) and then translation \(t\) (applied last), ie:
\[ A = t \theta h s, x' = A x \]
.
tr | Given affine transform. |
prim | Given primitives. |
References _WlzAffineTransformPrim::alpha, _WlzAffineTransformPrim::invert, _WlzAffineTransform::mat, _WlzAffineTransformPrim::phi, _WlzAffineTransformPrim::psi, _WlzAffineTransformPrim::scale, _WlzAffineTransformPrim::theta, _WlzAffineTransformPrim::tx, _WlzAffineTransformPrim::ty, _WlzAffineTransformPrim::tz, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, WlzAffineTransformDimension(), and _WlzAffineTransformPrim::xsi.
Referenced by WlzAffineTransformPrimValSet().
WlzErrorNum WlzAffineTransformTranslationSet | ( | WlzAffineTransform * | tr, |
double | tx, | ||
double | ty, | ||
double | tz | ||
) |
Sets the given transform's matrix from the given translations.
tr | Given 2D or 3D affine transform. |
tx | Translation along the x-axis. |
ty | Translation along the y-axis. |
tz | Translation along the z-axis, ignored for 2D transforms. |
References _WlzAffineTransform::mat, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, and WlzAffineTransformDimension().
Referenced by WlzAffineTransformFromTranslation().
WlzAffineTransform* WlzAffineTransformFromTranslation | ( | WlzTransformType | type, |
double | tx, | ||
double | ty, | ||
double | tz, | ||
WlzErrorNum * | dstErr | ||
) |
Constructs a new affine transform from the given translations.
type | Required transform type. |
tx | Translation along the x-axis. |
ty | Translation along the y-axis. |
tz | Translation along the z-axis, ignored for 2D transforms. |
dstErr | Destination pointer for error number. |
References WLZ_ERR_NONE, WlzAffineTransformTranslationSet(), WlzFreeAffineTransform(), and WlzMakeAffineTransform().
Referenced by WlzAffineTransformLSqTrans2D(), WlzAffineTransformLSqTrans3D(), and WlzInit3DViewStructAffineTransform().
WlzErrorNum WlzAffineTransformScaleSet | ( | WlzAffineTransform * | tr, |
double | sx, | ||
double | sy, | ||
double | sz | ||
) |
Sets the given transform's matrix from the given scales.
tr | Given 2D or 3D affine transform. |
sx | Scale along the x-axis. |
sy | Scale along the y-axis. |
sz | Scale along the z-axis, ignored for 2D transforms. |
References _WlzAffineTransform::mat, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, and WlzAffineTransformDimension().
Referenced by WlzAffineTransformFromScale(), WlzCMeshFromObj2D(), WlzCMeshFromObj3D(), WlzMakeTiledValuesObj2D(), and WlzMakeTiledValuesObj3D().
WlzAffineTransform* WlzAffineTransformFromScale | ( | WlzTransformType | type, |
double | sx, | ||
double | sy, | ||
double | sz, | ||
WlzErrorNum * | dstErr | ||
) |
Constructs a new affine transform from the given scales.
type | Required transform type. |
sx | Scale along the x-axis. |
sy | Scale along the y-axis. |
sz | Scale along the z-axis, ignored for 2D transforms. |
dstErr | Destination pointer for error number. |
References WLZ_ERR_NONE, WlzAffineTransformScaleSet(), WlzFreeAffineTransform(), and WlzMakeAffineTransform().
Referenced by WlzCMeshToDomObj(), WlzContourFromPoints(), and WlzDistanceTransform().
WlzErrorNum WlzAffineTransformRotationSet | ( | WlzAffineTransform * | tr, |
double | rx, | ||
double | ry, | ||
double | rz | ||
) |
Sets the given transform's matrix from the given rotations. Although the 3 rotations contain redundant information this may be a useful method for setting rotation transforms. The order of composition is R = Rz.Ry.Rx, x' = R.x.
tr | Given 2D or 3D affine transform. |
rx | Rotation about the x-axis, ignored for 2D transforms. |
ry | Rotation about the y-axis, ignored for 2D transforms. |
rz | Rotation about the z-axis. |
References _WlzAffineTransform::mat, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, and WlzAffineTransformDimension().
Referenced by WlzAffineTransformFromRotation().
WlzAffineTransform* WlzAffineTransformFromRotation | ( | WlzTransformType | type, |
double | rx, | ||
double | ry, | ||
double | rz, | ||
WlzErrorNum * | dstErr | ||
) |
Constructs a new affine transform from the given rotations.
type | Required transform type. |
rx | Rotation about the x-axis, ignored for 2D transforms. |
ry | Rotation about the y-axis, ignored for 2D transforms. |
rz | Rotation about the z-axis. |
dstErr | Destination pointer for error number. |
References WLZ_ERR_NONE, WlzAffineTransformRotationSet(), WlzFreeAffineTransform(), and WlzMakeAffineTransform().
WlzErrorNum WlzAffineTransformPrimGet | ( | WlzAffineTransform * | tr, |
WlzAffineTransformPrim * | prim | ||
) |
Gets the given 2D transform's primitives from it's matrix.
tr | Given 2D affine transform. |
prim | Primitives data structure to be set. |
References _WlzAffineTransformPrim::alpha, _WlzAffineTransformPrim::invert, _WlzAffineTransform::mat, _WlzAffineTransformPrim::phi, _WlzAffineTransformPrim::psi, _WlzAffineTransformPrim::scale, _WlzAffineTransformPrim::theta, _WlzAffineTransformPrim::tx, _WlzAffineTransformPrim::ty, _WlzAffineTransformPrim::tz, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WLZ_ERR_TRANSFORM_TYPE, WlzAffineTransformDimension(), and _WlzAffineTransformPrim::xsi.
Referenced by WlzRegCCorObjs().
WlzErrorNum WlzAffineTransformMatrixSet | ( | WlzAffineTransform * | trans, |
double ** | matrix | ||
) |
Sets the given transform from the given matrix.
trans | Given affine transform. |
matrix | 4x4 transform matrix values to be copied. |
References _WlzAffineTransform::mat, _WlzAffineTransform::type, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_NOSHEAR, WLZ_TRANSFORM_2D_REG, WLZ_TRANSFORM_2D_TRANS, WLZ_TRANSFORM_3D_AFFINE, WLZ_TRANSFORM_3D_NOSHEAR, WLZ_TRANSFORM_3D_REG, and WLZ_TRANSFORM_3D_TRANS.
Referenced by WlzAffineTransformFromMatrix(), and WlzInit3DViewStructAffineTransform().
WlzErrorNum WlzAffineTransformPrimValSet | ( | WlzAffineTransform * | tr, |
double | trX, | ||
double | trY, | ||
double | trZ, | ||
double | trScale, | ||
double | trTheta, | ||
double | trPhi, | ||
double | trAlpha, | ||
double | trPsi, | ||
double | trXsi, | ||
int | trInvert | ||
) |
Sets a 2D affine transform from the given primitives.
tr | Given 2D affine transform. |
trX | Column (x) translation. |
trY | Line (y) translation. |
trZ | Plane (z) translation. |
trScale | Scale transformation. |
trTheta | Rotation about z-axis. |
trPhi | Rotation about y-axis. |
trAlpha | Shear strength. |
trPsi | Shear angle in x-y plane. |
trXsi | 3D shear angle. |
trInvert | Reflection about y-axis if non-zero. |
References _WlzAffineTransformPrim::alpha, _WlzAffineTransformPrim::invert, _WlzAffineTransformPrim::phi, _WlzAffineTransformPrim::psi, _WlzAffineTransformPrim::scale, _WlzAffineTransformPrim::theta, _WlzAffineTransformPrim::tx, _WlzAffineTransformPrim::ty, _WlzAffineTransformPrim::tz, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WlzAffineTransformPrimSet(), and _WlzAffineTransformPrim::xsi.
Referenced by WlzAffineTransformFromPrimVal().
WlzAffineTransform* WlzAffineTransformFromMatrix | ( | WlzTransformType | type, |
double ** | matrix, | ||
WlzErrorNum * | dstErr | ||
) |
Makes a new affine transform of the given type and then sets it's matrix.
type | Required transform type. |
matrix | Given matrix. |
dstErr | Destination pointer for error number. |
References WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WlzAffineTransformMatrixSet(), WlzFreeAffineTransform(), and WlzMakeAffineTransform().
Referenced by WlzAffineTransformCopy(), WlzAffineTransformLSqDQ2D(), WlzAffineTransformLSqDQ3D(), WlzAffineTransformLSqGen2D(), WlzAffineTransformLSqGen3D(), WlzAffineTransformLSqReg2D(), WlzAffineTransformLSqReg3D(), WlzAffineTransformLSqRegWlz2D(), and WlzInit3DViewStructAffineTransform().
WlzAffineTransform* WlzAffineTransformFromPrimVal | ( | WlzTransformType | type, |
double | trX, | ||
double | trY, | ||
double | trZ, | ||
double | trScale, | ||
double | trTheta, | ||
double | trPhi, | ||
double | trAlpha, | ||
double | trPsi, | ||
double | trXsi, | ||
int | trInvert, | ||
WlzErrorNum * | dstErr | ||
) |
Makes a new affine transform from the given primitive transform properties.
type | Required transform type. |
trX | Column (x) translation. |
trY | Line (y) translation. |
trZ | Plane (z) translation. |
trScale | Scale transformation. |
trTheta | Rotation about z-axis. |
trPhi | Rotation about y-axis. |
trAlpha | Shear strength. |
trPsi | Shear angle in x-y plane. |
trXsi | 3D shear angle. |
trInvert | Reflection about y-axis if non-zero. |
dstErr | Destination pointer for error number. |
References WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_ERR_NONE, WlzAffineTransformPrimValSet(), WlzFreeAffineTransform(), and WlzMakeAffineTransform().
Referenced by WlzAffineTransformFromSpin(), WlzAffineTransformLSqScale2D(), WlzMarkerLattice(), WlzRegCCorObjs(), WlzRegICPVerticesWSD2D(), and WlzShiftDomain().
WlzAffineTransform* WlzAffineTransformFromSpin | ( | double | spX, |
double | spY, | ||
double | spTheta, | ||
WlzErrorNum * | dstErr | ||
) |
Makes a new 2D affine transform from the given spin angle and centre of rotation.
spX | Spin centre column (x). |
spY | Spin centre line (y). |
spTheta | Spin rotation about centre. number. |
dstErr | Destination pointer for error number. |
References WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_TRANSFORM_2D_AFFINE, and WlzAffineTransformFromPrimVal().
WlzAffineTransform* WlzAffineTransformFromSpinSqueeze | ( | double | spX, |
double | spY, | ||
double | spTheta, | ||
double | sqX, | ||
double | sqY, | ||
WlzErrorNum * | dstErr | ||
) |
Makes a new 2D affine transform from the given spin angle, centre of rotation and scale factors.
spX | Spin centre column (x). |
spY | Spin centre line (y). |
spTheta | Spin rotation about centre. number. |
sqX | Squeeze (x) factor. |
sqY | Squeeze (y) factor. |
dstErr | Destination pointer for error number. |
References _WlzAffineTransform::mat, matrix(), WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_ERR_NONE, WLZ_ERR_UNSPECIFIED, WLZ_TRANSFORM_2D_AFFINE, and WlzMakeAffineTransform().
WlzAffineTransform* WlzAffineTransformCopy | ( | WlzAffineTransform * | tr, |
WlzErrorNum * | dstErr | ||
) |
Copies the given affine transform.
tr | Given affine transform. |
dstErr | Destination pointer for error number. |
References _WlzAffineTransform::mat, _WlzAffineTransform::type, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WlzAffineTransformFromMatrix().
Referenced by WlzAffineTransformInverse(), WlzCopyDomain(), WlzGreyValueMakeWSp(), WlzMatchICPWeightMatches(), WlzRegICPTreeAndVertices(), and WlzRegICPVertices().
WlzAffineTransform* WlzAffineTransformProduct | ( | WlzAffineTransform * | tr0, |
WlzAffineTransform * | tr1, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the product of the two given affine transforms \(T_1 T_0\).
tr0 | First affine transform \(T_0\). |
tr1 | Second affine transform \(T_1\). |
dstErr | Destination pointer for error number. |
References _WlzAffineTransform::mat, _WlzAffineTransform::type, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_3D_AFFINE, and WlzMakeAffineTransform().
Referenced by WlzAffineTransformLSq2D(), WlzAffineTransformObjCb(), WlzGreyValueMakeWSp(), WlzInit3DViewStructAffineTransform(), WlzRegCCorObjs(), WlzRegICPTreeAndVertices(), WlzRegICPVerticesWSD2D(), WlzShiftDomain(), and WlzTransformProduct().
WlzAffineTransform* WlzAffineTransformInverse | ( | WlzAffineTransform * | tr, |
WlzErrorNum * | dstErr | ||
) |
Computes the inverse of the given affine transform.
tr | Given affine transform. |
dstErr | Destination pointer for error number. |
References ALG_ERR_NONE, AlgMatrixLUInvertRaw(), _WlzAffineTransform::mat, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_DATA, WlzAffineTransformCopy(), and WlzAffineTransformDimension().
Referenced by Wlz3DSectionIncrementDistance(), Wlz3DSectionTransformInvVtx(), Wlz3DViewGetIntersectionAngle(), Wlz3DViewGetIntersectionPoint(), Wlz3DViewStructSetupTransformLuts(), WlzAffineTransformGMShell(), WlzCMeshAffineProduct(), WlzGreyValueMakeWSp(), WlzInsideDomain(), WlzMeshTransformFromCPts(), and WlzRegICPTreeAndVertices().
int WlzAffineTransformIsIdentity | ( | WlzAffineTransform * | trans, |
WlzErrorNum * | dstErr | ||
) |
Checks whether the given transform is an identity transform. This function is equivalent to WlzAffineTransformIsIdentityTol() with a tolerances of 1.0e-06.
trans | Given affine transform. |
dstErr | Destination pointer for error number. |
References WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, and WlzAffineTransformIsIdentityTol().
Referenced by WlzRegCCorObjs().
int WlzAffineTransformIsIdentityTol | ( | WlzAffineTransform * | trans, |
double | tolTn, | ||
double | tolTx, | ||
WlzErrorNum * | dstErr | ||
) |
Checks whether the given transform is an identity transform using the given tolerance. If any of the transform parameters deviates from those an identity transform my more than +/- the given tolerance the transform is not considered an identity transform.
trans | Given affine transform. |
tolTn | Given tollerance for all elements except translation. |
tolTx | Given tollerance for translation. |
dstErr | Destination pointer for error number. |
References _WlzAffineTransform::mat, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, and WlzAffineTransformDimension().
Referenced by WlzAffineTransformIsIdentity().
WlzObject* WlzAffineTransformObj | ( | WlzObject * | srcObj, |
WlzAffineTransform * | trans, | ||
WlzInterpolationType | interp, | ||
WlzErrorNum * | dstErr | ||
) |
Applies the given affine transform to the given Woolz object.
srcObj | Object to be transformed. |
trans | Affine transform to apply. |
interp | Level of interpolation to use. |
dstErr | Destination pointer for error number, may be NULL. |
References WlzAffineTransformObjCb().
Referenced by WlzCMeshFromObj2D(), WlzCMeshFromObj3D(), WlzCMeshToDomObj(), WlzContourFromPoints(), WlzDistanceTransform(), WlzMakeTiledValuesObj2D(), WlzMakeTiledValuesObj3D(), WlzMarkerLattice(), WlzProjectObjToPlane(), and WlzRegCCorObjs().
WlzObject* WlzAffineTransformObjCb | ( | WlzObject * | srcObj, |
WlzAffineTransform * | trans, | ||
WlzInterpolationType | interp, | ||
void * | cbData, | ||
WlzAffineTransformCbFn | cbFn, | ||
WlzErrorNum * | dstErr | ||
) |
Applies the given affine transform to the given Woolz object. The interpolation data and function may both be NULL unless the interpolation type is WLZ_INTERPOLATION_CALLBACK in which case the interpolation callback function will be called for each interpolated value.
srcObj | Object to be transformed. |
trans | Affine transform to apply. |
interp | Level of interpolation to use. |
cbData | Data passed to the directly to the callback function. |
cbFn | Callback function. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzDomain::b, _WlzDomain::cm2, _WlzDomain::cm2d5, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzDomain::ctr, _WlzObject::domain, _WlzDomain::p, _WlzDomain::poly, _WlzDomain::pts, _WlzDomain::t, _WlzObject::type, _WlzCoreDomain::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_AFFINE_TRANS, WLZ_BOUNDLIST, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_CONTOUR, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_ERR_TRANSFORM_NULL, WLZ_INTERPOLATION_CALLBACK, WLZ_INTERPOLATION_CLASSIFY_1, WLZ_INTERPOLATION_LINEAR, WLZ_INTERPOLATION_NEAREST, WLZ_PLANEDOMAIN_DOMAIN, WLZ_POINTS, WLZ_SIMPLE_FILL, WLZ_TRANS_OBJ, WlzAffineTransformContour(), WlzAffineTransformIsTranslate(), WlzAffineTransformPoints(), WlzAffineTransformProduct(), WlzBoundToObj(), WlzFreeDomain(), WlzFreeObj(), WlzMakeEmpty(), WlzMakeMain(), and WlzObjToBoundary().
Referenced by WlzAffineTransformObj().
WlzIVertex2 WlzAffineTransformVertexI2 | ( | WlzAffineTransform * | trans, |
WlzIVertex2 | srcVtx, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzIVertex2.
trans | Affine transform to apply. |
srcVtx | Vertex to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, WLZ_ERR_NONE, WLZ_NINT, and WlzAffineTransformVertexD2().
Referenced by WlzAffineTransformBBoxI2(), WlzAffineTransformGMModel(), WlzAffineTransformGMShell(), and WlzAffineTransformPoints().
WlzIVertex3 WlzAffineTransformVertexI3 | ( | WlzAffineTransform * | trans, |
WlzIVertex3 | srcVtx, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzIVertex3.
trans | Affine transform to apply. |
srcVtx | Vertex to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_ERR_NONE, WLZ_NINT, and WlzAffineTransformVertexD3().
Referenced by WlzAffineTransformBBoxI3(), WlzAffineTransformGMModel(), WlzAffineTransformGMShell(), and WlzAffineTransformPoints().
WlzFVertex2 WlzAffineTransformVertexF2 | ( | WlzAffineTransform * | trans, |
WlzFVertex2 | srcVtx, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzFVertex2.
trans | Affine transform to apply. |
srcVtx | Vertex to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzFVertex2::vtX, _WlzDVertex2::vtX, _WlzFVertex2::vtY, _WlzDVertex2::vtY, WLZ_ERR_NONE, and WlzAffineTransformVertexD2().
WlzFVertex3 WlzAffineTransformVertexF3 | ( | WlzAffineTransform * | trans, |
WlzFVertex3 | srcVtx, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzFVertex3.
trans | Affine transform to apply. |
srcVtx | Vertex to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzFVertex3::vtX, _WlzDVertex3::vtX, _WlzFVertex3::vtY, _WlzDVertex3::vtY, _WlzFVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_ERR_NONE, and WlzAffineTransformVertexD3().
WlzDVertex2 WlzAffineTransformVertexD2 | ( | WlzAffineTransform * | trans, |
WlzDVertex2 | srcVtx, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzDVertex2.
trans | Affine transform to apply. |
srcVtx | Vertex to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzAffineTransform::mat, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, and WlzAffineTransformDimension().
Referenced by WlzAffineTransformBBoxD2(), WlzAffineTransformGMModel(), WlzAffineTransformGMShell(), WlzAffineTransformIsTranslate(), WlzAffineTransformLSq2D(), WlzAffineTransformPoints(), WlzAffineTransformVertexF2(), WlzAffineTransformVertexI2(), WlzCentreOfMassVtx3D(), WlzCMeshAffineProduct(), WlzCMeshAffineTransformMesh2D(), WlzGreyValueGet(), WlzGreyValueGetDir(), WlzInsideDomain(), WlzMatchICPWeightMatches(), WlzMeshAffineProduct(), WlzMeshTransformFromCPts(), WlzRegICPTreeAndVertices(), WlzRegICPVerticesWSD2D(), and WlzSnapFit().
WlzDVertex3 WlzAffineTransformVertexD3 | ( | WlzAffineTransform * | trans, |
WlzDVertex3 | srcVtx, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzDVertex3.
trans | Affine transform to apply. |
srcVtx | Vertex to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzAffineTransform::mat, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WlzAffineTransformDimension().
Referenced by Wlz3DSectionTransformInvVtx(), Wlz3DSectionTransformVtx(), Wlz3DViewStructSetupTransformLuts(), WlzAffineTransformBBoxD3(), WlzAffineTransformGMModel(), WlzAffineTransformGMShell(), WlzAffineTransformIsTranslate(), WlzAffineTransformPoints(), WlzAffineTransformVertexF3(), WlzAffineTransformVertexI3(), WlzCentreOfMassVtx3D(), WlzCMeshAffineProduct(), WlzCMeshAffineTransformMesh2D5(), WlzCMeshAffineTransformMesh3D(), WlzGreyValueGet(), WlzGreyValueGetDir(), WlzInsideDomain(), WlzRegICPTreeAndVertices(), WlzRegICPVerticesWSD2D(), and WlzSnapFit().
WlzDVertex2 WlzAffineTransformNormalD2 | ( | WlzAffineTransform * | trans, |
WlzDVertex2 | srcNrm, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzDVertex2 which is a normal.
trans | Affine transform to apply. |
srcNrm | Normal to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzAffineTransform::mat, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, and WlzAffineTransformDimension().
Referenced by WlzAffineTransformGMModel(), WlzAffineTransformGMShell(), WlzRegICPTreeAndVertices(), and WlzRegICPVerticesWSD2D().
WlzDVertex3 WlzAffineTransformNormalD3 | ( | WlzAffineTransform * | trans, |
WlzDVertex3 | srcNrm, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzDVertex3 which is a normal.
trans | Affine transform to apply. |
srcNrm | Normal to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzAffineTransform::mat, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WlzAffineTransformDimension().
Referenced by WlzAffineTransformGMModel(), WlzAffineTransformGMShell(), WlzRegICPTreeAndVertices(), and WlzRegICPVerticesWSD2D().
WlzIBox2 WlzAffineTransformBBoxI2 | ( | WlzAffineTransform * | tr, |
WlzIBox2 | srcBox, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzIBox2.
tr | Affine transform to apply. |
srcBox | Bounding box to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_ERR_NONE, WlzAffineTransformVertexI2(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, and _WlzIBox2::yMin.
Referenced by WlzAffineTransformGMModel(), and WlzAffineTransformGMShell().
WlzDBox2 WlzAffineTransformBBoxD2 | ( | WlzAffineTransform * | tr, |
WlzDBox2 | srcBox, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzDBox2.
tr | Affine transform to apply. |
srcBox | Bounding box to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_NONE, WlzAffineTransformVertexD2(), _WlzDBox2::xMax, _WlzDBox2::xMin, _WlzDBox2::yMax, and _WlzDBox2::yMin.
Referenced by WlzAffineTransformGMModel(), and WlzAffineTransformGMShell().
WlzIBox3 WlzAffineTransformBBoxI3 | ( | WlzAffineTransform * | tr, |
WlzIBox3 | srcBox, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzIBox3.
tr | Affine transform to apply. |
srcBox | Bounding box to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_ERR_NONE, WlzAffineTransformVertexI3(), _WlzIBox3::xMax, _WlzIBox3::xMin, _WlzIBox3::yMax, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzAffineTransformGMModel(), and WlzAffineTransformGMShell().
WlzDBox3 WlzAffineTransformBBoxD3 | ( | WlzAffineTransform * | tr, |
WlzDBox3 | srcBox, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzDBox3.
tr | Affine transform to apply. |
srcBox | Bounding box to be transformed. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, WlzAffineTransformVertexD3(), _WlzDBox3::xMax, _WlzDBox3::xMin, _WlzDBox3::yMax, _WlzDBox3::yMin, _WlzDBox3::zMax, and _WlzDBox3::zMin.
Referenced by WlzAffineTransformGMModel(), WlzAffineTransformGMShell(), and WlzBoundingBoxVtx3I().
WlzAffineTransform* WlzAffineTransformLSq | ( | WlzVertexType | vType, |
int | nVT, | ||
WlzVertexP | vT, | ||
int | nVS, | ||
WlzVertexP | vS, | ||
int | nVW, | ||
double * | vW, | ||
WlzTransformType | trType, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the Woolz affine transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices. The weights are optional but if givn must correspond to the vertices. This function calls either WlzAffineTransformLSq2D() or WlzAffineTransformLSq3D() depending on the given vertex type, see these functions of greater detail.
vType | Type of vertices. |
nVT | Number of target vertices. |
vT | Target vertices. |
nVS | Number source vertices, which must be the same as the number of target vertices. |
vS | Target vertices. |
nVW | number of vertex weights, which must either be zero or the same as the number target vertices. |
vW | Vertex pair weights which may be NULL if the number of weights is zero. |
trType | Required transform type. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzVertexP::d2, _WlzVertexP::d3, _WlzVertexP::v, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_VERTEX_D2, WLZ_VERTEX_D3, WlzAffineTransformLSq2D(), and WlzAffineTransformLSq3D().
Referenced by WlzRegICPTreeAndVertices(), and WlzRegICPVerticesWSD2D().
WlzAffineTransform* WlzAffineTransformLSq2D | ( | int | nVT, |
WlzDVertex2 * | vT, | ||
int | nVTS, | ||
WlzDVertex2 * | vS, | ||
int | nVW, | ||
double * | vW, | ||
WlzTransformType | trType, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the affine transform which gives the best (least squares) fit when used to transform the 2D source vertices onto the target vertices. This function calls the appropriate 2D least squares affine transform function:
nVT | Number of target vertices. |
vT | First vector of vertices. |
nVTS | Number of vertices in second vector (MUST be same as first). |
vS | Second vector of vertices. |
nVW | number of vertex weights, which must either be zero or the same as the number target vertices. |
vW | Vertex pair weights which may be NULL if the number of weights is zero. |
trType | Required transform type. |
dstErr | Destination pointer for error number, may be NULL. |
References AlcFree(), AlcMalloc(), WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_NOSHEAR, WLZ_TRANSFORM_2D_REG, WLZ_TRANSFORM_2D_TRANS, WlzAffineTransformLSqGen2D(), WlzAffineTransformLSqReg2D(), WlzAffineTransformLSqScale2D(), WlzAffineTransformLSqTrans2D(), WlzAffineTransformProduct(), WlzAffineTransformVertexD2(), and WlzFreeAffineTransform().
Referenced by WlzAffineTransformLSq(), and WlzMeshTransformFromCPts().
WlzAffineTransform* WlzAffineTransformLSq3D | ( | int | nVT, |
WlzDVertex3 * | vT, | ||
int | nVS, | ||
WlzDVertex3 * | vS, | ||
int | nVW, | ||
double * | vW, | ||
WlzTransformType | trType, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the affine transform which gives the best (least squares) fit when used to transform the 3D source vertices onto the target vertices. This function calls the appropriate 3D least squares affine transform function:
nVT | Number of target vertices. |
vT | First vector of vertices. |
nVS | Number of vertices in second vector (MUST be same as first). |
vS | Second vector of vertices. |
nVW | number of vertex weights, which must either be zero or the same as the number target vertices. |
vW | Vertex pair weights which may be NULL if the number of weights is zero. |
trType | Required transform type. |
dstErr | Destination pointer for error number, may be NULL. |
References WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_3D_AFFINE, WLZ_TRANSFORM_3D_REG, WLZ_TRANSFORM_3D_TRANS, WlzAffineTransformLSqGen3D(), WlzAffineTransformLSqReg3D(), and WlzAffineTransformLSqTrans3D().
Referenced by WlzAffineTransformLSq().
WlzAffineTransform* WlzAffineTransformLSqTrans2D | ( | WlzDVertex2 * | vT, |
WlzDVertex2 * | vS, | ||
double * | vW, | ||
int | nV, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the 2D translation transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices.
vT | Target vertices. |
vS | Source vertices. |
vW | Vertex pair weights. |
nV | Number of vertex pairs. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_TRANSFORM_2D_AFFINE, and WlzAffineTransformFromTranslation().
Referenced by WlzAffineTransformLSq2D().
WlzAffineTransform* WlzAffineTransformLSqTrans3D | ( | WlzDVertex3 * | vT, |
WlzDVertex3 * | vS, | ||
double * | vW, | ||
int | nV, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the 3D translation transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices.
vT | Target vertices. |
vS | Source vertices. |
vW | Vertex pair weights. |
nV | Number of vertex pairs. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_TRANSFORM_3D_AFFINE, and WlzAffineTransformFromTranslation().
Referenced by WlzAffineTransformLSq3D().
WlzAffineTransform* WlzAffineTransformLSqGen2D | ( | WlzDVertex2 * | vT, |
WlzDVertex2 * | vS, | ||
double * | vW, | ||
int | nV, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the general 2D affine transform which gives the best (least squares) fit when used to transform the target vertices onto the source vertices.
\[ \mathbf{\acute{x_i}} = T \mathbf{x_i} \]
can be found by minimizing \(\chi^2\) in:\[ \chi^2 = \sum_{i=0}^{N-1} {(w_i(\mathbf{x_i} - \mathbf{\acute{x_i}})^2)} \]
By taking partial derivatives of \(\chi^2\) w.r.t. the transform array elements and setting these to zero the least squares affine transform is found through solving:\[ A \mathbf{x} = \mathbf{b} \]
with\[ A = \left( \begin{array}{ccc} \sum_{i=0}^{N-1}{w_i^2 x_i^2} & \sum_{i=0}^{N-1}{w_i^2 x_i y_i} & \sum_{i=0}^{N-1}{w_i^2 x_i} \\ \sum_{i=0}^{N-1}{w_i^2 x_i y_i} & \sum_{i=0}^{N-1}{w_i^2 y_i^2} & \sum_{i=0}^{N-1}{w_i^2 y_i} \\ \sum_{i=0}^{N-1}{w_i^2 x_i} & \sum_{i=0}^{N-1}{w_i^2 y_i} & \sum_{i=0}^{N-1}{w_i^2} \end{array} \right) \]
For \(\mathbf{x} = (t00, t01, t02)^T\):\[ \mathbf{b} = \left( \begin{array}{c} \sum_{i=0}^{N-1}{w_i^2 x_i \acute{x_i}} \\ \sum_{i=0}^{N-1}{w_i^2 y_i \acute{x_i}} \\ \sum_{i=0}^{N-1}{w_i^2 \acute{x_i}} \end{array} \right) \]
and for \(\mathbf{y} = (t10, t11, t12)^T\):\[ \mathbf{b} = \left( \begin{array}{c} \sum_{i=0}^{N-1}{w_i^2 x_i \acute{y_i}} \\ \sum_{i=0}^{N-1}{w_i^2 y_i \acute{y_i}} \\ \sum_{i=0}^{N-1}{w_i^2 \acute{y_i}} \end{array} \right) \]
vT | Target vertices. |
vS | Source vertices. |
vW | Vertex pair weights in range [0.0-1.0], may be NULL in which case all weights have value 1.0. |
nV | Number of vertex pairs. |
dstErr | Destination pointer for error number, may be NULL. |
References AlgMatrixFree(), AlgMatrixRectNew(), _AlgMatrixRect::array, _AlgMatrix::core, _AlgMatrix::rect, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_TRANSFORM_2D_AFFINE, and WlzAffineTransformFromMatrix().
Referenced by WlzAffineTransformLSq2D().
WlzAffineTransform* WlzAffineTransformLSqGen3D | ( | WlzDVertex3 * | vT, |
WlzDVertex3 * | vS, | ||
double * | vW, | ||
int | nV, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the general 3D affine transform which gives the best (least squares) fit when used to transform the target vertices onto the source vertices.
\[ \mathbf{\acute{x_i}} = T \mathbf{x_i} \]
can be found by minimizing \(\chi^2\) in:\[ \chi^2 = \sum_{i=0}^{N-1} {(w_i(\mathbf{x_i} - \mathbf{\acute{x_i}})^2)} \]
By taking partial derivatives of \(\chi^2\) w.r.t. the transform array elements and setting these to zero the least squares affine transform is found through solving:\[ A \mathbf{x} = \mathbf{b} \]
with\[ A = \left( \begin{array}{cccc} \sum_{i=0}^{N-1}{w_i^2 x_i^2} & \sum_{i=0}^{N-1}{w_i^2 x_i y_i} & \sum_{i=0}^{N-1}{w_i^2 x_i z_i} & \sum_{i=0}^{N-1}{w_i^2 x_i} \\ \sum_{i=0}^{N-1}{w_i^2 x_i y_i} & \sum_{i=0}^{N-1}{w_i^2 y_i^2} & \sum_{i=0}^{N-1}{w_i^2 y_i z_i} & \sum_{i=0}^{N-1}{w_i^2 y_i} \\ \sum_{i=0}^{N-1}{w_i^2 x_i z_i} & \sum_{i=0}^{N-1}{w_i^2 y_i z_i} & \sum_{i=0}^{N-1}{w_i^2 z_i^2} & \sum_{i=0}^{N-1}{w_i^2 z_i} \\ \sum_{i=0}^{N-1}{w_i^2 x_i} & \sum_{i=0}^{N-1}{w_i^2 y_i} & \sum_{i=0}^{N-1}{w_i^2 z_i} & \sum_{i=0}^{N-1}{w_i^2} \end{array} \right) \]
For \(\mathbf{x} = (t00, t01, t02, t03)^T\):\[ \mathbf{b} = \left( \begin{array}{c} \sum_{i=0}^{N-1}{w_i^2 x_i \acute{x_i}} \\ \sum_{i=0}^{N-1}{w_i^2 y_i \acute{x_i}} \\ \sum_{i=0}^{N-1}{w_i^2 z_i \acute{x_i}} \\ \sum_{i=0}^{N-1}{w_i^2 \acute{x_i}} \end{array} \right) \]
for \(\mathbf{y} = (t10, t11, t12, t13)^T\):\[ \mathbf{b} = \left( \begin{array}{c} \sum_{i=0}^{N-1}{w_i^2 x_i \acute{y_i}} \\ \sum_{i=0}^{N-1}{w_i^2 y_i \acute{y_i}} \\ \sum_{i=0}^{N-1}{w_i^2 z_i \acute{y_i}} \\ \sum_{i=0}^{N-1}{w_i^2 \acute{y_i}} \end{array} \right) \]
and for \(\mathbf{z} = (t20, t21, t22, t23)^T\):\[ \mathbf{b} = \left( \begin{array}{c} \sum_{i=0}^{N-1}{w_i^2 x_i \acute{z_i}} \\ \sum_{i=0}^{N-1}{w_i^2 y_i \acute{z_i}} \\ \sum_{i=0}^{N-1}{w_i^2 z_i \acute{z_i}} \\ \sum_{i=0}^{N-1}{w_i^2 \acute{z_i}} \end{array} \right) \]
vT | Target vertices. |
vS | Source vertices. |
vW | Vertex pair weights in range [0.0-1.0], may be NULL in which case all weights have value 1.0. |
nV | Number of vertex pairs. |
dstErr | Destination pointer for error number, may be NULL. |
References AlgMatrixFree(), AlgMatrixRectNew(), _AlgMatrixRect::array, _AlgMatrix::core, _AlgMatrix::rect, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_TRANSFORM_3D_AFFINE, and WlzAffineTransformFromMatrix().
Referenced by WlzAffineTransformLSq3D().
WlzAffineTransform* WlzAffineTransformLSqReg2D | ( | WlzDVertex2 * | vT, |
WlzDVertex2 * | vS, | ||
double * | vW, | ||
int | nVtx, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the 2D registration transform which gives the best (weighted least squares) fit when used to transform the first set of vertices onto the second using the given match weights. The transform is constrained to rotation and translation only. The algorithm has been addapted from the algorithm: Arun K.S., Huang T.T. and Blostein S.D. "Least-Squares Fitting of Two 3-D Point Sets" PAMI 9(5), 698-700, 1987, by transforming the problem to a 2D space, including vertex weights and computing the translation component of the transform using
\[ \mathbf{T} = \frac{\sum_{i=0}^{N-1}{w_i^2 \mathbf{x}_i}} {\sum_{i=0}^{N-1}{w_i^2}} \]
\[ \mathbf{x}_i = {\mathbf{p}_i}' - \mathbf{R}\mathbf{p}_i \]
where \(w_i\) are the weights, \({\mathbf{p}_i}'\) are the target vertices, \(\mathbf{p}_i\) are the source vertices and \(\mathbf{R}\) is the rotation matrix.
vT | Target vertices. |
vS | Source vertices. |
vW | Vertex pair weights, range [0-1], may be NULL in which case all weights are 1. |
nVtx | Number of vertices in each array. |
dstErr | Destination pointer for error number, may be NULL. |
References ALC_ER_NONE, AlcDouble2Free(), AlcDouble2Malloc(), AlgMatrixFree(), AlgMatrixRectNew(), AlgMatrixSVDecomp(), _AlgMatrixRect::array, _AlgMatrix::core, _AlgMatrix::rect, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_TRANSFORM_2D_AFFINE, WLZ_VTX_2_ADD, WLZ_VTX_2_DOT, WLZ_VTX_2_SCALE, WLZ_VTX_2_SUB, WlzAffineTransformFromMatrix(), WlzErrorFromAlg(), and WlzMakeAffineTransform().
Referenced by WlzAffineTransformLSq2D().
WlzAffineTransform* WlzAffineTransformLSqScale2D | ( | WlzDVertex2 * | vT, |
WlzDVertex2 * | vS, | ||
double * | vW, | ||
int | nVtx, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the 2D transform to rescale the source vertices. The assumption is that the source vertices have a different "spread" to the target and this re-scaling transform can be used in conjunction with the rigid-body (registration) tansform to determine a re-scaled shape-preserving transform i.e. no-shear. It is called by WlzAffineTransformLSq2D when transform type WLZ_TRANSFORM_2D_NOSHEAR is requested. The algorithm compares the mean distance from the centroid of each set of vertices.
vT | Target vertices |
vS | Source vertices |
vW | Vertex weights |
nVtx | Number of vertices |
dstErr | Destination error pointer, may be NULL. |
References _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_TRANSFORM_2D_AFFINE, WLZ_VTX_2_ADD, WLZ_VTX_2_LENGTH, WLZ_VTX_2_SCALE, WLZ_VTX_2_SUB, and WlzAffineTransformFromPrimVal().
Referenced by WlzAffineTransformLSq2D().
WlzAffineTransform* WlzAffineTransformLSqReg3D | ( | WlzDVertex3 * | vT, |
WlzDVertex3 * | vS, | ||
double * | vW, | ||
int | nV, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the Woolz 3D registration transform which gives the best (weighted least squares) fit when used to transform the first set of vertices onto the second using the given match weights. The transform is constrained to rotation and translation only. The algorithm has been addapted from the algorithm: Arun K.S., Huang T.T. and Blostein S.D. "Least-Squares Fitting of Two 3-D Point Sets" PAMI 9(5), 698-700, 1987, by including vertex weights and computing the translation component of the transform using
\[ \mathbf{T} = \frac{\sum_{i=0}^{N-1}{w_i^2 \mathbf{x}_i}} {\sum_{i=0}^{N-1}{w_i^2}} \]
\[ \mathbf{x}_i = {\mathbf{p}_i}' - \mathbf{R}\mathbf{p}_i \]
where \(w_i\) are the weights, \({\mathbf{p}_i}'\) are the target vertices, \(\mathbf{p}_i\) are the source vertices and \(\mathbf{R}\) is the rotation matrix.
vT | Target vertices. |
vS | First array of vertices. |
vW | Vertex pair weights, range [0-1], may be NULL in which case all weights are 1.. |
nV | Number of vertices in each array. |
dstErr | Destination pointer for error number, may be NULL. |
References ALC_ER_NONE, AlcCalloc(), AlcDouble2Free(), AlcDouble2Malloc(), AlcFree(), AlgMatrixFree(), AlgMatrixRectNew(), AlgMatrixSVDecomp(), _AlgMatrixRect::array, _AlgMatrix::core, _AlgMatrix::rect, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_TRANSFORM_3D_AFFINE, WLZ_VTX_3_ADD, WLZ_VTX_3_DOT, WLZ_VTX_3_SCALE, WLZ_VTX_3_SUB, WlzAffineTransformFromMatrix(), WlzErrorFromAlg(), and WlzMakeAffineTransform().
Referenced by WlzAffineTransformLSq3D().
WlzAffineTransform* WlzAffineTransformLSqRegWlz2D | ( | WlzDVertex2 * | vT, |
WlzDVertex2 * | vS, | ||
int | nV, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the Woolz 2D registration transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices. This is an old function which should not be used in new code, use WlzAffineTransformLSqReg2D() instead.
vT | Target vertices. |
vS | Source vertices. |
nV | Number of vertex pairs. |
dstErr | Destination pointer for error number, may be NULL. |
References ALC_ER_NONE, AlcDouble1Malloc(), AlcDouble2Free(), AlcDouble2Malloc(), AlcFree(), AlgMatrixLUSolveRaw4(), _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_TRANSFORM_2D_AFFINE, WlzAffineTransformFromMatrix(), and WlzErrorFromAlg().
WlzAffineTransform* WlzAffineTransformLSqDQ2D | ( | int | nV, |
double * | vW, | ||
WlzDVertex2 * | vT, | ||
WlzDVertex2 * | vS, | ||
int | nN, | ||
double * | nW, | ||
WlzDVertex2 * | nT, | ||
WlzDVertex2 * | nS, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the Woolz affine transform which gives the best (least squares) fit when used to transform the first set of vertices and normals onto the second set. The vertex and normal weighting factors must be in the range [0-1]. See WlzAffineTransformLSqDQ3D() from which this function has been derived. This algorithm may be less stable than the SVD algorithm particularly when the data are co–linear, use WlzAffineTransformLSq2D() instead.
nV | Number of vertices. |
vW | Vertex weights (Walker's beta), may be NULL which implies that all the weights are 1.0. |
vT | Vertices of the target set. |
vS | Vertices of the source set. |
nN | Number of normals. |
nW | Normal weights (Walker's alpha)., may be NULL which implies that all the weights are 1.0 |
nT | Target normals, may be NULL. |
nS | Source normals, may be NULL. |
dstErr | Destination pointer for error number, may be NULL. |
References AlgMatrixFree(), AlgMatrixMul(), AlgMatrixRectNew(), AlgMatrixRSEigen(), AlgMatrixScale(), AlgMatrixSub(), AlgMatrixTranspose(), _AlgMatrixRect::array, _AlgMatrix::core, _AlgMatrixRect::nC, _AlgMatrix::rect, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_TRANSFORM_2D_AFFINE, WlzAffineTransformFromMatrix(), and WlzErrorFromAlg().
WlzAffineTransform* WlzAffineTransformLSqDQ3D | ( | int | nV, |
double * | vW, | ||
WlzDVertex3 * | vT, | ||
WlzDVertex3 * | vS, | ||
int | nN, | ||
double * | nW, | ||
WlzDVertex3 * | nT, | ||
WlzDVertex3 * | nS, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the Woolz affine transform which gives the best (least squares) fit when used to transform the source vertices and normals onto the target vertices. The vertex and normal weighting factors must be in the range [0-1]. This algorithm may be less stable than the SVD algorithm particularly when the data are co–linear, use WlzAffineTransformLSq3D() instead.
\[ \mathbf{C}_1 = -2 \sum_{i=1}^k{ \alpha_i \mathbf{Q}(\bar{\mathbf{n}}_i)^T\mathbf{W}(\mathbf{n}^0_i)} - 2 \sum_{i=1}^l{ \beta_i \mathbf{Q}(\bar{\mathbf{p}}_i)^T\mathbf{W}(\mathbf{p}^0_i)} \]
\[ \mathbf{C}_2 = \left(\sum_{i=1}^l{\beta_i} \right)\mathbf{I} \]
\[ \mathbf{C}_3 = 2 \sum_{i=1}^l{\beta_i (\mathbf{W}(\mathbf{p}^0_i) - \mathbf{Q}(\bar{\mathbf{p}}_i)) } \]
\[ \mathbf{A} = \frac{1}{2} (\mathbf{C}_3^T(\mathbf{C}_2 + \mathbf{C}_2^T)^{-1}\mathbf{C}_3 - \mathbf{C}_1 - \mathbf{C}_1^T) \]
This can be simplified to:\[ \mathbf{A} = {\frac{1}{4\sum_{i=1}^{n}{\beta_i}}} {\mathbf{C}_3^T\mathbf{C}_3} - \mathbf{C}_1 \]
because \(\mathbf{C}_1\) is real and symetric, \(\mathbf{C}_2\) is scalar and \(\mathbf{C}_3\) is anti-symetric.\[ \mathbf{t} = \mathbf{W}(\mathbf{r})^T \mathbf{s} \]
\[ \mathbf{t} = \mathbf{W}(\mathbf{r})^T \mathbf{s} \]
and\[ \mathbf{R} = (r^2_4 - \mathbf{r}^T\mathbf{r}) \mathbf{I} + 2 \mathbf{r} \mathbf{r}^T + 2 r_4 \mathbf{K}(\mathbf{r}) \]
nV | Number of vertices. |
vW | Vertex weights (Walker's beta), may be NULL which implies that all the weights are 1.0. |
vT | Vertices of the target set. |
vS | Vertices of the source set. |
nN | Number of normals. |
nW | Normal weights (Walker's alpha)., may be NULL which implies that all the weights are 1.0 |
nT | Target normals, may be NULL. |
nS | Source normals, may be NULL. |
dstErr | Destination pointer for error number, may be NULL. |
References AlcFree(), AlcMalloc(), AlgMatrixCGSolve(), AlgMatrixCopy(), AlgMatrixFree(), AlgMatrixMul(), AlgMatrixRectNew(), AlgMatrixRSEigen(), AlgMatrixScale(), AlgMatrixSub(), AlgMatrixSVSolve(), AlgMatrixTranspose(), AlgVectorCopy(), _AlgMatrixRect::array, _AlgMatrix::core, _AlgMatrixCore::nC, _AlgMatrixRect::nC, _AlgMatrixCore::nR, _AlgMatrix::rect, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_TRANSFORM_3D_AFFINE, WlzAffineTransformFromMatrix(), and WlzErrorFromAlg().
WlzBasisFnTransform* WlzMakeBasisFnTransform | ( | 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.
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.
Referenced by WlzBasisFnTrFromCPts2DParam(), and WlzBasisFnTrFromCPts3DParam().
WlzErrorNum WlzBasisFnFreeTransform | ( | WlzBasisFnTransform * | basisTr | ) |
Free's the given basis function transform.
basisTr | Given basis function transform, may be NULL. |
References AlcFree(), _WlzBasisFnTransform::basisFn, WLZ_ERR_NONE, and WlzBasisFnFree().
Referenced by WlzBasisFnTrFromCPts2DParam(), WlzBasisFnTrFromCPts3DParam(), WlzCMeshCompSurfMapToDomain(), WlzFreeTransform(), and WlzMeshTransformFromCPts().
WlzBasisFnTransform* WlzBasisFnTrFromCPts2D | ( | 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().
type | Required basis function type. |
order | Order of polynomial, only used for WLZ_FN_BASIS_2DPOLY. |
nDPts | Number of destination control points. |
dPts | Destination control points. |
nSPts | Number of source control points (must be same as nDPts). |
sPts | Source control points. |
mesh | Mesh which is used to compute constrained distances. If non NULL and the mesh type is WLZ_CMESH_2D then constrained distances are used and these are computed using the mesh. If NULL or the transform is some other type then Euclidean distances are used. |
dstErr | Destination error pointer, may be NULL. |
References WlzBasisFnTrFromCPts2DParam().
Referenced by WlzMeshTransformFromCPts().
WlzBasisFnTransform* WlzBasisFnTrFromCPts2DParam | ( | 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.
type | Required basis function type. |
order | Order of polynomial, only used for WLZ_FN_BASIS_2DPOLY. |
nDPts | Number of destination control points. |
dPts | Destination control points. |
nSPts | Number of source control points (must be same as nDPts). |
sPts | Source control points. |
mesh | Mesh which is used to compute constrained distances. If non NULL and the mesh type is WLZ_CMESH_2D then constrained distances are used and these are computed using the mesh. If NULL or the transform is some other type then Euclidean distances are used. |
nParam | Number of additional parameters. |
param | Array of additional parameters. |
dstErr | Destination error pointer, may be NULL. |
References _WlzBasisFnTransform::basisFn, _WlzCMesh2D::type, _WlzBasisFnTransform::type, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_FN_BASIS_2DCONF_POLY, WLZ_FN_BASIS_2DGAUSS, WLZ_FN_BASIS_2DIMQ, WLZ_FN_BASIS_2DMQ, WLZ_FN_BASIS_2DPOLY, WLZ_FN_BASIS_2DTPS, WLZ_TRANSFORM_2D_BASISFN, WlzBasisFnConf2DFromCPts(), WlzBasisFnFreeTransform(), WlzBasisFnGauss2DFromCPts(), WlzBasisFnIMQ2DFromCPts(), WlzBasisFnMQ2DFromCPts(), WlzBasisFnPoly2DFromCPts(), WlzBasisFnTPS2DFromCPts(), and WlzMakeBasisFnTransform().
Referenced by WlzBasisFnTrFromCPts2D().
WlzBasisFnTransform* WlzBasisFnTrFromCPts3DParam | ( | 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.
type | Required basis function type. |
order | Order of polynomial, only used for WLZ_FN_BASIS_3DPOLY. |
nDPts | Number of destination control points. |
dPts | Destination control points. |
nSPts | Number of source control points (must be same as nDPts). |
sPts | Source control points. |
mesh | Mesh which is used to compute constrained distances. If non NULL and the mesh type is WLZ_CMESH_3D then constrained distances are used and these are computed using the mesh. If NULL or the transform is some other type then Euclidean distances are used. |
nParam | Number of additional parameters. |
param | Array of additional parameters. |
dstErr | Destination error pointer, may be NULL. |
References _WlzBasisFnTransform::basisFn, _WlzCMesh3D::type, _WlzBasisFnTransform::type, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_FN_BASIS_3DIMQ, WLZ_FN_BASIS_3DMQ, WLZ_TRANSFORM_3D_BASISFN, WlzBasisFnFreeTransform(), WlzBasisFnIMQ3DFromCPts(), WlzBasisFnMQ3DFromCPts(), and WlzMakeBasisFnTransform().
Referenced by WlzBasisFnTrFromCPts3D().
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.
basisTr | Existing basis function transform. |
nDPts | Number of destination control points. |
dPts | Destination control points. |
nSPts | Number of source control points (must be same as nDPts). |
sPts | Source control points. |
cObj | Constraining object, within which all distances are constrained. If NULL Euclidean distances are used in place of constrained distances. |
References WLZ_ERR_NONE, and WlzBasisFnTPS2DChangeCPtsParam().
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.
basisTr | Existing basis function transform. |
nDPts | Number of destination control points. |
dPts | Destination control points. |
nSPts | Number of source control points (must be same as nDPts). |
sPts | Source control points. |
cObj | Constraining object, within which all distances are constrained. If NULL Euclidean distances are used in place of constrained distances. |
nParam | Number of additional parameters. |
param | Array of additional parameters. |
References _WlzBasisFnTransform::basisFn, _WlzCMeshP::m2, _WlzBasisFn::mesh, _WlzBasisFn::nPoly, _WlzCMesh2D::type, _WlzBasisFn::type, _WlzBasisFnTransform::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_FN_BASIS_2DCONF_POLY, WLZ_FN_BASIS_2DGAUSS, WLZ_FN_BASIS_2DIMQ, WLZ_FN_BASIS_2DMQ, WLZ_FN_BASIS_2DPOLY, WLZ_FN_BASIS_2DTPS, WLZ_TRANSFORM_2D_BASISFN, WlzBasisFnConf2DFromCPts(), WlzBasisFnFree(), WlzBasisFnGauss2DFromCPts(), WlzBasisFnIMQ2DFromCPts(), WlzBasisFnMQ2DFromCPts(), WlzBasisFnPoly2DFromCPts(), and WlzBasisFnTPS2DFromCPts().
Referenced by WlzBasisFnTPS2DChangeCPts().
WlzBasisFnTransform* WlzBasisFnTrFromCPts3D | ( | 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.
type | Required basis function type. |
order | Order of polynomial, only used for WLZ_BASISFN_POLY. |
nDPts | Number of destination control points. |
dPts | Destination control points. |
nSPts | Number of source control points (must be same as nDPts) |
sPts | Source control points. |
mesh | Mesh which is used to compute constrained distances. If non NULL and the mesh type is WLZ_CMESH_3D then constrained distances are used and these are computed using the mesh. If NULL or the transform is some other type then Euclidean distances are used. |
dstErr | Destination error pointer, may be NULL. |
References WlzBasisFnTrFromCPts3DParam().
WlzErrorNum WlzBasisFnSetMesh | ( | WlzMeshTransform * | mesh, |
WlzBasisFnTransform * | basisTr | ||
) |
Sets the displacements of the given mesh transform according to the basis function transform.
mesh | Given mesh transform. |
basisTr | Given basis function transform. |
References _WlzBasisFnTransform::basisFn, _WlzMeshNode::displacement, _WlzMeshTransform::nNodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzBasisFn::type, _WlzBasisFnTransform::type, _WlzMeshTransform::type, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_FN_BASIS_2DCONF_POLY, WLZ_FN_BASIS_2DGAUSS, WLZ_FN_BASIS_2DIMQ, WLZ_FN_BASIS_2DMQ, WLZ_FN_BASIS_2DPOLY, WLZ_FN_BASIS_2DTPS, WLZ_TRANSFORM_2D_BASISFN, WLZ_TRANSFORM_2D_MESH, WlzBasisFnValueConf2D(), WlzBasisFnValueGauss2D(), WlzBasisFnValueIMQ2D(), WlzBasisFnValueMQ2D(), WlzBasisFnValuePoly2D(), and WlzBasisFnValueTPS2D().
Referenced by WlzBasisFnTransformObj(), and WlzMeshTransformFromCPts().
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.
mObj | Given conforming mesh transform object. |
basisTr | Given basis function transform. |
References _WlzDomain::core, _WlzObject::domain, _WlzObject::type, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_TRANSFORM_TYPE, WlzBasisFnSetCMesh2D(), and WlzBasisFnSetCMesh3D().
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.
mObj | Given mesh transform object. |
basisTr | Given basis function transform. |
References AlcVectorItemGet(), _WlzIndexedValues::attach, _WlzBasisFnTransform::basisFn, _WlzDomain::cm2, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshRes::elm, _WlzCMeshNod2D::idx, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzIndexedValues::type, _WlzCMesh2D::type, _WlzBasisFn::type, _WlzBasisFnTransform::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex2::vtY, _WlzIndexedValues::vType, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_FN_BASIS_2DGAUSS, WLZ_FN_BASIS_2DIMQ, WLZ_FN_BASIS_2DMQ, WLZ_FN_BASIS_2DTPS, WLZ_GREY_DOUBLE, WLZ_INDEXED_VALUES, WLZ_MESH_TOLERANCE, WLZ_TRANSFORM_2D_BASISFN, WLZ_VALUE_ATTACH_NOD, WLZ_VTX_2_ADD, WLZ_VTX_2_LENGTH, WLZ_VTX_2_SCALE, WLZ_VTX_2_SUB, WLZ_VTX_2_ZERO, WlzBasisFnValueGauss2D(), WlzBasisFnValueIMQ2D(), WlzBasisFnValueMQ2D(), WlzBasisFnValueTPS2D(), WlzCMeshElmGetNodes2D(), WlzIndexedValueExtGet(), WlzIndexedValueGet(), and _WlzValues::x.
Referenced by WlzBasisFnInvertMakeCMeshTr2D(), WlzBasisFnMakeCMeshTr2D(), and WlzBasisFnSetCMesh().
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.
mObj | Given mesh transform object. |
basisTr | Given basis function transform. |
References AlcVectorItemGet(), _WlzIndexedValues::attach, _WlzBasisFnTransform::basisFn, _WlzDomain::cm3, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshRes::elm, _WlzCMeshNod3D::idx, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod3D::pos, _WlzIndexedValues::rank, _WlzCMesh3D::res, _WlzIndexedValues::type, _WlzCMesh3D::type, _WlzBasisFn::type, _WlzBasisFnTransform::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzIndexedValues::vType, _WlzDVertex3::vtZ, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_FN_BASIS_3DIMQ, WLZ_FN_BASIS_3DMQ, WLZ_GREY_DOUBLE, WLZ_INDEXED_VALUES, WLZ_MESH_TOLERANCE, WLZ_TRANSFORM_3D_BASISFN, WLZ_VALUE_ATTACH_NOD, WLZ_VTX_3_ADD, WLZ_VTX_3_LENGTH, WLZ_VTX_3_SCALE, WLZ_VTX_3_SUB, WLZ_VTX_3_ZERO, WlzBasisFnValueIMQ3D(), WlzBasisFnValueMQ3D(), WlzCMeshElmGetNodes3D(), WlzIndexedValueExtGet(), WlzIndexedValueGet(), and _WlzValues::x.
Referenced by WlzBasisFnInvertMakeCMeshTr3D(), WlzBasisFnMakeCMeshTr3D(), and WlzBasisFnSetCMesh().
WlzObject* WlzBasisFnMakeCMeshTr | ( | 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.
basisTr | Given basis function transform which transforms target to source. |
mesh | Given conforming mesh for target. |
dstErr | Destination error pointer, may be NULL. |
References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMesh3D::type, _WlzBasisFnTransform::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_2D_BASISFN, WLZ_TRANSFORM_3D_BASISFN, WlzBasisFnMakeCMeshTr2D(), and WlzBasisFnMakeCMeshTr3D().
WlzObject* WlzBasisFnMakeCMeshTr2D | ( | 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.
basisTr | Given basis function transform which transforms target to source. |
mesh | Given conforming mesh for target. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::cm2, _WlzValues::core, _WlzCMesh2D::type, _WlzObject::values, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_NOD, WlzAssignValues(), WlzBasisFnSetCMesh2D(), WlzFreeIndexedValues(), WlzFreeObj(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.
Referenced by WlzBasisFnMakeCMeshTr().
WlzObject* WlzBasisFnMakeCMeshTr3D | ( | 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.
basisTr | Given basis function transform which transforms target to source. |
mesh | Given conforming mesh for target. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::cm3, _WlzValues::core, _WlzCMesh3D::type, _WlzObject::values, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_NOD, WlzAssignValues(), WlzBasisFnSetCMesh3D(), WlzFreeIndexedValues(), WlzFreeObj(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.
Referenced by WlzBasisFnMakeCMeshTr().
WlzObject* WlzBasisFnInvertMakeCMeshTr | ( | 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.
basisTr | Given basis function transform which transforms target to source. |
mesh | Given conforming mesh for target. |
dstErr | Destination error pointer, may be NULL. |
References _WlzCMeshP::m2, _WlzCMeshP::m3, _WlzCMesh2D::type, _WlzCMesh3D::type, _WlzBasisFnTransform::type, _WlzCMeshP::v, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_2D_BASISFN, WLZ_TRANSFORM_3D_BASISFN, WlzBasisFnInvertMakeCMeshTr2D(), and WlzBasisFnInvertMakeCMeshTr3D().
WlzObject* WlzBasisFnInvertMakeCMeshTr2D | ( | 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.
basisTr | Given basis function transform which transforms target to source. |
mesh | Given conforming mesh for target. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::cm2, _WlzValues::core, _WlzObject::values, WLZ_CMESH_2D, WLZ_ERR_NONE, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_NOD, WlzAssignValues(), WlzBasisFnSetCMesh2D(), WlzCMeshCopy2D(), WlzCMeshTransformInvert(), WlzFreeObj(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.
Referenced by WlzBasisFnInvertMakeCMeshTr().
WlzObject* WlzBasisFnInvertMakeCMeshTr3D | ( | 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.
basisTr | Given basis function transform which transforms target to source. |
mesh | Given conforming mesh for target. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::cm3, _WlzValues::core, _WlzObject::values, WLZ_CMESH_3D, WLZ_ERR_NONE, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_NOD, WlzAssignValues(), WlzBasisFnSetCMesh3D(), WlzCMeshCopy3D(), WlzCMeshTransformInvert(), WlzFreeObj(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.
Referenced by WlzBasisFnInvertMakeCMeshTr().
WlzObject* WlzBasisFnTransformObj | ( | 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.
srcObj | Object to be transformed. |
basisTr | Basis function transform to apply. |
interp | Level of interpolation to use. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::b, _WlzValues::core, _WlzDomain::core, _WlzDomain::ctr, _WlzObject::domain, _WlzDomain::poly, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_BOUNDLIST, WLZ_CONTOUR, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_MESH_GENMETHOD_BLOCK, WlzBasisFnSetMesh(), WlzBasisFnTransformBoundList(), WlzBasisFnTransformContour(), WlzBasisFnTransformPoly2(), WlzFreeDomain(), WlzMakeEmpty(), WlzMakeMain(), WlzMeshFreeTransform(), WlzMeshFromObj(), and WlzMeshTransformObj().
WlzPolygonDomain* WlzBasisFnTransformPoly2 | ( | WlzPolygonDomain * | srcPoly, |
WlzBasisFnTransform * | basisTr, | ||
int | newPoly, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms a 2D polygon domain using a the given basis function transform.
srcPoly | Polygon domain to be transformed. |
basisTr | Basis function transform to apply. |
newPoly | Makes a new polygon domain if non-zero otherwise the given polygon domain will be transformed in place. |
dstErr | Destination error pointer, may be NULL. |
References _WlzVertexP::d2, _WlzVertexP::f2, _WlzVertexP::i2, _WlzPolygonDomain::nvertices, _WlzPolygonDomain::type, _WlzVertexP::v, _WlzIVertex2::vtX, _WlzFVertex2::vtX, _WlzDVertex2::vtX, _WlzPolygonDomain::vtx, _WlzIVertex2::vtY, _WlzFVertex2::vtY, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_POLYGON_TYPE, WLZ_POLYGON_DOUBLE, WLZ_POLYGON_FLOAT, WLZ_POLYGON_INT, WlzBasisFnTransformVertexD(), WlzFreePolyDmn(), and WlzMakePolygonDomain().
Referenced by WlzBasisFnTransformBoundList(), and WlzBasisFnTransformObj().
WlzBoundList* WlzBasisFnTransformBoundList | ( | WlzBoundList * | srcBnd, |
WlzBasisFnTransform * | basisTr, | ||
int | newBnd, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms a 2D boundary list using a the given basis function transform.
srcBnd | Boundary list to be transformed. |
basisTr | Basis function transform to apply. |
newBnd | Makes a new bound list if non-zero otherwise the given bound list will be transformed in place. |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), _WlzDomain::b, _WlzBoundList::down, _WlzBoundList::next, _WlzBoundList::poly, _WlzBoundList::type, WLZ_BOUNDLIST_PIECE, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WlzAssignDomain(), WlzBasisFnTransformPoly2(), WlzFreeBoundList(), and _WlzBoundList::wrap.
Referenced by WlzBasisFnTransformObj().
WlzContour* WlzBasisFnTransformContour | ( | WlzContour * | srcCtr, |
WlzBasisFnTransform * | basisTr, | ||
int | newCtr, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms a contour using a the given basis function transform. See WlzBasisFnTransformGMModel().
srcCtr | Contour to be transformed. |
basisTr | Basis function transform to apply. |
newCtr | Makes a new contour if non-zero otherwise the given contour will be transformed in place. |
dstErr | Destination error pointer, may be NULL. |
References _WlzContour::model, WLZ_ERR_NONE, WlzAssignGMModel(), WlzBasisFnTransformGMModel(), WlzFreeContour(), and WlzMakeContour().
Referenced by WlzBasisFnTransformObj().
WlzGMModel* WlzBasisFnTransformGMModel | ( | 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!
srcM | Model to be transformed. |
basisTr | Basis function transform to apply. |
newModel | Makes a new model if non-zero otherwise the given model will be transformed in place. |
dstErr | Destination error pointer, may be NULL. |
References AlcVectorItemGet(), _WlzGMElemP::core, _WlzGMCore::idx, _WlzGMVertexG2N::nrm, _WlzGMResource::numIdx, _WlzGMModel::res, _WlzGMElemP::shell, _WlzGMModelR::shell, _WlzGMModel::type, _WlzGMResource::vec, _WlzGMModelR::vertexG, _WlzGMElemP::vertexG2D, _WlzGMElemP::vertexG2I, _WlzGMElemP::vertexG2N, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzGMVertexG2I::vtx, _WlzGMVertexG2D::vtx, _WlzGMVertexG2N::vtx, _WlzIVertex2::vtY, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_GMMOD_2D, WLZ_GMMOD_2I, WLZ_GMMOD_2N, WLZ_NINT, WlzBasisFnTransformNormalD(), WlzBasisFnTransformVertexD(), WlzGMModelCopy(), WlzGMModelRehashVHT(), and WlzGMShellComputeGBB().
Referenced by WlzBasisFnTransformContour().
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.
basisTr | Basis function transform to apply. |
srcVx | Given vertex. |
srcNr | Given normal. |
dstVx | Destination pointer for the transformed vertex. Must not be NULL. |
dstErr | Destination pointer for error, may be NULL. |
References _WlzBasisFnTransform::type, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_TRANSFORM_DATA, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_2D_BASISFN, WLZ_VTX_2_ADD, WLZ_VTX_2_SCALE, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, WLZ_VTX_2_ZERO, and WlzBasisFnTransformVertexD().
Referenced by WlzBasisFnTransformGMModel().
WlzDVertex2 WlzBasisFnTransformVertexD | ( | WlzBasisFnTransform * | basisTr, |
WlzDVertex2 | srcVx, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzDVertex2.
basisTr | Basis function transform to apply. |
srcVx | Vertex to be transformed. |
dstErr | Destination pointer for error, may be NULL. |
References _WlzBasisFnTransform::basisFn, _WlzBasisFn::type, _WlzBasisFnTransform::type, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_FN_BASIS_2DCONF_POLY, WLZ_FN_BASIS_2DGAUSS, WLZ_FN_BASIS_2DIMQ, WLZ_FN_BASIS_2DMQ, WLZ_FN_BASIS_2DPOLY, WLZ_FN_BASIS_2DTPS, WLZ_TRANSFORM_2D_BASISFN, WlzBasisFnValueConf2D(), WlzBasisFnValueGauss2D(), WlzBasisFnValueIMQ2D(), WlzBasisFnValueMQ2D(), WlzBasisFnValuePoly2D(), and WlzBasisFnValueTPS2D().
Referenced by WlzBasisFnTransformGMModel(), WlzBasisFnTransformNormalD(), WlzBasisFnTransformPoly2(), WlzBasisFnTransformVertexF(), and WlzBasisFnTransformVertexI().
WlzFVertex2 WlzBasisFnTransformVertexF | ( | WlzBasisFnTransform * | basisTr, |
WlzFVertex2 | srcVxF, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzFVertex2.
basisTr | Basis function transform to apply. |
srcVxF | Vertex to be transformed. |
dstErr | Destination pointer for error, may be NULL. |
References _WlzFVertex2::vtX, _WlzDVertex2::vtX, _WlzFVertex2::vtY, _WlzDVertex2::vtY, and WlzBasisFnTransformVertexD().
WlzIVertex2 WlzBasisFnTransformVertexI | ( | WlzBasisFnTransform * | basisTr, |
WlzIVertex2 | srcVxI, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the given WlzIVertex2.
basisTr | Basis function transform to apply. |
srcVxI | Vertex to be transformed. |
dstErr | Destination pointer for error, may be NULL. |
References _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, WLZ_NINT, and WlzBasisFnTransformVertexD().
WlzObject* WlzCMeshCompSurfMapToDomain | ( | WlzObject * | mshObj, |
WlzObject * | domObj, | ||
int | nDV, | ||
WlzDVertex3 * | dV, | ||
int | nMV, | ||
WlzDVertex3 * | mV, | ||
WlzErrorNum * | dstErr | ||
) |
Computes a isomophic mapping of the given surface patch (which must be isomorphic to a disk) to the given spatial domain object (which must have a single 2D convex boundary polygon.
mshObj | Input conforming mesh object which must be of type WLZ_CMESH_2D5. |
domObj | Given planar spatial domain, which must be a single piece. |
nDV | Number of spatial domain vertices which must be the same as nMV. |
dV | Spatial domain vertices which must be on or near the domain boundary. These are 3D vertices with the Z component zero. |
nMV | Number of in mesh vertices. |
mV | Mesh vertices. |
dstErr | Woolz error code, may be NULL. |
References AlcCalloc(), AlcFree(), AlcMalloc(), AlcVectorItemGet(), ALG_MAX, AlgHeapSortCmpIdxIFn(), AlgHeapSortIdx(), _WlzDomain::b, _WlzDomain::cm2d5, _WlzDomain::core, _WlzObject::domain, _WlzBoundList::down, _WlzCMeshNod2D5::idx, _WlzBoundList::next, _WlzCMeshRes::nod, _WlzPolygonDomain::nvertices, _WlzBoundList::poly, _WlzCMeshNod2D5::pos, _WlzCMesh2D5::res, _WlzObject::type, _WlzCMesh2D5::type, _WlzBoundList::up, _WlzCMeshEntRes::vec, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzPolygonDomain::vtx, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_BOUNDLIST, WLZ_CMESH_2D5, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, WLZ_VTX_3_LENGTH, WLZ_VTX_3_SQRLEN, WLZ_VTX_3_SUB, WlzBasisFnFreeTransform(), WlzCMeshGetBoundNodes2D5(), WlzFreeObj(), WlzFreePolyDmn(), WlzObjToBoundary(), and WlzPolyEquispace().
WlzObject* WlzCMeshCompSurfMap | ( | WlzObject * | inObj, |
int | nDV, | ||
WlzDVertex3 * | dV, | ||
int | nSV, | ||
WlzDVertex3 * | sV, | ||
WlzErrorNum * | dstErr | ||
) |
Computes a least squares conformal transformation which maps the source surface to a destination plane with z coordinate zero. When matching the mesh vertices from their position, the closest vertices to the given positions are used. See WlzCMeshCompSurfMapLevy().
inObj | Input conforming mesh object which must be of type WLZ_CMESH_2D5. |
nDV | Number of destination vertices. |
dV | Destination vertices. |
nSV | Number of source vertices which must be the same as nDV. |
sV | Source vertices. |
dstErr | Woolz error code, may be NULL. |
References Alc2Free(), ALC_ER_NONE, AlcCalloc(), AlcDouble1WriteAsci(), AlcFree(), AlcMalloc(), AlcUnchar2Calloc(), AlcVectorItemGet(), AlgHeapSortCmpIdxIFn(), AlgHeapSortIdx(), AlgMatrixCGSolve(), AlgMatrixFree(), AlgMatrixLLRNew(), AlgMatrixRectNew(), AlgMatrixSet(), AlgMatrixSetAll(), AlgMatrixSolveLSQR(), AlgMatrixVectorMul(), AlgMatrixWriteAscii(), AlgSort(), _WlzDomain::cm2d5, _AlgMatrix::core, _WlzValues::core, _WlzDomain::core, _WlzDomain::ctr, _WlzObject::domain, _WlzCMeshNod2D5::edu, _WlzCMeshRes::elm, _WlzCMeshNod2D5::idx, _WlzCMeshElm2D5::idx, _AlgMatrix::llr, _WlzCMeshEntRes::maxEnt, _WlzContour::model, _WlzCMeshEdgU2D5::nnxt, _WlzCMeshEdgU2D5::nod, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshEdgU2D5::opp, _WlzCMeshNod2D5::pos, _AlgMatrix::rect, _WlzCMesh2D5::res, _WlzObject::type, _WlzCMesh2D5::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_2D5, WLZ_CMESH_ELM2D5_GET_NODE_0, WLZ_CMESH_ELM2D5_GET_NODE_1, WLZ_CMESH_ELM2D5_GET_NODE_2, WLZ_CONTOUR, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_GREY_DOUBLE, WLZ_MESH_TOLERANCE, WLZ_VALUE_ATTACH_NOD, WLZ_VTX_3_CROSS, WLZ_VTX_3_DOT, WLZ_VTX_3_LENGTH, WLZ_VTX_3_SCALE, WLZ_VTX_3_SUB, WlzAssignDomain(), WlzAssignValues(), WlzCMeshClosestNod2D5(), WlzCMeshFree2D5(), WlzCMeshFromGM(), WlzCMeshSetElmIdxTbl2D5(), WlzCMeshSetNodIdxTbl2D5(), WlzErrorFromAlg(), WlzFreeObj(), WlzIndexedValueGet(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.
WlzObject* WlzCMeshTransformInvert | ( | WlzObject * | gObj, |
WlzErrorNum * | dstErr | ||
) |
Inverts the given constrained mesh transform in place.
gObj | Given constrained mesh object with indexed values for transform. |
dstErr | Destination error pointer, may be NULL. |
References ALC_ER_NONE, AlcFree(), AlcMalloc(), AlcVectorExtend(), AlcVectorItemGet(), _WlzIndexedValues::attach, _WlzDomain::cm2, _WlzDomain::cm2d5, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshRes::elm, _WlzCMeshNod2D::idx, _WlzCMeshNod2D5::idx, _WlzCMeshNod3D::idx, _WlzCMeshElm2D::idx, _WlzCMeshElm2D5::idx, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod2D::pos, _WlzCMeshNod2D5::pos, _WlzCMeshNod3D::pos, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzCMesh3D::res, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzIndexedValues::vType, _WlzDVertex3::vtZ, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_CMESH_ELM2D5_GET_NODE_0, WLZ_CMESH_ELM2D5_GET_NODE_1, WLZ_CMESH_ELM2D5_GET_NODE_2, WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, WLZ_CMESH_ELM2D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_INDEXED_VALUES, WLZ_VALUE_ATTACH_NOD, WlzAssignValues(), WlzCMeshFree2D(), WlzCMeshFree2D5(), WlzCMeshFree3D(), WlzCMeshNew2D(), WlzCMeshNew2D5(), WlzCMeshNew3D(), WlzCMeshNewElm2D(), WlzCMeshNewElm2D5(), WlzCMeshNewElm3D(), WlzCMeshNewNod2D(), WlzCMeshNewNod2D5(), WlzCMeshNewNod3D(), WlzCMeshReassignGridCells2D(), WlzCMeshReassignGridCells2D5(), WlzCMeshReassignGridCells3D(), WlzCMeshUpdateBBox2D(), WlzCMeshUpdateBBox2D5(), WlzCMeshUpdateBBox3D(), WlzFreeObj(), WlzIndexedValueGet(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.
Referenced by WlzBasisFnInvertMakeCMeshTr2D(), WlzBasisFnInvertMakeCMeshTr3D(), and WlzCMeshStrainTensorAtPts().
WlzObject* WlzCMeshTransformFromObj | ( | WlzObject * | srcObj, |
WlzMeshGenMethod | method, | ||
double | minDist, | ||
double | maxDist, | ||
WlzObject ** | dstDilObj, | ||
int | delOut, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a conforming mesh transform for the given object with all mesh displacements allocated but set to zero. A mesh transform is a conforming mesh object with indexed values such that the values are double precision displacements that are ordered x, y[, z].
srcObj | The given object. |
method | Mesh generation method to use. |
minDist | Minimum distance between mesh vertices. |
maxDist | Maximum distance between mesh vertices. |
dstDilObj | Destination pointer for the dilated object used to build the mesh, may be NULL. |
delOut | Delete all elements with nodes outside the object if non-zero. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::cm2, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_TYPE, WLZ_GREY_DOUBLE, WLZ_MESH_GENMETHOD_CONFORM, WLZ_NULL, WLZ_VALUE_ATTACH_NOD, WlzAssignValues(), WlzCMeshFromObj2D(), WlzCMeshFromObj3D(), WlzFreeDomain(), WlzFreeObj(), WlzIndexedValuesSet(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.
WlzErrorNum WlzCMeshTransformVtxAry2I | ( | WlzObject * | mObj, |
int | nVtx, | ||
WlzIVertex2 * | vtx, | ||
int | nInside, | ||
WlzUByte * | inside | ||
) |
Transforms the vertices in the given integer vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2I().
mObj | The mesh transform object. |
nVtx | Number of vertices in the array. |
vtx | Array of vertices. |
nInside | Number of inside markers (must be zero or >= the number of vertices). |
inside | Inside byte flags set to zero or one; zero when vertices are inside the mesh, otherwise one. |
References _WlzDomain::cm2, _WlzObject::domain, _WlzCMeshScanElm2D::flags, _WlzCMeshScanElm2D::idx, _WlzCMeshScanElm2D::trX, _WlzCMeshScanElm2D::trY, _WlzObject::values, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, WLZ_CMESH_SCANELM_FWD, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_NINT, WlzCMeshElmEnclosingPos2D(), WlzIndexedValueGet(), and _WlzValues::x.
Referenced by WlzCMeshTransformManyObjAsIdx().
WlzErrorNum WlzCMeshTransformVtxAry3I | ( | WlzObject * | mObj, |
int | nVtx, | ||
WlzIVertex3 * | vtx, | ||
int | nInside, | ||
WlzUByte * | inside | ||
) |
Transforms the vertices in the given integer vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze3I().
mObj | The mesh transform object. |
nVtx | Number of vertices in the array. |
vtx | Array of vertices. |
nInside | Number of inside markers (must be zero or >= the number of vertices). |
inside | Inside byte flags set to zero or one; zero when vertices are inside the mesh, otherwise one. |
References _WlzDomain::cm3, _WlzObject::domain, _WlzCMeshScanElm3D::flags, _WlzCMeshScanElm3D::idx, _WlzCMeshScanElm3D::tr, _WlzObject::values, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_CMESH_SCANELM_FWD, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_NINT, WlzCMeshElmEnclosingPos3D(), WlzIndexedValueGet(), and _WlzValues::x.
Referenced by WlzCMeshTransformManyObjAsIdx().
WlzErrorNum WlzCMeshTransformVtxAry2F | ( | WlzObject * | mObj, |
int | nVtx, | ||
WlzFVertex2 * | vtx, | ||
int | nInside, | ||
WlzUByte * | inside | ||
) |
Transforms the vertices in the given float vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2F().
mObj | The mesh transform object. |
nVtx | Number of vertices in the array. |
vtx | Array of vertices. |
nInside | Number of inside markers (must be zero or >= the number of vertices). |
inside | Inside byte flags set to zero or one; zero when vertices are inside the mesh, otherwise one. |
References _WlzDomain::cm2, _WlzObject::domain, _WlzCMeshScanElm2D::flags, _WlzCMeshScanElm2D::idx, _WlzCMeshScanElm2D::trX, _WlzCMeshScanElm2D::trY, _WlzObject::values, _WlzFVertex2::vtX, _WlzDVertex2::vtX, _WlzFVertex2::vtY, _WlzDVertex2::vtY, WLZ_CMESH_SCANELM_FWD, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WlzCMeshElmEnclosingPos2D(), WlzIndexedValueGet(), and _WlzValues::x.
Referenced by WlzCMeshTransformManyObjAsIdx().
WlzErrorNum WlzCMeshTransformVtxAry3F | ( | WlzObject * | mObj, |
int | nVtx, | ||
WlzFVertex3 * | vtx, | ||
int | nInside, | ||
WlzUByte * | inside | ||
) |
Transforms the vertices in the given float vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze3F().
mObj | The mesh transform object. |
nVtx | Number of vertices in the array. |
vtx | Array of vertices. |
nInside | Number of inside markers (must be zero or >= the number of vertices). |
inside | Inside byte flags set to zero or one; zero when vertices are inside the mesh, otherwise one. |
References _WlzDomain::cm3, _WlzObject::domain, _WlzCMeshScanElm3D::flags, _WlzCMeshScanElm3D::idx, _WlzCMeshScanElm3D::tr, _WlzObject::values, _WlzFVertex3::vtX, _WlzDVertex3::vtX, _WlzFVertex3::vtY, _WlzDVertex3::vtY, _WlzFVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_CMESH_SCANELM_FWD, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WlzCMeshElmEnclosingPos3D(), WlzIndexedValueGet(), and _WlzValues::x.
WlzErrorNum WlzCMeshTransformVtxAry2D | ( | WlzObject * | mObj, |
int | nVtx, | ||
WlzDVertex2 * | vtx, | ||
int | nInside, | ||
WlzUByte * | inside | ||
) |
Transforms the vertices in the given double vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2D().
mObj | The mesh transform object. |
nVtx | Number of vertices in the array. |
vtx | Array of vertices. |
nInside | Number of inside markers (must be zero or >= the number of vertices). |
inside | Inside byte flags set to zero or one; zero when vertices are inside the mesh, otherwise one. |
References _WlzDomain::cm2, _WlzObject::domain, _WlzCMeshScanElm2D::flags, _WlzCMeshScanElm2D::idx, _WlzCMeshScanElm2D::trX, _WlzCMeshScanElm2D::trY, _WlzObject::values, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_CMESH_SCANELM_FWD, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WlzCMeshElmEnclosingPos2D(), WlzIndexedValueGet(), and _WlzValues::x.
Referenced by WlzCMeshTransformManyObjAsIdx().
WlzErrorNum WlzCMeshTransformVtxAry2D5 | ( | WlzObject * | mObj, |
int | nVtx, | ||
WlzDVertex3 * | vtx, | ||
int | nInside, | ||
WlzUByte * | inside | ||
) |
Transforms the vertices in the given double vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze2D().
mObj | The mesh transform object. |
nVtx | Number of vertices in the array. |
vtx | Array of vertices. |
nInside | Number of inside markers (must be zero or >= the number of vertices). |
inside | Inside byte flags set to zero or one; zero when vertices are inside the mesh, otherwise one. |
Transforms the vertices in the given double vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh.
mObj | The mesh transform object. |
nVtx | Number of vertices in the array. |
vtx | Array of vertices. |
References _WlzDomain::cm2d5, _WlzObject::domain, _WlzCMeshScanElm3D::flags, _WlzCMeshScanElm3D::idx, _WlzCMeshScanElm3D::tr, _WlzObject::values, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_SCANELM_FWD, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WlzCMeshElmEnclosingPos2D5(), WlzIndexedValueGet(), and _WlzValues::x.
WlzErrorNum WlzCMeshTransformVtxAry3D | ( | WlzObject * | mObj, |
int | nVtx, | ||
WlzDVertex3 * | vtx, | ||
int | nInside, | ||
WlzUByte * | inside | ||
) |
Transforms the vertices in the given double vertex array in place and using the given conforming mesh transform. If a vertex is outside the mest it is displaced using the displacement of the closest node in the mesh and these vertices may be flagged using an array of byte masks if provided. Vertices flagged outside the mesh may be removed using WlzVerticesSqueeze3D().
mObj | The mesh transform object. |
nVtx | Number of vertices in the array. |
vtx | Array of vertices. |
nInside | Number of inside markers (must be zero or >= the number of vertices). |
inside | Inside byte flags set to zero or one; zero when vertices are inside the mesh, otherwise one. |
References _WlzDomain::cm3, _WlzObject::domain, _WlzCMeshScanElm3D::flags, _WlzCMeshScanElm3D::idx, _WlzCMeshScanElm3D::tr, _WlzObject::values, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_SCANELM_FWD, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WlzCMeshElmEnclosingPos3D(), WlzIndexedValueGet(), and _WlzValues::x.
Referenced by WlzCMeshTransformManyObjAsIdx().
WlzObject* WlzCMeshTransformObj | ( | WlzObject * | srcObj, |
WlzObject * | mObj, | ||
WlzInterpolationType | interp, | ||
WlzErrorNum * | dstErr | ||
) |
Applies a conforming mesh transform to the given source object.
srcObj | Object to be transformed. |
mObj | Conforming mesh transform object. |
interp | Type of interpolation. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcMalloc(), _WlzIndexedValues::attach, _WlzDomain::b, _WlzDomain::cm2, _WlzDomain::cm2d5, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzDomain::ctr, _WlzIndexedValues::dim, _WlzPointValues::dim, _WlzObject::domain, _WlzPoints::nPoints, _WlzPoints::points, _WlzDomain::poly, _WlzValues::pts, _WlzDomain::pts, _WlzIndexedValues::rank, _WlzPointValues::rank, _WlzObject::type, _WlzCoreDomain::type, _WlzCoreValues::type, _WlzRagRValues::type, _WlzIndexedValues::type, _WlzPoints::type, _WlzVertexP::v, _WlzGreyP::v, _WlzValues::v, _WlzObject::values, _WlzPointValues::values, _WlzIndexedValues::vType, _WlzPointValues::vType, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_BOUNDLIST, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_CONTOUR, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_INDEXED_VALUES, WLZ_POINTS, WLZ_POINTS_2D, WLZ_POINTS_2I, WLZ_POINTS_3D, WLZ_POINTS_3I, WLZ_VALUE_ATTACH_NOD, WlzAssignValues(), WlzFreeDomain(), WlzGetBackground(), WlzGreyTableIsTiled(), WlzMakeEmpty(), WlzMakeMain(), WlzMakePointValues(), WlzNewValueTb(), WlzValueSqueeze(), and _WlzValues::x.
Referenced by WlzCMeshTransformManyObjAsIdx().
WlzCompoundArray* WlzCMeshTransformManyObjAsIdx | ( | WlzCompoundArray * | srcObj, |
WlzObject * | mObj, | ||
WlzInterpolationType | interp, | ||
WlzErrorNum * | dstErr | ||
) |
Applies a conforming mesh transform to all the domains of the given compound array, in a single pass, by creating an grey valued index object from the domains in the compound array; transforming the grey valued domain object and then extracting the domains from the grey valued index object. Because a conforming mesh transform can be comparatively slow this can reduce the time taken to apply the same transform to multiple domains. However it is assumed that none of the domains intersect. If they do then the domains with higher indices (later in the compound array) will overwrite those with lower indices (earlier in the compound array). In many cases this assumption may be valid, eg in the case of exclusive anatomy domains or gene expression strength domains where each is known to be a subset of the preceding strength domains. Even so the results of this function may not be identical to seperate calls at the boundaries of the domains. To distinguish the domains from the background value it may be useful to make the first object of the given compound array an empty object.
srcObj | Object to be transformed. This must be a compound array with at least one non empty object. |
mObj | Conforming mesh transform object. |
interp | Type of interpolation, which should probably either be nearest neighbours or classify. Other interpolation methods may be allowed. |
dstErr | Destination error pointer, may be NULL. |
References ALC_ER_NONE, AlcBit1Calloc(), AlcCalloc(), AlcFree(), AlcVectorItemGet(), ALG_MAX, ALG_MIN, _WlzDomain::b, _WlzGreyValueWSpace::bkdFlag, _WlzDomain::cm2, _WlzDomain::cm2d5, _WlzDomain::cm3, _WlzGMElemP::core, _WlzValues::core, _WlzDomain::core, _WlzVertexP::d2, _WlzVertexP::d3, _WlzCMeshScanWSp3D::dBox, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzCMeshScanWSp3D::dElm, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzBoundList::down, _WlzCMeshScanItv3D::elmIdx, _WlzCMeshScanElm2D::flags, _WlzCMeshScanElm3D::flags, _WlzGreyP::flp, _WlzGreyV::flv, _WlzGreyValueWSpace::gPtr, _WlzGreyValueWSpace::gVal, _WlzDomain::i, _WlzVertexP::i2, _WlzVertexP::i3, _WlzCMeshScanElm2D::idx, _WlzCMeshScanElm3D::idx, _WlzGMCore::idx, _WlzCMeshNod2D::idx, _WlzCMeshNod2D5::idx, _WlzCMeshNod3D::idx, _WlzGreyP::inp, _WlzGreyV::inv, _WlzDynItvPool::itvBlock, _WlzCMeshScanWSp3D::itvs, _WlzDynItvPool::itvsInBlock, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastpl, _WlzCMeshScanItv3D::lftI, _WlzIntervalWSpace::lftpos, _WlzCMeshScanItv3D::line, _WlzIntervalWSpace::linpos, _WlzCMeshEntRes::maxEnt, _WlzContour::model, _WlzCMeshScanWSp3D::mTr, _WlzCompoundArray::n, _WlzBoundList::next, _WlzCMeshScanWSp3D::nItvs, _WlzCMeshRes::nod, _WlzPoints::nPoints, _WlzGMResource::numIdx, _WlzPolygonDomain::nvertices, _WlzDynItvPool::offset, _WlzDomain::p, _WlzCMeshScanItv3D::plane, _WlzPlaneDomain::plane1, _WlzPoints::points, _WlzDomain::poly, _WlzBoundList::poly, _WlzCMeshNod2D::pos, _WlzCMeshNod2D5::pos, _WlzCMeshNod3D::pos, _WlzDomain::pts, _WlzGMModel::res, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzCMesh3D::res, _WlzGreyP::rgbp, _WlzGreyV::rgbv, _WlzCMeshScanItv3D::rgtI, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzGreyV::shv, _WlzCMeshScanElm3D::tr, _WlzCMeshScanElm2D::trX, _WlzCMeshScanElm2D::trY, _WlzPixelV::type, _WlzGMModel::type, _WlzObject::type, _WlzCompoundArray::type, _WlzCoreDomain::type, _WlzPoints::type, _WlzPolygonDomain::type, _WlzBoundList::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzGreyP::v, _WlzPixelV::v, _WlzObject::values, _WlzVoxelValues::values, _WlzGMResource::vec, _WlzCMeshEntRes::vec, _WlzGMModelR::vertexG, _WlzGMElemP::vertexG2D, _WlzGMElemP::vertexG2I, _WlzGMElemP::vertexG3D, _WlzGMElemP::vertexG3I, _WlzValues::vox, _WlzPlaneDomain::voxel_size, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzGMVertexG2I::vtx, _WlzGMVertexG2D::vtx, _WlzGMVertexG3I::vtx, _WlzGMVertexG3D::vtx, _WlzPolygonDomain::vtx, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CLAMP, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_CMESH_POS_DTOI, WLZ_CMESH_SCANELM_FWD, WLZ_CMESH_SCANELM_REV, WLZ_COMPOUND_ARR_1, WLZ_COMPOUND_ARR_2, WLZ_EMPTY_DOMAIN, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_INTERPOLATION_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_POLYGON_TYPE, WLZ_ERR_UNIMPLEMENTED, WLZ_GMMOD_2D, WLZ_GMMOD_2I, WLZ_GMMOD_3D, WLZ_GMMOD_3I, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_INTERPOLATION_CLASSIFY_1, WLZ_INTERPOLATION_LINEAR, WLZ_INTERPOLATION_NEAREST, WLZ_INTERVALDOMAIN_INTVL, WLZ_NINT, WLZ_PLANEDOMAIN_DOMAIN, WLZ_POINTS_2D, WLZ_POINTS_2I, WLZ_POINTS_3D, WLZ_POINTS_3I, WLZ_POLYGON_DOUBLE, WLZ_POLYGON_FLOAT, WLZ_POLYGON_INT, WLZ_RGBA_ALPHA_GET, WLZ_RGBA_BLUE_GET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_RED_GET, WLZ_RGBA_RGBA_SET, WlzAssignDomain(), WlzAssignGMModel(), WlzAssignObject(), WlzAssignPolygonDomain(), WlzAssignValues(), WlzBitLnSetItv(), WlzCMeshCopy2D(), WlzCMeshCopy2D5(), WlzCMeshCopy3D(), WlzCMeshElmEnclosingPos2D(), WlzCMeshElmEnclosingPos2D5(), WlzCMeshElmEnclosingPos3D(), WlzCMeshTransformObj(), WlzCMeshTransformVtxAry2D(), WlzCMeshTransformVtxAry2F(), WlzCMeshTransformVtxAry2I(), WlzCMeshTransformVtxAry3D(), WlzCMeshTransformVtxAry3I(), WlzDynItvLnFromBitLn(), WlzEndGreyScan(), WlzFreeContour(), WlzFreeDomain(), WlzFreeObj(), WlzFreePlaneDomain(), WlzFreePolyDmn(), WlzGetBackground(), WlzGMModelCopy(), WlzGMModelRehashVHT(), WlzGreySetValue(), WlzGreyTypeFromObj(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueGetCon(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzIndexedValueGet(), WlzIndexObjFromCompound(), WlzIndexObjToCompound(), WlzInitGreyScan(), WlzInsideDomain(), WlzMakeContour(), WlzMakeEmpty(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakePoints(), WlzMakePolygonDomain(), WlzNewValuesVox(), WlzNextGreyInterval(), WlzPolyTo8Polygon(), WlzStandardPlaneDomain(), WlzValueConvertPixel(), WlzValueSetDouble(), WlzValueSetInt(), _WlzBoundList::wrap, _WlzValues::x, _WlzIBox3::xMax, _WlzIBox3::xMin, _WlzIBox3::yMax, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
WlzErrorNum WlzCMeshGetNodesAndEdges | ( | WlzObject * | mObj, |
int * | dstNNod, | ||
WlzDVertex2 ** | dstNod, | ||
int * | dstNDsp, | ||
WlzDVertex2 ** | dstDsp, | ||
int * | dstNEdg, | ||
int ** | dstEdg | ||
) |
Gets the nodes, node displacements and edges of the mesh. The nodes and node displacements are returned as simple arrays of vertices. The edges are returned as a degenerate list of triples, with each triple being the indices of the nodes of an element.
mObj | Given mesh object. |
dstNNod | Destination pointer for the number of mesh nodes. |
dstNod | Destination pointer for the mesh nodes. |
dstNDsp | Destination pointer for the number of mesh node displacements. |
dstDsp | Destination pointer for the mesh node displacement. |
dstNEdg | Destination pointer for the number of edge indices. |
dstEdg | Destination pointer for the edge indices. |
References AlcFree(), AlcMalloc(), AlcVectorItemGet(), _WlzIndexedValues::attach, _WlzDomain::cm2, _WlzDomain::cm2d5, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshEntP::e2, _WlzCMeshEntP::e2d5, _WlzCMeshEntP::e3, _WlzCMeshElm2D::edu, _WlzCMeshRes::elm, _WlzGreyP::flp, _WlzCMeshScanElm2D::idx, _WlzCMeshNod2D::idx, _WlzCMeshNod3D::idx, _WlzCMeshElm2D::idx, _WlzCMeshElm3D::idx, _WlzGreyP::inp, _WlzGreyP::lnp, _WlzCMeshP::m2, _WlzCMeshP::m2d5, _WlzCMeshP::m3, _WlzCMeshEntRes::maxEnt, _WlzCMeshEntP::n2, _WlzCMeshEntP::n2d5, _WlzCMeshEntP::n3, _WlzCMeshEdgU2D::nod, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMeshNod2D::prop, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzCMesh3D::res, _WlzGreyP::rgbp, _WlzGreyP::shp, _WlzObject::type, _WlzCoreDomain::type, _WlzGreyP::ubp, _WlzGreyP::v, _WlzCMeshEntP::v, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzIndexedValues::vType, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_GREY_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_NULL, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_LONG, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_RGBA_ALPHA_GET, WLZ_RGBA_ALPHA_SET, WLZ_RGBA_BLUE_GET, WLZ_RGBA_BLUE_SET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_GREEN_SET, WLZ_RGBA_RED_GET, WLZ_RGBA_RED_SET, WLZ_VALUE_ATTACH_ELM, WLZ_VALUE_ATTACH_NOD, WlzIndexedValueGet(), and _WlzValues::x.
WlzDBox2 WlzCMeshTransformGetBBox2D | ( | WlzObject * | mObj, |
int | trans, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the bounding box of the mesh in the given mesh transform, with or without applying the displacements according to the value of trans.
mObj | Given mesh transform object. |
trans | Displacements applied if non-zero. |
dstErr | Destination error pointer, may be NULL. |
References AlcVectorItemGet(), _WlzDomain::cm2, _WlzDomain::core, _WlzObject::domain, _WlzCMeshRes::elm, _WlzCMeshNod2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _WlzObject::type, _WlzCoreDomain::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_CMESH_2D, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WlzIndexedValueGet(), _WlzValues::x, _WlzDBox2::xMax, _WlzDBox2::xMin, _WlzDBox2::yMax, and _WlzDBox2::yMin.
Referenced by WlzCMeshToDomObjValues().
WlzDBox3 WlzCMeshTransformGetBBox3D | ( | WlzObject * | mObj, |
int | trans, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the bounding box of the mesh in the given mesh transform, with or without applying the displacements according to the value of trans.
mObj | Given mesh transform object. |
trans | Displacements applied if non-zero. |
dstErr | Destination error pointer, may be NULL. |
References AlcVectorItemGet(), _WlzDomain::cm3, _WlzDomain::core, _WlzObject::domain, _WlzCMeshRes::elm, _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshEntRes::numEnt, _WlzCMeshNod3D::pos, _WlzCMesh3D::res, _WlzObject::type, _WlzCoreDomain::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WlzIndexedValueGet(), _WlzValues::x, _WlzDBox3::xMax, _WlzDBox3::xMin, _WlzDBox3::yMax, _WlzDBox3::yMin, _WlzDBox3::zMax, and _WlzDBox3::zMin.
WlzErrorNum WlzScaleCMeshValue | ( | double | scale, |
WlzObject * | obj | ||
) |
Scales index values pointed of a WoolzObject in place.
scale | Scale value |
obj | Woolz object |
WlzObject* WlzCopyScaleCMeshValue | ( | double | scale, |
WlzObject * | obj, | ||
WlzErrorNum * | dstErr | ||
) |
Creates an woolz CMesh transform object indentical with the input object, but with value scaled.
scale | Scale value |
obj | Woolz object |
dstErr | Destination error pointer, may be NULL. |
References _WlzIndexedValues::attach, _WlzIndexedValues::dim, _WlzObject::domain, _WlzIndexedValues::rank, _WlzObject::type, _WlzObject::values, _WlzIndexedValues::vType, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_VALUES_NULL, WlzAssignValues(), WlzFreeObj(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.
WlzErrorNum WlzCMeshAffineProduct | ( | WlzObject * | trM, |
WlzAffineTransform * | trA, | ||
int | order | ||
) |
Computes the product of the given affine and conforming mesh transforms in place, ie the mesh transform has it's displacements overwritten.
Given a conforming mesh transform \form#149 and an affine transform \form#62. The product\(\mathbf{P}\) can be evaluated as:
\[ \begin{array}{ll} \mathbf{P} = \mathbf{A}\mathbf{M}, & o = 0 \\ \mathbf{P} = \mathbf{M}\mathbf{A}, & o = 1 \end{array} \]
where \(o\) is the order parameter and\[ \mathbf{T_0}\mathbf{T_1}\mathbf{x} = \mathbf{T_0}(\mathbf{T_1}\mathbf{x}) \]
The product with \(o = 1\) applies the mesh displacement at location \(\mathbf{x}\) and not at \(\mathbf{A}(\mathbf{x})\) as might be expected.trM | Given conforming mesh transform. |
trA | Given affine transform. |
order | Order of evaluation. |
References AlcVectorItemGet(), _WlzIndexedValues::attach, _WlzDomain::cm2, _WlzDomain::cm2d5, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshNod2D::idx, _WlzCMeshNod2D5::idx, _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMeshNod2D5::pos, _WlzCMeshNod3D::pos, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzCMesh2D5::res, _WlzCMesh3D::res, _WlzObject::type, _WlzCoreValues::type, _WlzAffineTransform::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzIndexedValues::vType, _WlzDVertex3::vtZ, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_ERR_VALUES_DATA, WLZ_GREY_DOUBLE, WLZ_INDEXED_VALUES, WLZ_TRANSFORM_2D5_CMESH, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_CMESH, WLZ_TRANSFORM_2D_NOSHEAR, WLZ_TRANSFORM_2D_REG, WLZ_TRANSFORM_2D_TRANS, WLZ_TRANSFORM_3D_AFFINE, WLZ_TRANSFORM_3D_CMESH, WLZ_TRANSFORM_3D_NOSHEAR, WLZ_TRANSFORM_3D_REG, WLZ_TRANSFORM_3D_TRANS, WLZ_TRANSFORM_EMPTY, WLZ_VALUE_ATTACH_NOD, WlzAffineTransformInverse(), WlzAffineTransformVertexD2(), WlzAffineTransformVertexD3(), WlzCMeshReassignGridCells2D(), WlzCMeshReassignGridCells2D5(), WlzCMeshReassignGridCells3D(), WlzCMeshUpdateBBox2D(), WlzCMeshUpdateBBox2D5(), WlzCMeshUpdateBBox3D(), WlzCMeshUpdateMaxSqEdgLen2D(), WlzCMeshUpdateMaxSqEdgLen2D5(), WlzCMeshUpdateMaxSqEdgLen3D(), WlzFreeAffineTransform(), WlzIndexedValueGet(), and _WlzValues::x.
Referenced by WlzTransformProduct().
WlzObject* WlzCMeshMeshMeshProduct | ( | WlzMeshTransform * | tr0, |
WlzMeshTransform * | tr1, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the product of the two given (convex) mesh transforms. This is computed within intersection of the two mesh transforms resulting in a conforming mesh transform.
\[ \mathbf{T_R}(\mathbf{x}) = \mathbf{T_0}(\mathbf{T_1}(\mathbf{x})) \]
Where possible the node positions of the second mesh \(\mathbf{T_1}\) are preserved in the output conforming mesh \(\mathbf{T_R}\). The displacements are given in the output conforming transform are given by
\[ \mathbf{d_R}(\mathbf{x}) = \mathbf{d_1}(\mathbf{x}) + \mathbf{d_0}(\mathbf{d_1}(\mathbf{x})) - \mathbf{x} \]
.
tr0 | First (convex) mesh transform. |
tr1 | Second (convex) mesh transform. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcRealloc(), AlcVectorItemGet(), AlgMatrixFree(), _WlzDomain::cm2, _AlgMatrix::core, _WlzValues::core, _WlzMeshNode::displacement, _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzCMeshNod2D::idx, _WlzMeshTransform::maxNodes, _WlzMeshElem::neighbours, _WlzCMeshRes::nod, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzCMeshNod2D::pos, _WlzMeshNode::position, _WlzCMesh2D::res, _WlzMeshTransform::type, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_CMESH_2D, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_DATA, WLZ_ERR_TRANSFORM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_GREY_DOUBLE, WLZ_KRIG_MODELFN_LINEAR, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_TOLERANCE, WLZ_TRANSFORM_2D_MESH, WLZ_VALUE_ATTACH_NOD, WLZ_VTX_2_ADD, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, WlzCMeshIntersect2Mesh2D(), WlzGeomInterpolateTri2D(), WlzIndexedValueGet(), WlzKrigOSetModelSV2D(), WlzKrigOSetPosSV2D(), WlzKrigOWeightsSolve(), WlzKrigReallocBuffers2D(), WlzKrigSetModelFn(), WlzMakeIndexedValues(), WlzMakeMain(), WlzMeshElemFindVx(), and WlzMeshMaxEdgeLenSq().
Referenced by WlzTransformProduct().
WlzObject* WlzCMeshMeshProduct | ( | WlzObject * | tr0, |
WlzMeshTransform * | tr1, | ||
int | order, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the product of the two given (convex) mesh transforms. This is computed within intersection of the two mesh transforms resulting in a conforming mesh transform.
\[ \mathbf{T_R}(\mathbf{x}) = \mathbf{T_1}(\mathbf{T_0}(\mathbf{x})) \]
Where possible the node positions of the second mesh \(\mathbf{T_1}\) are preserved in the output mesh \(\mathbf{T_R}\). The displacements in the output transform are given by
\[ \mathbf{d_R}(\mathbf{x}) = \mathbf{d_0}(\mathbf{x}) + \mathbf{d_1}(\mathbf{d_0}(\mathbf{x})) - \mathbf{x} \]
.
tr0 | First (convex) mesh transform. |
tr1 | Second (convex) mesh transform. |
order | Order of evaluation. |
dstErr | Destination error pointer, may be NULL. |
References WLZ_ERR_UNIMPLEMENTED.
Referenced by WlzTransformProduct().
WlzObject* WlzCMeshProduct | ( | WlzObject * | tr0, |
WlzObject * | tr1, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the product of the two given (conforming) mesh transforms. This is computed within intersection of the two mesh transforms resulting in another conforming mesh transform.
\[ \mathbf{T_R}(\mathbf{x}) = \mathbf{T_1}(\mathbf{T_0}(\mathbf{x})) \]
Where possible the node positions of the second mesh \(\mathbf{T_1}\) are preserved in the output mesh \(\mathbf{T_R}\). The displacements in the output transform are given by
\[ \mathbf{d_R}(\mathbf{x}) = \mathbf{d_0}(\mathbf{x}) + \mathbf{d_1}(\mathbf{d_0}(\mathbf{x})) - \mathbf{x} \]
.
tr0 | First (conforming) mesh transform. |
tr1 | Second (conforming) mesh transform. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcVectorItemGet(), AlgMatrixFree(), _WlzIndexedValues::attach, _WlzDomain::cm2, _WlzDomain::cm3, _AlgMatrix::core, _WlzValues::core, _WlzDomain::core, _WlzIndexedValues::dim, _WlzObject::domain, _WlzCMeshScanElm2D::idx, _WlzCMeshNod2D::idx, _WlzCMeshNod3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMeshNod3D::pos, _WlzIndexedValues::rank, _WlzCMesh2D::res, _WlzCMesh3D::res, _WlzObject::type, _WlzCoreDomain::type, _WlzCoreValues::type, _WlzIndexedValues::type, _WlzCMesh2D::type, _WlzCMesh3D::type, _WlzObject::values, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzIndexedValues::vType, _WlzDVertex3::vtZ, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_CMESH_ELM2D_GET_NODE_0, WLZ_CMESH_ELM2D_GET_NODE_1, WLZ_CMESH_ELM2D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_TRANSFORM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_INDEXED_VALUES, WLZ_KRIG_MODELFN_LINEAR, WLZ_MESH_TOLERANCE, WLZ_VALUE_ATTACH_NOD, WLZ_VTX_2_ADD, WLZ_VTX_2_SUB, WLZ_VTX_2_ZERO, WLZ_VTX_3_ADD, WLZ_VTX_3_SUB, WLZ_VTX_3_ZERO, WlzAssignValues(), WlzCMeshClosestNod2D(), WlzCMeshClosestNod3D(), WlzCMeshElmEnclosingPos2D(), WlzCMeshElmEnclosingPos3D(), WlzCMeshIntersect(), WlzCMeshNodRingNodIndices2D(), WlzCMeshNodRingNodIndices3D(), WlzGeomInterpolateTet3D(), WlzGeomInterpolateTri2D(), WlzIndexedValueGet(), WlzKrigOSetModelSV2D(), WlzKrigOSetModelSV3D(), WlzKrigOSetPosSV2D(), WlzKrigOSetPosSV3D(), WlzKrigOWeightsSolve(), WlzKrigReallocBuffers2D(), WlzKrigReallocBuffers3D(), WlzKrigSetModelFn(), WlzMakeIndexedValues(), and _WlzValues::x.
Referenced by WlzTransformProduct().
WlzObject* WlzCMeshExpansion | ( | WlzObject * | cObj, |
int | inverse, | ||
int | method, | ||
WlzErrorNum * | dstErr | ||
) |
Compute the scalar expansion factors for the mesh elements of the given conforming mesh transform. The expansion factors are attached to the elements of the returned conforming mesh object. The expansion factor is defined to be the trace of the strain tensor but in many cases the maximum eigenvalue is a more sensitive feature.
cObj | Given conforming mesh transform. |
inverse | Use inverse of transform if non zero. |
method | Method used:
|
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), AlcVectorItemGet(), ALG_MAX3, AlgMatrixRectFree(), AlgMatrixRectNew(), AlgMatrixRSEigen(), _AlgMatrixRect::array, _WlzDomain::cm3, _WlzObject::domain, _WlzCMeshRes::elm, _WlzCMeshScanElm2D::idx, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshNod3D::pos, _AlgMatrix::rect, _WlzCMesh3D::res, _WlzObject::type, _WlzObject::values, _WlzIndexedValues::values, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_CMESH_ELM3D_GET_NODE_0, WLZ_CMESH_ELM3D_GET_NODE_1, WLZ_CMESH_ELM3D_GET_NODE_2, WLZ_CMESH_ELM3D_GET_NODE_3, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_UNIMPLEMENTED, WLZ_GREY_DOUBLE, WLZ_VALUE_ATTACH_ELM, WlzCMeshStrainTensor(), WlzFreeIndexedValues(), WlzFreeObj(), WlzGeomTetraSnVolume6(), WlzIndexedValueGet(), WlzMakeIndexedValues(), WlzMakeMain(), and _WlzValues::x.
WlzErrorNum WlzFitPlaneSVD | ( | WlzVertexType | vtxType, |
int | nVtx, | ||
WlzVertexP | vtx, | ||
WlzDVertex3 * | dstPinP, | ||
WlzDVertex3 * | dstNrm | ||
) |
Fits a plane to the given vertices using singular value decomposition. The best fit plane is returned (provided there is no error) as a unit normal \(n\) and the centroid of the given vertices ( \(r_0\) ) which in a point in the plane, with the plane equation
\[ \vec{n}\cdot(\vec{r} - \vec{r_0}) = \vec{0} \]
.
vtxType | Given vertex type. |
nVtx | Number of given vertices. |
vtx | Given vertices. |
dstPinP | Destination pointer for the return of the median point ( \(r_0\)) in the plane. |
dstNrm | Destination pointer for the unit normal to the plane ( \(n\)). |
References AlcCalloc(), AlcFree(), ALG_ERR_NONE, AlgMatrixRectFree(), AlgMatrixRectNew(), AlgMatrixSVDecomp(), _AlgMatrixRect::array, _AlgMatrix::core, _WlzVertexP::d3, _WlzVertexP::f3, _WlzVertexP::i3, _AlgMatrix::rect, _WlzVertexP::v, _WlzIVertex3::vtX, _WlzFVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex3::vtY, _WlzFVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzFVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_ERR_ALG_SINGULAR, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_ERR_PARAM_TYPE, WLZ_VERTEX_D3, WLZ_VERTEX_F3, WLZ_VERTEX_I3, WLZ_VTX_3_LENGTH, WLZ_VTX_3_SCALE, WLZ_VTX_3_ZERO, and WlzErrorFromAlg().
WlzObject* WlzIntRescaleObj | ( | WlzObject * | gObj, |
int | scale, | ||
int | expand, | ||
WlzErrorNum * | dstErr | ||
) |
Rescales the given object using an integer scale.
gObj | Given object. |
scale | Integer scale factor. |
expand | If zero use \(\frac{1}{scale}\). |
dstErr | Destination error pointer, may be NULL. |
References AlcFreeStackPush(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzIntervalDomain::freeptr, _WlzGreyValueWSpace::gVal, _WlzDomain::i, _WlzInterval::ileft, _WlzGreyP::inp, _WlzIntervalDomain::intvlines, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzIntervalWSpace::linpos, _WlzIntervalLine::nintvs, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzGreyP::rgbp, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzObject::type, _WlzIntervalDomain::type, _WlzPlaneDomain::type, _WlzCoreValues::type, _WlzRagRValues::type, _WlzVoxelValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_3D_POLYGON, WLZ_BOUNDLIST, WLZ_EMPTY_DOMAIN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_INTERVALDOMAIN_INTVL, WLZ_MAX, WLZ_MIN, WLZ_TRANS_OBJ, WlzAssignDomain(), WlzAssignValues(), WlzEndGreyScan(), WlzFreeObj(), WlzFreePlaneDomain(), WlzFreeVoxelValueTb(), WlzGetBackground(), WlzGreyTableIsTiled(), WlzGreyTableTypeToGreyType(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueMakeWSp(), WlzInitGreyScan(), WlzIntervalCount(), WlzMakeEmpty(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakeVoxelValueTb(), WlzNewValueTb(), WlzNextGreyInterval(), WlzStandardIntervalDomain(), _WlzIBox3::xMax, _WlzIBox3::xMin, _WlzIBox3::yMax, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzContourGrdObj2D().
WlzAffineTransform* WlzMakeAffineTransform | ( | WlzTransformType | type, |
WlzErrorNum * | dstErr | ||
) |
Allocates and initialises space for a 2D or 3D affine transform. Sufficient space is always allocated for a 3D transform. The transform should be freed using WlzFreeAffineTransform().
type | Transform type. |
dstErr | Destination error pointer, may be null. |
References ALC_ER_NONE, AlcCalloc(), AlcDouble2Calloc(), AlcFree(), _WlzAffineTransform::mat, _WlzAffineTransform::type, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_NOSHEAR, WLZ_TRANSFORM_2D_REG, WLZ_TRANSFORM_2D_TRANS, WLZ_TRANSFORM_3D_AFFINE, WLZ_TRANSFORM_3D_NOSHEAR, WLZ_TRANSFORM_3D_REG, and WLZ_TRANSFORM_3D_TRANS.
Referenced by WlzAffineTransformFromMatrix(), WlzAffineTransformFromPrimVal(), WlzAffineTransformFromRotation(), WlzAffineTransformFromScale(), WlzAffineTransformFromSpinSqueeze(), WlzAffineTransformFromTranslation(), WlzAffineTransformLSqReg2D(), WlzAffineTransformLSqReg3D(), WlzAffineTransformProduct(), WlzCMeshFromObj2D(), WlzCMeshFromObj3D(), WlzContourFromPoints(), WlzEffReadObjNifti(), WlzMake3DViewStruct(), WlzMake3DViewStructCopy(), WlzMakeTiledValuesObj2D(), WlzMakeTiledValuesObj3D(), WlzProjectObjToPlane(), WlzReadObj(), WlzRegICPTreeAndVertices(), and WlzRegICPVertices().
WlzErrorNum WlzFreeAffineTransform | ( | WlzAffineTransform * | trans | ) |
Frees an affine transform allocated by WlzMakeAffineTransform().
trans | Affine transform to free. |
References AlcDouble2Free(), AlcFree(), _WlzAffineTransform::linkcount, _WlzAffineTransform::mat, WLZ_ERR_NONE, and WlzUnlink().
Referenced by Wlz3DSectionIncrementDistance(), Wlz3DSectionTransformInvVtx(), Wlz3DViewGetIntersectionAngle(), Wlz3DViewGetIntersectionPoint(), Wlz3DViewStructSetupTransformLuts(), WlzAffineTransformFromMatrix(), WlzAffineTransformFromPrimVal(), WlzAffineTransformFromRotation(), WlzAffineTransformFromScale(), WlzAffineTransformFromTranslation(), WlzAffineTransformGMShell(), WlzAffineTransformLSq2D(), WlzCMeshAffineProduct(), WlzCMeshFromObj2D(), WlzCMeshFromObj3D(), WlzCMeshToDomObj(), WlzContourFromPoints(), WlzDistanceTransform(), WlzEffReadObjNifti(), WlzFree3DViewStruct(), WlzFreeObj(), WlzFreePlaneDomain(), WlzFreeTransform(), WlzGreyValueFreeWSp(), WlzGreyValueMakeWSp(), WlzInit3DViewStructAffineTransform(), WlzInsideDomain(), WlzMakeTiledValuesObj3D(), WlzMarkerLattice(), WlzMatchICPCtr(), WlzMatchICPWeightMatches(), WlzMeshTransformFromCPts(), WlzProjectObjToPlane(), WlzReadObj(), WlzRegCCorObjs(), WlzRegICPTreeAndVertices(), WlzRegICPVertices(), WlzRegICPVerticesWSD2D(), and WlzShiftDomain().
WlzErrorNum WlzMatchICPObjs | ( | WlzObject * | tObj, |
WlzObject * | sObj, | ||
WlzAffineTransform * | initTr, | ||
int * | dstNMatch, | ||
WlzVertexP * | dstTMatch, | ||
WlzVertexP * | dstSMatch, | ||
int | maxItr, | ||
int | minSpx, | ||
int | minSegSpx, | ||
int | brkFlg, | ||
double | maxDisp, | ||
double | maxAng, | ||
double | maxDeform, | ||
int | matchImpNN, | ||
double | matchImpThr, | ||
double | delta | ||
) |
Finds matching points in two objects using an ICP based matching algorithm. On return the match points are ranked by plausibility with the most plausible matches first. If either the target or source object is a contour then it's model is modified in place. If this isn't wanted then use WlzCopyObj() to copy the contours before calling this function.
tObj | The target object. |
sObj | The source object to be matched with target object. |
initTr | Initial affine transform to be applied to the source object prior to matching. May be NULL. |
dstNMatch | Destination pointer for the number of match points found. Required. |
dstTMatch | Destination pointer for the target match points found. Required. |
dstSMatch | Destination pointer for the source match points found. Required. |
maxItr | Maximum number of iterations. |
minSpx | Minimum number of simplicies in a contour shell for matching. |
minSegSpx | Minimum number of simplices per matched shell segment, with a tie point pair possibly being generated for each matched shell segment. |
brkFlg | Controls the breaking of the source shells. Possible values are:
|
maxDisp | The maximum displacement to the geometry of a shell, from the global affine transformed position for an acceptable registration. distance, for a registered shell to be used for correspondence computation. |
maxAng | The maximum angle of rotation of a shell geometry with respect to the global affine transformed geometry for an acceptable registration. |
maxDeform | The maximum deformation to the geometry of a shell, from the global affine transformed geometry, for an acceptable registration. |
matchImpNN | Number match points in neighbourhood when removing implausible match points, must be \(> 2\). |
matchImpThr | Implausibility threshold which should be \(> 0\) but the useful range is probably \([0.5-2.5]\). Higher values allow more implausible matches to be returned. |
delta | Tolerance for mean value of registration metric. |
References _WlzDomain::core, _WlzDomain::ctr, _WlzObject::domain, _WlzMatchICPWeightCbData::maxDisp, _WlzContour::model, _WlzMatchICPWeightCbData::nScatter, _WlzMatchICPWeightCbData::sGM, _WlzMatchICPWeightCbData::tGM, _WlzGMModel::type, _WlzObject::type, WLZ_CONTOUR, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_NULL, WLZ_GMMOD_2D, WLZ_GMMOD_2I, WLZ_GMMOD_2N, WLZ_GMMOD_3D, WLZ_GMMOD_3I, WLZ_GMMOD_3N, WlzMatchICPCtr(), and WlzMatchICPWeightMatches().
WlzErrorNum WlzMatchICPCtr | ( | WlzContour * | tCtr, |
WlzContour * | sCtr, | ||
WlzAffineTransform * | initTr, | ||
int | maxItr, | ||
int | minSpx, | ||
int | minSegSpx, | ||
int * | dstNMatch, | ||
WlzVertexP * | dstTMatch, | ||
WlzVertexP * | dstSMatch, | ||
int | brkFlg, | ||
double | maxDisp, | ||
double | maxAng, | ||
double | maxDeform, | ||
int | matchImpNN, | ||
double | matchImpThr, | ||
WlzRegICPUsrWgtFn | usrWgtFn, | ||
void * | usrWgtData, | ||
double | delta | ||
) |
Establishes matching points in two 2D contours using ICP based registration algorithm. The contours have been checked so that their models are neither NULL or of different types. The source contour's model is modified in place.
tCtr | The target contour. |
sCtr | The source contour to be matched with target contour. |
initTr | Initial affine transform to be applied to the source object prior to matching. May be NULL. |
maxItr | Maximum number of iterations. |
minSpx | Minimum number of simplicies in a contour shell for matching. |
minSegSpx | Minimum number of simplices per matched shell segment, with a tie point pair possibly being generated for each matched shell segment. |
dstNMatch | Destination pointer for the number of match points found. |
dstTMatch | Destination pointer for the target match points found. |
dstSMatch | Destination pointer for the source match points found. |
brkFlg | Controls the breaking of the source shells. Possible values are:
|
maxDisp | The maximum displacement to the geometry of a shell for an acceptable registration. distance for a registered shell to be used for correspondence computation. |
maxAng | The maximum angle of rotation of a shell geometry with respect to the global affine transformed geometry for an acceptable registration. |
maxDeform | The maximum deformation to the geometry of a shell for an acceptable registration. |
matchImpNN | Number match points in neighbourhood when removing implausible match points, must be \(> 2\). |
matchImpThr | Implausibility threshold which should be \(> 0\) but the useful range is probably \([0.5-2.5]\). Higher values allow more implausible matches to be returned. |
usrWgtFn | User supplied weighting function. |
usrWgtData | User supplied weighting data. |
delta | Tolerance for mean value of registration metric. |
References ALC_ER_NONE, AlcCalloc(), AlcCPQEntryInsert(), AlcCPQItemFree(), AlcCPQItemInsert(), AlcCPQItemUnlink(), AlcCPQQueueNew(), AlcFree(), AlcKDTTreeFree(), AlcMalloc(), AlcRealloc(), _WlzGMShell::child, _AlcCPQItem::entry, _WlzMatchICPCbData::errNum, _WlzMatchICPShellList::head, _WlzMatchICPCbData::list, _WlzContour::model, _WlzMatchICPShellListElm::mShell, _WlzMatchICPShellListElm::next, _WlzGMShell::next, _WlzMatchICPCbData::nFS, _WlzMatchICPCbData::nNS, _WlzGMResource::numIdx, _AlcCPQItem::priority, _WlzGMModel::res, _WlzMatchICPShell::shell, _WlzMatchICPShell::size, _WlzMatchICPShellList::tail, _WlzMatchICPShell::tr, _WlzGMModel::type, _WlzVertexP::v, _WlzGMModelR::vertex, WLZ_ERR_ALG_CONVERGENCE, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_GMMOD_2D, WLZ_GMMOD_2I, WLZ_GMMOD_2N, WLZ_GMMOD_3D, WLZ_GMMOD_3I, WLZ_GMMOD_3N, WLZ_MAX, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_3D_AFFINE, WLZ_VERTEX_D2, WLZ_VERTEX_D3, WlzAffineTransformGMModel(), WlzAffineTransformGMShell(), WlzAssignAffineTransform(), WlzFreeAffineTransform(), WlzGMFilterRmSmShells(), WlzGMModelAddResCb(), WlzGMModelDeleteS(), WlzGMModelRemResCb(), WlzGMShellSimplexCnt(), WlzVerticesBuildTree(), and WlzVerticesFromGM().
Referenced by WlzMatchICPObjs().
double WlzMatchICPWeightMatches | ( | WlzVertexType | vType, |
WlzAffineTransform * | curTr, | ||
AlcKDTTree * | tree, | ||
WlzVertexP | tVx, | ||
WlzVertexP | sVx, | ||
WlzVertex | tMVx, | ||
WlzVertex | sMVx, | ||
double | wVx, | ||
double | wNr, | ||
void * | data | ||
) |
Compute an the weighting for the matched pair of verticies. This function is called from WlzRegICPTreeAndVertices().
vType | Type of vertices. |
curTr | Current affine transform. |
tree | Given kD-tree populated by the target vertices such that the nodes of the tree have the same indicies as the given target vertices. |
tVx | The target vertices. |
sVx | The source vertices. |
tMVx | The matched target vertex. |
sMVx | The matched source vertex. |
wVx | Distance weight. |
wNr | Normal weight. |
data | Data used to pass the geometric models. |
References AlcCalloc(), AlcFree(), AlcKDTGetNN(), AlcMalloc(), AlcVectorItemGet(), AlgHeapSortIdx(), AlgRandUniform(), AlgSort(), _WlzGMShell::child, _WlzGMElemP::core, _WlzValues::core, _WlzDomain::ctr, _WlzVertexP::d2, _WlzVertex::d2, _WlzVertexP::d3, _WlzVertex::d3, _WlzGMVertexT::diskT, _WlzGMVertex::diskT, _WlzGMLoopT::edgeT, _WlzMatchICPCbData::errNum, _WlzMatchICPShellList::head, _AlcKDTNode::idx, _WlzGMVertex::idx, _WlzMatchICPCbData::list, _WlzMatchICPWeightCbData::maxDisp, _WlzContour::model, _WlzMatchICPShellListElm::mShell, _WlzMatchICPShellListElm::next, _WlzGMVertexT::next, _WlzGMEdgeT::next, _WlzGMLoopT::next, _WlzMatchICPCbData::nFS, _WlzMatchICPCbData::nNS, _WlzMatchICPWeightCbData::nScatter, _WlzGMEdgeT::opp, _WlzGMLoopT::opp, _WlzGMVertexT::parent, _WlzGMEdgeT::parent, _WlzGMLoopT::parent, _WlzMatchICPShellListElm::prev, _WlzGMEdgeT::prev, _WlzGMModel::res, _WlzMatchICPWeightCbData::sGM, _WlzMatchICPShell::shell, _WlzGMElemP::shell, _WlzMatchICPShell::size, _WlzMatchICPShellList::tail, _WlzMatchICPWeightCbData::tGM, _WlzMatchICPShell::tr, _WlzMatchICPTPPair2D::tVx, _WlzGMCore::type, _WlzGMModel::type, _WlzGMResource::vec, _WlzGMDiskT::vertex, _WlzGMModelR::vertex, _WlzGMDiskT::vertexT, _WlzGMEdgeT::vertexT, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_CONTOUR, WLZ_ERR_ALG_CONVERGENCE, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_UNIMPLEMENTED, WLZ_GMCB_NEW, WLZ_GMELM_SHELL, WLZ_GMMOD_2D, WLZ_GMMOD_2I, WLZ_GMMOD_2N, WLZ_GMMOD_3D, WLZ_GMMOD_3I, WLZ_GMMOD_3N, WLZ_VERTEX_D2, WLZ_VERTEX_D3, WLZ_VTX_2_DOT, WLZ_VTX_2_LENGTH, WLZ_VTX_2_SUB, WlzAffineTransformCopy(), WlzAffineTransformVertexD2(), WlzAssignAffineTransform(), WlzAssignGMModel(), WlzFreeAffineTransform(), WlzFreeObj(), WlzGeomEllipseVxDistSq(), WlzGMModelDeleteS(), WlzGMModelDeleteV(), WlzGMModelMatchVertexG2D(), WlzGMModelNewFromS(), WlzGMShellSimplexCnt(), WlzGMVertexGetG2D(), WlzMakeContour(), WlzMakeMain(), WlzRegICPTreeAndVertices(), and WlzWriteObj().
Referenced by WlzMatchICPObjs().
void WlzCMeshDbgOutVTK2D | ( | FILE * | fP, |
WlzCMesh2D * | mesh | ||
) |
Debuging function for 2D mesh output in VTK format.
fP | Given file pointer. |
mesh | Given mesh. |
References AlcVectorItemGet(), _WlzCMeshElm2D::edu, _WlzCMeshRes::elm, _WlzCMeshNod2D::idx, _WlzCMeshElm2D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU2D::nod, _WlzCMeshRes::nod, _WlzCMeshNod2D::pos, _WlzCMesh2D::res, _WlzCMesh2D::type, _WlzCMeshEntRes::vec, _WlzDVertex2::vtX, _WlzDVertex2::vtY, and WLZ_CMESH_2D.
Referenced by WlzCMeshDbgOutVTK().
void WlzCMeshDbgOutVTK3D | ( | FILE * | fP, |
WlzCMesh3D * | mesh | ||
) |
Debuging function for 3D mesh output in VTK format.
fP | Given file pointer. |
mesh | Given mesh. |
References AlcVectorItemGet(), _WlzCMeshFace::edu, _WlzCMeshFace::elm, _WlzCMeshRes::elm, _WlzCMeshElm3D::face, _WlzCMeshNod3D::idx, _WlzCMeshElm3D::idx, _WlzCMeshEntRes::maxEnt, _WlzCMeshEdgU3D::nod, _WlzCMeshRes::nod, _WlzCMeshFace::opp, _WlzCMeshNod3D::pos, _WlzCMesh3D::res, _WlzCMesh3D::type, _WlzCMeshEntRes::vec, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, and WLZ_CMESH_3D.
Referenced by WlzCMeshDbgOutVTK().
WlzErrorNum WlzMeshFreeTransform | ( | WlzMeshTransform * | mesh | ) |
Free's the given mesh transform.
mesh | Given mesh transform. |
References AlcFree(), _WlzMeshTransform::elements, _WlzMeshTransform::maxElem, _WlzMeshTransform::maxNodes, _WlzMeshTransform::nodes, and WLZ_ERR_NONE.
Referenced by WlzBasisFnTransformObj(), WlzFreeTransform(), WlzMeshTransformFromCPts(), and WlzMeshTransformObj().
WlzMeshTransform* WlzMeshTransformNew | ( | unsigned int | nNode, |
unsigned int | nElem, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a mesh transform data structure with the nodes, elements and displacements allocated and initialized to zero.
nNode | Number of nodes (and displacements). |
nElem | Number of elements. |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), AlcFree(), _WlzMeshTransform::elements, _WlzMeshTransform::maxElem, _WlzMeshTransform::maxNodes, _WlzMeshTransform::nodes, _WlzMeshTransform::type, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WLZ_TRANSFORM_2D_MESH.
Referenced by WlzMeshFromObjBox(), and WlzMeshTransformCopy().
WlzMeshTransform* WlzMeshTransformAdapt | ( | WlzMeshTransform * | gMesh, |
double | minArea, | ||
WlzErrorNum * | dstErr | ||
) |
Adapts the given mesh transform so that each of the elements in the displaced mesh has an area greater than the given minimum.
gMesh | Given mesh transform. |
minArea | Minimum element area. |
dstErr | Destination error pointer, may be NULL. |
References _WlzMeshNode::displacement, _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzMeshElem::idx, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WlzGeomTriangleSnArea2(), WlzMeshNodeDelIdx(), WlzMeshSqueeze(), WlzMeshTransformCopy(), and WlzMeshTransformVerify().
Referenced by WlzMeshTransformObj().
WlzMeshTransform* WlzMeshTransformCopy | ( | WlzMeshTransform * | gMesh, |
WlzErrorNum * | dstErr | ||
) |
Copies the given mesh transform. The copied mesh will have any zombie elements squeezed out.
gMesh | Given mesh transform. |
dstErr | Destination error pointer, may be NULL. |
References _WlzMeshTransform::elements, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshTransform::nodes, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WlzMeshSqueeze(), and WlzMeshTransformNew().
Referenced by WlzMeshTransformAdapt(), and WlzTransformProduct().
WlzMeshTransform* WlzMeshFromObj | ( | WlzObject * | srcObj, |
WlzMeshGenMethod | method, | ||
double | minDist, | ||
double | maxDist, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a mesh transform for the given object with all mesh displacements zero.
srcObj | The given object. |
method | Mesh generation method to use. |
minDist | Minimum distance between mesh vertices. |
maxDist | Maximum distance between mesh vertices. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::core, _WlzObject::domain, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_MESH_GENMETHOD_BLOCK, WLZ_MESH_GENMETHOD_GRADIENT, and WLZ_NINT.
Referenced by WlzBasisFnTransformObj(), and WlzMeshTransformFromCPts().
WlzObject* WlzMeshTransformObj | ( | WlzObject * | srcObj, |
WlzMeshTransform * | gMesh, | ||
WlzInterpolationType | interp, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms a woolz object using a the given mesh transform.
srcObj | Object to be transformed. |
gMesh | Given mesh transform to apply. |
interp | Level of interpolation. |
dstErr | Destination error pointer, may be NULL. |
References _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WlzMeshFreeTransform(), and WlzMeshTransformAdapt().
Referenced by WlzBasisFnTransformObj(), and WlzProj3DToSection().
WlzMeshTransform* WlzMeshTransformFromCPts | ( | WlzObject * | obj, |
WlzFnType | basisFnType, | ||
int | polyOrder, | ||
int | nSPts, | ||
WlzDVertex2 * | sPts, | ||
int | nDPts, | ||
WlzDVertex2 * | dPts, | ||
WlzMeshGenMethod | meshGenMtd, | ||
double | meshMinDist, | ||
double | meshMaxDist, | ||
WlzErrorNum * | dstErr | ||
) |
Computes a mesh transform for the given object and a set of control points using both an affine and a basis function transform to set the mesh displacements.
obj | Given object. |
basisFnType | Required basis function type. |
polyOrder | Order of polynomial, only used for WLZ_FN_BASIS_2DPOLY. |
nSPts | Number of source control points. |
sPts | Source control points. |
nDPts | Number of destination control points. |
dPts | Destination control points. |
meshGenMtd | Mesh generation method. |
meshMinDist | Minimum mesh vertex distance. |
meshMaxDist | Maximum mesh vertex distance. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcMalloc(), WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_TRANSFORM_2D_AFFINE, WlzAffineTransformInverse(), WlzAffineTransformLSq2D(), WlzAffineTransformVertexD2(), WlzBasisFnFreeTransform(), WlzBasisFnSetMesh(), WlzBasisFnTrFromCPts2D(), WlzFreeAffineTransform(), WlzMeshAffineProduct(), WlzMeshFreeTransform(), and WlzMeshFromObj().
WlzErrorNum WlzMeshAffineProduct | ( | WlzMeshTransform * | mTr, |
WlzAffineTransform * | aTr, | ||
int | order | ||
) |
Computes the product of the given affine and mesh transforms in place, ie the mesh transform has it's displacements overwritten.
Given a mesh transform \form#149 and an affine transform \form#62. The product \form#150 can be evaluated as:
\[ \begin{array}{ll} \mathbf{P} = \mathbf{A}\mathbf{M}, & o = 0 \\ \mathbf{P} = \mathbf{M}\mathbf{A}, & o = 1 \end{array} \]
where \(o\) is the order parameter and\[ \mathbf{T_0}\mathbf{T_1}\mathbf{x} = \mathbf{T_0}(\mathbf{T_1}\mathbf{x}) \]
The product with \(o = 1\) applies the mesh displacement at location \(\mathbf{x}\) and not at \(\mathbf{A}(\mathbf{x})\) as might be expected.mTr | Given mesh transform. |
aTr | Given affine transform. |
order | Order of evaluation. |
References _WlzDomain::b, _WlzValues::core, _WlzDomain::core, _WlzMeshNode::displacement, _WlzObject::domain, _WlzMeshTransform::nNodes, _WlzMeshTransform::nodes, _WlzDomain::poly, _WlzMeshNode::position, _WlzObject::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_BOUNDLIST, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_TYPE, WLZ_SIMPLE_FILL, WLZ_VTX_2_ADD, WLZ_VTX_2_SUB, WlzAffineTransformVertexD2(), WlzBoundToObj(), WlzFreeDomain(), WlzFreeObj(), WlzMakeEmpty(), WlzMakeMain(), and WlzObjToBoundary().
Referenced by WlzMeshTransformFromCPts(), and WlzTransformProduct().
WlzErrorNum WlzMeshTransformVerify | ( | WlzMeshTransform * | mesh, |
int | dispFlg, | ||
int * | badElm, | ||
WlzMeshError * | dstErrMsk | ||
) |
Checks that the given mesh transform is valid.
mesh | Given mesh transform. |
dispFlg | Verify displacements if non-zero. |
badElm | Destination ptr for the index of the first bad mesh element. |
dstErrMsk | Destination pointer to be set with a mesh error after verifying this element, may be NULL. |
References AlcCalloc(), _WlzDomain::b, _WlzObject::domain, _WlzBoundList::down, _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzMeshTransform::nElem, _WlzBoundList::next, _WlzMeshTransform::nNodes, _WlzPolygonDomain::nvertices, _WlzDomain::poly, _WlzBoundList::poly, _WlzPolygonDomain::type, _WlzBoundList::type, _WlzPolygonDomain::vtx, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_POLYGON_TYPE, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_MESH_ERR_NONE, WLZ_POLYGON_DOUBLE, WLZ_POLYGON_FLOAT, WLZ_POLYGON_INT, WlzAssignDomain(), WlzAssignPolygonDomain(), WlzFreeObj(), WlzFreePolyDmn(), WlzMakePolygonDomain(), WlzMeshElemVerify(), WlzPolyDecimate(), WlzPolyTo8Polygon(), and _WlzBoundList::wrap.
Referenced by WlzMeshFromObjBox(), WlzMeshNodeDel(), and WlzMeshTransformAdapt().
double WlzClassValCon4 | ( | double * | g, |
double | p, | ||
double | q | ||
) |
Interpolate pixel value using maximum probability.
g | Array of four values at integer coordinates. |
p | Column offset from integer coordinate. |
q | Line offset from integer coordinate. |
References _WlzValues::core, _WlzGreyP::dbp, _WlzMeshScanWSp::dElm, _WlzMeshScanItv::elmIdx, _WlzGreyP::flp, _WlzGreyValueWSpace::gVal, _WlzGreyP::inp, _WlzMeshScanWSp::itvs, _WlzMeshScanItv::lftI, _WlzIntervalWSpace::lftpos, _WlzMeshScanItv::line, _WlzIntervalWSpace::linpos, _WlzGreyWSpace::pixeltype, _WlzGreyP::rgbp, _WlzMeshScanItv::rgtI, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzPixelV::type, _WlzRagRValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzValues::v, _WlzMeshScanDElm::valid, _WlzObject::values, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, WLZ_CLAMP, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_INTERPOLATION_TYPE, WLZ_ERR_NONE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_INTERPOLATION_CLASSIFY_1, WLZ_INTERPOLATION_LINEAR, WLZ_INTERPOLATION_NEAREST, WLZ_NINT, WLZ_RGBA_ALPHA_GET, WLZ_RGBA_ALPHA_SET, WLZ_RGBA_BLUE_GET, WLZ_RGBA_BLUE_SET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_GREEN_SET, WLZ_RGBA_RED_GET, WLZ_RGBA_RED_SET, WlzAssignValues(), WlzEndGreyScan(), WlzGetBackground(), WlzGreyTableTypeToGreyType(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueGetCon(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzNewValueTb(), WlzNextGreyInterval(), WlzValueConvertPixel(), _WlzMeshScanDElm::xTr, and _WlzMeshScanDElm::yTr.
Referenced by WlzAffineTransformGMShell().
WlzMeshTransform* WlzMeshFromObjBox | ( | WlzObject * | srcObj, |
WlzIBox2 * | dstBox, | ||
int | boxDilation, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a mesh transform for the given object where the mesh has just two elements which enclose the objects bounding box. All mesh displacements are zero.
srcObj | The given object. |
dstBox | Destination bounding box pointer, may be NULL. |
boxDilation | Dilation of box to be sure of enclosing any possible node. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzMeshNode::displacement, _WlzObject::domain, _WlzMeshTransform::elements, _WlzMeshNode::flags, _WlzMeshElem::flags, _WlzDomain::i, _WlzMeshPolyVx::id, _WlzMeshElem::idx, _WlzInterval::ileft, _WlzGreyV::inv, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzIntervalWSpace::linpos, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshPolyVx::next, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzPolygonDomain::nvertices, _WlzDomain::poly, _WlzMeshNode::position, _WlzMeshPolyVx::prev, _WlzIntervalWSpace::rgtpos, _WlzMeshElem::strainA, _WlzMeshElem::strainU, _WlzPixelV::type, _WlzObject::type, _WlzPolygonDomain::type, _WlzMeshElem::type, _WlzPixelV::v, _WlzObject::values, _WlzIVertex2::vtX, _WlzFVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzPolygonDomain::vtx, _WlzIVertex2::vtY, _WlzFVertex2::vtY, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzMeshPolyVx::vx, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_GREY_INT, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_NONE, WLZ_MESH_ELEM_TRILINEAR, WLZ_MESH_NODE_FLAGS_BBOX, WLZ_MESH_NODE_FLAGS_BLOCK, WLZ_MESH_TOLERANCE_SQ, WLZ_NINT, WLZ_POLYGON_INT, WLZ_RASTERDIR_ILIC, WLZ_SAMPLEFN_MIN, WLZ_SIMPLE_FILL, WLZ_THRESH_HIGH, WLZ_THRESH_LOW, WlzAssignObject(), WlzBoundingBox2I(), WlzFreeObj(), WlzGeomTriangleAffineSolve(), WlzGeomTriangleSnArea2(), WlzGreyRange(), WlzInitRasterScan(), WlzLaplacian(), WlzMakeCircleObject(), WlzMeshDomainAdd(), WlzMeshNodeDelIdx(), WlzMeshSqueeze(), WlzMeshTransformNew(), WlzMeshTransformVerify(), WlzNextInterval(), WlzObjToConvexPolygon(), WlzPolyToObj(), WlzSampleObj(), WlzSetBackground(), WlzStructDilation(), WlzThreshold(), WlzValueConvertPixel(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzMeshScanDElm::xTr, _WlzIBox2::yMax, _WlzIBox2::yMin, and _WlzMeshScanDElm::yTr.
WlzDVertex2 WlzMeshTransformVtx | ( | WlzDVertex2 | vtx, |
WlzMeshTransform * | mesh, | ||
WlzErrorNum * | dstErr | ||
) |
Transform the vertex using the given mesh transform.
vtx | Given double vertex. |
mesh | Given mesh transform. |
dstErr | Error return. |
References AlcCalloc(), AlcFree(), AlcMalloc(), AlgSort(), _WlzMeshScanWSp::dElm, _WlzMeshNode::displacement, _WlzMeshTransform::elements, _WlzMeshScanItv::elmIdx, _WlzMeshElem::flags, _WlzMeshScanWSp::itvs, _WlzMeshScanItv::lftI, _WlzMeshScanItv::line, _WlzMeshScanWSp::mesh, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshScanWSp::nItvs, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzMeshScanItv::rgtI, _WlzMeshScanDElm::valid, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_NONE, WLZ_MESH_TOLERANCE_SQ, WLZ_NINT, WlzGeomTriangleAffineSolve(), WlzGeomTriangleSnArea2(), _WlzMeshScanDElm::xTr, and _WlzMeshScanDElm::yTr.
WlzErrorNum WlzMeshDomainAdd | ( | WlzMeshTransform * | mesh, |
WlzObject * | obj, | ||
double | minDist, | ||
WlzDVertex2 | scaleVx | ||
) |
Adds mesh nodes within the domain of the given 2D domain object.
mesh | Given mesh transform. |
obj | Given object with domain. |
minDist | Minimum distance between mesh nodes. |
scaleVx | Object scale factor. |
References _WlzDomain::core, _WlzObject::domain, _WlzMeshTransform::nElem, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WlzMeshIDomAdd(), and WlzMeshPolyDomAdd().
Referenced by WlzMeshFromObjBox().
WlzErrorNum WlzMeshVxVecAdd | ( | WlzMeshTransform * | mesh, |
WlzDVertex2 * | vxVec, | ||
int | nVx, | ||
double | minDistSq, | ||
unsigned int | nodeFlags | ||
) |
Adds mesh nodes at the vertices of the given (2D) vertex vector.
mesh | Given mesh transform. |
vxVec | Given vector of vertices. |
nVx | Number of vertices. |
minDistSq | Square of the minimum distance between mesh nodes. |
nodeFlags | Node flags to set (eg source). |
References AlcFree(), _WlzMeshIntVec::count, _WlzMeshTransform::elements, _WlzMeshNode::flags, _WlzMeshElem::flags, _WlzMeshIntVec::minSize, _WlzMeshIntVec::mulSize, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzMeshIntVec::size, _WlzMeshIntVec::vector, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_MESH_NODE_FLAGS_BBOX, WlzGeomTriangleSnArea2(), WlzMeshElemFindVx(), WlzMeshElemNodeIdxFromVx(), WlzMeshElemReplaceN(), and WlzMeshQueConflictElem().
Referenced by WlzMeshPolyDomAdd().
WlzErrorNum WlzMeshIDomAdd | ( | WlzMeshTransform * | mesh, |
WlzObject * | obj, | ||
double | minDistSq, | ||
WlzDVertex2 | scaleVx | ||
) |
Adds mesh nodes within the interval domain of the given 2D domain object.
mesh | Given mesh transform. |
obj | Given object with domain. |
minDistSq | Square of the minimum distance between mesh nodes. |
scaleVx | Object scale factor. |
References AlcFree(), _WlzMeshIntVec::count, _WlzMeshTransform::elements, _WlzMeshNode::flags, _WlzMeshElem::flags, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linpos, _WlzMeshIntVec::minSize, _WlzMeshIntVec::mulSize, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzIntervalWSpace::rgtpos, _WlzMeshIntVec::size, _WlzMeshIntVec::vector, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_MESH_NODE_FLAGS_BBOX, WLZ_MESH_NODE_FLAGS_IDOM, WLZ_RASTERDIR_ILIC, WlzGeomTriangleSnArea2(), WlzInitRasterScan(), WlzMeshElemFindVx(), WlzMeshElemNodeIdxFromVx(), WlzMeshElemReplaceN(), WlzMeshQueConflictElem(), and WlzNextInterval().
Referenced by WlzMeshDomainAdd().
WlzErrorNum WlzMeshPolyDomAdd | ( | WlzMeshTransform * | mesh, |
WlzObject * | obj, | ||
double | minDist, | ||
WlzDVertex2 | scaleVx | ||
) |
Adds mesh nodes along the polygon domain of the given 2D domain object.
mesh | Given mesh transform. |
obj | Given object with domain. |
minDist | Minimum distance between mesh nodes. |
scaleVx | Object scale factor. |
References AlcFree(), AlcMalloc(), _WlzObject::domain, _WlzPolygonDomain::nvertices, _WlzDomain::poly, _WlzPolygonDomain::type, _WlzDVertex2::vtX, _WlzPolygonDomain::vtx, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_NODE_FLAGS_POLY, WLZ_POLYGON_DOUBLE, WLZ_POLYGON_FLOAT, WLZ_POLYGON_INT, WlzMeshVxVecAdd(), WlzValueCopyDVertexToDVertex(), WlzValueCopyFVertexToDVertex(), and WlzValueCopyIVertexToDVertex().
Referenced by WlzMeshDomainAdd().
WlzErrorNum WlzMeshElemVerify | ( | WlzMeshTransform * | mesh, |
int | dispFlg, | ||
WlzMeshElem * | elm, | ||
WlzMeshError * | dstErrMsk | ||
) |
Checks that the given mesh transform is valid.
mesh | Given mesh transform. |
dispFlg | Verify displacements if non-zero. |
elm | Element to verify. |
dstErrMsk | Destination pointer to be set with a mesh error after verifying this element, may be NULL. |
References _WlzMeshNode::displacement, _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzMeshElem::idx, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_MESH_ERR_DELEM_CW, WLZ_MESH_ERR_ELEM_CW, WLZ_MESH_ERR_ELEM_NODE, WLZ_MESH_ERR_ELEM_ZOMBIE, WLZ_MESH_ERR_NELEM_INDEX, WLZ_MESH_ERR_NELEM_NODE, WLZ_MESH_ERR_NELEM_NOTNBR, WLZ_MESH_ERR_NELEM_ZOMBIE, WLZ_MESH_ERR_NONE, WLZ_MESH_TOLERANCE_SQ, and WlzGeomTriangleSnArea2().
Referenced by WlzMeshTransformVerify().
WlzErrorNum WlzMeshExpand | ( | WlzMeshTransform * | mesh, |
int | nElem, | ||
int | nNodes | ||
) |
Expands a mesh to make sure that there are enough mesh elements and nodes available.
mesh | Given mesh transform. |
nElem | Minimum number of mesh elements required. |
nNodes | Minimum number of mesh nodes required. |
References AlcRealloc(), _WlzMeshTransform::elements, _WlzMeshTransform::maxElem, _WlzMeshTransform::maxNodes, _WlzMeshTransform::nodes, _WlzMeshTransform::type, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WLZ_TRANSFORM_2D_MESH.
Referenced by WlzMeshElemReplace1(), and WlzMeshElemReplaceNWithN().
WlzErrorNum WlzMeshSqueeze | ( | WlzMeshTransform * | mesh | ) |
Squeeze out any zombie nodes and/or elements so that they are available for reuse.
mesh | Given mesh transform. |
References AlcFree(), AlcMalloc(), _WlzMeshTransform::elements, _WlzMeshNode::flags, _WlzMeshElem::flags, _WlzMeshElem::idx, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_ZOMBIE, and WLZ_MESH_NODE_FLAGS_ZOMBIE.
Referenced by WlzMeshFromObjBox(), WlzMeshTransformAdapt(), and WlzMeshTransformCopy().
int WlzMeshElemNodeIdxFromVx | ( | WlzMeshTransform * | mesh, |
WlzMeshElem * | elm, | ||
WlzDVertex2 | gVx | ||
) |
Finds which of the given elements nodes are coincident with the given vertex.
mesh | Mesh transform. |
elm | Mesh element. |
gVx | Given vertex. |
References _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzDVertex2::vtX, and _WlzDVertex2::vtY.
Referenced by WlzMeshIDomAdd(), WlzMeshNodeAdd(), WlzMeshNodeDel(), and WlzMeshVxVecAdd().
int WlzMeshElemNodeIdxFromNodeIdx | ( | int * | nodes, |
int | mNodId | ||
) |
Finds which of the given ear/element nodes has the given mesh node index.
nodes | Mesh ear/element nodes. |
mNodId | Given mesh node index. |
Referenced by WlzMeshEarPowerSet(), and WlzMeshNodeDelVecBuild().
int WlzMeshElemNbrIdxFromNodes | ( | WlzMeshElem * | elm, |
int | nodId0, | ||
int | nodId1 | ||
) |
Finds which neighbour of the given element would share the nodes has the given pair of nodes.
elm | Mesh element. |
nodId0 | First node. |
nodId1 | Second node. |
References _WlzMeshElem::nodes.
Referenced by WlzMeshEarMatchElm().
int WlzMeshElemFindVx | ( | WlzMeshTransform * | mesh, |
WlzDVertex2 | gvnVx, | ||
int | startElm, | ||
int * | lastElm, | ||
int * | existsFlg, | ||
WlzErrorNum * | dstErr | ||
) |
Searches the mesh for the element which contains the given vertex. It is NOT an error if the vertex is not within the mesh.
mesh | Given mesh transform. |
gvnVx | Given vertex. |
startElm | If >= 0, the index of the element from which to start the search. |
lastElm | Destination ptr for index of the last element visited. May be NULL. |
existsFlg | Destination ptr for vertex already exists flag. May be NULL. |
dstErr | Destination pointer for error number, may be NULL. |
References _WlzMeshTransform::nElem, _WlzMeshTransform::type, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_TRANSFORM_2D_MESH, and WlzMeshElemFindVxWalk().
Referenced by WlzCMeshIntersect2Mesh2D(), WlzCMeshMeshMeshProduct(), WlzMeshIDomAdd(), WlzMeshNodeAdd(), WlzMeshNodeDel(), and WlzMeshVxVecAdd().
WlzErrorNum WlzMeshElemSplit | ( | WlzMeshTransform * | mesh, |
int | sElmId | ||
) |
Splits the given mesh element by placing a new node at it's circumcentre.
mesh | Given mesh transform. |
sElmId | Index of element to split. |
References AlcFree(), _WlzMeshIntVec::count, _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzMeshIntVec::minSize, _WlzMeshIntVec::mulSize, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshIntVec::size, _WlzMeshTransform::type, _WlzMeshIntVec::vector, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_NODE_FLAGS_NONE, WLZ_MESH_TOLERANCE_SQ, WLZ_TRANSFORM_2D_MESH, WlzGeomTriangleCircumcentre(), WlzGeomTriangleSnArea2(), WlzMeshElemReplaceN(), and WlzMeshQueConflictElem().
WlzErrorNum WlzMeshNodeAdd | ( | WlzMeshTransform * | mesh, |
int | startElm, | ||
WlzDVertex2 | newVx, | ||
unsigned int | nodeFlags | ||
) |
Adds a node to the given mesh, the new node must lie inside the existing mesh.
mesh | Given mesh transform. |
startElm | If >= 0, the index of the element from which to start the search. |
newVx | New node vertex. |
nodeFlags | Node flags to set (eg source). |
References AlcFree(), _WlzMeshIntVec::count, _WlzMeshTransform::elements, _WlzMeshNode::flags, _WlzMeshIntVec::minSize, _WlzMeshIntVec::mulSize, _WlzMeshTransform::nElem, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshIntVec::size, _WlzMeshTransform::type, _WlzMeshIntVec::vector, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_MESH_NODE_FLAGS_NONE, WLZ_TRANSFORM_2D_MESH, WlzMeshElemFindVx(), WlzMeshElemNodeIdxFromVx(), WlzMeshElemReplaceN(), and WlzMeshQueConflictElem().
WlzErrorNum WlzMeshNodeDelIdx | ( | WlzMeshTransform * | mesh, |
int | startElm, | ||
int * | nodIdP, | ||
int | nNod | ||
) |
Deletes nodes, specified by their index, from the given mesh.
mesh | Given mesh transform. |
startElm | If >= 0, the index of the element from which to start the search an element using the node. |
nodIdP | Vector of node indicies. |
nNod | Number of indicies in vector. |
References _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshTransform::nodes, _WlzMeshTransform::type, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_TRANSFORM_2D_MESH, WlzMeshNodeDel(), WlzMeshNodeDelFree(), and WlzMeshNodeDelInit().
Referenced by WlzMeshFromObjBox(), and WlzMeshTransformAdapt().
static void WlzMeshNodeDelInit | ( | WlzMeshIntVec * | elmVec, |
WlzMeshIntVec * | nodVec, | ||
WlzMeshEarList * | earList | ||
) |
Initialize the element vector, node vector and ear list ready for node deletion.
elmVec | Element vector. |
nodVec | Node vector. |
earList | Ear list. |
References _WlzMeshIntVec::count, _WlzMeshEarList::maxEars, _WlzMeshIntVec::minSize, _WlzMeshIntVec::mulSize, _WlzMeshEarList::pool, _WlzMeshIntVec::size, and _WlzMeshIntVec::vector.
Referenced by WlzMeshNodeDelIdx().
static void WlzMeshNodeDelFree | ( | WlzMeshIntVec * | elmVec, |
WlzMeshIntVec * | nodVec, | ||
WlzMeshEarList * | earList | ||
) |
Free storage allocated for the element vector, node vector and ear list after node deletion.
elmVec | Element vector. |
nodVec | Node vector. |
earList | Ear list. |
References AlcFree(), _WlzMeshEarList::maxEars, _WlzMeshEarList::pool, _WlzMeshIntVec::size, and _WlzMeshIntVec::vector.
Referenced by WlzMeshNodeDelIdx().
static WlzErrorNum WlzMeshNodeDel | ( | WlzMeshTransform * | mesh, |
WlzMeshIntVec * | elmVec, | ||
WlzMeshIntVec * | nodVec, | ||
WlzMeshEarList * | earList, | ||
int | startElm, | ||
WlzDVertex2 | nodVx | ||
) |
Deletes a node, specified by it's position, from the given mesh.
mesh | Given mesh transform. |
elmVec | Element vector. |
nodVec | Node vector. |
earList | Ear list. |
startElm | Index of the element from which to start the search for an element using the node. |
nodVx | Node position. |
References _WlzMeshIntVec::count, _WlzMeshTransform::elements, _WlzMeshEar::flags, _WlzMeshNode::flags, _WlzMeshElem::flags, _WlzMeshElem::idx, _WlzMeshEarList::inEars, _WlzMeshEar::neighbours, _WlzMeshElem::neighbours, _WlzMeshEar::next, _WlzMeshEar::nodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshEar::prev, _WlzMeshEar::selfNeighbour, _WlzMeshIntVec::vector, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_MESH_ELEM_AREA_TOLERANCE, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_MESH_NODE_FLAGS_ZOMBIE, WlzMeshEarPowerSet(), WlzMeshEarsCreate(), WlzMeshElemFindVx(), WlzMeshElemNodeIdxFromVx(), WlzMeshNodeDelVecBuild(), and WlzMeshTransformVerify().
Referenced by WlzMeshNodeDelIdx().
static WlzErrorNum WlzMeshElemFindVxWalk | ( | WlzMeshTransform * | mesh, |
WlzDVertex2 | gVx, | ||
int * | elmId, | ||
int * | foundFlg, | ||
int * | existsFlg | ||
) |
Searches the mesh for the element which contains the given vertex. Walks from the given element in the direction of the given vertex until the element which encloses the given vertex is found. If the walk oscillates back and forth between two elements then either may be returned as the enclosing element.
mesh | Given mesh transform. |
gVx | Given vertex. |
elmId | Source and destination element index pointer. |
foundFlg | Destination pointer for element found flag. |
existsFlg | Destination pointer for node exists flag. |
References ALG_SQR, _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_MESH_TOLERANCE_SQ, WlzGeomTriangleSnArea2(), and WlzGeomVxInTriangle2D().
Referenced by WlzMeshElemFindVx().
static WlzErrorNum WlzMeshQueConflictElem | ( | WlzMeshIntVec * | eCnfQVec, |
WlzMeshTransform * | mesh, | ||
int | srcElmId, | ||
int | elmId, | ||
WlzDVertex2 | newVx | ||
) |
Recursively builds a que of elements in conflict with the given new node vertex, all elements in conflict being marked using a flag. An element is in conflict with a new node vertex if the new node lies within the circumcircle of the element.
eCnfQVec | The mesh element que to build. |
mesh | Given mesh transform. |
srcElmId | Index of element which contains the vertex. |
elmId | Index of element to test and possibly add to the queue. |
newVx | New node vertex. |
References _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzMeshElem::neighbours, _WlzMeshTransform::nodes, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_ZOMBIE, and WlzGeomInTriangleCircumcircle().
Referenced by WlzMeshElemSplit(), WlzMeshIDomAdd(), WlzMeshNodeAdd(), and WlzMeshVxVecAdd().
static WlzErrorNum WlzMeshElemReplaceN | ( | WlzMeshTransform * | mesh, |
int * | eCnfQ, | ||
int | qCnt, | ||
WlzDVertex2 | newVx, | ||
unsigned int | nodeFlags | ||
) |
Replaces those mesh elements that are queued and flaged as zombies with new mesh elements which include the given new node vertex.
mesh | Given mesh transform. |
eCnfQ | The mesh element que to build. |
qCnt | Number of elements in queue. |
newVx | New node vertex. |
nodeFlags | Node flags to set (eg source). |
References WLZ_ERR_NONE, WlzMeshElemReplace1(), and WlzMeshElemReplaceNWithN().
Referenced by WlzMeshElemSplit(), WlzMeshIDomAdd(), WlzMeshNodeAdd(), and WlzMeshVxVecAdd().
static WlzErrorNum WlzMeshElemReplace1 | ( | WlzMeshTransform * | mesh, |
int | eId, | ||
WlzDVertex2 | newVx, | ||
unsigned int | nodeFlags | ||
) |
Replaces a single mesh element with 1 element (no action), 2 elements (1 new and 1 recycled) or 3 elements (2 new and 1 recycled) using the new node to split the element.
mesh | Given mesh transform. |
eId | Index of the element containing the new node vertex. |
newVx | New node vertex. |
nodeFlags | Node flags to set (eg source). |
References _WlzMeshTransform::elements, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, WLZ_ERR_NONE, WLZ_MESH_TOLERANCE_SQ, WlzGeomTriangleSnArea2(), WlzMeshElemReplace1With2(), WlzMeshElemReplace1With3(), and WlzMeshExpand().
Referenced by WlzMeshElemReplaceN().
static void WlzMeshElemReplace1With1 | ( | WlzMeshTransform * | mesh, |
int | eId0, | ||
int | eId1 | ||
) |
Replaces a single mesh element with another mesh element.
mesh | Given mesh transform. |
eId0 | Index of the element to be replaced in the mesh. |
eId1 | Index of the element to replace element with index eId0. |
References _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzMeshElem::idx, _WlzMeshElem::neighbours, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, and WLZ_MESH_ELEM_FLAGS_NBR_2.
Referenced by WlzMeshElemReplaceNWithN().
static void WlzMeshElemReplace1With2 | ( | WlzMeshTransform * | mesh, |
int | eId, | ||
int | nod0, | ||
WlzDVertex2 | newVx, | ||
unsigned int | nodeFlags | ||
) |
Replaces a single mesh element with 2 mesh elements, (1 new and 1 recycled) which include the given new node vertex.
mesh | Given mesh transform. |
eId | Index of the element containing the new node vertex. |
nod0 | Which of the existing elements nodes is shared between the two new elements. |
newVx | New node vertex. |
nodeFlags | Node flags to set (eg source). |
References _WlzMeshNode::displacement, _WlzMeshTransform::elements, _WlzMeshNode::flags, _WlzMeshElem::flags, _WlzMeshElem::idx, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzMeshElem::strainA, _WlzMeshElem::strainU, _WlzMeshElem::type, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, and WLZ_MESH_ELEM_TRILINEAR.
Referenced by WlzMeshElemReplace1().
static void WlzMeshElemReplace1With3 | ( | WlzMeshTransform * | mesh, |
int | eId, | ||
WlzDVertex2 | newVx, | ||
unsigned int | nodeFlags | ||
) |
Replaces a single mesh element with 3 mesh elements, (2 new and 1 recycled) which include the given new node vertex.
mesh | Given mesh transform. |
eId | Index of the element containing the new node vertex. |
newVx | New node vertex. |
nodeFlags | Node flags to set (eg source). |
References _WlzMeshNode::displacement, _WlzMeshTransform::elements, _WlzMeshNode::flags, _WlzMeshElem::flags, _WlzMeshElem::idx, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzMeshElem::strainA, _WlzMeshElem::strainU, _WlzMeshElem::type, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, and WLZ_MESH_ELEM_TRILINEAR.
Referenced by WlzMeshElemReplace1().
static WlzErrorNum WlzMeshElemReplaceNWithN | ( | WlzMeshTransform * | mesh, |
int * | zElmIdVec, | ||
int | zElmCnt, | ||
WlzDVertex2 | newVx, | ||
unsigned int | nodeFlags | ||
) |
Replaces all queued mesh elements (which always have a convex hull) with elements that use the new node vertex. This function is only ever called with more than one mesh element enqueued. Computing the number of nodes in the enqueued elements is easy because the region is always convex with all it's nodes on it's boundary. Every triangulation of a polygon with N nodes has N - 2 elements.
mesh | Given mesh transform. |
zElmIdVec | The vector (queue) of zombie mesh elements to replace. |
zElmCnt | Number of zombie elements. |
newVx | New node vertex. |
nodeFlags | Node flags to set (eg source). |
References _WlzMeshNode::displacement, _WlzMeshTransform::elements, _WlzMeshNode::flags, _WlzMeshElem::flags, _WlzMeshTransform::maxElem, _WlzMeshTransform::maxNodes, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_MESH_ELEM_TRILINEAR, WLZ_MESH_TOLERANCE_SQ, WlzGeomTriangleSnArea2(), WlzMeshElemReplace1With1(), and WlzMeshExpand().
Referenced by WlzMeshElemReplaceN().
static WlzErrorNum WlzMeshNodeDelVecBuild | ( | WlzMeshIntVec * | elmVec, |
WlzMeshIntVec * | nodVec, | ||
WlzMeshTransform * | mesh, | ||
int | dElmId, | ||
int | dElmNodId | ||
) |
Builds a vector of the id's of all the mesh elements which include given the node (to be deleted), and a vector to the id's of all the mesh nodes which lie around the perimeter of the polygon formed by the vector of elements. The element and node vectors are in ccw order around the given node. The vector of nodes does not include the given node. All the elements in the vector are marked as zombies ready for recycling.
elmVec | Mesh element vector to build. |
nodVec | Mesh node vector to build. |
mesh | Given mesh transform. |
dElmId | Index of an element known to use the given node. |
dElmNodId | Index of node to be deleted within the given element. |
References AlcRealloc(), _WlzMeshIntVec::count, _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzMeshElem::idx, _WlzMeshIntVec::minSize, _WlzMeshIntVec::mulSize, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, _WlzMeshIntVec::size, _WlzMeshIntVec::vector, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_ZOMBIE, and WlzMeshElemNodeIdxFromNodeIdx().
Referenced by WlzMeshNodeDel().
static WlzErrorNum WlzMeshEarListRealloc | ( | WlzMeshEarList * | earList, |
int | maxEars | ||
) |
Realloc's a mesh ear list pool.
earList | Given ear list for recycling. |
maxEars | Maximum number of ears that can be used in the stack. |
References AlcFree(), AlcMalloc(), _WlzMeshEarList::inEars, _WlzMeshEarList::maxEars, _WlzMeshEarList::pool, _WlzMeshEarList::topIn, WLZ_ERR_MEM_ALLOC, and WLZ_ERR_NONE.
Referenced by WlzMeshEarsCreate().
static void WlzMeshEarPowerSet | ( | WlzMeshTransform * | mesh, |
WlzMeshEar * | ear, | ||
int | delNodId | ||
) |
Computes a power for the given ear, where the power is given by:
\[ \frac { \left| \begin{array}{cccc} x_o & x_1 & x_2 & x_3 \\ y_0 & y_1 & y_2 & y_3 \\ x_0^2 + y_0^2 & x_1^2 + y_1^2 & x_2^2 + y_2^2 & x_p^2 + y_p^2 \\ 1 & 1 & 1 & 1 \end{array} \right| } { \left| \begin{array}{ccc} x_0 & x_1 & x_2 \\ y_0 & y_1 & y_2 \\ 1 & 1 & 1 \end{array} \right| } \]
Where the given (CCW order) nodes are (x0,y0), (x1,y1) and (x2,y2). The node to be deleted is (xp, yp). In practice this function first checks that the nodes are not co-linear, then that the nodes are CCW and if all ok so far then computes the power.
mesh | Given mesh transform. |
ear | Given mesh ear. |
delNodId | Id of node to be deleted. |
References _WlzMeshIntVec::count, _WlzMeshEar::flags, _WlzMeshEarList::inEars, _WlzMeshEar::neighbours, _WlzMeshEar::next, _WlzMeshEar::nodes, _WlzMeshTransform::nodes, _WlzMeshEar::power, _WlzMeshEar::selfNeighbour, _WlzMeshEar::snArea2, _WlzMeshEarList::topIn, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_MESH_ELEM_AREA_TOLERANCE, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, and WlzMeshElemNodeIdxFromNodeIdx().
Referenced by WlzMeshEarsCreate(), and WlzMeshNodeDel().
static WlzErrorNum WlzMeshEarsCreate | ( | WlzMeshEarList * | earList, |
WlzMeshIntVec * | elmVec, | ||
WlzMeshIntVec * | nodVec, | ||
WlzMeshTransform * | mesh, | ||
int | delNodId | ||
) |
Creates a list of mesh ears from a vector of nodes and the node to be deleted. The list is in the order of given nodes, ie CCW around the node to be deleted.
earList | Given ear list for recycling. |
elmVec | Vector of mesh elements which runs CCW around the node to be deleted. |
nodVec | Vector of mesh nodes which runs CCW around the enclosing polygon of the node to be deleted. |
mesh | Given mesh transform. |
delNodId | Index of an node to be deleted. |
References _WlzMeshIntVec::count, _WlzMeshEar::flags, _WlzMeshEarList::inEars, _WlzMeshEar::next, _WlzMeshEar::nodes, _WlzMeshEarList::pool, _WlzMeshEar::prev, _WlzMeshIntVec::size, _WlzMeshEarList::topIn, _WlzMeshIntVec::vector, WLZ_ERR_NONE, WLZ_MESH_ELEM_FLAGS_NONE, WlzMeshEarListRealloc(), WlzMeshEarMatchElm(), and WlzMeshEarPowerSet().
Referenced by WlzMeshNodeDel().
static void WlzMeshEarMatchElm | ( | WlzMeshTransform * | mesh, |
WlzMeshEar * | ear, | ||
WlzMeshIntVec * | elmVec, | ||
int * | elmVecIdP | ||
) |
Finds the indicies into the given element vector for the elements which connect to the given ear and sets the ear's neighbours and flags.
mesh | Given mesh transform. |
ear | Ear (with nodes already set). |
elmVec | Element vector. |
elmVecIdP | Used to remember element vector index between calls. |
References _WlzMeshIntVec::count, _WlzMeshTransform::elements, _WlzMeshEar::flags, _WlzMeshElem::flags, _WlzMeshEar::neighbours, _WlzMeshElem::neighbours, _WlzMeshEar::nodes, _WlzMeshEar::selfNeighbour, _WlzMeshIntVec::vector, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, and WlzMeshElemNbrIdxFromNodes().
Referenced by WlzMeshEarsCreate().
WlzErrorNum WlzMeshGetNodesAndEdges | ( | WlzMeshTransform * | mesh, |
int * | dstNNod, | ||
WlzDVertex2 ** | dstNod, | ||
int * | dstNDsp, | ||
WlzDVertex2 ** | dstDsp, | ||
int * | dstNEdg, | ||
int ** | dstEdg | ||
) |
Gets the nodes, node displacements and edges of the mesh. The nodes and node displacements are returned as simple arrays of vertices. The edges are returned as a degenerate list of triples, with each triple being the indices of the nodes of an element.
mesh | Given mesh transform. |
dstNNod | Destination pointer for the number of mesh nodes. |
dstNod | Destination pointer for the mesh nodes. |
dstNDsp | Destination pointer for the number of mesh node displacements. |
dstDsp | Destination pointer for the mesh node displacement. |
dstNEdg | Destination pointer for the number of edge indices. |
dstEdg | Destination pointer for the edge indices. |
References AlcFree(), AlcMalloc(), _WlzMeshNode::displacement, _WlzMeshTransform::elements, _WlzMeshNode::flags, _WlzMeshElem::flags, _WlzMeshTransform::nElem, _WlzMeshTransform::nNodes, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WLZ_MESH_ELEM_FLAGS_ZOMBIE, and WLZ_MESH_NODE_FLAGS_ZOMBIE.
double WlzMeshMaxEdgeLenSq | ( | WlzMeshTransform * | mesh, |
WlzErrorNum * | dstErr | ||
) |
Computes the maximum squared edge length of the mesh elements.
mesh | Given mesh. |
dstErr | Destination error pointer, may be NULL. |
References _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzMeshTransform::maxElem, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzMeshNode::position, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_VTX_2_SQRLEN, and WLZ_VTX_2_SUB.
Referenced by WlzCMeshMeshMeshProduct().
int WlzMeshClosestNod2D | ( | WlzMeshTransform * | mesh, |
WlzDVertex2 | pos | ||
) |
Finds the closest node in the mesh to the given vertex position.
mesh | Given mesh. |
pos | The vertex position. |
References ALG_SQR, _WlzMeshTransform::elements, _WlzMeshElem::flags, _WlzMeshElem::idx, _WlzMeshTransform::maxElem, _WlzMeshElem::neighbours, _WlzMeshTransform::nElem, _WlzMeshElem::nodes, _WlzMeshTransform::nodes, _WlzDVertex2::vtX, _WlzDVertex2::vtY, WLZ_MESH_ELEM_FLAGS_NBR_0, WLZ_MESH_ELEM_FLAGS_NBR_1, WLZ_MESH_ELEM_FLAGS_NBR_2, WLZ_MESH_ELEM_FLAGS_ZOMBIE, WLZ_MESH_TOLERANCE_SQ, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, and WlzGeomTriangleSnArea2().
WlzObject* WlzProj3DToSection | ( | WlzObject * | gvnObj, |
int | nMask, | ||
WlzObject ** | maskObj, | ||
WlzThreeDViewStruct * | prjView, | ||
int | nPlnTr, | ||
WlzObject ** | plnTrObj, | ||
WlzThreeDViewStruct * | secView, | ||
WlzErrorNum * | dstErr | ||
) |
Projects the given 3D doimain onto a section using a given projection, set of mask domains and set of within section transforms and a section view.
gvnObj | Given 3D domain to be projected onto a section the section |
nMask | Number of mask domain objects. |
maskObj | Mask domain objects and mask objects that are NULL are assumed to represent the universal domain. |
prjView | Projection view. |
nPlnTr | Number of in section transforms, must be equal to the number of mask domains. |
plnTrObj | Within-plane transforms any within-plane transforms that are NULL are assumed to represent an identity transform. |
secView | The section view transform. |
dstErr | Destination error pointer, may be NULL. |
References Wlz3DViewTransformObj(), WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_INTERPOLATION_NEAREST, WLZ_MESH_TRANS, WLZ_PROJECT_INT_MODE_NONE, WlzAssignObject(), WlzFree3DViewStruct(), WlzFreeObj(), WlzInit3DViewStruct(), WlzIntersect2(), WlzIsEmpty(), WlzMake3DViewStructCopy(), WlzMeshTransformObj(), WlzProjectObjToPlane(), and WlzUnion2().
WlzAffineTransform* WlzRegICPObjsGrd | ( | WlzObject * | tObj, |
WlzObject * | sObj, | ||
WlzAffineTransform * | initTr, | ||
WlzTransformType | trType, | ||
double | ctrLo, | ||
double | ctrHi, | ||
double | ctrWth, | ||
int * | dstConv, | ||
int * | dstItr, | ||
int | maxItr, | ||
double | delta, | ||
double | minDistWgt, | ||
WlzErrorNum * | dstErr | ||
) |
Registers the two given objects using the iterative closest point algorithm. Maximal gradient contours and gradients are extracted from the two given domain objects with values. An affine transform is computed, which when applied to the source object takes it into register with the target object.
tObj | The target object. |
sObj | The source object to be registered with target object. |
initTr | Initial affine transform to be applied to the source object prior to using the ICP algorithm. May be NULL. |
trType | Required transform type. |
ctrLo | Low threshold contour gradient value. |
ctrHi | High threshold contour gradient value. |
ctrWth | Contour filter width. |
dstConv | Destination ptr for the convergence flag (non zero on convergence), may be NULL. |
dstItr | Destination ptr for the number of iterations, may be NULL. |
maxItr | Maximum number of iterations, if <= 0 then infinite iterations are allowed. |
delta | Tolerance for mean value of registration metric. |
minDistWgt | Minimum distance weighting. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzDomain::ctr, _WlzVertexP::d2, _WlzVertexP::d3, _WlzRegICPWSp::itr, _WlzObject::type, _WlzRegICPWSp::vType, WLZ_CONTOUR, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_VERTEX_D2, WLZ_VERTEX_D3, WlzContourObjGrd(), WlzFreeObj(), WlzMakeMain(), WlzRegICPVertices(), WlzVerticesFromObj(), and WlzWriteObj().
WlzAffineTransform* WlzRegICPObjs | ( | WlzObject * | tObj, |
WlzObject * | sObj, | ||
WlzAffineTransform * | initTr, | ||
WlzTransformType | trType, | ||
int * | dstConv, | ||
int * | dstItr, | ||
int | maxItr, | ||
double | delta, | ||
double | minDistWgt, | ||
WlzErrorNum * | dstErr | ||
) |
Registers the two given objects using the iterative closest point algorithm. An affine transform is computed, which when applied to the source object takes it into register with the target object.
tObj | The target object. |
sObj | The source object to be registered with target object. |
initTr | Initial affine transform to be applied to the source object prior to using the ICP algorithm. May be NULL. |
trType | Required transform type. |
dstConv | Destination ptr for the convergence flag (non zero on convergence), may be NULL. |
dstItr | Destination ptr for the number of iterations, may be NULL. |
maxItr | Maximum number of iterations, if <= 0 then infinite iterations are allowed. |
delta | Tolerance for mean value of registration metric. |
minDistWgt | Minimum distance weighting. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), _WlzDomain::ctr, _WlzObject::domain, _WlzRegICPWSp::itr, _WlzContour::model, _WlzRegICPWSp::sgnNrm, _WlzGMModel::type, _WlzObject::type, _WlzVertexP::v, _WlzRegICPWSp::vType, WLZ_CONTOUR, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_TYPE, WLZ_GMMOD_2N, WLZ_GMMOD_3N, WlzRegICPVertices(), and WlzVerticesFromObj().
WlzObject* WlzRegICPObjWSD2D | ( | WlzObject * | tObj, |
WlzObject * | sObj, | ||
WlzAffineTransform * | initTr, | ||
double | xMin, | ||
double | xMax, | ||
double | xStep, | ||
double | yMin, | ||
double | yMax, | ||
double | yStep, | ||
double | rMin, | ||
double | rMax, | ||
double | rStep, | ||
double | minDistWgt, | ||
WlzErrorNum * | dstErr | ||
) |
Computes a 3D domain object in which the double precission values are the weighted sums of distances as used by WlzRegICPObjs(). Thehese values are computed for the given range of translations and rotations.
tObj | 2D target object. |
sObj | 2D source object to be registered with target object. |
initTr | Initial affine transform to be applied to the source object prior to using the ICP algorithm. May be NULL. |
xMin | Minimum column translation. |
xMax | Maximum column translation. |
xStep | Increment for column translation. |
yMin | Minimum line translation. |
yMax | Maximum line translation. |
yStep | Increment for line translation. |
rMin | Minimum rotation (radians). |
rMax | Maximum rotation (radians). |
rStep | Increment for rotation (radians). |
minDistWgt | Minimum distance weighting. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcMalloc(), _WlzDomain::ctr, _WlzVertexP::d2, _WlzVertexP::d3, _WlzObject::domain, _WlzVertexP::f2, _WlzVertexP::f3, _WlzVertexP::i2, _WlzVertexP::i3, _WlzContour::model, _WlzRegICPWSp::sgnNrm, _WlzGMModel::type, _WlzObject::type, _WlzVertexP::v, _WlzRegICPWSp::vType, WLZ_CONTOUR, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_TYPE, WLZ_GMMOD_2N, WLZ_GMMOD_3N, WLZ_VERTEX_D2, WLZ_VERTEX_D3, WLZ_VERTEX_F2, WLZ_VERTEX_F3, WLZ_VERTEX_I2, WLZ_VERTEX_I3, WlzRegICPVerticesWSD2D(), WlzValueCopyFVertexToDVertex(), WlzValueCopyFVertexToDVertex3(), WlzValueCopyIVertexToDVertex(), WlzValueCopyIVertexToDVertex3(), and WlzVerticesFromObj().
WlzAffineTransform* WlzRegICPVertices | ( | WlzVertexP | tVx, |
WlzVertexP | tNr, | ||
int | tCnt, | ||
WlzVertexP | sVx, | ||
WlzVertexP | sNr, | ||
int | sCnt, | ||
WlzVertexType | vType, | ||
int | sgnNrm, | ||
WlzAffineTransform * | initTr, | ||
WlzTransformType | trType, | ||
int * | dstConv, | ||
int * | dstItr, | ||
int | maxItr, | ||
double | delta, | ||
double | minDistWgt, | ||
WlzErrorNum * | dstErr | ||
) |
Registers the two given sets of vertices using the iterative closest point algorithm. An affine transform is computed, which when applied to the source vertices takes it into register with the target vertices. The vertices and their normals are known to be either WlzDVertex2 or WlzDVertex3.
tVx | Target vertices. |
tNr | Target normals, may be NULL. |
tCnt | Number of target vertices. |
sVx | Source vertices. |
sNr | Source normals, may be NULL. |
sCnt | Number of source vertices. |
vType | Type of the vertices. |
sgnNrm | Non zero if the normals have reliably signed components. |
initTr | Initial affine transform to be applied to the source object prior to using the ICP algorithm. May be NULL. |
trType | Required transform type. |
dstConv | Destination ptr for the convergence flag (non zero on convergence), may be NULL. |
dstItr | Destination ptr for the number of iterations, may be NULL. |
maxItr | Maximum number of iterations, if <= 0 then infinite iterations are allowed. |
delta | Tolerance for mean value of registration metric. |
minDistWgt | Minimum distance weighting. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcMalloc(), _WlzRegICPWSp::curMetric, _WlzRegICPWSp::curTr, _WlzVertexP::d2, _WlzVertexP::d3, _WlzRegICPWSp::delta, _WlzRegICPWSp::dist, _WlzRegICPWSp::gSNr, _WlzRegICPWSp::gSVx, _WlzRegICPWSp::gTNr, _WlzRegICPWSp::gTVx, _WlzRegICPWSp::itr, _WlzRegICPWSp::maxDist, _WlzRegICPWSp::nMatch, _WlzRegICPWSp::nNTVx, _WlzRegICPWSp::nS, _WlzRegICPWSp::nT, _WlzRegICPWSp::prvMetric, _WlzRegICPWSp::prvTr, _WlzRegICPWSp::sgnNrm, _WlzRegICPWSp::sNN, _WlzRegICPWSp::tSNr, _WlzRegICPWSp::tSVx, _WlzRegICPWSp::tTree, _WlzVertexP::v, _WlzRegICPWSp::vType, _WlzRegICPWSp::wgt, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_MAX, WLZ_MIN, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_REG, WLZ_TRANSFORM_3D_AFFINE, WLZ_TRANSFORM_3D_REG, WLZ_VERTEX_D2, WlzAffineTransformCopy(), WlzFreeAffineTransform(), and WlzMakeAffineTransform().
Referenced by WlzRegICPObjs(), and WlzRegICPObjsGrd().
WlzObject* WlzRegICPVerticesWSD2D | ( | WlzVertexP | tVx, |
WlzVertexP | tNr, | ||
int | tCnt, | ||
WlzVertexP | sVx, | ||
WlzVertexP | sNr, | ||
int | sCnt, | ||
WlzVertexType | vType, | ||
int | sgnNrm, | ||
WlzAffineTransform * | initTr, | ||
double | xMin, | ||
double | xMax, | ||
double | xStep, | ||
double | yMin, | ||
double | yMax, | ||
double | yStep, | ||
double | rMin, | ||
double | rMax, | ||
double | rStep, | ||
double | minDistWgt, | ||
WlzErrorNum * | dstErr | ||
) |
Computes a 3D domain object in which the double precission values are the weighted sums of distances as used by WlzRegICPObjs(). Thehese values are computed for the given range of translations and rotations.
tVx | Target vertices. |
tNr | Target normals, may be NULL. |
tCnt | Number of target vertices. |
sVx | Source vertices. |
sNr | Source normals, may be NULL. |
sCnt | Number of source vertices. |
vType | Type of the vertices. |
sgnNrm | Non zero if the normals have reliably signed components. |
initTr | Initial affine transform to be applied to the source object prior to using the ICP algorithm. May be NULL. |
xMin | Minimum column translation. |
xMax | Maximum column translation. |
xStep | Increment for column translation. |
yMin | Minimum line translation. |
yMax | Maximum line translation. |
yStep | Increment for line translation. |
rMin | Minimum rotation (radians). |
rMax | Maximum rotation (radians). |
rStep | Increment for rotation (radians). |
minDistWgt | Minimum distance weighting. |
dstErr | Destination error pointer, may be NULL. |
References Alc3Free(), ALC_ER_NONE, AlcDouble2WriteAsci(), AlcDouble3Calloc(), AlcFree(), AlcKDTGetNN(), AlcMalloc(), _WlzRegICPWSp::curMetric, _WlzRegICPWSp::curTr, _WlzVertexP::d2, _WlzVertex::d2, _WlzVertexP::d3, _WlzVertex::d3, _WlzRegICPWSp::delta, _WlzRegICPWSp::dist, _WlzRegICPWSp::gSNr, _WlzRegICPWSp::gSVx, _WlzRegICPWSp::gTNr, _WlzRegICPWSp::gTVx, _AlcKDTNode::idx, _WlzRegICPWSp::itr, _WlzAffineTransform::mat, _WlzRegICPWSp::maxDist, _WlzRegICPWSp::nMatch, _WlzRegICPWSp::nNTVx, _WlzRegICPWSp::nS, _WlzRegICPWSp::nT, _WlzRegICPWSp::prvMetric, _WlzRegICPWSp::prvTr, _WlzRegICPWSp::sgnNrm, _WlzRegICPWSp::sNN, _WlzRegICPWSp::tSNr, _WlzRegICPWSp::tSVx, _WlzRegICPWSp::tTree, _WlzVertexP::v, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzRegICPWSp::vType, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, _WlzRegICPWSp::wgt, WLZ_ERR_ALG_CONVERGENCE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_GREY_DOUBLE, WLZ_MAX, WLZ_MIN, WLZ_NINT, WLZ_TRANSFORM_2D_AFFINE, WLZ_VERTEX_D2, WLZ_VTX_2_DOT, WLZ_VTX_3_DOT, WlzAffineTransformFromPrimVal(), WlzAffineTransformLSq(), WlzAffineTransformNormalD2(), WlzAffineTransformNormalD3(), WlzAffineTransformProduct(), WlzAffineTransformVertexD2(), WlzAffineTransformVertexD3(), WlzAssignAffineTransform(), WlzFreeAffineTransform(), WlzFreeObj(), WlzFromArray3D(), and WlzVerticesBuildTree().
Referenced by WlzRegICPObjWSD2D().
WlzAffineTransform* WlzRegICPTreeAndVertices | ( | AlcKDTTree * | tree, |
WlzTransformType | trType, | ||
WlzVertexType | vType, | ||
int | sgnNrm, | ||
int | nT, | ||
WlzVertexP | tVx, | ||
WlzVertexP | tNr, | ||
int | nS, | ||
int * | sIdx, | ||
WlzVertexP | sVx, | ||
WlzVertexP | sNr, | ||
WlzVertexP | tVxBuf, | ||
WlzVertexP | sVxBuf, | ||
double * | wgtBuf, | ||
int | maxItr, | ||
WlzAffineTransform * | initTr, | ||
int * | dstConv, | ||
WlzRegICPUsrWgtFn | usrWgtFn, | ||
void * | usrWgtData, | ||
double | delta, | ||
double | minDistWgt, | ||
WlzErrorNum * | dstErr | ||
) |
Registers the given vertices using the already built kD-tree and the given buffers. This function will attempt to find a rigid body registration before attempting a general affine registration.
tree | Given kD-tree populated by the target vertices such that the nodes of the tree have the same indicies as the given target vertices and normals. |
trType | The required type of transform, must be either WLZ_TRANSFORM_2D_REG, or WLZ_TRANSFORM_2D_AFFINE. |
vType | Vertex type. |
sgnNrm | Non zero if sign of normal components is meaningful. |
nT | Number of target vertices. |
tVx | The target vertices. |
tNr | The target normals. |
nS | Number of source vertices. |
sIdx | Indicies of the source vertices/normals. |
sVx | The source vertices. |
sNr | The source normals. |
tVxBuf | A buffer with room for at least nS vertices. |
sVxBuf | A buffer with room for at least nS vertices. |
wgtBuf | A buffer with room for at least nS doubles. |
maxItr | Maximum number of iterations. |
initTr | Initial affine transform. |
dstConv | Destination pointer for a convergence flag which is set to a non zero value if the registration converges. |
usrWgtFn | User supplied weight function, may be NULL. |
usrWgtData | User supplied weight data, may be NULL. |
delta | Tolerance for mean value of registration metric. |
minDistWgt | Minimum distance weighting. |
dstErr | Destination error pointer, may be NULL. |
References AlcDouble2WriteAsci(), AlcKDTGetNN(), _WlzRegICPWSp::curMetric, _WlzRegICPWSp::curTr, _WlzVertexP::d2, _WlzVertex::d2, _WlzVertexP::d3, _WlzVertex::d3, _WlzRegICPWSp::delta, _WlzRegICPWSp::dist, _AlcKDTNode::idx, _WlzRegICPWSp::itr, _WlzAffineTransform::mat, _WlzRegICPWSp::nS, _WlzRegICPWSp::nT, _WlzRegICPWSp::prvMetric, _WlzRegICPWSp::prvTr, _WlzRegICPWSp::sgnNrm, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzRegICPWSp::vType, _WlzDVertex3::vtZ, WLZ_ERR_ALG_CONVERGENCE, WLZ_ERR_ALG_SINGULAR, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_REG, WLZ_TRANSFORM_3D_AFFINE, WLZ_TRANSFORM_3D_REG, WLZ_VERTEX_D2, WLZ_VTX_2_DOT, WLZ_VTX_2_LENGTH, WLZ_VTX_2_SUB, WLZ_VTX_3_DOT, WLZ_VTX_3_LENGTH, WLZ_VTX_3_SUB, WlzAffineTransformCopy(), WlzAffineTransformInverse(), WlzAffineTransformLSq(), WlzAffineTransformNormalD2(), WlzAffineTransformNormalD3(), WlzAffineTransformProduct(), WlzAffineTransformVertexD2(), WlzAffineTransformVertexD3(), WlzFreeAffineTransform(), and WlzMakeAffineTransform().
Referenced by WlzMatchICPWeightMatches().
WlzObject* WlzSampleObj | ( | WlzObject * | srcObj, |
WlzIVertex3 | samFac, | ||
WlzSampleFn | samFn, | ||
WlzErrorNum * | dstErr | ||
) |
Samples the given object using the given sampling factor and sampling method.
srcObj | Given source object. |
samFac | Sampling factor for both rows and columns. Every pixel == 1, every other pixel == 2, .... |
samFn | Sampling method. |
dstErr | Destination pointer for error, may be NULL. |
References ALC_ER_NONE, AlcDouble2Free(), AlcDouble2Malloc(), AlcFree(), AlcFreeStackPush(), AlcInt2Free(), AlcInt2Malloc(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzIntervalDomain::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzIntervalWSpace::intrmn, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzIntervalDomain::lastln, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzIntervalWSpace::linpos, _WlzIntervalWSpace::rgtpos, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, _WlzIVertex2::vtX, _WlzIVertex3::vtX, _WlzIVertex2::vtY, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_INTERVALDOMAIN_INTVL, WLZ_RASTERDIR_ILIC, WLZ_SAMPLEFN_GAUSS, WLZ_SAMPLEFN_MAX, WLZ_SAMPLEFN_MEAN, WLZ_SAMPLEFN_MEDIAN, WLZ_SAMPLEFN_MIN, WLZ_SAMPLEFN_POINT, WlzFreeObj(), WlzGreyTableIsTiled(), WlzGreyTableTypeToGreyType(), WlzInitRasterScan(), WlzMakeEmpty(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzNextInterval(), WlzSampleObjPoint2D(), WlzSampleObjPoint3D(), WlzStandardIntervalDomain(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, and _WlzIBox2::yMin.
Referenced by WlzMeshFromObjBox(), and WlzRegCCorObjs().
WlzObject* WlzSampleObjPoint3D | ( | WlzObject * | srcObj, |
WlzIVertex3 | samFac, | ||
WlzErrorNum * | dstErr | ||
) |
Samples the given object's plane domain only using the given sampling factor. This function assumes it's parameters to be valid.
srcObj | Given source object. |
samFac | Sampling factor for both rows and columns. Every voxel == 1, every other voxel == 2, .... |
dstErr | Destination pointer for error, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzPlaneDomain::line1, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzCoreDomain::type, _WlzPlaneDomain::type, _WlzCoreValues::type, _WlzVoxelValues::type, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, _WlzPlaneDomain::voxel_size, _WlzIVertex2::vtX, _WlzIVertex3::vtX, _WlzIVertex2::vtY, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_VALUES_TYPE, WLZ_PLANEDOMAIN_DOMAIN, WLZ_VOXELVALUETABLE_GREY, WlzFreeDomain(), WlzFreeObj(), WlzGetBackground(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakeVoxelValueTb(), WlzSampleObjPoint2D(), WlzStandardPlaneDomain(), _WlzIBox3::xMax, _WlzIBox3::xMin, _WlzIBox3::yMax, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzContourRBFBndObj3D(), and WlzSampleObj().
WlzObject* WlzSampleObjPoint2D | ( | WlzObject * | srcObj, |
WlzIVertex2 | samFac, | ||
WlzErrorNum * | dstErr | ||
) |
Samples the given object using a simple point sampling method and the given sampling factor. This function assumes it's parameters to be valid.
srcObj | Given source object. |
samFac | Sampling factor for both rows and columns. Every pixel == 1, every other pixel == 2, .... |
dstErr | Destination pointer for error, may be NULL. |
References ALC_ER_NONE, AlcDouble2Free(), AlcDouble2Malloc(), AlcFree(), AlcFreeStackPush(), AlcInt2Free(), AlcInt2Malloc(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzGreyP::flp, _WlzGreyV::flv, _WlzIntervalDomain::freeptr, _WlzRectValues::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzGreyP::inp, _WlzIntervalWSpace::intrmn, _WlzIntervalDomain::intvlines, _WlzGreyV::inv, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzIntervalDomain::lastln, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzIntervalWSpace::linpos, _WlzValues::r, _WlzGreyP::rgbp, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzGreyV::shv, _WlzPixelV::type, _WlzCoreDomain::type, _WlzIntervalDomain::type, _WlzCoreValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzGreyP::v, _WlzPixelV::v, _WlzObject::values, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_ABS, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_TAB_RECT, WLZ_GREY_UBYTE, WLZ_INTERVALDOMAIN_INTVL, WLZ_INTERVALDOMAIN_RECT, WLZ_M_LN2, WLZ_MAX, WLZ_MIN, WLZ_NINT, WLZ_SAMPLE_KERNEL_INORM, WLZ_SAMPLEFN_MAX, WLZ_SAMPLEFN_MEDIAN, WLZ_SAMPLEFN_MIN, WlzEndGreyScan(), WlzFreeDomain(), WlzFreeValues(), WlzGetBackground(), WlzGreyTableTypeToGreyType(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzMakeEmpty(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakeRectValueTb(), WlzNextGreyInterval(), WlzSetBackground(), WlzStandardIntervalDomain(), WlzValueCopyDoubleToDouble(), WlzValueCopyFloatToDouble(), WlzValueCopyIntToInt(), WlzValueCopyShortToInt(), WlzValueCopyUByteToInt(), WlzValueMedianDouble(), WlzValueMedianInt(), WlzValueSetDouble(), WlzValueSetInt(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, and _WlzIBox2::yMin.
Referenced by WlzSampleObj(), and WlzSampleObjPoint3D().
WlzObject* WlzShiftObject | ( | WlzObject * | inObj, |
int | xShift, | ||
int | yShift, | ||
int | zShift, | ||
WlzErrorNum * | dstErr | ||
) |
The external object shift interface function. Shifts a Woolz object in place, cf WlzAffineTransform() which always creates a new object with both a new domain and a new value table. WlzShiftObject always makes a new domain but keeps as much of the given object's value table as possible.
inObj | The given object. |
xShift | Column shift. |
yShift | Line shift. |
zShift | Plane shift (only used for 3D objects). |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_3D_POLYGON, WLZ_3D_WARP_TRANS, WLZ_AFFINE_TRANS, WLZ_BOUNDLIST, WLZ_COMPOUND_ARR_1, WLZ_COMPOUND_ARR_2, WLZ_COMPOUND_LIST_1, WLZ_COMPOUND_LIST_2, WLZ_CONTOUR, WLZ_CONV_HULL, WLZ_CONVOLVE_FLOAT, WLZ_CONVOLVE_INT, WLZ_EMPTY_OBJ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_FMATCHOBJ, WLZ_HISTOGRAM, WLZ_PROPERTY_OBJ, WLZ_RECTANGLE, WLZ_TEXT, WLZ_TRANS_OBJ, WLZ_WARP_TRANS, WlzFreeDomain(), WlzFreeValues(), WlzMakeEmpty(), WlzMakeMain(), WlzShiftDomain(), and WlzShiftValues().
Referenced by DumbRegMatch(), WlzAffineTransformIsTranslate(), WlzConComThreshold(), WlzDrawDomainObj(), WlzEffReadObjNifti(), WlzMakeMarkers(), WlzPatchTreeToObject(), and WlzRegisterPatchTreeBF().
WlzDomain WlzShiftDomain | ( | WlzObjectType | inObjType, |
WlzDomain | inDom, | ||
int | xShift, | ||
int | yShift, | ||
int | zShift, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a new shifted domain.
inObjType | Type of given domain's parent object. |
inDom | Domain to be shifted. |
xShift | Column shift. |
yShift | Line shift. |
zShift | Plane shift (only used for 3D objects). |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::b, _WlzDomain::core, _WlzDomain::ctr, _WlzPlaneDomain::domains, _WlzBoundList::down, _WlzDomain::i, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzPolygonDomain::maxvertices, _WlzContour::model, _WlzBoundList::next, _WlzPolygonDomain::nvertices, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzDomain::poly, _WlzBoundList::poly, _WlzDomain::t, _WlzIntervalDomain::type, _WlzPlaneDomain::type, _WlzPolygonDomain::type, _WlzBoundList::type, _WlzAffineTransform::type, _WlzPlaneDomain::voxel_size, _WlzIVertex2::vtX, _WlzFVertex2::vtX, _WlzDVertex2::vtX, _WlzPolygonDomain::vtx, _WlzIVertex2::vtY, _WlzFVertex2::vtY, _WlzDVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_3D_POLYGON, WLZ_3D_WARP_TRANS, WLZ_AFFINE_TRANS, WLZ_BOUNDLIST, WLZ_COMPOUND_ARR_1, WLZ_COMPOUND_ARR_2, WLZ_COMPOUND_LIST_1, WLZ_COMPOUND_LIST_2, WLZ_CONTOUR, WLZ_CONV_HULL, WLZ_CONVOLVE_FLOAT, WLZ_CONVOLVE_INT, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_TYPE, WLZ_FMATCHOBJ, WLZ_HISTOGRAM, WLZ_POLYGON_DOUBLE, WLZ_POLYGON_FLOAT, WLZ_POLYGON_INT, WLZ_PROPERTY_OBJ, WLZ_RECTANGLE, WLZ_TEXT, WLZ_TRANS_OBJ, WLZ_WARP_TRANS, WlzAffineTransformFromPrimVal(), WlzAffineTransformProduct(), WlzAssignDomain(), WlzAssignGMModel(), WlzFreeAffineTransform(), WlzFreeBoundList(), WlzFreeContour(), WlzFreeDomain(), WlzFreePolyDmn(), WlzMakeBoundList(), WlzMakeContour(), WlzMakePlaneDomain(), WlzMakePolygonDomain(), WlzNewIDomain(), and _WlzBoundList::wrap.
Referenced by WlzMakeTiledValuesObj2D(), WlzMakeTiledValuesObj3D(), and WlzShiftObject().
WlzValues WlzShiftValues | ( | WlzObjectType | inObjType, |
WlzValues | inVal, | ||
WlzDomain | inDom, | ||
int | xShift, | ||
int | yShift, | ||
int | zShift, | ||
WlzErrorNum * | dstErr | ||
) |
Shifts the given objects values.
inObjType | Type of given domain's parent object. |
inVal | Values to be shifted. |
inDom | Domain over which values are defined (parent object's domain). |
xShift | Column shift. |
yShift | Line shift. |
zShift | Plane shift (only used for 3D objects). |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), AlcVectorItemGet(), _WlzGMShellG2I::bBox, _WlzGMShellG2D::bBox, _WlzGMShellG3I::bBox, _WlzGMShellG3D::bBox, _WlzRagRValues::bckgrnd, _WlzRectValues::bckgrnd, _WlzVoxelValues::bckgrnd, _WlzGMElemP::core, _WlzValues::core, _WlzDomain::core, _WlzVertexP::d2, _WlzBoxP::d2, _WlzVertexP::d3, _WlzBoxP::d3, _WlzPlaneDomain::domains, _WlzIntervalValues::freeptr, _WlzValues::i, _WlzVertexP::i2, _WlzBoxP::i2, _WlzVertexP::i3, _WlzBoxP::i3, _WlzGMCore::idx, _WlzRagRValues::kol1, _WlzRectValues::kol1, _WlzIntervalValues::kol1, _WlzTiledValues::kol1, _WlzTiledValues::lastkl, _WlzRagRValues::lastln, _WlzRectValues::lastln, _WlzIntervalValues::lastln, _WlzTiledValues::lastln, _WlzVoxelValues::lastpl, _WlzTiledValues::lastpl, _WlzRagRValues::line1, _WlzRectValues::line1, _WlzIntervalValues::line1, _WlzTiledValues::line1, _WlzIntervalValues::linkcount, _WlzValueIntervalLine::nintvs, _WlzGMResource::numIdx, _WlzValues::obj, _WlzRagRValues::original_table, _WlzRectValues::original_table, _WlzIntervalValues::original_table, _WlzDomain::p, _WlzVoxelValues::plane1, _WlzTiledValues::plane1, _WlzValues::r, _WlzGMModel::res, _WlzGMModelR::shellG, _WlzGMElemP::shellG2D, _WlzGMElemP::shellG2I, _WlzGMElemP::shellG3D, _WlzGMElemP::shellG3I, _WlzValues::t, _WlzGMModel::type, _WlzCoreDomain::type, _WlzCoreValues::type, _WlzRagRValues::type, _WlzRectValues::type, _WlzIntervalValues::type, _WlzVoxelValues::type, _WlzValues::v, _WlzRectValues::values, _WlzVoxelValues::values, _WlzGMResource::vec, _WlzGMModelR::vertexG, _WlzGMElemP::vertexG2D, _WlzGMElemP::vertexG2I, _WlzGMElemP::vertexG3D, _WlzGMElemP::vertexG3I, _WlzIntervalValues::vil, _WlzValues::vox, _WlzValueIntervalLine::vtbint, _WlzRagRValues::vtblines, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzGMVertexG2I::vtx, _WlzGMVertexG2D::vtx, _WlzGMVertexG3I::vtx, _WlzGMVertexG3D::vtx, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, _WlzRagRValues::width, _WlzRectValues::width, _WlzIntervalValues::width, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_3D_POLYGON, WLZ_3D_WARP_TRANS, WLZ_AFFINE_TRANS, WLZ_BOUNDLIST, WLZ_COMPOUND_ARR_1, WLZ_COMPOUND_ARR_2, WLZ_COMPOUND_LIST_1, WLZ_COMPOUND_LIST_2, WLZ_CONV_HULL, WLZ_CONVOLVE_FLOAT, WLZ_CONVOLVE_INT, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_FMATCHOBJ, WLZ_GMMOD_2D, WLZ_GMMOD_2I, WLZ_GMMOD_2N, WLZ_GMMOD_3D, WLZ_GMMOD_3I, WLZ_GMMOD_3N, WLZ_GREY_TAB_INTL, WLZ_GREY_TAB_RAGR, WLZ_GREY_TAB_RECT, WLZ_GREY_TAB_TILED, WLZ_HISTOGRAM, WLZ_PLANEDOMAIN_DOMAIN, WLZ_PROPERTY_OBJ, WLZ_RECTANGLE, WLZ_TEXT, WLZ_TRANS_OBJ, WLZ_VOXELVALUETABLE_GREY, WLZ_WARP_TRANS, WlzAssignValues(), WlzFreeValues(), WlzGMModelRehashVHT(), WlzGreyTableIsTiled(), WlzGreyTableTypeToTableType(), WlzMakeRectValueTb(), WlzMakeValueTb(), WlzMakeVoxelValueTb(), _WlzIBox2::xMax, _WlzDBox2::xMax, _WlzIBox3::xMax, _WlzDBox3::xMax, _WlzIBox2::xMin, _WlzDBox2::xMin, _WlzIBox3::xMin, _WlzDBox3::xMin, _WlzIBox2::yMax, _WlzDBox2::yMax, _WlzIBox3::yMax, _WlzDBox3::yMax, _WlzIBox2::yMin, _WlzDBox2::yMin, _WlzIBox3::yMin, _WlzDBox3::yMin, _WlzIBox3::zMax, _WlzDBox3::zMax, _WlzIBox3::zMin, and _WlzDBox3::zMin.
Referenced by WlzShiftObject().
WlzErrorNum WlzSnapFit | ( | WlzObject * | tObj, |
WlzObject * | sObj, | ||
WlzAffineTransform * | tr, | ||
WlzVertexType * | vType, | ||
int * | dstNVtx, | ||
WlzVertexP * | dstTVtxP, | ||
WlzVertexP * | dstSVtxP, | ||
double | maxCDist, | ||
double | minTDist, | ||
double | minSDist | ||
) |
Computes correspondences between the given target and source objects, based only on closest points. These may be used to snap-fit one object to another when the alignment of the objects is known to be close. If the optional transform is given then all distances are with respect to the transformed source.
The algorithm used is: -# Get vertices from target and source object. -# Select those target vertices such that for any pair of target vertices \form#566 and\(\mathbf{v_j}\) the separation distance \(|\mathbf{v_i} - \mathbf{v_j}| < d_t \forall i,j\)
tObj | Target object. |
sObj | Source object. |
tr | Initial affine transform for source object. |
vType | Type of vertices returned, which is always either WLZ_VERTEX_D2 or WLZ_VERTEX_D3. |
dstNVtx | Destination pointer for the number of target vertces. |
dstTVtxP | Destination pointer for the target vertces. |
dstSVtxP | Destination pointer for the target vertces. |
maxCDist | Maximum distance between target and source vertex pairs \(d_c\). |
minTDist | Minimum distance between target vertces, \(d_t\). |
minSDist | Minimum distance between source vertces \(d_s\). |
References ALC_ER_NONE, ALC_POINTTYPE_DBL, AlcFree(), AlcKDTGetNN(), AlcKDTInsert(), AlcKDTTreeFree(), AlcKDTTreeNew(), AlcMalloc(), AlgHeapSortCmpIdxDFn(), AlgHeapSortIdx(), AlgShuffleIdx(), _WlzDomain::core, _WlzVertexP::d2, _WlzVertexP::d3, _WlzObject::domain, _WlzVertexP::f2, _WlzVertexP::i2, _WlzVertexP::i3, _AlcKDTNode::idx, _WlzVertexP::v, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_MAX, WLZ_VERTEX_D2, WLZ_VERTEX_D3, WLZ_VERTEX_F2, WLZ_VERTEX_F3, WLZ_VERTEX_I2, WLZ_VERTEX_I3, WlzAffineTransformDimension(), WlzAffineTransformVertexD2(), WlzAffineTransformVertexD3(), WlzValueCopyFVertexToDVertex(), WlzValueCopyIVertexToDVertex(), WlzValueCopyIVertexToDVertex3(), WlzValueSetInt(), and WlzVerticesFromObj().
WlzEmptyTransform* WlzMakeEmptyTransform | ( | WlzErrorNum * | dstErr | ) |
Makes a new empty transform.
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), _WlzEmptyTransform::type, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WLZ_TRANSFORM_EMPTY.
Referenced by WlzTransformProduct().
WlzErrorNum WlzFreeEmptyTransform | ( | WlzEmptyTransform * | tr | ) |
Frees the given empty transform.
tr | Given empty transform. |
References AlcFree(), _WlzEmptyTransform::linkcount, _WlzEmptyTransform::type, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_TRANSFORM_EMPTY, and WlzUnlink().
Referenced by WlzFreeTransform().
WlzErrorNum WlzFreeTransform | ( | WlzTransform | tr | ) |
Free's the given Woolz transform.
tr | Given transform. |
References _WlzTransform::affine, _WlzTransform::basis, _WlzTransform::core, _WlzTransform::empty, _WlzTransform::mesh, _WlzTransform::obj, _WlzCoreTransform::type, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_ERR_UNIMPLEMENTED, WLZ_TRANSFORM_2D5_BASISFN, WLZ_TRANSFORM_2D5_CMESH, WLZ_TRANSFORM_2D5_MESH, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_BASISFN, WLZ_TRANSFORM_2D_CMESH, WLZ_TRANSFORM_2D_MESH, WLZ_TRANSFORM_2D_NOSHEAR, WLZ_TRANSFORM_2D_REG, WLZ_TRANSFORM_2D_TRANS, WLZ_TRANSFORM_3D_AFFINE, WLZ_TRANSFORM_3D_BASISFN, WLZ_TRANSFORM_3D_CMESH, WLZ_TRANSFORM_3D_MESH, WLZ_TRANSFORM_3D_NOSHEAR, WLZ_TRANSFORM_3D_REG, WLZ_TRANSFORM_3D_TRANS, WLZ_TRANSFORM_EMPTY, WlzBasisFnFreeTransform(), WlzFreeAffineTransform(), WlzFreeEmptyTransform(), WlzFreeObj(), and WlzMeshFreeTransform().
Referenced by WlzTransformRANSAC().
WlzTransform WlzTransformProduct | ( | WlzTransform | tr0, |
WlzTransform | tr1, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the product of the given transforms. The resulting transform's type depends on the given transform types:
\[ \mathbf{T_r} = \mathbf{T_0} \mathbf{T_1} \]
The product of any transform with an empty transform is an empty transform.
tr0 | First transform ( \(\mathbf{T_0}\)). |
tr1 | Second transform ( \(\mathbf{T_1}\)). |
dstErr | Destination error pointer, may be NULL. |
References _WlzTransform::affine, _WlzTransform::core, _WlzTransform::empty, _WlzTransform::mesh, _WlzTransform::obj, _WlzCoreTransform::type, WLZ_CMESH_2D, WLZ_CMESH_2D5, WLZ_CMESH_3D, WLZ_ERR_NONE, WLZ_ERR_TRANSFORM_NULL, WLZ_ERR_TRANSFORM_TYPE, WLZ_ERR_UNIMPLEMENTED, WLZ_TRANSFORM_2D5_BASISFN, WLZ_TRANSFORM_2D5_MESH, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_BASISFN, WLZ_TRANSFORM_2D_MESH, WLZ_TRANSFORM_2D_NOSHEAR, WLZ_TRANSFORM_2D_REG, WLZ_TRANSFORM_2D_TRANS, WLZ_TRANSFORM_3D_AFFINE, WLZ_TRANSFORM_3D_BASISFN, WLZ_TRANSFORM_3D_MESH, WLZ_TRANSFORM_3D_NOSHEAR, WLZ_TRANSFORM_3D_REG, WLZ_TRANSFORM_3D_TRANS, WLZ_TRANSFORM_EMPTY, WlzAffineTransformProduct(), WlzCMeshAffineProduct(), WlzCMeshMeshMeshProduct(), WlzCMeshMeshProduct(), WlzCMeshProduct(), WlzCopyObject(), WlzMakeEmptyTransform(), WlzMeshAffineProduct(), and WlzMeshTransformCopy().
WlzObject* WlzTransposeObj | ( | WlzObject * | obj, |
WlzErrorNum * | dstErr | ||
) |
Transpose a woolz object. Currently implemented for 2D domain, boundary and polyline objects. Transpose means pixels/vertices at (k,l) are moved to (l,k). Domain, boundary and polyline objects can all be transposed. This is used in the WlzSepTrans procedure.
obj | Input object |
dstErr | Error return. |
References AlcFreeStackPush(), AlcMalloc(), _WlzDomain::b, _WlzVoxelValues::bckgrnd, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzBoundList::down, _WlzGreyP::flp, _WlzDomain::fr, _WlzRectValues::freeptr, _WlzRect::freeptr, _WlzFRect::freeptr, _WlzFRect::frk, _WlzFRect::frl, _WlzGreyValueWSpace::gType, _WlzGreyValueWSpace::gVal, _WlzDomain::i, _WlzGreyP::inp, _WlzRect::irk, _WlzRect::irl, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzVoxelValues::lastpl, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linbot, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzRect::linkcount, _WlzFRect::linkcount, _WlzIntervalWSpace::linpos, _WlzBoundList::next, _WlzPolygonDomain::nvertices, _WlzValues::obj, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzVoxelValues::plane1, _WlzDomain::poly, _WlzBoundList::poly, _WlzValues::r, _WlzDomain::r, _WlzRect::rangle, _WlzFRect::rangle, _WlzGreyP::rgbp, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzObject::type, _WlzCoreDomain::type, _WlzPlaneDomain::type, _WlzCoreValues::type, _WlzVoxelValues::type, _WlzPolygonDomain::type, _WlzBoundList::type, _WlzRect::type, _WlzFRect::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, _WlzPlaneDomain::voxel_size, _WlzIVertex2::vtX, _WlzFVertex2::vtX, _WlzDVertex2::vtX, _WlzPolygonDomain::vtx, _WlzIVertex2::vtY, _WlzFVertex2::vtY, _WlzDVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_BOUNDLIST, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_POLYGON_TYPE, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_TAB_RECT, WLZ_GREY_TAB_TILED, WLZ_GREY_UBYTE, WLZ_INTERVALDOMAIN_INTVL, WLZ_INTERVALDOMAIN_RECT, WLZ_M_PI_2, WLZ_NULL, WLZ_POLYGON_DOUBLE, WLZ_POLYGON_FLOAT, WLZ_POLYGON_INT, WLZ_RECTANGLE, WLZ_RECTANGLE_DOMAIN_FLOAT, WLZ_RECTANGLE_DOMAIN_INT, WLZ_SIMPLE_FILL, WLZ_TRANS_OBJ, WlzAssignBoundList(), WlzAssignDomain(), WlzAssignValues(), WlzBoundToObj(), WlzEndGreyScan(), WlzFreeBoundList(), WlzFreeIntervalDomain(), WlzFreeObj(), WlzFreePolyDmn(), WlzGetBackground(), WlzGreyTableIsTiled(), WlzGreyTableTypeToGreyType(), WlzGreyTableTypeToTableType(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzMakeBoundList(), WlzMakeEmpty(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakePolygonDomain(), WlzMakeRectValueTb(), WlzMakeVoxelValueTb(), WlzNewValueTb(), WlzNextGreyInterval(), WlzObjToBoundary(), and _WlzBoundList::wrap.
Referenced by WlzSepTrans().
WlzTransform WlzTransformRANSAC | ( | int | nVtx, |
WlzVertexType | tType, | ||
WlzVertexP | tVtx, | ||
WlzVertexType | sType, | ||
WlzVertexP | sVtx, | ||
int | minPair, | ||
WlzTransformRANSACFitFn | fitFn, | ||
WlzTransformRANSACErrFn | errFn, | ||
WlzTransformRANSACDegFn | degFn, | ||
double | oTol, | ||
double | eTol, | ||
double | pTol, | ||
int | dMax, | ||
int | iMax, | ||
int | rMax, | ||
int | iMin, | ||
void * | cData, | ||
int * | dstNIn, | ||
int ** | dstIn, | ||
WlzErrorNum * | dstErr | ||
) |
Function to compute a transform from paired correspondences using RANSAC (Random Sample Consensus) which returns the transform for which there are the most inlier vertex pairs. This function is based on the following papers: M.A. Fishler and R.C. Boles "Random Sample Concensus: A Paradigm for Model Fitting with Applications to Image Analysis and Automated Cartography" Communication of the ACM, Vol 24, No 6, pp 381-395, 1981. Ondrej Chum and Jiri Matas "Optimal Randomized RANSAC" PAMI, Vol 30, No 8, pp 1472-1482, 2008.
nVtx | Number of source-target vertex pairs. |
tType | Target vertex type. |
tVtx | Target vertices. |
sType | Source vertex type. |
sVtx | Source vertices. |
minPair | Minimum number of vertex pairs for the given transform function. |
fitFn | Function used to fit transformation from source vertices to target vertices. |
errFn | Error function used to compute the error between correspondence and model. |
degFn | Degenerate model transform checking function. between correspondence and model. |
oTol | Probability that no samples are inliers. |
eTol | Correspondences within this error distance are classed as inliers. |
pTol | Pruning tollerance, if pTol < eTol then pruning is done. |
dMax | Maximum number of attempts to find a nondegenerate set, if zero default of TODO is used. |
iMax | Maximum number of iterations, if zero default of TODO is used. |
rMax | Maximum number of resamplings, if zero default of TODO is used. |
iMin | Minimum number of inliers before optimisation is done. |
cData | Client data passed to the transform and error functions. |
dstNIn | Destination pointer for the number of inliers found. |
dstIn | Destination pointer for indices to the inliers in the given arrays. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcMalloc(), ALG_MAX, _WlzTransform::core, _WlzTransRANSACVtx::nVtx, _WlzTransRANSACVtx::sType, _WlzTransRANSACVtx::sVtx, _WlzTransRANSACVtx::tType, _WlzTransRANSACVtx::tVtx, _WlzVertexP::v, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, and WlzFreeTransform().