Woolz Image Processing  Version 1.8.3
WlzCMeshUtils.c File Reference

Utility functions for 2D and 3D graph based conforming simplical meshes. More...

Functions

double WlzCMeshElmMaxSqEdgLen2D (WlzCMeshElm2D *elm)
 Computes the mesh maximum edge length of the given element. More...
 
double WlzCMeshElmMaxSqEdgLen2D5 (WlzCMeshElm2D5 *elm)
 Computes the mesh maximum edge length of the given element. More...
 
double WlzCMeshElmMaxSqEdgLen3D (WlzCMeshElm3D *elm)
 Computes the mesh maximum edge length of the given element. More...
 
void WlzCMeshUpdateMaxSqEdgLen2D (WlzCMesh2D *mesh)
 Computes the mesh maximum edge length which is used to terminate vertex location. This should not be allowed to become less than the actual maximum edge length or vertex location may fail, also if it is far larger than the actual maximum edge length then vertex location will be inefficient when vertices are outside the mesh. More...
 
void WlzCMeshUpdateMaxSqEdgLen2D5 (WlzCMesh2D5 *mesh)
 Computes the mesh maximum edge length which is used to terminate vertex location. This should not be allowed to become less than the actual maximum edge length or vertex location may fail, also if it is far larger than the actual maximum edge length then vertex location will be inefficient when vertices are outside the mesh. More...
 
void WlzCMeshUpdateMaxSqEdgLen3D (WlzCMesh3D *mesh)
 Computes the mesh maximum edge length which is used to terminate vertex location. This should not be allowed to become less than the actual maximum edge length or vertex location may fail, also if it is far larger than the actual maximum edge length then vertex location will be inefficient when vertices are outside the mesh. More...
 
void WlzCMeshUpdateBBox2D (WlzCMesh2D *mesh)
 Updates the bounding box of the 2D conforming mesh. More...
 
void WlzCMeshUpdateBBox2D5 (WlzCMesh2D5 *mesh)
 Updates the bounding box of the 2D5 conforming mesh. More...
 
void WlzCMeshUpdateBBox3D (WlzCMesh3D *mesh)
 Updates the bounding box of the 3D conforming mesh. More...
 
void WlzCMeshSetNodFlags (WlzCMeshP mesh, unsigned int flags)
 Sets the node flags for all valid nodes of the mesh. More...
 
void WlzCMeshSetNodFlags2D (WlzCMesh2D *mesh, unsigned int flags)
 Sets node flags for all valid nodes of the 2D mesh. More...
 
void WlzCMeshSetNodFlags3D (WlzCMesh3D *mesh, unsigned int flags)
 Sets node flags for all valid nodes of the 3D mesh. More...
 
void WlzCMeshClearNodFlags (WlzCMeshP mesh, unsigned int flags)
 Clears the node flags for all valid nodes of the mesh. More...
 
void WlzCMeshClearNodFlags2D (WlzCMesh2D *mesh, unsigned int flags)
 Clears node flags for all valid nodes of the 2D mesh. More...
 
void WlzCMeshClearNodFlags3D (WlzCMesh3D *mesh, unsigned int flags)
 Clears node flags for all valid nodes of the 3D mesh. More...
 
void WlzCMeshClearElmFlags (WlzCMeshP mesh, unsigned int flags)
 Clears the element flags for all valid elements of the mesh. More...
 
void WlzCMeshClearElmFlags2D (WlzCMesh2D *mesh, unsigned int flags)
 Clears element flags for all valid elements of the 2D mesh. More...
 
void WlzCMeshClearElmFlags3D (WlzCMesh3D *mesh, unsigned int flags)
 Clears element flags for all valid elements of the 3D mesh. More...
 
int WlzCMeshSetBoundNodFlags (WlzCMeshP mesh)
 Sets or clears the boundary node flag bit for all nodes of the mesh. More...
 
int WlzCMeshSetBoundNodFlags2D (WlzCMesh2D *mesh)
 Sets or clears the boundary node flag bit for all nodes of the 2D mesh. More...
 
int WlzCMeshSetBoundNodFlags2D5 (WlzCMesh2D5 *mesh)
 Sets or clears the boundary node flag bit for all nodes of the 2D5 mesh. More...
 
int WlzCMeshSetBoundNodFlags3D (WlzCMesh3D *mesh)
 Sets or clears the boundary node flag bit for all nodes of the 3D mesh. More...
 
WlzErrorNum WlzCMeshGetBoundNodes (WlzCMeshP mesh, int *dstNNod, int **dstNod)
 Gets the indeces of the boundary nodes of the mesh. The boundary nodes will be unordered. More...
 
WlzErrorNum WlzCMeshGetBoundNodes2D (WlzCMesh2D *mesh, int *dstNNod, int **dstNod)
 Gets the indeces of the boundary nodes of the 2D mesh. More...
 
WlzErrorNum WlzCMeshGetBoundNodes2D5 (WlzCMesh2D5 *mesh, int *dstNNod, int **dstNod, int ordered)
 Gets the indices of the boundary nodes of the 2D5 mesh. More...
 
WlzErrorNum WlzCMeshGetBoundNodes3D (WlzCMesh3D *mesh, int *dstNNod, int **dstNod)
 Gets the indeces of the boundary nodes of the 3D mesh. More...
 
int WlzCMeshCountBoundNodes (WlzCMeshP mesh)
 Counts the number of boundary nodes of the mesh. More...
 
int WlzCMeshCountBoundNodes2D (WlzCMesh2D *mesh)
 Counts the number of boundary nodes of the 2D mesh. More...
 
int WlzCMeshCountBoundNodes2D5 (WlzCMesh2D5 *mesh)
 Counts the number of boundary nodes of the 2D5 mesh. More...
 
int WlzCMeshCountBoundNodes3D (WlzCMesh3D *mesh)
 Counts the number of boundary nodes of the 3D mesh. More...
 
int WlzCMeshSetBoundElmFlags (WlzCMeshP mesh)
 Sets or clears the boundary element flag bit for all elements of the mesh. More...
 
int WlzCMeshSetBoundElmFlags2D (WlzCMesh2D *mesh)
 Sets or clears the boundary element flag bit for all elements of the 2D mesh. More...
 
int WlzCMeshSetBoundElmFlags3D (WlzCMesh3D *mesh)
 Sets or clears the boundary element flag bit for all elements of the 3D mesh. More...
 
int WlzCMeshNodIsBoundary2D (WlzCMeshNod2D *nod)
 Checks whether the node is a boundary node by examining the edges which use the node. If one of these edges does not have an opposite edge (other than itself) the node is a boundary node. More...
 
int WlzCMeshNodIsBoundary2D5 (WlzCMeshNod2D5 *nod)
 Checks whether the node is a boundary node by examining the edges which use the node. If one of these edges does not have an opposite edge (other than itself) the node is a boundary node. More...
 
int WlzCMeshNodIsBoundary3D (WlzCMeshNod3D *nod)
 Checks whether the node is a boundary node by examining the faces which use the node. If one of these faces does not have an opposite face (other than itself) the node is a boundary node. More...
 
int WlzCMeshElmIsBoundary2D (WlzCMeshElm2D *elm)
 Checks whether the element is a boundary node by examining the edges for opposite edges. More...
 
int WlzCMeshElmIsBoundary3D (WlzCMeshElm3D *elm)
 Checks whether the element is a boundary node by examining the faces for opposite faces. More...
 
WlzErrorNum WlzCMeshLaplacianSmooth (WlzCMeshP mesh, int itr, double alpha, int doBnd, int update)
 Applies a Laplacian smoothing to the 2D mesh in which nodes are iteratively moved to the centroid of their imediate neighbours. If a node is on a boundary of the mesh then it is moved on the boundary, ie to the centroid of it's neighboring boundary nodes. Before calling this function all nodes must have had the boundary node flag bit set or cleared appropriately. This function will shrink meshes when the boundary parameter is set. More...
 
WlzErrorNum WlzCMeshLaplacianSmooth2D (WlzCMesh2D *mesh, int itr, double alpha, int doBnd, int update)
 Applies a Laplacian smoothing to the 2D mesh in which nodes are iteratively moved to the centroid of their imediate neighbours. See WlzCMeshLaplacianSmooth(). More...
 
WlzErrorNum WlzCMeshLaplacianSmooth3D (WlzCMesh3D *mesh, int itr, double alpha, int doBnd, int update)
 Applies a Laplacian smoothing to the 3D mesh in which nodes are iteratively moved to the centroid of their imediate neighbours. See WlzCMeshLaplacianSmooth(). More...
 
WlzErrorNum WlzCMeshLPFilter (WlzCMeshP mesh, double kPB, double kSB, double dPB, double dSB, int maxItr, int doBnd, int update)
 Applies a low pass filter to the mesh in which nodes are moved. If a node is on a boundary of the mesh then it is moved on the boundary. Before calling this function all nodes must have had the boundary node flag bit set or cleared appropriately. This function should not significantly shrink meshes because it applies a low pass filter. More...
 
WlzErrorNum WlzCMeshLPFilterLM (WlzCMeshP mesh, double lambda, double mu, int nItr, int doBnd, int update)
 Applies a low pass filter to the geometry of the given mesh. See WlzGMFilterGeomLPLM(). This will change the boundary node/element flags. More...
 
WlzErrorNum WlzCMeshSetVertices (WlzCMeshP mesh, WlzVertexP vtxBuf, int update)
 Sets the position of all valid nodes in the mesh. The mesh will still need to have it's bounding box, maximum edge length and grid box set after this function has repositioned the nodes. Vertex type must be correct for mesh type, ie WlzDVertex2 for WlzCMesh2D and WlzDVertex3 for WlzCMesh3D. More...
 
void WlzCMeshSetVertices2D (WlzCMesh2D *mesh, WlzDVertex2 *vtxBuf, int update)
 Sets the position of all valid nodes in the mesh. The mesh will still need to have it's bounding box, maximum edge length and grid box set after this function has repositioned the nodes. The parameters are assumed vaild. More...
 
void WlzCMeshSetVertices3D (WlzCMesh3D *mesh, WlzDVertex3 *vtxBuf, int update)
 Sets the position of all valid nodes in the mesh. The mesh will still need to have it's bounding box, maximum edge length and grid box set after this function has repositioned the nodes. The parameters are assumed vaild. More...
 
WlzErrorNum WlzCMeshVerify (WlzCMeshP mesh, void **dstElm, int allErr, FILE *fP)
 Checks that the 2D or 3D mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults. More...
 
WlzErrorNum WlzCMeshVerify2D (WlzCMesh2D *mesh, WlzCMeshElm2D **dstElm, int allErr, FILE *fP)
 Checks that the 2D mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults. More...
 
WlzErrorNum WlzCMeshVerify2D5 (WlzCMesh2D5 *mesh, WlzCMeshElm2D5 **dstElm, int allErr, FILE *fP)
 Checks that the 2D5 mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults. More...
 
WlzErrorNum WlzCMeshVerify3D (WlzCMesh3D *mesh, WlzCMeshElm3D **dstElm, int allErr, FILE *fP)
 Checks that the 3D mesh has valid connectivities. This function is slow and should only be used when debugging mesh connectivities - it is not intended for routine use. With an invalid mesh this checking function may provoke NULL pointer access or segmentation faults. More...
 
WlzErrorNum WlzCMeshCmpElmFeat (WlzCMeshP mesh, int *dstNElm, int **dstIdx, double **dstVol, double **dstMinLen, double **dstMaxLen)
 Computes some simple geometric features of all valid elements in a mesh. More...
 
WlzErrorNum WlzCMeshCmpElmFeat2D (WlzCMesh2D *mesh, int *dstNElm, int **dstIdx, double **dstVol, double **dstMinLen, double **dstMaxLen)
 Computes some simple geometric features of all valid elements in a 2D mesh. More...
 
WlzErrorNum WlzCMeshCmpElmFeat3D (WlzCMesh3D *mesh, int *dstNElm, int **dstIdx, double **dstVol, double **dstMinLen, double **dstMaxLen)
 Computes some simple geometric features of all valid elements in a 3D mesh. More...
 
double WlzCMeshElmSnArea22D (WlzCMeshElm2D *elm)
 Computes twice the signed area of the 2D mesh element. More...
 
double WlzCMeshElmSqArea22D5 (WlzCMeshElm2D5 *elm)
 Computes twice the square of te area of the 2D5 mesh element. More...
 
double WlzCMeshElmSnVolume63D (WlzCMeshElm3D *elm)
 Computes six times the signed volume of the 3D mesh element. More...
 
void WlzCMeshElmGetNodes2D (WlzCMeshElm2D *elm, WlzCMeshNod2D **dstNod0, WlzCMeshNod2D **dstNod1, WlzCMeshNod2D **dstNod2)
 Gets the three nodes of a 2D element. More...
 
void WlzCMeshElmGetNodes2D5 (WlzCMeshElm2D5 *elm, WlzCMeshNod2D5 **dstNod0, WlzCMeshNod2D5 **dstNod1, WlzCMeshNod2D5 **dstNod2)
 Gets the three nodes of a 2D5 element. More...
 
void WlzCMeshElmGetNodes3D (WlzCMeshElm3D *elm, WlzCMeshNod3D **dstNod0, WlzCMeshNod3D **dstNod1, WlzCMeshNod3D **dstNod2, WlzCMeshNod3D **dstNod3)
 Gets the four nodes of a 3D element. More...
 
WlzDBox2 WlzCMeshElmBBox2D (WlzCMeshElm2D *elm)
 Gets the axis aligned bounding box of a 2D element. More...
 
WlzDBox3 WlzCMeshElmBBox2D5 (WlzCMeshElm2D5 *elm)
 Gets the axis aligned bounding box of a 3D element. More...
 
WlzDBox3 WlzCMeshElmBBox3D (WlzCMeshElm3D *elm)
 Gets the axis aligned bounding box of a 3D element. More...
 
int WlzCMeshElmUseNod3D (WlzCMeshNod3D *gNod, int *gMaxElm, int **gElmIdxAry, WlzErrorNum *dstErr)
 Finds the elements which use the given node and returns their indices in an array. The indices are unique and in acending order. The array will be resized as needed. More...
 
WlzCMeshP WlzCMeshCopy (WlzCMeshP gvnMesh, int squeeze, size_t datSz, AlcVector **newDat, AlcVector *gvnDat, WlzErrorNum *dstErr)
 Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored. More...
 
WlzCMesh2DWlzCMeshCopy2D (WlzCMesh2D *gvnMesh, int squeeze, size_t datSz, AlcVector **newDat, AlcVector *gvnDat, WlzErrorNum *dstErr)
 Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored. More...
 
WlzCMesh2D5WlzCMeshCopy2D5 (WlzCMesh2D5 *gvnMesh, int squeeze, size_t datSz, AlcVector **newDat, AlcVector *gvnDat, WlzErrorNum *dstErr)
 Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored. More...
 
WlzCMesh3DWlzCMeshCopy3D (WlzCMesh3D *gvnMesh, int squeeze, size_t datSz, AlcVector **newDat, AlcVector *gvnDat, WlzErrorNum *dstErr)
 Creates a copy of the given constrained mesh. If the squeeze flag is set then the copy will have all invalid (deleted) entities squeezed out so that the mew mesh will only have valid mesh entities that are contiguous and start with index 0. As well as copying the given mesh this function will also copy data associated with the nodes of the mesh. The associated data are held in AlcVector data structures and are indexed using the node index. If (datSz == 0) || (newDat == NULL) || (gvnDat == NULL) then the associated data will be ignored. More...
 
WlzErrorNum WlzCMeshFixNegativeElms (WlzCMeshP mesh)
 Reorders nodes in any elements which have negative area. More...
 
WlzErrorNum WlzCMeshFixNegativeElms2D (WlzCMesh2D *mesh)
 Reorders nodes in any elements which have negative area. More...
 
WlzErrorNum WlzCMeshFixNegativeElms3D (WlzCMesh3D *mesh)
 Reorders nodes in any elements which have negative area. More...
 
void WlzCMeshGetCellStats (WlzCMeshP mesh, int *dstMinNodPerCell, int *dstMaxNodPerCell, double *dstMeanNodPerCell, int *dstMinElmPerCell, int *dstMaxElmPerCell, double *dstMeanElmPerCell)
 Computes simple mesh node and element grid cell location statistics. This function is probably only useful for optimising the number of location cells allocated. More...
 
void WlzCMeshGetCellStats2D (WlzCMesh2D *mesh, int *dstMinNodPerCell, int *dstMaxNodPerCell, double *dstMeanNodPerCell, int *dstMinElmPerCell, int *dstMaxElmPerCell, double *dstMeanElmPerCell)
 Computes simple 2D mesh node and element grid cell location statistics. This function is probably only useful for optimising the number of location cells allocated. More...
 
void WlzCMeshGetCellStats3D (WlzCMesh3D *mesh, int *dstMinNodPerCell, int *dstMaxNodPerCell, double *dstMeanNodPerCell, int *dstMinElmPerCell, int *dstMaxElmPerCell, double *dstMeanElmPerCell)
 Computes simple 3D mesh node and element grid cell location statistics. This function is probably only useful for optimising the number of location cells allocated. More...
 
int * WlzCMeshMakeNodIdxTbl2D (WlzCMesh2D *mesh, int *dstNNod)
 Allocates and populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table is the maximum number of nodes allocated in the mesh. More...
 
int * WlzCMeshMakeNodIdxTbl2D5 (WlzCMesh2D5 *mesh, int *dstNNod)
 Allocates and populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table is the maximum number of nodes allocated in the mesh. More...
 
int * WlzCMeshMakeNodIdxTbl3D (WlzCMesh3D *mesh, int *dstNNod)
 Allocates and populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table is the maximum number of nodes allocated in the mesh. More...
 
int WlzCMeshSetNodIdxTbl2D (WlzCMesh2D *mesh, int *idxTb)
 Populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table must be at least the maximum number of nodes allocated in the mesh. More...
 
int WlzCMeshSetNodIdxTbl2D5 (WlzCMesh2D5 *mesh, int *idxTb)
 Populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table must be at least the maximum number of nodes allocated in the mesh. More...
 
int WlzCMeshSetNodIdxTbl3D (WlzCMesh3D *mesh, int *idxTb)
 Populates a node look up table which maps node indices to the range 0 - (n nodes - 1). The size of the look up table must be at least the maximum number of nodes allocated in the mesh. More...
 
int * WlzCMeshMakeElmIdxTbl2D (WlzCMesh2D *mesh, int *dstNElm)
 Allocates and populates an element look up table which maps element indices to the range 0 - (n elements - 1). The size of the look up table is the maximum number of elements allocated in the mesh. More...
 
int * WlzCMeshMakeElmIdxTbl2D5 (WlzCMesh2D5 *mesh, int *dstNElm)
 Allocates and populates an element look up table which maps element indices to the range 0 - (n elements - 1). The size of the look up table is the maximum number of elements allocated in the mesh. More...
 
int * WlzCMeshMakeElmIdxTbl3D (WlzCMesh3D *mesh, int *dstNElm)
 Allocates and populates an element look up table which maps element indices to the range 0 - (n elements - 1). The size of the look up table is the maximum number of elements allocated in the mesh. More...
 
int WlzCMeshSetElmIdxTbl2D (WlzCMesh2D *mesh, int *idxTb)
 Populates a element look up table which maps ellement indices to the range 0 - (n elements - 1). The size of the look up table must be at least the maximum number of elements allocated in the mesh. More...
 
int WlzCMeshSetElmIdxTbl2D5 (WlzCMesh2D5 *mesh, int *idxTb)
 Populates a element look up table which maps ellement indices to the range 0 - (n elements - 1). The size of the look up table must be at least the maximum number of elements allocated in the mesh. More...
 
int WlzCMeshSetElmIdxTbl3D (WlzCMesh3D *mesh, int *idxTb)
 Populates a element look up table which maps ellement indices to the range 0 - (n elements - 1). The size of the look up table must be at least the maximum number of elements allocated in the mesh. More...
 
int WlzCMeshNodNbrCnt2D5 (WlzCMeshNod2D5 *nod)
 Computes the number of nodes directly connected to the given node. More...
 
int WlzCMeshNodRingNodIndices2D (WlzCMeshNod2D *nod, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the nodes that form a ring or partial rings around the given node. Where members of the ring are the immediate neighbours of the given node. The given node's index will always be the first in the buffer but the remainder of the node indices may be unsorted. More...
 
int WlzCMeshNodRingNodIndices2D5 (WlzCMeshNod2D5 *nod, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the nodes that form a ring or partial rings around the given node. Where members of the ring are the immediate neighbours of the given node. The given node's index will always be the first in the buffer but the remainder of the node indices may be unsorted. More...
 
int WlzCMeshNodRingNodIndices3D (WlzCMeshNod3D *nod, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the nodes that form a ring or partial rings around the given node. Where members of the ring are the immediate neighbours of the given node. The given node's index will always be the first in the buffer but the remainder of the node indices may be unsorted. More...
 
int WlzCMeshNodRingElmIndices2D5 (WlzCMeshNod2D5 *nod, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the elements that form a ring or partial rings around the given node. Where members of the ring are immediate neighbours of the given node. The element indices may be unsorted. More...
 
int WlzCMeshElmRingNodIndices2D (WlzCMeshElm2D *elm, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the nodes that form a ring or partial rings around the given element. Where members of the ring are the nodes of the element followed by the immediate edge neighbours of these nodes. The node indices may be unsorted (apart from the element nodes being first and in edge use order) but they will not have duplicates. More...
 
int WlzCMeshElmRingElmIndices2D (WlzCMeshElm2D *elm, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the elements that form a ring around (ie are directly connected to) the given element. The element indices will be partially ordered with the given element's index first, followed by edge connected neighbouring elements and then the remaining node only connected elements. There will not be duplicates. More...
 
int WlzCMeshElmRingElmIndices3D (WlzCMeshElm3D *elm, int *maxIdxBuf, int **idxBuf, WlzErrorNum *dstErr)
 Gathers the indices of the elements that form a ring around (ie are directly connected to) the given element. The element indices will be partially ordered with the given element's index first, followed by face connected neighbouring elements and then the remaining node or edge only connected elements. There will not be duplicates. More...
 
WlzErrorNum WlzCMeshValuesNormalise (WlzObject *cObj, int mapZero, double vZero, double vMin, double vMax, double oFrac)
 Given a conforming mesh with attached values; this function normalises the values to the given range in place. If the zero value is not mapped to a given value explicitly then the the output values will be given using:

\[ V = \frac{U - L}{u - l} (v - l) + L \]

otherwise with the zero value explicitly mapped the values will be

\[ \begin{array}{l} f = \min{\frac{U - V_0}{u}, \frac{L - V_0}{l}} \\ V = f v + V_0 \end{array} \]

Here \(U\) and \(L\) are the required maximum and minimum values on return, \(u\) and \(l\) are the given mesh maximum and minimum values, \(v\) is a given value and \(V\) is a returned value. \(V_0\) is the returned value corresponding to the given value of zero. More...

 
WlzUByteWlzCMeshIndexMaskFromValueRange (WlzObject *obj, double lo, double hi, int in, WlzErrorNum *dstErr)
 Allocates and array of byte values and then sets these to non-zero values for the conforming mesh value indices where the values satisfy the given range test. If either the lower or upper limit is NaN then the test is simply for the conforming meshes values being NaN. More...
 

Detailed Description

Utility functions for 2D and 3D graph based conforming simplical meshes.

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

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

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

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