Woolz Image Processing  Version 1.7.5
WlzTransform

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...
 

Enumerations

enum  _WlzCMeshScanElmFlags {
  WLZ_CMESH_SCANELM_NONE = (0),
  WLZ_CMESH_SCANELM_SQUASH = (1),
  WLZ_CMESH_SCANELM_FWD = (2),
  WLZ_CMESH_SCANELM_REV = (4)
}
 Flags for the conforming mesh scannning elements. More...
 
enum  _WlzTransformType {
  WLZ_TRANSFORM_EMPTY = 0,
  WLZ_TRANSFORM_2D_AFFINE = 1,
  WLZ_TRANSFORM_2D_REG,
  WLZ_TRANSFORM_2D_TRANS,
  WLZ_TRANSFORM_2D_NOSHEAR,
  WLZ_TRANSFORM_3D_AFFINE,
  WLZ_TRANSFORM_3D_REG,
  WLZ_TRANSFORM_3D_TRANS,
  WLZ_TRANSFORM_3D_NOSHEAR,
  WLZ_TRANSFORM_2D_BASISFN,
  WLZ_TRANSFORM_2D5_BASISFN,
  WLZ_TRANSFORM_3D_BASISFN,
  WLZ_TRANSFORM_2D_MESH,
  WLZ_TRANSFORM_2D5_MESH,
  WLZ_TRANSFORM_3D_MESH,
  WLZ_TRANSFORM_2D_CMESH = WLZ_CMESH_2D,
  WLZ_TRANSFORM_2D5_CMESH = WLZ_CMESH_2D5,
  WLZ_TRANSFORM_3D_CMESH = WLZ_CMESH_3D
}
 Types of spatial transformation. Typedef: WlzTransformType. More...
 
enum  _WlzMeshElemType {
  WLZ_MESH_ELEM_TRILINEAR,
  WLZ_MESH_ELEM_TRIINCOMPRESSIBLE,
  WLZ_MESH_ELEM_TRICOMPRESSIBLE
}
 Mesh transform element types. Typedef: WlzMeshElemType. More...
 
enum  _WlzMeshElemFlags {
  WLZ_MESH_ELEM_FLAGS_NONE = (0),
  WLZ_MESH_ELEM_FLAGS_NBR_0 = (1),
  WLZ_MESH_ELEM_FLAGS_NBR_1 = (1<<1),
  WLZ_MESH_ELEM_FLAGS_NBR_2 = (1<<2),
  WLZ_MESH_ELEM_FLAGS_ZOMBIE = (1<<3),
  WLZ_MESH_ELEM_FLAGS_REFINE = (1<<4),
  WLZ_MESH_ELEM_FLAGS_OUTSIDE = (1<<5)
}
 Mesh transform element flag bit masks. Typedef: WlzMeshElemFlags. More...
 
enum  _WlzMeshNodeFlags {
  WLZ_MESH_NODE_FLAGS_NONE = (0),
  WLZ_MESH_NODE_FLAGS_BBOX = (1),
  WLZ_MESH_NODE_FLAGS_BLOCK = (1<<1),
  WLZ_MESH_NODE_FLAGS_IDOM = (1<<2),
  WLZ_MESH_NODE_FLAGS_POLY = (1<<3),
  WLZ_MESH_NODE_FLAGS_ZOMBIE = (1<<4)
}
 Mesh transform node flag masks. Typedef: WlzMeshNodeFlags. More...
 
enum  _WlzMeshGenMethod {
  WLZ_MESH_GENMETHOD_BLOCK,
  WLZ_MESH_GENMETHOD_GRADIENT,
  WLZ_MESH_GENMETHOD_CONFORM
}
 Mesh generation methods. Typedef: WlzMeshGenMethod. More...
 
enum  _WlzMeshError {
  WLZ_MESH_ERR_NONE = (0),
  WLZ_MESH_ERR_ELEM_CW = (1),
  WLZ_MESH_ERR_ELEM_INDEX = (1<<1),
  WLZ_MESH_ERR_ELEM_NODE = (1<<2),
  WLZ_MESH_ERR_ELEM_ZOMBIE = (1<<3),
  WLZ_MESH_ERR_DELEM_CW = (1<<4),
  WLZ_MESH_ERR_NELEM_INDEX = (1<<5),
  WLZ_MESH_ERR_NELEM_NODE = (1<<6),
  WLZ_MESH_ERR_NELEM_NOTNBR = (1<<7),
  WLZ_MESH_ERR_NELEM_ZOMBIE = (1<<8)
}
 Mesh error bit masks. Typedef: WlzMeshError. More...
 
enum  _WlzGreyTransformType {
  WLZ_GREYTRANSFORMTYPE_IDENTITY,
  WLZ_GREYTRANSFORMTYPE_LINEAR,
  WLZ_GREYTRANSFORMTYPE_GAMMA,
  WLZ_GREYTRANSFORMTYPE_SIGMOID
}
 Grey-level transform types. Typedef: WlzGreyTransformType. More...
 
enum  _WlzSampleFn {
  WLZ_SAMPLEFN_NONE,
  WLZ_SAMPLEFN_POINT,
  WLZ_SAMPLEFN_MEAN,
  WLZ_SAMPLEFN_GAUSS,
  WLZ_SAMPLEFN_MIN,
  WLZ_SAMPLEFN_MAX,
  WLZ_SAMPLEFN_MEDIAN
}
 Sampling functions. Typedef: WlzSampleFn. More...
 
enum  _WlzElementType {
  WLZ_LINEAR_RECT = 11,
  WLZ_INCOMPRESSIBLE_RECT,
  WLZ_COMPRESSIBLE_RECT,
  WLZ_LINEAR_TRI = 21,
  WLZ_INCOMPRESSIBLE_TRI,
  WLZ_COMPRESSIBLE_TRI
}
 The types of elements in a finite element warp mesh. Typedef: WlzElementType. More...
 
enum  _Wlz3DViewStructInitMask {
  WLZ_3DVIEWSTRUCT_INIT_NONE = (0),
  WLZ_3DVIEWSTRUCT_INIT_TRANS = (1),
  WLZ_3DVIEWSTRUCT_INIT_BB = (1<<1),
  WLZ_3DVIEWSTRUCT_INIT_LUT = (1<<2),
  WLZ_3DVIEWSTRUCT_INIT_ALL = 0x7
}
 Mesh transform element flag bit masks. Typedef: WlzMeshElemFlags. More...
 

Functions

WlzObjectWlzGetProjectionFromObject (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...
 
WlzObjectWlzProjectObjToPlane (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...

 
WlzObjectWlz3DViewTransformObj (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...
 
WlzObjectWlz3DViewTransformBitmap (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...
 
WlzContourWlzAffineTransformContour (WlzContour *srcCtr, WlzAffineTransform *tr, int newModFlg, WlzErrorNum *dstErr)
 Transforms the given contour. More...
 
WlzPointsWlzAffineTransformPoints (WlzPoints *srcPts, WlzAffineTransform *tr, int newPtsFlg, WlzErrorNum *dstErr)
 Transforms the given contour. More...
 
WlzGMModelWlzAffineTransformGMModel (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...
 
WlzAffineTransformWlzAffineTransformFromTranslation (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...
 
WlzAffineTransformWlzAffineTransformFromScale (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...
 
WlzAffineTransformWlzAffineTransformFromRotation (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...
 
WlzAffineTransformWlzAffineTransformFromMatrix (WlzTransformType type, double **matrix, WlzErrorNum *dstErr)
 Makes a new affine transform of the given type and then sets it's matrix. More...
 
WlzAffineTransformWlzAffineTransformFromPrimVal (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...
 
WlzAffineTransformWlzAffineTransformFromSpin (double spX, double spY, double spTheta, WlzErrorNum *dstErr)
 Makes a new 2D affine transform from the given spin angle and centre of rotation. More...
 
WlzAffineTransformWlzAffineTransformFromSpinSqueeze (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...
 
WlzAffineTransformWlzAffineTransformCopy (WlzAffineTransform *tr, WlzErrorNum *dstErr)
 Copies the given affine transform. More...
 
WlzAffineTransformWlzAffineTransformProduct (WlzAffineTransform *tr0, WlzAffineTransform *tr1, WlzErrorNum *dstErr)
 Computes the product of the two given affine transforms \(T_1 T_0\). More...
 
WlzAffineTransformWlzAffineTransformInverse (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...
 
WlzObjectWlzAffineTransformObj (WlzObject *srcObj, WlzAffineTransform *trans, WlzInterpolationType interp, WlzErrorNum *dstErr)
 Applies the given affine transform to the given Woolz object. More...
 
WlzObjectWlzAffineTransformObjCb (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...
 
WlzAffineTransformWlzAffineTransformLSq (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...
 
WlzAffineTransformWlzAffineTransformLSq2D (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...
 
WlzAffineTransformWlzAffineTransformLSq3D (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...
 
WlzAffineTransformWlzAffineTransformLSqTrans2D (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...
 
WlzAffineTransformWlzAffineTransformLSqTrans3D (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...
 
WlzAffineTransformWlzAffineTransformLSqGen2D (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...
 
WlzAffineTransformWlzAffineTransformLSqGen3D (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...
 
WlzAffineTransformWlzAffineTransformLSqReg2D (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...

 
WlzAffineTransformWlzAffineTransformLSqScale2D (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...
 
WlzAffineTransformWlzAffineTransformLSqReg3D (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...

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

 
WlzObjectWlzCMeshMeshProduct (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...

 
WlzObjectWlzCMeshProduct (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...

 
WlzObjectWlzCMeshExpansion (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...

 
WlzObjectWlzIntRescaleObj (WlzObject *gObj, int scale, int expand, WlzErrorNum *dstErr)
 Rescales the given object using an integer scale. More...
 
WlzAffineTransformWlzMakeAffineTransform (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...
 
WlzMeshTransformWlzMeshTransformNew (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...
 
WlzMeshTransformWlzMeshTransformAdapt (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...
 
WlzMeshTransformWlzMeshTransformCopy (WlzMeshTransform *gMesh, WlzErrorNum *dstErr)
 Copies the given mesh transform. The copied mesh will have any zombie elements squeezed out. More...
 
WlzMeshTransformWlzMeshFromObj (WlzObject *srcObj, WlzMeshGenMethod method, double minDist, double maxDist, WlzErrorNum *dstErr)
 Creates a mesh transform for the given object with all mesh displacements zero. More...
 
WlzObjectWlzMeshTransformObj (WlzObject *srcObj, WlzMeshTransform *gMesh, WlzInterpolationType interp, WlzErrorNum *dstErr)
 Transforms a woolz object using a the given mesh transform. More...
 
WlzMeshTransformWlzMeshTransformFromCPts (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...
 
WlzMeshTransformWlzMeshFromObjBox (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...
 
WlzObjectWlzProj3DToSection (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...
 
WlzAffineTransformWlzRegICPObjsGrd (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...
 
WlzAffineTransformWlzRegICPObjs (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...
 
WlzObjectWlzRegICPObjWSD2D (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...
 
WlzAffineTransformWlzRegICPVertices (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...
 
WlzObjectWlzRegICPVerticesWSD2D (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...
 
WlzAffineTransformWlzRegICPTreeAndVertices (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...
 
WlzObjectWlzSampleObj (WlzObject *srcObj, WlzIVertex3 samFac, WlzSampleFn samFn, WlzErrorNum *dstErr)
 Samples the given object using the given sampling factor and sampling method. More...
 
WlzObjectWlzSampleObjPoint3D (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...
 
WlzObjectWlzSampleObjPoint2D (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...
 
WlzObjectWlzShiftObject (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...
 
WlzEmptyTransformWlzMakeEmptyTransform (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...

 
WlzObjectWlzTransposeObj (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...
 

Detailed Description

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.

Typedef Documentation

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:

  • cbData Callback data passed to WlzAffineTransformCb().
  • gWSp Target grey workspace.
  • gVWSp Source grey value workspace.
  • invTr Affine transform from target to source.
  • pln Plane of interval in destination.
  • ln Line of interval in destination.

3D to 2D projection integration modes.

Enumeration Type Documentation

Flags for the conforming mesh scannning elements.

Enumerator
WLZ_CMESH_SCANELM_NONE 
WLZ_CMESH_SCANELM_SQUASH 

Clear - no flags set for the element.

WLZ_CMESH_SCANELM_FWD 

The transformed element has negligable area/volume and only the transform coefficients for translation are non zero.

WLZ_CMESH_SCANELM_REV 

The transform is forward, ie transforming source to destination.

Types of spatial transformation. Typedef: WlzTransformType.

Enumerator
WLZ_TRANSFORM_EMPTY 

Undefined transform.

WLZ_TRANSFORM_2D_AFFINE 

General 2D affine transform.

WLZ_TRANSFORM_2D_REG 

2D affine but only rotation and translation.

WLZ_TRANSFORM_2D_TRANS 

2D affine but only translation.

WLZ_TRANSFORM_2D_NOSHEAR 

2D affine but no shear.

WLZ_TRANSFORM_3D_AFFINE 

General 3D affine transform.

WLZ_TRANSFORM_3D_REG 

3D affine but only rotation and translation.

WLZ_TRANSFORM_3D_TRANS 

3D affine but only translation.

WLZ_TRANSFORM_3D_NOSHEAR 

3D affine but no shear.

WLZ_TRANSFORM_2D_BASISFN 

2D basis function transform.

WLZ_TRANSFORM_2D5_BASISFN 

2.5D (plane wise) basis function transform.

WLZ_TRANSFORM_3D_BASISFN 

3D basis function transform.

WLZ_TRANSFORM_2D_MESH 

2D triangular mesh transform.

WLZ_TRANSFORM_2D5_MESH 

2.5D (plane wise) triangular mesh transform.

WLZ_TRANSFORM_3D_MESH 

3D tetrahedral mesh transform.

WLZ_TRANSFORM_2D_CMESH 

2D conforming triangular mesh transform.

WLZ_TRANSFORM_2D5_CMESH 

3D conforming triangular mesh transform.

WLZ_TRANSFORM_3D_CMESH 

3D conforming tetrahedral mesh transform.

Mesh transform element types. Typedef: WlzMeshElemType.

Enumerator
WLZ_MESH_ELEM_TRILINEAR 
WLZ_MESH_ELEM_TRIINCOMPRESSIBLE 
WLZ_MESH_ELEM_TRICOMPRESSIBLE 

Mesh transform element flag bit masks. Typedef: WlzMeshElemFlags.

Enumerator
WLZ_MESH_ELEM_FLAGS_NONE 
WLZ_MESH_ELEM_FLAGS_NBR_0 

Neighbour on side 0 exists

WLZ_MESH_ELEM_FLAGS_NBR_1 

Neighbour on side 1 exists

WLZ_MESH_ELEM_FLAGS_NBR_2 

Neighbour on side 2 exists

WLZ_MESH_ELEM_FLAGS_ZOMBIE 

Dead, awaiting replacement

WLZ_MESH_ELEM_FLAGS_REFINE 

Available for refinement

WLZ_MESH_ELEM_FLAGS_OUTSIDE 

Outside object's domain

Mesh transform node flag masks. Typedef: WlzMeshNodeFlags.

Enumerator
WLZ_MESH_NODE_FLAGS_NONE 
WLZ_MESH_NODE_FLAGS_BBOX 

Created from bounding box.

WLZ_MESH_NODE_FLAGS_BLOCK 

Created by block fill.

WLZ_MESH_NODE_FLAGS_IDOM 

Created to fill interval domain

WLZ_MESH_NODE_FLAGS_POLY 

Created along polygon domain

WLZ_MESH_NODE_FLAGS_ZOMBIE 

Dead, awaiting replacement

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.

Mesh error bit masks. Typedef: WlzMeshError.

Enumerator
WLZ_MESH_ERR_NONE 

No error, mesh valid

WLZ_MESH_ERR_ELEM_CW 

Element not CCW

WLZ_MESH_ERR_ELEM_INDEX 

Element index invalid

WLZ_MESH_ERR_ELEM_NODE 

Element node invalid

WLZ_MESH_ERR_ELEM_ZOMBIE 

Element is a zombie

WLZ_MESH_ERR_DELEM_CW 

Displaced element not CCW

WLZ_MESH_ERR_NELEM_INDEX 

Neighbour index invalid

WLZ_MESH_ERR_NELEM_NODE 

Neighbour node invalid

WLZ_MESH_ERR_NELEM_NOTNBR 

Neighbour not a neighbour

WLZ_MESH_ERR_NELEM_ZOMBIE 

Neighbour is a zombie

Grey-level transform types. Typedef: WlzGreyTransformType.

Enumerator
WLZ_GREYTRANSFORMTYPE_IDENTITY 

No value change.

WLZ_GREYTRANSFORMTYPE_LINEAR 

Linear interpolation.

WLZ_GREYTRANSFORMTYPE_GAMMA 

Gamma function.

WLZ_GREYTRANSFORMTYPE_SIGMOID 

Sigmoid function.

Sampling functions. Typedef: WlzSampleFn.

Enumerator
WLZ_SAMPLEFN_NONE 

No sampling function

WLZ_SAMPLEFN_POINT 

Point sampling

WLZ_SAMPLEFN_MEAN 

Mean value sample of data

WLZ_SAMPLEFN_GAUSS 

Gaussian weighted sample of data

WLZ_SAMPLEFN_MIN 

Minimum value sampling

WLZ_SAMPLEFN_MAX 

Maximum value sampling

WLZ_SAMPLEFN_MEDIAN 

Median value sampling

The types of elements in a finite element warp mesh. Typedef: WlzElementType.

Enumerator
WLZ_LINEAR_RECT 

Linear and rectangular.

WLZ_INCOMPRESSIBLE_RECT 

Incompessible and rectangular.

WLZ_COMPRESSIBLE_RECT 

Compressible and rectangular.

WLZ_LINEAR_TRI 

Linear and triangular.

WLZ_INCOMPRESSIBLE_TRI 

Incompessible and triangular.

WLZ_COMPRESSIBLE_TRI 

Compressible and triangular.

Mesh transform element flag bit masks. Typedef: WlzMeshElemFlags.

Enumerator
WLZ_3DVIEWSTRUCT_INIT_NONE 
WLZ_3DVIEWSTRUCT_INIT_TRANS 

Initialised transform

WLZ_3DVIEWSTRUCT_INIT_BB 

Initialised bounding box

WLZ_3DVIEWSTRUCT_INIT_LUT 

Initialised look-up tables

WLZ_3DVIEWSTRUCT_INIT_ALL 

Initialised all convenience mask

Function Documentation

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.

Returns
projection object
Parameters
objsource 3D object
viewStrview structure defining the projection
intFuncgrey-value summation function
intFuncDatadata to be passed to the integration function
dstErrerror 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.

Returns
New object with the rojection.
Parameters
objThe given object.
vStrGiven view structure defining the projection plane.
intModThis may take three values: WLZ_PROJECT_INT_MODE_NONE, WLZ_PROJECT_INT_MODE_DOMAIN or WLZ_PROJECT_INT_MODE_VALUES.
denDomDensity of domain voxels this value is not used unless the integration mode is WLZ_PROJECT_INT_MODE_DOMAIN.
denValDensity 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.
depthIf greater than zero, the projection depth perpendicular to the viewing plane.
dstErrDestination 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.

Returns
Transformed object.
Parameters
srcObjGiven source object.
viewStrGiven view transform.
dstErrDestination 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.

Returns
Parameters
sizeBitDataNumber of bytes in bitmap.
bitDataBitmap data.
widthBitmap width.
heightBitmap height.
x_offsetHorizontal ofset into the bitmap.
y_offsetVertical offset into the bitmap.
xFixed point x coordinate.
yFixed point y coordinate.
zFixed point z coordinate.
thetaAngle of rotation about the z-axis (radians).
phiAngle between the viewing direction and the original z-axis (radians).
distancePerpendicular distance from the fixed point to the view plane.
dstErrDestination 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 WlzAffineTransformIsTranslate ( WlzAffineTransform tr,
WlzObject obj,
WlzErrorNum dstErr 
)

Tests whether the given affine transform is a simple integer translation.

Returns
Non-zero if translation.
Parameters
trGiven affine transform.
objOptional object, may be NULL.
dstErrDestination 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.

Returns
Transformed contour or NULL on error.
Parameters
srcCtrGiven contour.
trGiven affine transform.
newModFlgMake a new model if non-zero, otherwise transform the given model in place.
dstErrDestination 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.

Returns
Transformed points or NULL on error.
Parameters
srcPtsGiven points.
trGiven affine transform.
newPtsFlgMake a new points domain if non-zero, otherwise transform the given points in place.
dstErrDestination 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.

Returns
Transformed model or NULL on error.
Parameters
srcMGiven geometric model.
trGiven affine transform.
newModFlgMake a new model if non-zero, otherwise transform the given model in place.
dstErrDestination 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.

Returns
Woolz error code.
Parameters
shellGiven shell.
trGiven 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 \]

.

Returns
Error number.
Parameters
trGiven affine transform.
primGiven 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.

Returns
Error number.
Parameters
trGiven 2D or 3D affine transform.
txTranslation along the x-axis.
tyTranslation along the y-axis.
tzTranslation 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.

Returns
New affine transform, NULL on error.
Parameters
typeRequired transform type.
txTranslation along the x-axis.
tyTranslation along the y-axis.
tzTranslation along the z-axis, ignored for 2D transforms.
dstErrDestination 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.

Returns
Error number.
Parameters
trGiven 2D or 3D affine transform.
sxScale along the x-axis.
syScale along the y-axis.
szScale 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.

Returns
New affine transform, NULL on error.
Parameters
typeRequired transform type.
sxScale along the x-axis.
syScale along the y-axis.
szScale along the z-axis, ignored for 2D transforms.
dstErrDestination 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.

Returns
Error number.
Parameters
trGiven 2D or 3D affine transform.
rxRotation about the x-axis, ignored for 2D transforms.
ryRotation about the y-axis, ignored for 2D transforms.
rzRotation 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.

Returns
New affine transform, NULL on error.
Parameters
typeRequired transform type.
rxRotation about the x-axis, ignored for 2D transforms.
ryRotation about the y-axis, ignored for 2D transforms.
rzRotation about the z-axis.
dstErrDestination pointer for error number.

References WLZ_ERR_NONE, WlzAffineTransformRotationSet(), WlzFreeAffineTransform(), and WlzMakeAffineTransform().

WlzErrorNum WlzAffineTransformMatrixSet ( WlzAffineTransform trans,
double **  matrix 
)
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.

Returns
New affine transform, or NULL on error.
Parameters
trGiven 2D affine transform.
trXColumn (x) translation.
trYLine (y) translation.
trZPlane (z) translation.
trScaleScale transformation.
trThetaRotation about z-axis.
trPhiRotation about y-axis.
trAlphaShear strength.
trPsiShear angle in x-y plane.
trXsi3D shear angle.
trInvertReflection 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.

Returns
New affine transform, or NULL on error.
Parameters
typeRequired transform type.
matrixGiven matrix.
dstErrDestination 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.

Returns
New affine transform, or NULL on error.
Parameters
typeRequired transform type.
trXColumn (x) translation.
trYLine (y) translation.
trZPlane (z) translation.
trScaleScale transformation.
trThetaRotation about z-axis.
trPhiRotation about y-axis.
trAlphaShear strength.
trPsiShear angle in x-y plane.
trXsi3D shear angle.
trInvertReflection about y-axis if non-zero.
dstErrDestination 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.

Returns
New affine transform, or NULL on error.
Parameters
spXSpin centre column (x).
spYSpin centre line (y).
spThetaSpin rotation about centre. number.
dstErrDestination 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.

Returns
New affine transform, or NULL on error.
Parameters
spXSpin centre column (x).
spYSpin centre line (y).
spThetaSpin rotation about centre. number.
sqXSqueeze (x) factor.
sqYSqueeze (y) factor.
dstErrDestination 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.

Returns
New affine transform, or NULL on error.
Parameters
trGiven affine transform.
dstErrDestination 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\).

Returns
New affine transform, or NULL on error.
Parameters
tr0First affine transform \(T_0\).
tr1Second affine transform \(T_1\).
dstErrDestination 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().

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.

Returns
Non-zero if the given transform is an identity transform.
Parameters
transGiven affine transform.
dstErrDestination 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.

Returns
Non-zero if the given transform is an identity transform.
Parameters
transGiven affine transform.
tolTnGiven tollerance for all elements except translation.
tolTxGiven tollerance for translation.
dstErrDestination 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.

Returns
Transformed object, NULL on error.
Parameters
srcObjObject to be transformed.
transAffine transform to apply.
interpLevel of interpolation to use.
dstErrDestination 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.

Returns
Transformed object, NULL on error.
Parameters
srcObjObject to be transformed.
transAffine transform to apply.
interpLevel of interpolation to use.
cbDataData passed to the directly to the callback function.
cbFnCallback function.
dstErrDestination 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.

Returns
Transformed vertex.
Parameters
transAffine transform to apply.
srcVtxVertex to be transformed.
dstErrDestination 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.

Returns
Transformed vertex.
Parameters
transAffine transform to apply.
srcVtxVertex to be transformed.
dstErrDestination 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.

Returns
Transformed vertex.
Parameters
transAffine transform to apply.
srcVtxVertex to be transformed.
dstErrDestination 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.

Returns
Transformed vertex.
Parameters
transAffine transform to apply.
srcVtxVertex to be transformed.
dstErrDestination 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 WlzAffineTransformNormalD2 ( WlzAffineTransform trans,
WlzDVertex2  srcNrm,
WlzErrorNum dstErr 
)

Transforms the given WlzDVertex2 which is a normal.

Returns
Transformed vertex.
Parameters
transAffine transform to apply.
srcNrmNormal to be transformed.
dstErrDestination 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.

Returns
Transformed vertex.
Parameters
transAffine transform to apply.
srcNrmNormal to be transformed.
dstErrDestination 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.

Returns
Transformed bounding box.
Parameters
trAffine transform to apply.
srcBoxBounding box to be transformed.
dstErrDestination 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.

Returns
Transformed bounding box.
Parameters
trAffine transform to apply.
srcBoxBounding box to be transformed.
dstErrDestination 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.

Returns
Transformed bounding box.
Parameters
trAffine transform to apply.
srcBoxBounding box to be transformed.
dstErrDestination 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.

Returns
Transformed bounding box.
Parameters
trAffine transform to apply.
srcBoxBounding box to be transformed.
dstErrDestination 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.

Returns
Computed affine transform, may be NULL on error.
Parameters
vTypeType of vertices.
nVTNumber of target vertices.
vTTarget vertices.
nVSNumber source vertices, which must be the same as the number of target vertices.
vSTarget vertices.
nVWnumber of vertex weights, which must either be zero or the same as the number target vertices.
vWVertex pair weights which may be NULL if the number of weights is zero.
trTypeRequired transform type.
dstErrDestination 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:

Returns
Computed affine transform, may be NULL on error.
Parameters
nVTNumber of target vertices.
vTFirst vector of vertices.
nVTSNumber of vertices in second vector (MUST be same as first).
vSSecond vector of vertices.
nVWnumber of vertex weights, which must either be zero or the same as the number target vertices.
vWVertex pair weights which may be NULL if the number of weights is zero.
trTypeRequired transform type.
dstErrDestination 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:

Returns
Computed affine transform, may be NULL on error.
Parameters
nVTNumber of target vertices.
vTFirst vector of vertices.
nVSNumber of vertices in second vector (MUST be same as first).
vSSecond vector of vertices.
nVWnumber of vertex weights, which must either be zero or the same as the number target vertices.
vWVertex pair weights which may be NULL if the number of weights is zero.
trTypeRequired transform type.
dstErrDestination 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.

Returns
Computed affine transform, may be NULL on error.
Parameters
vTTarget vertices.
vSSource vertices.
vWVertex pair weights.
nVNumber of vertex pairs.
dstErrDestination 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.

Returns
Computed affine transform, may be NULL on error.
Parameters
vTTarget vertices.
vSSource vertices.
vWVertex pair weights.
nVNumber of vertex pairs.
dstErrDestination 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.

Returns
Computed affine transform, may be NULL on error. Given \(N\) source, target vertex pairs \(\mathbf{x_i}\), \(\mathbf{\acute{x_i}}\) respectively, each with a weight \(w_i\), the least squares general affine transform \(T\), with

\[ \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) \]

Parameters
vTTarget vertices.
vSSource vertices.
vWVertex pair weights in range [0.0-1.0], may be NULL in which case all weights have value 1.0.
nVNumber of vertex pairs.
dstErrDestination 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.

Returns
Computed affine transform, may be NULL on error. Given \(N\) source, target vertex pairs \(\mathbf{x_i}\), \(\mathbf{\acute{x_i}}\) respectively, each with a weight \(w_i\), the least squares general affine transform \(T\), with

\[ \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) \]

Parameters
vTTarget vertices.
vSSource vertices.
vWVertex pair weights in range [0.0-1.0], may be NULL in which case all weights have value 1.0.
nVNumber of vertex pairs.
dstErrDestination 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.

Returns
Computed affine transform, may be NULL on error.
Parameters
vTTarget vertices.
vSSource vertices.
vWVertex pair weights, range [0-1], may be NULL in which case all weights are 1.
nVtxNumber of vertices in each array.
dstErrDestination 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.

Returns
Affine transform or NULL on error.
Parameters
vTTarget vertices
vSSource vertices
vWVertex weights
nVtxNumber of vertices
dstErrDestination 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.

Returns
Computed affine transform, may be NULL on error.
Parameters
vTTarget vertices.
vSFirst array of vertices.
vWVertex pair weights, range [0-1], may be NULL in which case all weights are 1..
nVNumber of vertices in each array.
dstErrDestination 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.

Returns
Computed affine transform, may be NULL on error.
Parameters
vTTarget vertices.
vSSource vertices.
nVNumber of vertex pairs.
dstErrDestination 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.

Returns
Computed affine transform, may be NULL on error.
Parameters
nVNumber of vertices.
vWVertex weights (Walker's beta), may be NULL which implies that all the weights are 1.0.
vTVertices of the target set.
vSVertices of the source set.
nNNumber of normals.
nWNormal weights (Walker's alpha)., may be NULL which implies that all the weights are 1.0
nTTarget normals, may be NULL.
nSSource normals, may be NULL.
dstErrDestination 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.

Returns
Computed affine transform, may be NULL on error. This function is based on the dual quaternion algorithm: M.W. Walker and Shao L. Estimating 3-D Location Parameters Using Dual Number Quaternions, CVGIP 54(3), 1991. Given a set on \(k\) source points \(\bar{\mathbf{p}}^0_i\), \(l\) source unit normals \(\bar{\mathbf{n}}^0_i\); the corresponding target points \(\mathbf{p}^0_i\) and unit normals \(\mathbf{n}^0_i\), with weights \(\alpha_i\) and \(\beta_i\) the algorithm performs the following steps:
  1. Compute \(\mathbf{C}_1\), \(\mathbf{C}_2\), \(\mathbf{C}_3\):

    \[ \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)) } \]

  2. Compute the \(4 \times 4\) symetric matrix \(\mathbf{A}\):

    \[ \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.
  3. Compute the eigenvector of \(r\) corresponding to the largest positive eigenvalue of matrix \(\mathbf{A}\) and derive \(\mathbf{s}\) from \(\mathbf{r}\) using

    \[ \mathbf{t} = \mathbf{W}(\mathbf{r})^T \mathbf{s} \]

  4. Compute the translation vector \(\mathbf{t}\) and rotation matrix \(\mathbf{R}\) using:

    \[ \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}) \]

Parameters
nVNumber of vertices.
vWVertex weights (Walker's beta), may be NULL which implies that all the weights are 1.0.
vTVertices of the target set.
vSVertices of the source set.
nNNumber of normals.
nWNormal weights (Walker's alpha)., may be NULL which implies that all the weights are 1.0
nTTarget normals, may be NULL.
nSSource normals, may be NULL.
dstErrDestination 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.

Returns
New Basis function transform.
Parameters
dstErrDestination 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.

Returns
Woolz error number.
Parameters
basisTrGiven 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().

Returns
New basis function transform.
Parameters
typeRequired basis function type.
orderOrder of polynomial, only used for WLZ_FN_BASIS_2DPOLY.
nDPtsNumber of destination control points.
dPtsDestination control points.
nSPtsNumber of source control points (must be same as nDPts).
sPtsSource control points.
meshMesh 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.
dstErrDestination 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.

Returns
New basis function transform.
Parameters
typeRequired basis function type.
orderOrder of polynomial, only used for WLZ_FN_BASIS_2DPOLY.
nDPtsNumber of destination control points.
dPtsDestination control points.
nSPtsNumber of source control points (must be same as nDPts).
sPtsSource control points.
meshMesh 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.
nParamNumber of additional parameters.
paramArray of additional parameters.
dstErrDestination 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.

Returns
New basis function transform.
Parameters
typeRequired basis function type.
orderOrder of polynomial, only used for WLZ_FN_BASIS_3DPOLY.
nDPtsNumber of destination control points.
dPtsDestination control points.
nSPtsNumber of source control points (must be same as nDPts).
sPtsSource control points.
meshMesh 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.
nParamNumber of additional parameters.
paramArray of additional parameters.
dstErrDestination 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.

Returns
Woolz error code.
Parameters
basisTrExisting basis function transform.
nDPtsNumber of destination control points.
dPtsDestination control points.
nSPtsNumber of source control points (must be same as nDPts).
sPtsSource control points.
cObjConstraining 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.

Returns
Woolz error code.
Parameters
basisTrExisting basis function transform.
nDPtsNumber of destination control points.
dPtsDestination control points.
nSPtsNumber of source control points (must be same as nDPts).
sPtsSource control points.
cObjConstraining object, within which all distances are constrained. If NULL Euclidean distances are used in place of constrained distances.
nParamNumber of additional parameters.
paramArray 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.

Returns
New basis function transform.
Parameters
typeRequired basis function type.
orderOrder of polynomial, only used for WLZ_BASISFN_POLY.
nDPtsNumber of destination control points.
dPtsDestination control points.
nSPtsNumber of source control points (must be same as nDPts)
sPtsSource control points.
meshMesh 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.
dstErrDestination error pointer, may be NULL.

References WlzBasisFnTrFromCPts3DParam().

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.

Returns
Error number.
Parameters
mObjGiven conforming mesh transform object.
basisTrGiven 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.

Returns
Error number.
Parameters
mObjGiven mesh transform object.
basisTrGiven 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.

Returns
Error number.
Parameters
mObjGiven mesh transform object.
basisTrGiven 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.

Returns
New constrained mesh transform object.
Parameters
basisTrGiven basis function transform which transforms target to source.
meshGiven conforming mesh for target.
dstErrDestination 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.

Returns
New constrained mesh transform object.
Parameters
basisTrGiven basis function transform which transforms target to source.
meshGiven conforming mesh for target.
dstErrDestination 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.

Returns
New constrained mesh transform object.
Parameters
basisTrGiven basis function transform which transforms target to source.
meshGiven conforming mesh for target.
dstErrDestination 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.

Returns
New constrained mesh transform object.
Parameters
basisTrGiven basis function transform which transforms target to source.
meshGiven conforming mesh for target.
dstErrDestination 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.

Returns
New constrained mesh transform object.
Parameters
basisTrGiven basis function transform which transforms target to source.
meshGiven conforming mesh for target.
dstErrDestination 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.

Returns
New constrained mesh transform object.
Parameters
basisTrGiven basis function transform which transforms target to source.
meshGiven conforming mesh for target.
dstErrDestination 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.

Returns
Transformed object, NULL on error.
Parameters
srcObjObject to be transformed.
basisTrBasis function transform to apply.
interpLevel of interpolation to use.
dstErrDestination 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.

Returns
Transformed 2D polygon domain, NULL on error.
Parameters
srcPolyPolygon domain to be transformed.
basisTrBasis function transform to apply.
newPolyMakes a new polygon domain if non-zero otherwise the given polygon domain will be transformed in place.
dstErrDestination 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.

Returns
Transformed 2D boundary list, NULL on error.
Parameters
srcBndBoundary list to be transformed.
basisTrBasis function transform to apply.
newBndMakes a new bound list if non-zero otherwise the given bound list will be transformed in place.
dstErrDestination 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().

Returns
Transformed contour, NULL on error.
Parameters
srcCtrContour to be transformed.
basisTrBasis function transform to apply.
newCtrMakes a new contour if non-zero otherwise the given contour will be transformed in place.
dstErrDestination 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!

Returns
Transformed model, NULL on error.
Parameters
srcMModel to be transformed.
basisTrBasis function transform to apply.
newModelMakes a new model if non-zero otherwise the given model will be transformed in place.
dstErrDestination 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.

Returns
Transformed vertex.
Parameters
basisTrBasis function transform to apply.
srcVxGiven vertex.
srcNrGiven normal.
dstVxDestination pointer for the transformed vertex. Must not be NULL.
dstErrDestination 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().

WlzFVertex2 WlzBasisFnTransformVertexF ( WlzBasisFnTransform basisTr,
WlzFVertex2  srcVxF,
WlzErrorNum dstErr 
)

Transforms the given WlzFVertex2.

Returns
Transformed vertex.
Parameters
basisTrBasis function transform to apply.
srcVxFVertex to be transformed.
dstErrDestination 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.

Returns
Transformed vertex.
Parameters
basisTrBasis function transform to apply.
srcVxIVertex to be transformed.
dstErrDestination 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.

Returns
New mesh object with displacements set or NULL on error.
Parameters
mshObjInput conforming mesh object which must be of type WLZ_CMESH_2D5.
domObjGiven planar spatial domain, which must be a single piece.
nDVNumber of spatial domain vertices which must be the same as nMV.
dVSpatial domain vertices which must be on or near the domain boundary. These are 3D vertices with the Z component zero.
nMVNumber of in mesh vertices.
mVMesh vertices.
dstErrWoolz 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().

Returns
New mesh object with displacements set or NULL on error.
Parameters
inObjInput conforming mesh object which must be of type WLZ_CMESH_2D5.
nDVNumber of destination vertices.
dVDestination vertices.
nSVNumber of source vertices which must be the same as nDV.
sVSource vertices.
dstErrWoolz 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.

Returns
Woolz error code.
Parameters
gObjGiven constrained mesh object with indexed values for transform.
dstErrDestination 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].

Returns
New conforming mesh transform.
Parameters
srcObjThe given object.
methodMesh generation method to use.
minDistMinimum distance between mesh vertices.
maxDistMaximum distance between mesh vertices.
dstDilObjDestination pointer for the dilated object used to build the mesh, may be NULL.
delOutDelete all elements with nodes outside the object if non-zero.
dstErrDestination 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().

Returns
Woolz error code.
Parameters
mObjThe mesh transform object.
nVtxNumber of vertices in the array.
vtxArray of vertices.
nInsideNumber of inside markers (must be zero or >= the number of vertices).
insideInside 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().

Returns
Woolz error code.
Parameters
mObjThe mesh transform object.
nVtxNumber of vertices in the array.
vtxArray of vertices.
nInsideNumber of inside markers (must be zero or >= the number of vertices).
insideInside 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().

Returns
Woolz error code.
Parameters
mObjThe mesh transform object.
nVtxNumber of vertices in the array.
vtxArray of vertices.
nInsideNumber of inside markers (must be zero or >= the number of vertices).
insideInside 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().

Returns
Woolz error code.
Parameters
mObjThe mesh transform object.
nVtxNumber of vertices in the array.
vtxArray of vertices.
nInsideNumber of inside markers (must be zero or >= the number of vertices).
insideInside 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().

Returns
Woolz error code.
Parameters
mObjThe mesh transform object.
nVtxNumber of vertices in the array.
vtxArray of vertices.
nInsideNumber of inside markers (must be zero or >= the number of vertices).
insideInside 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().

Returns
Woolz error code.
Parameters
mObjThe mesh transform object.
nVtxNumber of vertices in the array.
vtxArray of vertices.
nInsideNumber of inside markers (must be zero or >= the number of vertices).
insideInside byte flags set to zero or one; zero when vertices are inside the mesh, otherwise one.
Returns
Woolz error code.

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.

Parameters
mObjThe mesh transform object.
nVtxNumber of vertices in the array.
vtxArray 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().

Returns
Woolz error code.
Parameters
mObjThe mesh transform object.
nVtxNumber of vertices in the array.
vtxArray of vertices.
nInsideNumber of inside markers (must be zero or >= the number of vertices).
insideInside 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.

Returns
Transformed object, NULL on error.
Parameters
srcObjObject to be transformed.
mObjConforming mesh transform object.
interpType of interpolation.
dstErrDestination 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.

Returns
Compound array with transformed object domains, NULL on error.
Parameters
srcObjObject to be transformed. This must be a compound array with at least one non empty object.
mObjConforming mesh transform object.
interpType of interpolation, which should probably either be nearest neighbours or classify. Other interpolation methods may be allowed.
dstErrDestination 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.

Returns
Woolz error code.
Parameters
mObjGiven mesh object.
dstNNodDestination pointer for the number of mesh nodes.
dstNodDestination pointer for the mesh nodes.
dstNDspDestination pointer for the number of mesh node displacements.
dstDspDestination pointer for the mesh node displacement.
dstNEdgDestination pointer for the number of edge indices.
dstEdgDestination 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.

Returns
The bounding box of the mesh in the mesh transform.
Parameters
mObjGiven mesh transform object.
transDisplacements applied if non-zero.
dstErrDestination 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.

Returns
The bounding box of the mesh in the mesh transform.
Parameters
mObjGiven mesh transform object.
transDisplacements applied if non-zero.
dstErrDestination 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.

Returns
Woolz error code.
Author
Zsolt Husz
Parameters
scaleScale value
objWoolz object
WlzObject* WlzCopyScaleCMeshValue ( double  scale,
WlzObject obj,
WlzErrorNum dstErr 
)

Creates an woolz CMesh transform object indentical with the input object, but with value scaled.

Returns
Copied source object.
Author
Zsolt Husz
Parameters
scaleScale value
objWoolz object
dstErrDestination 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.

Returns
Woolz error code.
            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.
Parameters
trMGiven conforming mesh transform.
trAGiven affine transform.
orderOrder 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} \]

.

Returns
New conforming mesh transform.
Parameters
tr0First (convex) mesh transform.
tr1Second (convex) mesh transform.
dstErrDestination 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} \]

.

Returns
New Woolz object containing the conforming mesh transform product or NULL on error.
Parameters
tr0First (convex) mesh transform.
tr1Second (convex) mesh transform.
orderOrder of evaluation.
dstErrDestination 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} \]

.

Returns
New Woolz object containing the conforming mesh transform product or NULL on error.
Parameters
tr0First (conforming) mesh transform.
tr1Second (conforming) mesh transform.
dstErrDestination 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.

Returns
Woolz object with the given conforming mesh and scalar expansion factor values attached the the mesh elements, or NULL on error.
Parameters
cObjGiven conforming mesh transform.
inverseUse inverse of transform if non zero.
methodMethod used:
  • 0 - average expansion from strain tensor trace
  • 1 - maximum expansion from maximum eigenvalue of the strain tensor
  • 2 - ratio of element volumes, expansion will be DBL_MAX for infinite expansion and zero for complete collapse.
dstErrDestination 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} \]

.

Returns
Woolz error code.
Parameters
vtxTypeGiven vertex type.
nVtxNumber of given vertices.
vtxGiven vertices.
dstPinPDestination pointer for the return of the median point ( \(r_0\)) in the plane.
dstNrmDestination 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.

Returns
Rescaled object.
Parameters
gObjGiven object.
scaleInteger scale factor.
expandIf zero use \(\frac{1}{scale}\).
dstErrDestination 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().

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.

Returns
Error code.
Parameters
tObjThe target object.
sObjThe source object to be matched with target object.
initTrInitial affine transform to be applied to the source object prior to matching. May be NULL.
dstNMatchDestination pointer for the number of match points found. Required.
dstTMatchDestination pointer for the target match points found. Required.
dstSMatchDestination pointer for the source match points found. Required.
maxItrMaximum number of iterations.
minSpxMinimum number of simplicies in a contour shell for matching.
minSegSpxMinimum number of simplices per matched shell segment, with a tie point pair possibly being generated for each matched shell segment.
brkFlgControls the breaking of the source shells. Possible values are:
  • 0 Whole model registration, source shells are never broken.
  • 1 Whole source shells are registered to the target model. Source shells are never broken.
  • 2 Source shells are only ever broken by connectivity.
  • > 2 Source shells are broken by connectivity and then near there midpoints brkFlg - 1 times.
maxDispThe 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.
maxAngThe maximum angle of rotation of a shell geometry with respect to the global affine transformed geometry for an acceptable registration.
maxDeformThe maximum deformation to the geometry of a shell, from the global affine transformed geometry, for an acceptable registration.
matchImpNNNumber match points in neighbourhood when removing implausible match points, must be \(> 2\).
matchImpThrImplausibility threshold which should be \(> 0\) but the useful range is probably \([0.5-2.5]\). Higher values allow more implausible matches to be returned.
deltaTolerance 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.

Returns
Error code.
Parameters
tCtrThe target contour.
sCtrThe source contour to be matched with target contour.
initTrInitial affine transform to be applied to the source object prior to matching. May be NULL.
maxItrMaximum number of iterations.
minSpxMinimum number of simplicies in a contour shell for matching.
minSegSpxMinimum number of simplices per matched shell segment, with a tie point pair possibly being generated for each matched shell segment.
dstNMatchDestination pointer for the number of match points found.
dstTMatchDestination pointer for the target match points found.
dstSMatchDestination pointer for the source match points found.
brkFlgControls the breaking of the source shells. Possible values are:
  • 0 Whole model registration, source shells are never broken.
  • 1 Whole source shells are registered to the target model. Source shells are never broken.
  • 2 Source shells are only ever broken by connectivity.
  • > 2 Source shells are broken by connectivity and then near there midpoints brkFlg - 1 times.
maxDispThe maximum displacement to the geometry of a shell for an acceptable registration. distance for a registered shell to be used for correspondence computation.
maxAngThe maximum angle of rotation of a shell geometry with respect to the global affine transformed geometry for an acceptable registration.
maxDeformThe maximum deformation to the geometry of a shell for an acceptable registration.
matchImpNNNumber match points in neighbourhood when removing implausible match points, must be \(> 2\).
matchImpThrImplausibility threshold which should be \(> 0\) but the useful range is probably \([0.5-2.5]\). Higher values allow more implausible matches to be returned.
usrWgtFnUser supplied weighting function.
usrWgtDataUser supplied weighting data.
deltaTolerance 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().

Returns
Weight value in the range [0.0-1.0].
Parameters
vTypeType of vertices.
curTrCurrent affine transform.
treeGiven kD-tree populated by the target vertices such that the nodes of the tree have the same indicies as the given target vertices.
tVxThe target vertices.
sVxThe source vertices.
tMVxThe matched target vertex.
sMVxThe matched source vertex.
wVxDistance weight.
wNrNormal weight.
dataData 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 
)
WlzErrorNum WlzMeshFreeTransform ( WlzMeshTransform mesh)

Free's the given mesh transform.

Returns
Woolz error code.
Parameters
meshGiven 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.

Returns
New mesh transform.
Parameters
nNodeNumber of nodes (and displacements).
nElemNumber of elements.
dstErrDestination 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.

Returns
New mesh transform.
Parameters
gMeshGiven mesh transform.
minAreaMinimum element area.
dstErrDestination 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.

Returns
New mesh transform.
Parameters
gMeshGiven mesh transform.
dstErrDestination 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.

Returns
New mesh transform.
Parameters
srcObjThe given object.
methodMesh generation method to use.
minDistMinimum distance between mesh vertices.
maxDistMaximum distance between mesh vertices.
dstErrDestination 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.

Returns
Transformed object, NULL on error.
Parameters
srcObjObject to be transformed.
gMeshGiven mesh transform to apply.
interpLevel of interpolation.
dstErrDestination 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.

Returns
New mesh transform.
Parameters
objGiven object.
basisFnTypeRequired basis function type.
polyOrderOrder of polynomial, only used for WLZ_FN_BASIS_2DPOLY.
nSPtsNumber of source control points.
sPtsSource control points.
nDPtsNumber of destination control points.
dPtsDestination control points.
meshGenMtdMesh generation method.
meshMinDistMinimum mesh vertex distance.
meshMaxDistMaximum mesh vertex distance.
dstErrDestination 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.

Returns
Woolz error code.
            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.
Parameters
mTrGiven mesh transform.
aTrGiven affine transform.
orderOrder 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 
)
double WlzClassValCon4 ( double *  g,
double  p,
double  q 
)

Interpolate pixel value using maximum probability.

Returns
Pixel value.
Parameters
gArray of four values at integer coordinates.
pColumn offset from integer coordinate.
qLine 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.

Returns
New mesh transform.
Parameters
srcObjThe given object.
dstBoxDestination bounding box pointer, may be NULL.
boxDilationDilation of box to be sure of enclosing any possible node.
dstErrDestination 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.

WlzErrorNum WlzMeshDomainAdd ( WlzMeshTransform mesh,
WlzObject obj,
double  minDist,
WlzDVertex2  scaleVx 
)

Adds mesh nodes within the domain of the given 2D domain object.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
objGiven object with domain.
minDistMinimum distance between mesh nodes.
scaleVxObject 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.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
vxVecGiven vector of vertices.
nVxNumber of vertices.
minDistSqSquare of the minimum distance between mesh nodes.
nodeFlagsNode 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 WlzMeshPolyDomAdd ( WlzMeshTransform mesh,
WlzObject obj,
double  minDist,
WlzDVertex2  scaleVx 
)

Adds mesh nodes along the polygon domain of the given 2D domain object.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
objGiven object with domain.
minDistMinimum distance between mesh nodes.
scaleVxObject 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 WlzMeshExpand ( WlzMeshTransform mesh,
int  nElem,
int  nNodes 
)

Expands a mesh to make sure that there are enough mesh elements and nodes available.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
nElemMinimum number of mesh elements required.
nNodesMinimum 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().

int WlzMeshElemNodeIdxFromVx ( WlzMeshTransform mesh,
WlzMeshElem elm,
WlzDVertex2  gVx 
)

Finds which of the given elements nodes are coincident with the given vertex.

Returns
Index to the node in the given element or -1 if the vertex is not a node of the given element or two nodes are coincident at the given vertex.
Parameters
meshMesh transform.
elmMesh element.
gVxGiven 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.

Returns
Index to the node in the given element or -1 if the vertex is not a node of the given element or two nodes are coincident at the given vertex.
Parameters
nodesMesh ear/element nodes.
mNodIdGiven 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.

Returns
Index to the neighbour of the given element which would (if exists) share given nodes, or -1 if both nodes not shared with the element.
Parameters
elmMesh element.
nodId0First node.
nodId1Second 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.

Returns
Element index, negative if not found.
Parameters
meshGiven mesh transform.
gvnVxGiven vertex.
startElmIf >= 0, the index of the element from which to start the search.
lastElmDestination ptr for index of the last element visited. May be NULL.
existsFlgDestination ptr for vertex already exists flag. May be NULL.
dstErrDestination 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 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.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
startElmIf >= 0, the index of the element from which to start the search.
newVxNew node vertex.
nodeFlagsNode 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.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
startElmIf >= 0, the index of the element from which to start the search an element using the node.
nodIdPVector of node indicies.
nNodNumber 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.

Returns
void
Parameters
elmVecElement vector.
nodVecNode vector.
earListEar 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.

Returns
void
Parameters
elmVecElement vector.
nodVecNode vector.
earListEar list.

References AlcFree(), _WlzMeshEarList::maxEars, _WlzMeshEarList::pool, _WlzMeshIntVec::size, and _WlzMeshIntVec::vector.

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.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
gVxGiven vertex.
elmIdSource and destination element index pointer.
foundFlgDestination pointer for element found flag.
existsFlgDestination 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.

Returns
Woolz error code.
Parameters
eCnfQVecThe mesh element que to build.
meshGiven mesh transform.
srcElmIdIndex of element which contains the vertex.
elmIdIndex of element to test and possibly add to the queue.
newVxNew 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.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
eCnfQThe mesh element que to build.
qCntNumber of elements in queue.
newVxNew node vertex.
nodeFlagsNode 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.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
eIdIndex of the element containing the new node vertex.
newVxNew node vertex.
nodeFlagsNode 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.

Returns
void
Parameters
meshGiven mesh transform.
eId0Index of the element to be replaced in the mesh.
eId1Index 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.

Returns
void
Parameters
meshGiven mesh transform.
eIdIndex of the element containing the new node vertex.
nod0Which of the existing elements nodes is shared between the two new elements.
newVxNew node vertex.
nodeFlagsNode 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.

Returns
void
Parameters
meshGiven mesh transform.
eIdIndex of the element containing the new node vertex.
newVxNew node vertex.
nodeFlagsNode 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.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
zElmIdVecThe vector (queue) of zombie mesh elements to replace.
zElmCntNumber of zombie elements.
newVxNew node vertex.
nodeFlagsNode 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.

Returns
Woolz error code.
Parameters
elmVecMesh element vector to build.
nodVecMesh node vector to build.
meshGiven mesh transform.
dElmIdIndex of an element known to use the given node.
dElmNodIdIndex 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.

Returns
Woolz error code.
Parameters
earListGiven ear list for recycling.
maxEarsMaximum 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.

Returns
void
Parameters
meshGiven mesh transform.
earGiven mesh ear.
delNodIdId 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.

Returns
Woolz error code.
Parameters
earListGiven ear list for recycling.
elmVecVector of mesh elements which runs CCW around the node to be deleted.
nodVecVector of mesh nodes which runs CCW around the enclosing polygon of the node to be deleted.
meshGiven mesh transform.
delNodIdIndex 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.

Returns
void
Parameters
meshGiven mesh transform.
earEar (with nodes already set).
elmVecElement vector.
elmVecIdPUsed 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.

Returns
Woolz error code.
Parameters
meshGiven mesh transform.
dstNNodDestination pointer for the number of mesh nodes.
dstNodDestination pointer for the mesh nodes.
dstNDspDestination pointer for the number of mesh node displacements.
dstDspDestination pointer for the mesh node displacement.
dstNEdgDestination pointer for the number of edge indices.
dstEdgDestination 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.

Returns
Maximum squared edge length, >= 0.0.
Parameters
meshGiven mesh.
dstErrDestination 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.

Returns
Index of the closest node in the mesh to the given position or -1 if the mesh has no nodes.
Parameters
meshGiven mesh.
posThe 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.

Returns
New domain object.
Parameters
gvnObjGiven 3D domain to be projected onto a section the section
nMaskNumber of mask domain objects.
maskObjMask domain objects and mask objects that are NULL are assumed to represent the universal domain.
prjViewProjection view.
nPlnTrNumber of in section transforms, must be equal to the number of mask domains.
plnTrObjWithin-plane transforms any within-plane transforms that are NULL are assumed to represent an identity transform.
secViewThe section view transform.
dstErrDestination 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.

Returns
Affine transform which brings the two objects into register.
Parameters
tObjThe target object.
sObjThe source object to be registered with target object.
initTrInitial affine transform to be applied to the source object prior to using the ICP algorithm. May be NULL.
trTypeRequired transform type.
ctrLoLow threshold contour gradient value.
ctrHiHigh threshold contour gradient value.
ctrWthContour filter width.
dstConvDestination ptr for the convergence flag (non zero on convergence), may be NULL.
dstItrDestination ptr for the number of iterations, may be NULL.
maxItrMaximum number of iterations, if <= 0 then infinite iterations are allowed.
deltaTolerance for mean value of registration metric.
minDistWgtMinimum distance weighting.
dstErrDestination 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.

Returns
Affine transform which brings the two objects into register.
Parameters
tObjThe target object.
sObjThe source object to be registered with target object.
initTrInitial affine transform to be applied to the source object prior to using the ICP algorithm. May be NULL.
trTypeRequired transform type.
dstConvDestination ptr for the convergence flag (non zero on convergence), may be NULL.
dstItrDestination ptr for the number of iterations, may be NULL.
maxItrMaximum number of iterations, if <= 0 then infinite iterations are allowed.
deltaTolerance for mean value of registration metric.
minDistWgtMinimum distance weighting.
dstErrDestination 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.

Returns
3D Woolz domain object.
Parameters
tObj2D target object.
sObj2D source object to be registered with target object.
initTrInitial affine transform to be applied to the source object prior to using the ICP algorithm. May be NULL.
xMinMinimum column translation.
xMaxMaximum column translation.
xStepIncrement for column translation.
yMinMinimum line translation.
yMaxMaximum line translation.
yStepIncrement for line translation.
rMinMinimum rotation (radians).
rMaxMaximum rotation (radians).
rStepIncrement for rotation (radians).
minDistWgtMinimum distance weighting.
dstErrDestination 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.

Returns
Affine transform which brings the two sets of vertices into register.
Parameters
tVxTarget vertices.
tNrTarget normals, may be NULL.
tCntNumber of target vertices.
sVxSource vertices.
sNrSource normals, may be NULL.
sCntNumber of source vertices.
vTypeType of the vertices.
sgnNrmNon zero if the normals have reliably signed components.
initTrInitial affine transform to be applied to the source object prior to using the ICP algorithm. May be NULL.
trTypeRequired transform type.
dstConvDestination ptr for the convergence flag (non zero on convergence), may be NULL.
dstItrDestination ptr for the number of iterations, may be NULL.
maxItrMaximum number of iterations, if <= 0 then infinite iterations are allowed.
deltaTolerance for mean value of registration metric.
minDistWgtMinimum distance weighting.
dstErrDestination 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.

Returns
3D Woolz domain object.
Parameters
tVxTarget vertices.
tNrTarget normals, may be NULL.
tCntNumber of target vertices.
sVxSource vertices.
sNrSource normals, may be NULL.
sCntNumber of source vertices.
vTypeType of the vertices.
sgnNrmNon zero if the normals have reliably signed components.
initTrInitial affine transform to be applied to the source object prior to using the ICP algorithm. May be NULL.
xMinMinimum column translation.
xMaxMaximum column translation.
xStepIncrement for column translation.
yMinMinimum line translation.
yMaxMaximum line translation.
yStepIncrement for line translation.
rMinMinimum rotation (radians).
rMaxMaximum rotation (radians).
rStepIncrement for rotation (radians).
minDistWgtMinimum distance weighting.
dstErrDestination 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.

Returns
Affine transform found.
Parameters
treeGiven 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.
trTypeThe required type of transform, must be either WLZ_TRANSFORM_2D_REG, or WLZ_TRANSFORM_2D_AFFINE.
vTypeVertex type.
sgnNrmNon zero if sign of normal components is meaningful.
nTNumber of target vertices.
tVxThe target vertices.
tNrThe target normals.
nSNumber of source vertices.
sIdxIndicies of the source vertices/normals.
sVxThe source vertices.
sNrThe source normals.
tVxBufA buffer with room for at least nS vertices.
sVxBufA buffer with room for at least nS vertices.
wgtBufA buffer with room for at least nS doubles.
maxItrMaximum number of iterations.
initTrInitial affine transform.
dstConvDestination pointer for a convergence flag which is set to a non zero value if the registration converges.
usrWgtFnUser supplied weight function, may be NULL.
usrWgtDataUser supplied weight data, may be NULL.
deltaTolerance for mean value of registration metric.
minDistWgtMinimum distance weighting.
dstErrDestination 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.

Returns
New sampled object.
Parameters
srcObjGiven source object.
samFacSampling factor for both rows and columns. Every pixel == 1, every other pixel == 2, ....
samFnSampling method.
dstErrDestination 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* 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.

Returns
New sampled object.
Parameters
srcObjGiven source object.
samFacSampling factor for both rows and columns. Every pixel == 1, every other pixel == 2, ....
dstErrDestination 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.

Returns
Shifted object.
Parameters
inObjThe given object.
xShiftColumn shift.
yShiftLine shift.
zShiftPlane shift (only used for 3D objects).
dstErrDestination 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.

Returns
Shifted domain, NULL on error.
Parameters
inObjTypeType of given domain's parent object.
inDomDomain to be shifted.
xShiftColumn shift.
yShiftLine shift.
zShiftPlane shift (only used for 3D objects).
dstErrDestination 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.

Returns
Shifted values, NULL on error.
Parameters
inObjTypeType of given domain's parent object.
inValValues to be shifted.
inDomDomain over which values are defined (parent object's domain).
xShiftColumn shift.
yShiftLine shift.
zShiftPlane shift (only used for 3D objects).
dstErrDestination 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.

Returns
Woolz error code.
    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\)
  1. For each source vertex find the closest target vertex and add those source vertices for which \(|\mathbf{v_{ti}} - \mathbf{v_{si}}| \leq d_c\) to a list of correspondences.
  2. Reject all correspondences for which \(|\mathbf{v_i} - \mathbf{v_j}| < d_s \forall i,j\), where \(\mathbf{v_i}\) and \(\mathbf{v_j}\) are the corresponding source vertices, keeping those with the minimum target-source separation by preference.
Parameters
tObjTarget object.
sObjSource object.
trInitial affine transform for source object.
vTypeType of vertices returned, which is always either WLZ_VERTEX_D2 or WLZ_VERTEX_D3.
dstNVtxDestination pointer for the number of target vertces.
dstTVtxPDestination pointer for the target vertces.
dstSVtxPDestination pointer for the target vertces.
maxCDistMaximum distance between target and source vertex pairs \(d_c\).
minTDistMinimum distance between target vertces, \(d_t\).
minSDistMinimum 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.

Returns
New empty transform or NULL on error.
Parameters
dstErrDestination 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.

Returns
New empty transform or NULL on error.
Parameters
trGiven 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().

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.

Returns
New transform with type that depends on given transform types or transform with NULL core pointer on error.
Parameters
tr0First transform ( \(\mathbf{T_0}\)).
tr1Second transform ( \(\mathbf{T_1}\)).
dstErrDestination 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.

Returns
Transposed object, NULL on error.
Source:
WlzTransposeObj.c
Parameters
objInput object
dstErrError 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.

Returns
New transform, NULL on error.
Parameters
nVtxNumber of source-target vertex pairs.
tTypeTarget vertex type.
tVtxTarget vertices.
sTypeSource vertex type.
sVtxSource vertices.
minPairMinimum number of vertex pairs for the given transform function.
fitFnFunction used to fit transformation from source vertices to target vertices.
errFnError function used to compute the error between correspondence and model.
degFnDegenerate model transform checking function. between correspondence and model.
oTolProbability that no samples are inliers.
eTolCorrespondences within this error distance are classed as inliers.
pTolPruning tollerance, if pTol < eTol then pruning is done.
dMaxMaximum number of attempts to find a nondegenerate set, if zero default of TODO is used.
iMaxMaximum number of iterations, if zero default of TODO is used.
rMaxMaximum number of resamplings, if zero default of TODO is used.
iMinMinimum number of inliers before optimisation is done.
cDataClient data passed to the transform and error functions.
dstNInDestination pointer for the number of inliers found.
dstInDestination pointer for indices to the inliers in the given arrays.
dstErrDestination 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().