Woolz Image Processing
Version 1.7.5
|
Files | |
file | WlzClipObjToBox.c |
Functions for clipping the domain of either 2D or 3D domain objects so that they lie within the given axis aligned biunding box. | |
file | WlzDiffDomain.c |
Functions for computing the domain difference between objects. | |
file | WlzDiffDomain3d.c |
Functions for computing the domain difference between 3D objects. | |
file | WlzDomainFill.c |
Functions to fill holes in domain objects. | |
file | WlzDomainFill3D.c |
Functions to fill holes in 3D voxel domain objects. | |
file | WlzDomainUtils.c |
Utility functions for domains. | |
file | WlzDrawDomain.c |
Functions for composing a domain from simple drawing commands. | |
file | WlzEmpty.c |
Convenience functions to check empty status of objects. | |
file | WlzFillBlankPlanes.c |
Fills blank planes of a 3D object. Originally this was used by MAPaint to allow painting of intermediate planes. | |
file | WlzIntervalCount.c |
Counts the number of intervals (or equivalent) in an object's domain. | |
file | WlzIntervalDomScan.c |
Functions for scanning through an object's interval domain. | |
file | WlzIterate.c |
Functions for iteration through Woolz objects. | |
file | WlzLBTDomain.c |
Functions for creating and manipulating linear binary tree domains. | |
file | WlzSkeleton.c |
Performs a proper interval-domain skeletonisation Hilditch's method. | |
file | WlzVolume.c |
Computes the volume of domain objects. | |
file | WlzXOR.c |
Functions for computing the set exclusive or of objects. | |
Functions | |
WlzObject * | WlzClipObjToBox3D (WlzObject *srcObj, WlzIBox3 clipBox, WlzErrorNum *dstErrNum) |
Clips the given object's domain so that it does not lie outside the given 3D axis alaigned clip box. More... | |
WlzObject * | WlzDiffDomain (WlzObject *obj1, WlzObject *obj2, WlzErrorNum *dstErr) |
Calculates the domain difference between two objects. More... | |
WlzObject * | WlzDiffDomain3d (WlzObject *obj1, WlzObject *obj2, WlzErrorNum *dstErr) |
Calculates the domain difference between two 3D objects This function assumes that the object pointers have been checked to be non-NULL, non-empty, both 3D types and with non-NULL domains. This is the case if the function is accessed via WlzDiffDomain which is recommended. More... | |
WlzObject * | WlzDomainFill (WlzObject *obj, WlzErrorNum *dstErr) |
Fills holes in a Woolz domain object domain. The returned object will have a NULL valuetable. More... | |
WlzObject * | WlzDomainFill3D (WlzObject *srcObj, WlzErrorNum *dstErr) |
Fills the holes in the given object's domain (which are by definition not connected to the outside). When the given object's domain has more than one component part, the object should first be labeled, this function should then be called for each of the labeled parts and then the union of the filled domains should be formed. More... | |
WlzObjectType | WlzDomainType (WlzDomain dom) |
Gets the type of the given domain. More... | |
void | WlzBitLnSetItv (WlzUByte *bitLnP, int iLft, int iRgt, int size) |
Sets bits in the given byte packed bit line which are within the given interval. More... | |
WlzErrorNum | WlzDynItvLnFromBitLn (WlzIntervalDomain *iDom, WlzUByte *bitLn, int line, int width, WlzDynItvPool *iPool) |
Adds an interval line to a interval domain given an allocated interval domain a byte packed bitmask for the interval line and a pool of available intervals. More... | |
WlzErrorNum | WlzDynItvAdd (WlzIntervalDomain *iDom, WlzDynItvPool *iPool, int line, int iLft, int iLen) |
Adds an interval to a interval domain given an allocated interval domain, a pool of available intervals, the line, the intervals left most column and the intertvals width. More... | |
WlzErrorNum | WlzStandardIntervalDomain (WlzIntervalDomain *idom) |
Standardises an interval domain by ensuring that it has a minaimal bounding box, striping away empty lines as required. The domain is modified "in place". More... | |
WlzErrorNum | WlzStandardPlaneDomain (WlzPlaneDomain *pdom, WlzVoxelValues *voxtb) |
Standardizes a plane domain and corresponding voxel-table (voxel-tables must have exactly matching valuetables) by stripping leading and trailing NULL domains and standardising each domain in turn. The bounding box is reset to be minimal. Both the domain and values may be modified by this function. Any plane which has an invalid interval domain is discarded. More... | |
WlzObject * | WlzDrawDomainObj (WlzDVertex2 org, WlzThreeDViewStruct *view, int keep2D, char *cmdStr, int *dstErrIdx, WlzErrorNum *dstErr) |
Constructs a 3D spatial domain object (without values) by drawing on a section in 3D space, using commands in the given command string. More... | |
int | WlzIsEmpty (WlzObject *obj, WlzErrorNum *wlzErr) |
Convenience procedure to check if an object is empty. This include objects with zero area or volume. More... | |
WlzErrorNum | WlzFillBlankPlanes (WlzObject *obj, int min_domain) |
Fill in blank planes of a 3D object. More... | |
int | WlzIDomMaxItvLn (WlzIntervalDomain *iDom) |
Computes the maximum number of intervals on any line. More... | |
int | WlzIntervalCount (WlzIntervalDomain *idom, WlzErrorNum *dstErr) |
Count the number of intervals or equivalent if rectangular. More... | |
WlzLong | WlzIntervalCountObj (WlzObject *obj, WlzErrorNum *dstErr) |
Counts the number of intervals in an object, where the object type is WLZ_EMPTY_OBJ, WLZ_2D_DOMAINOBJ or WLZ_3D_DOMAINOBJ. Any other object type (including compound objects is an error). More... | |
WlzErrorNum | WlzInitRasterScan (WlzObject *obj, WlzIntervalWSpace *iwsp, WlzRasterDir raster) |
Initialise raster scanning. More... | |
WlzErrorNum | WlzNextInterval (WlzIntervalWSpace *iwsp) |
Get next interval in a standard object. More... | |
WlzErrorNum | WlzNextLine (WlzIntervalWSpace *iwsp, int step) |
Moving to the line which is step away from the present line (beware when both nextline() and nextinterval() are used since nextinterval() will locate the first interval in that line) More... | |
WlzErrorNum | WlzInitLineScan (WlzObject *obj, WlzIntervalWSpace *iwsp, WlzRasterDir raster, int scale, int firstline) |
Initialise line scanning, must be called before the first call of WlzNextLine(). More... | |
int | WlzIWSpIntersection (WlzInterval *dstItv, WlzIntervalWSpace *iWSp0, WlzIntervalWSpace *iWSp1, int *dstIsn) |
Classifies the possible intersections between the intervals of the two given interval workspaces. More... | |
WlzRasterDir | WlzRasterDir2D (WlzRasterDir dir) |
Masks a 2 or 3D raster direction so that it is valid for 2D. More... | |
WlzIterateWSpace * | WlzIterateInit (WlzObject *obj, WlzRasterDir dir, int grey, WlzErrorNum *dstErr) |
Creates a new domain object iteration workspace that may be used to iterate through either a 2 or 3D domain object. More... | |
void | WlzIterateWSpFree (WlzIterateWSpace *itWSp) |
Frees the given iteration workspace including it's interval and grey workspaces. The object and 2D object are freed if non NULL. More... | |
WlzErrorNum | WlzIterate (WlzIterateWSpace *itWSp) |
Iterates through an object for which the given workspace was initialised. This function will return WLZ_ERR_EOO when there are no more pixels/voxels remaining. More... | |
WlzDomain | WlzLBTDomainFromObj (WlzObject *obj, WlzErrorNum *dstErr) |
Creates a new 2D or 3D linear binary tree domain from the given object's domain. The given object must be either a 2D or 3D domain object. domain. More... | |
WlzLBTDomain2D * | WlzLBTDomain2DFromDomain (WlzDomain dom, WlzErrorNum *dstErr) |
Creates a new 2D linear binary tree domain from the given domain. More... | |
WlzLBTDomain3D * | WlzLBTDomain3DFromDomain (WlzDomain dom, WlzErrorNum *dstErr) |
Creates a new 2D linear binary tree domain from the given domain. More... | |
WlzIntervalDomain * | WlzLBTDomainToIDomain (WlzLBTDomain2D *lDom, WlzErrorNum *dstErr) |
Creates a new interval domain from the given 2D linear binary tree domain. More... | |
WlzPlaneDomain * | WlzLBTDomainToPDomain (WlzLBTDomain3D *lDom, WlzErrorNum *dstErr) |
Creates a new plane domain from the given 3D linear binary tree domain. More... | |
WlzIntervalDomain * | WlzIDomainFromPItv2D (int line1, int lastln, int kol1, int lastkl, int nPItv, WlzPartialItv2D *pItv, WlzErrorNum *dstErr) |
Allocates and computes an interval domain from the given table of partial intervals. The given partial intervals must fit within the given domain bounding box. More... | |
WlzPlaneDomain * | WlzPDomainFromPItv3D (int plane1, int lastpl, int line1, int lastln, int kol1, int lastkl, int nPItv, WlzPartialItv3D *pItv, WlzErrorNum *dstErr) |
Allocates and computes a plane domain from the given table of partial intervals. The given partial intervals must fit within the given domain bounding box. More... | |
WlzLBTDomain3D * | WlzLBTDomain3DFromPDomain (WlzPlaneDomain *pDom, WlzErrorNum *dstErr) |
Creates a new 3D linear binary tree domain from the given interval domain. More... | |
WlzLBTDomain2D * | WlzLBTDomain2DFromIDomain (WlzIntervalDomain *iDom, WlzErrorNum *dstErr) |
Creates a new 2D linear binary tree domain from the given interval domain. More... | |
WlzErrorNum | WlzLBTBalanceDomain2D (WlzLBTDomain2D *lDom, WlzObject *iObj, int maxSz, int maxBndSz) |
Balances the given LBT domain so that the neighbouring nodes of each node are either of the same size or differ in size by a ratio of 2:1. The function also enforces maximum node size for all nodes and boundary nodes. The neighbour finding algorithm used is quick and simple but it requires an object in which the values are set to the corresponding LBT domain indices. For efficiency an associated interval domain may be given, if the associated domain pointer is NULL then a domain will be computed. More... | |
WlzErrorNum | WlzLBTBalanceDomain3D (WlzLBTDomain3D *lDom, WlzObject *iObj, int maxSz, int maxBndSz) |
Balances the given LBT domain so that the neighbouring nodes of each node are either of the same size or differ in size by a ratio of 2:1. The function also enforces maximum node size for all nodes and boundary nodes. The neighbour finding algorithm used is quick and simple but it requires an object in which the values are set to the corresponding LBT domain indices. For efficiency an associated interval domain may be given, if the associated domain pointer is NULL then a domain will be computed. More... | |
WlzObject * | WlzLBTMakeNodeIndexObj2D (WlzLBTDomain2D *lDom, WlzIntervalDomain *iDom, WlzErrorNum *dstErr) |
Creates a new 2D domain object with integer values which are the indices of the nodes containing the pixels of the domain. More... | |
WlzObject * | WlzLBTMakeNodeIndexObj3D (WlzLBTDomain3D *lDom, WlzPlaneDomain *pDom, WlzErrorNum *dstErr) |
Creates a new 3D domain object with integer values which are the indices of the nodes containing the pixels of the domain. More... | |
WlzErrorNum | WlzLBTIndexObjSetAllNodes2D (WlzLBTDomain2D *lDom, WlzObject *iObj) |
Sets all index values in an existing 2D LBT node index object. More... | |
WlzErrorNum | WlzLBTIndexObjSetAllNodes3D (WlzLBTDomain3D *lDom, WlzObject *iObj) |
Sets all index values in an existing 3D LBT node index object. More... | |
void | WlzLBTClassifyNode2D (WlzLBTDomain2D *lDom, WlzGreyValueWSpace *iGVWSp, int idN, WlzLBTNodeClass2D *dstCls, int *dstRot) |
Classifies the given LBT node by it's connectivity and returns it's class and the counter-clockwise rotation of the basic class pattern in multiples of 90 degrees. More... | |
void | WlzLBTClassifyNodeFace3D (WlzLBTDomain3D *lDom, WlzGreyValueWSpace *iGVWSp, int idN, int idF, WlzDVertex3 *vtx, WlzLBTNodeClass2D *dstCls, int *dstRot) |
Classifies the given LBT node's face by it's connectivity and returns it's class and the counter-clockwise rotation of the basic class pattern, when viewed from outside of the node's cube looking at the face, in multiples of 90 degrees. This function uses the face index and orientation system defined in WlzCMeshFromBalLBTDom3D(). More... | |
int | WlzLBTCountNodNbrDir2D (WlzLBTDomain2D *lDom, WlzGreyValueWSpace *iGVWSp, int idN, WlzDirection dir) |
Counts the number of neighbours of the given node in the given direction. More... | |
int | WlzLBTNodeSz2D (WlzLBTNode2D *nod) |
Computes the size of a 2D linear binary tree node. More... | |
int | WlzLBTNodeLogSz2D (WlzLBTNode2D *nod) |
Computes the log (base 2) of the size of a 2D linear binary tree node. More... | |
int | WlzLBTNodeSz3D (WlzLBTNode3D *nod) |
Computes the size of a 3D linear binary tree node. More... | |
int | WlzLBTNodeLogSz3D (WlzLBTNode3D *nod) |
Computes the log (base 2) of the size of a 3D linear binary tree node. More... | |
void | WlzLBTPosToKey3D (WlzIVertex3 pos, unsigned *keys) |
Sets the value of the LBT key for the given position, where the position is relative to the first line and column of the domain. The key is encoded by interleaving the bits of the column coordinate, line coordinate, plane coordinate and term value in that order. The keys are ordered so that bit 0 is least significant. More... | |
void | WlzLBTPosToKey2D (WlzIVertex2 pos, unsigned *keys) |
Sets the value of the LBT key for the given position, where the position is relative to the first line and column of the domain. The key is encoded by interleaving the bits of the column coordinate, line coordinate and term value in that order. The keys are ordered so that bit 0 is least significant. More... | |
void | WlzLBTGetKeyDigits3D (unsigned *keys, WlzUByte *digits) |
Gets an array of WLZ_LBTDOMAIN_MAXDIGITS location digits from the given 3D keys. More... | |
void | WlzLBTGetKeyDigits2D (unsigned *keys, WlzUByte *digits) |
Gets an array of WLZ_LBTDOMAIN_MAXDIGITS location digits from the given 2D keys. More... | |
void | WlzLBTKeyToPos3I (unsigned *key, WlzIVertex3 *pos) |
Sets position (relative to the first line and column of the domain) which corresponds to the given 3D LBT key. More... | |
void | WlzLBTKeyToPos2I (unsigned *key, WlzIVertex2 *pos) |
Sets position (relative to the first line and column of the domain) which corresponds to the given 3D LBT key. More... | |
void | WlzLBTKeyToBox3I (unsigned *key, WlzIBox3 *box) |
Sets bounding box which corresponds to the given 3D LBT key. More... | |
void | WlzLBTKeyToBox2I (unsigned *key, WlzIBox2 *box) |
Sets bounding box which corresponds to the given 2D LBT key. More... | |
WlzErrorNum | WlzLBTTestOutputNodesTxt (FILE *fP, WlzDomain dom) |
Outputs the nodes of the LBT ask text for testing. More... | |
WlzErrorNum | WlzLBTTestOutputNodesVtk (FILE *fP, WlzDomain dom) |
Outputs the nodes of the LBT as VTK polydata for testing. More... | |
WlzObject * | WlzSkeleton (WlzObject *srcObj, int smoothpasses, WlzConnectType minCon, WlzErrorNum *dstErr) |
Computes the skeleton of the given object using Hilditch's method. See detail. More... | |
WlzLong | WlzVolume (WlzObject *obj, WlzErrorNum *wlzErr) |
Calculate the volume of the input 3D domain object. More... | |
WlzObject * | WlzXORDom (WlzObject *o0, WlzObject *o1, WlzErrorNum *dstErr) |
Calculates the domain exclusive or of the two given objects. The exclusive or object \(O_x\) is computed using \[ O_x = (O_0 - O_1) \cup (O_1 - O_0) \] where \(-\) and \(\cup\) are the set difference and union operators respectively. This seems to be slightly quicker than the alternative: \[ O_x = (O_0 \cup O_1) - (O_1 \cap O_0) \] . More... | |
WlzObject* WlzClipObjToBox3D | ( | WlzObject * | srcObj, |
WlzIBox3 | clipBox, | ||
WlzErrorNum * | dstErrNum | ||
) |
Clips the given object's domain so that it does not lie outside the given 3D axis alaigned clip box.
srcObj | Given source object. |
clipBox | Clip box. |
dstErrNum | Destination pointer for error, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzPlaneDomain::line1, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzCoreDomain::type, _WlzPlaneDomain::type, _WlzCoreValues::type, _WlzVoxelValues::type, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, _WlzPlaneDomain::voxel_size, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_2, WLZ_DBG_LVL_FN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_MAX, WLZ_MIN, WLZ_PLANEDOMAIN_DOMAIN, WlzAssignDomain(), WlzAssignValues(), WlzClipObjToBox2D(), WlzFreeObj(), WlzGetBackground(), WlzMakeEmpty(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakeVoxelValueTb(), WlzStandardPlaneDomain(), _WlzIBox2::xMax, _WlzIBox3::xMax, _WlzIBox2::xMin, _WlzIBox3::xMin, _WlzIBox2::yMax, _WlzIBox3::yMax, _WlzIBox2::yMin, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzDomainFill3D(), WlzSplitMontageObj(), and WlzSplitObj().
WlzObject* WlzDiffDomain | ( | WlzObject * | obj1, |
WlzObject * | obj2, | ||
WlzErrorNum * | dstErr | ||
) |
Calculates the domain difference between two objects.
obj1 | First object. |
obj2 | Second object. |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), AlcFree(), AlcFreeStackPush(), _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, _WlzValues::v, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, 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_INTERVALDOMAIN_INTVL, WLZ_RASTERDIR_ILIC, WlzDiffDomain3d(), WlzFreeIntervalDomain(), WlzFreeObj(), WlzInitRasterScan(), WlzIntervalCount(), WlzMakeEmpty(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzNextInterval(), and WlzStandardIntervalDomain().
Referenced by WlzBoundaryDomain(), WlzBoundToObj(), WlzContourRBFBndObj3D(), WlzDiffDomain3d(), WlzDistanceTransform(), WlzDrawDomainObj(), WlzEffWriteObjAm(), WlzPatchTreeToObject(), WlzPolyToObj(), WlzSkeleton3D(), WlzSplitMontageObj(), WlzVerticesFromObjBnd3I(), and WlzXORDom().
WlzObject* WlzDiffDomain3d | ( | WlzObject * | obj1, |
WlzObject * | obj2, | ||
WlzErrorNum * | dstErr | ||
) |
Calculates the domain difference between two 3D objects This function assumes that the object pointers have been checked to be non-NULL, non-empty, both 3D types and with non-NULL domains. This is the case if the function is accessed via WlzDiffDomain which is recommended.
obj1 | First object. |
obj2 | Second object. |
dstErr | Destination error pointer, may be NULL. |
References _WlzObject::assoc, _WlzVoxelValues::bckgrnd, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzVoxelValues::lastpl, _WlzPlaneDomain::line1, _WlzObject::linkcount, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzVoxelValues::plane1, _WlzObject::plist, _WlzObject::type, _WlzCoreDomain::type, _WlzPlaneDomain::type, _WlzVoxelValues::type, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, _WlzPlaneDomain::voxel_size, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WlzAssignDomain(), WlzAssignValues(), WlzCopyDomain(), WlzDiffDomain(), WlzFreeObj(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakeVoxelValueTb(), and WlzStandardPlaneDomain().
Referenced by WlzDiffDomain().
WlzObject* WlzDomainFill | ( | WlzObject * | obj, |
WlzErrorNum * | dstErr | ||
) |
Fills holes in a Woolz domain object domain. The returned object will have a NULL valuetable.
obj | Input domain object. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzBoundList::down, _WlzBoundList::next, _WlzValues::obj, _WlzObject::type, _WlzCoreDomain::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_DOMAIN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_INTERVALDOMAIN_INTVL, WLZ_INTERVALDOMAIN_RECT, WLZ_PLANEDOMAIN_DOMAIN, WLZ_SIMPLE_FILL, WLZ_TRANS_OBJ, WlzBoundToObj(), WlzDomainFill3D(), WlzFreeBoundList(), WlzFreeObj(), WlzMakeEmpty(), WlzMakeMain(), and WlzObjToBoundary().
Referenced by WlzRegConCalcRCC().
WlzObject* WlzDomainFill3D | ( | WlzObject * | srcObj, |
WlzErrorNum * | dstErr | ||
) |
Fills the holes in the given object's domain (which are by definition not connected to the outside). When the given object's domain has more than one component part, the object should first be labeled, this function should then be called for each of the labeled parts and then the union of the filled domains should be formed.
srcObj | Given 3D domain object. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), _WlzDomain::b, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzBoundList::down, _WlzGreyValueWSpace::gPtr, _WlzValues::i, _WlzDomain::i, _WlzPlaneDomain::lastpl, _WlzPolygonDomain::maxvertices, _WlzBoundList::next, _WlzPolygonDomain::nvertices, _WlzDomain::p, _WlzBoundList::poly, _WlzPixelV::type, _WlzObject::type, _WlzPolygonDomain::type, _WlzBoundList::type, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzBoundList::up, _WlzPixelV::v, _WlzVoxelValues::values, _WlzValues::vox, _WlzIVertex2::vtX, _WlzPolygonDomain::vtx, _WlzIVertex2::vtY, WLZ_26_CONNECTED, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_GREY_TAB_INTL, WLZ_GREY_UBYTE, WLZ_PLANEDOMAIN_DOMAIN, WLZ_SIMPLE_FILL, WLZ_THRESH_HIGH, WLZ_VOXELVALUETABLE_GREY, WlzAssignDomain(), WlzAssignObject(), WlzAssignValues(), WlzBoundaryDomain(), WlzBoundingBox3I(), WlzBoundToObj(), WlzClipObjToBox3D(), WlzFreeBoundList(), WlzFreeObj(), WlzFreePolyDmn(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzHasIntersection(), WlzInsideDomain2D(), WlzIntersect2(), WlzLabel(), WlzMakeBoundList(), WlzMakeIntervalValues(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakePolygonDomain(), WlzMakeVoxelValueTb(), WlzObjToBoundary(), WlzStandardPlaneDomain(), WlzThreshold(), WlzUnion2(), WlzUnionN(), WlzWriteObj(), _WlzBoundList::wrap, _WlzIBox3::xMax, _WlzIBox3::xMin, _WlzIBox3::yMax, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzDomainFill().
WlzObjectType WlzDomainType | ( | WlzDomain | dom | ) |
Gets the type of the given domain.
dom | Given domain. |
References _WlzDomain::core, _WlzCoreDomain::type, and WLZ_NULL.
void WlzBitLnSetItv | ( | WlzUByte * | bitLnP, |
int | iLft, | ||
int | iRgt, | ||
int | size | ||
) |
Sets bits in the given byte packed bit line which are within the given interval.
bitLnP | The bit line pointer. |
iLft | Left coordinate of interval. |
iRgt | Right coordinate of interval. |
size | Number of bits in the bit line. |
Referenced by WlzCMeshToDomObjValues(), WlzCMeshTransformManyObjAsIdx(), WlzContourFromPoints(), WlzContourGrdObj2D(), WlzRankFilter(), WlzRsvFilterBuffer(), and WlzToArray2D().
WlzErrorNum WlzDynItvLnFromBitLn | ( | WlzIntervalDomain * | iDom, |
WlzUByte * | bitLn, | ||
int | line, | ||
int | width, | ||
WlzDynItvPool * | iPool | ||
) |
Adds an interval line to a interval domain given an allocated interval domain a byte packed bitmask for the interval line and a pool of available intervals.
iDom | Given interval domain. |
bitLn | Byte packed bitmap for line. |
line | The line coordinate. |
width | Width of the line, ie number of valid bits in bitmask. |
iPool | Interval pool. |
References _WlzIntervalDomain::type, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WLZ_INTERVALDOMAIN_INTVL, and WlzDynItvAdd().
Referenced by WlzCMeshToDomObjValues(), WlzCMeshTransformManyObjAsIdx(), and WlzFromArray2D().
WlzErrorNum WlzDynItvAdd | ( | WlzIntervalDomain * | iDom, |
WlzDynItvPool * | iPool, | ||
int | line, | ||
int | iLft, | ||
int | iLen | ||
) |
Adds an interval to a interval domain given an allocated interval domain, a pool of available intervals, the line, the intervals left most column and the intertvals width.
iDom | Given interval domain. |
iPool | Interval pool. |
line | The line. |
iLft | Left most column of interval. |
iLen | Width of the interval. |
References ALC_ER_NONE, AlcFreeStackPush(), AlcMalloc(), _WlzIntervalDomain::freeptr, _WlzInterval::ileft, _WlzIntervalDomain::intvlines, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzDynItvPool::itvBlock, _WlzDynItvPool::itvsInBlock, _WlzIntervalDomain::lastln, _WlzIntervalDomain::line1, _WlzIntervalLine::nintvs, _WlzDynItvPool::offset, _WlzIntervalDomain::type, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, and WLZ_INTERVALDOMAIN_INTVL.
Referenced by WlzDynItvLnFromBitLn().
WlzErrorNum WlzStandardIntervalDomain | ( | WlzIntervalDomain * | idom | ) |
Standardises an interval domain by ensuring that it has a minaimal bounding box, striping away empty lines as required. The domain is modified "in place".
idom | The given interval domain. |
References _WlzInterval::ileft, _WlzIntervalDomain::intvlines, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzIntervalDomain::lastln, _WlzIntervalDomain::line1, _WlzIntervalLine::nintvs, _WlzIntervalDomain::type, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_INTERVALLINE_NULL, WLZ_ERR_NONE, and WLZ_INTERVALDOMAIN_INTVL.
Referenced by Wlz3DSectionSegmentObject(), WlzCMeshToDomObjValues(), WlzDiffDomain(), WlzFromArray2D(), WlzIntersectN(), WlzIntRescaleObj(), WlzMakeCircleObject(), WlzReadObj(), WlzRegisterPatchTreeDF(), WlzSampleObj(), WlzSampleObjPoint2D(), WlzStandardPlaneDomain(), WlzStructErosion(), and WlzThinToPoints().
WlzErrorNum WlzStandardPlaneDomain | ( | WlzPlaneDomain * | pdom, |
WlzVoxelValues * | voxtb | ||
) |
Standardizes a plane domain and corresponding voxel-table (voxel-tables must have exactly matching valuetables) by stripping leading and trailing NULL domains and standardising each domain in turn. The bounding box is reset to be minimal. Both the domain and values may be modified by this function. Any plane which has an invalid interval domain is discarded.
pdom | Given plane domain, must NOT be NULL.. |
voxtb | Corresponding voxel table, maybe NULL. |
References _WlzObject::assoc, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzDomain::i, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzVoxelValues::lastpl, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzPlaneDomain::plane1, _WlzVoxelValues::plane1, _WlzObject::plist, _WlzObject::type, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, WLZ_2D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_PLANEDOMAIN_DATA, WlzFreeIntervalDomain(), WlzFreeValueTb(), WlzIsEmpty(), and WlzStandardIntervalDomain().
Referenced by Wlz3DSectionSegmentObject(), WlzAffineTransformGMShell(), WlzCbThreshold(), WlzClipObjToBox3D(), WlzCMeshTransformManyObjAsIdx(), WlzConstruct3DObjFromFile(), WlzConstruct3DObjFromObj(), WlzCutObjToValBox3D(), WlzDiffDomain3d(), WlzDilation(), WlzDomainFill3D(), WlzErosion(), WlzFromArray3D(), WlzIntersect3d(), WlzLabel3D(), WlzMakeCuboidObject(), WlzMakeSphereObject(), WlzSampleObjPoint3D(), WlzStructDilation(), WlzStructErosion(), WlzThinToPoints(), WlzThreshold(), and WlzUnion3d().
WlzObject* WlzDrawDomainObj | ( | WlzDVertex2 | org, |
WlzThreeDViewStruct * | view, | ||
int | keep2D, | ||
char * | cmdStr, | ||
int * | dstErrIdx, | ||
WlzErrorNum * | dstErr | ||
) |
Constructs a 3D spatial domain object (without values) by drawing on a section in 3D space, using commands in the given command string.
The command string must have the following syntax:
<command string> = <init command>[<command>]+<end command> <init command> = <ident>:<version>; <end command> = END:; <ident> = WLZ_DRAW_DOMAIN <version> = 1 <command> = <command name>:[<parameter>[,<parameter>]*]; <command name> = PEN | LINE | CIRCLEIn addition to the init and end commands, the following drawing commands are recognised:
CIRCLE:<action>:<radius>,<x>,<y>; LINE:<action>:<width>,<x>,<y>,<x>,<y>; PEN:<action>,<width>,<x>,<y>[,<x>,<y>]*;Where
<action> = DRAW | ERASEA simple example is:
WLZ_DRAW_DOMAIN:1; CIRCLE:DRAW,100,200,200; LINE:ERASE,10,0,0,200,200; PEN,DRAW,4,0,0,200,0,200,200,0,200,0,0; END:;The circle command draws or erases a filled circle which is specified by it's radius and centre parameters. The line command draws a rectangle using the given width and end coordinates of the mid-line. The pen command draws a polyline which is composed of a series of rectangular segments, with each segment ending in a semi-circular cap. The parameters of the pen command are the width and line segment end point coordinates. All widths, radii and coordinates may be in any floating point format recognised by scanf().
Other commands may be present provided they have the same syntax described above, but they will be ignored. All white space characters are ignored. The drawn domain is offset by the given origin before being transformed to the section plane given by the view structure.
org | Origin of the 2D drawing frame with respect to the 2D Woolz object cut using the given view transform. |
view | The section plane in 3D space on which the domain is drawn. May be NULL, in which case the view transform is the default transform created by WlzMake3DViewStruct(). |
keep2D | Ignore the view struct and keep the object 2D if this flag is non-zero. |
cmdStr | String with drawing commands using the syntax described above. |
dstErrIdx | Used to return the index of the last character parsed in the command string. May be NULL. |
dstErr | Destination error pointer, may be NULL. |
References ALC_STRTOK_R, AlcFree(), AlcRealloc(), _WlzDrawDomWSp::buf, _WlzDrawDomWSp::bufMax, _WlzDrawDomWSp::cmdStr, _WlzDrawDomWSp::cmdStrIdx, _WlzDrawDomWSp::savPtr, _WlzThreeDViewStruct::view_mode, _WlzDVertex2::vtX, _WlzDVertex2::vtY, Wlz3DViewTransformObj(), WLZ_3D_VIEW_STRUCT, WLZ_DRAWDOM_ACT_DRAW, WLZ_DRAWDOM_ACT_ERASE, WLZ_DRAWDOM_ACT_NONE, WLZ_DRAWDOM_CMD_CIRCLE, WLZ_DRAWDOM_CMD_END, WLZ_DRAWDOM_CMD_ERROR, WLZ_DRAWDOM_CMD_INIT, WLZ_DRAWDOM_CMD_LINE, WLZ_DRAWDOM_CMD_PEN, WLZ_DRAWDOM_CMD_UNKNOWN, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_NULL, WLZ_NINT, WLZ_UP_IS_UP_MODE, WlzAssignObject(), WlzCopyObject(), WlzDiffDomain(), WlzFree3DViewStruct(), WlzFreeObj(), WlzGeomRectFromWideLine(), WlzInit3DViewStruct(), WlzMake3DViewStruct(), WlzMakeCircleObject(), WlzMakeEmpty(), WlzMakeQuadrilateral(), WlzShiftObject(), WlzStringMatchValue(), and WlzUnion2().
int WlzIsEmpty | ( | WlzObject * | obj, |
WlzErrorNum * | wlzErr | ||
) |
Convenience procedure to check if an object is empty. This include objects with zero area or volume.
obj | Input object |
wlzErr | Error return |
References _WlzObject::assoc, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzDomain::i, _WlzIntervalDomain::intvlines, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalDomain::line1, _WlzIntervalLine::nintvs, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::plist, _WlzObject::type, _WlzCoreDomain::type, _WlzIntervalDomain::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_INTERVALDOMAIN_INTVL, and WLZ_PLANEDOMAIN_DOMAIN.
Referenced by Wlz3DSectionOcc(), Wlz3DSectionSegmentObject(), WlzConComThreshold(), WlzDistanceTransform(), WlzEffWriteObjAm(), WlzGreyTransfer(), WlzHasIntersection(), WlzIndexObjToCompound(), WlzInteriority(), WlzIntersect3d(), WlzIntersectN(), WlzNObjGreyStats(), WlzPointsFromDomObj(), WlzProj3DToSection(), WlzRegConCalcRCC(), WlzRGBAMultiThreshold(), WlzStandardPlaneDomain(), and WlzUnionN().
WlzErrorNum WlzFillBlankPlanes | ( | WlzObject * | obj, |
int | min_domain | ||
) |
Fill in blank planes of a 3D object.
obj | Input 3D woolz domain object. |
min_domain | Minimum domain value. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzDomain::i, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::line1, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzIntervalDomain::type, _WlzPlaneDomain::type, _WlzCoreValues::type, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_GREY_TAB_RAGR, WLZ_INTERVALDOMAIN_RECT, WLZ_NULL, WLZ_PLANEDOMAIN_DOMAIN, WlzAssignDomain(), WlzAssignValues(), WlzFreeObj(), WlzGetBackground(), WlzGreyTableTypeToGreyType(), WlzGreyValueTableType(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzNewIDomain(), WlzNewValueTb(), and WlzUnion2().
int WlzIDomMaxItvLn | ( | WlzIntervalDomain * | iDom | ) |
Computes the maximum number of intervals on any line.
iDom | Given interval domain. |
References _WlzIntervalDomain::intvlines, _WlzIntervalDomain::lastln, _WlzIntervalDomain::line1, _WlzIntervalDomain::type, WLZ_INTERVALDOMAIN_INTVL, and WLZ_INTERVALDOMAIN_RECT.
Referenced by WlzDilation(), WlzErosion(), WlzErosion4(), WlzStructDilation(), and WlzStructErosion().
int WlzIntervalCount | ( | WlzIntervalDomain * | idom, |
WlzErrorNum * | dstErr | ||
) |
Count the number of intervals or equivalent if rectangular.
WLZ_INTERVALDOMAIN_INTVL
else the number of lines. idom | Input domain. |
dstErr | Destination error pointer, may be NULL. |
References _WlzIntervalDomain::intvlines, _WlzIntervalDomain::lastln, _WlzIntervalDomain::line1, _WlzIntervalDomain::type, WLZ_ERR_INTERVALDOMAIN_NULL, WLZ_ERR_INTERVALDOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_UNSPECIFIED, WLZ_INTERVALDOMAIN_INTVL, and WLZ_INTERVALDOMAIN_RECT.
Referenced by Wlz3DSectionSegmentObject(), Wlz3DViewTransformObj(), WlzDiffDomain(), WlzDilation(), WlzErosion(), WlzErosion4(), WlzIntersectN(), WlzIntervalCountObj(), WlzIntRescaleObj(), WlzMakeIntervalValues(), WlzObjectFacts(), WlzObjToBoundary(), WlzSkeleton3D(), WlzStructDilation(), WlzStructErosion(), and WlzUnionN().
WlzLong WlzIntervalCountObj | ( | WlzObject * | obj, |
WlzErrorNum * | dstErr | ||
) |
Counts the number of intervals in an object, where the object type is WLZ_EMPTY_OBJ, WLZ_2D_DOMAINOBJ or WLZ_3D_DOMAINOBJ. Any other object type (including compound objects is an error).
obj | Given object. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzDomain::i, _WlzPlaneDomain::lastpl, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, and WlzIntervalCount().
WlzErrorNum WlzInitRasterScan | ( | WlzObject * | obj, |
WlzIntervalWSpace * | iwsp, | ||
WlzRasterDir | raster | ||
) |
Initialise raster scanning.
obj | Input object too be scanned. |
iwsp | Interval scan workspace. |
raster | Scanning direction. |
References _WlzIntervalWSpace::colraster, _WlzIntervalWSpace::colrmn, _WlzDomain::core, _WlzIntervalWSpace::dmntype, _WlzObject::domain, _WlzDomain::i, _WlzIntervalWSpace::intdmn, _WlzIntervalWSpace::intrmn, _WlzIntervalDomain::intvlines, _WlzIntervalWSpace::intvln, _WlzIntervalDomain::lastln, _WlzIntervalWSpace::linbot, _WlzIntervalDomain::line1, _WlzIntervalWSpace::lineraster, _WlzIntervalWSpace::linpos, _WlzIntervalWSpace::linrmn, _WlzIntervalWSpace::objaddr, _WlzObject::type, _WlzIntervalDomain::type, WLZ_2D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_NULL, WLZ_ERR_RASTERDIR_TYPE, WLZ_INTERVALDOMAIN_INTVL, WLZ_INTERVALDOMAIN_RECT, WLZ_RASTERDIR_DLDC, WLZ_RASTERDIR_DLIC, WLZ_RASTERDIR_ILDC, and WLZ_RASTERDIR_ILIC.
Referenced by Wlz3DSectionSegmentObject(), Wlz3DViewTransformObj(), WlzArea(), WlzCCorS2D(), WlzCentrality(), WlzCentreOfMassVtx3D(), WlzConComThreshold(), WlzCopyObjectGreyValues(), WlzCutObjToValBox2D(), WlzDGTensorSDFeature(), WlzDiffDomain(), WlzGreySetHilbertRankValues(), WlzHasIntersection(), WlzImageBlendObjToBufRGBA(), WlzInitGreyRasterScan(), WlzIntersectN(), WlzIterate(), WlzLabel(), WlzLBTDomain2DFromIDomain(), WlzLBTDomain3DFromPDomain(), WlzLineArea(), WlzMakeIntervalValues(), WlzMeshFromObjBox(), WlzMeshIDomAdd(), WlzNewValueTb(), WlzObjToBoundary(), WlzObjToConvexPolygon(), WlzPrincipalAngle(), WlzProjectObjToPlane(), WlzReadObj(), WlzSampleObj(), WlzSkStrip4(), WlzToArray2D(), WlzUnionN(), and WlzVerticesFromObj2I().
WlzErrorNum WlzNextInterval | ( | WlzIntervalWSpace * | iwsp | ) |
Get next interval in a standard object.
iwsp | Interval scanning workspace. |
References _WlzIntervalWSpace::colpos, _WlzIntervalWSpace::colraster, _WlzIntervalWSpace::colrmn, _WlzIntervalWSpace::dmntype, _WlzInterval::ileft, _WlzIntervalWSpace::intdmn, _WlzIntervalWSpace::intpos, _WlzIntervalWSpace::intrmn, _WlzIntervalWSpace::intvln, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::lineraster, _WlzIntervalWSpace::linpos, _WlzIntervalWSpace::linrmn, _WlzIntervalLine::nintvs, _WlzIntervalWSpace::nwlpos, _WlzIntervalWSpace::rgtpos, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WLZ_INTERVALDOMAIN_INTVL, and WLZ_INTERVALDOMAIN_RECT.
Referenced by Wlz3DSectionSegmentObject(), Wlz3DViewTransformObj(), WlzArea(), WlzCCorS2D(), WlzCentrality(), WlzCentreOfMassVtx3D(), WlzConComThreshold(), WlzCopyObjectGreyValues(), WlzCutObjToValBox2D(), WlzDGTensorSDFeature(), WlzDiffDomain(), WlzGreySetHilbertRankValues(), WlzHasIntersection(), WlzImageBlendObjToBufRGBA(), WlzIntersectN(), WlzIterate(), WlzLabel(), WlzLBTDomain2DFromIDomain(), WlzLBTDomain3DFromPDomain(), WlzLineArea(), WlzMakeIntervalValues(), WlzMeshFromObjBox(), WlzMeshIDomAdd(), WlzNewValueTb(), WlzNextGreyInterval(), WlzObjToBoundary(), WlzObjToConvexPolygon(), WlzPrincipalAngle(), WlzProjectObjToPlane(), WlzReadObj(), WlzSampleObj(), WlzSeqPar(), WlzSkStrip4(), WlzToArray2D(), WlzUnionN(), and WlzVerticesFromObj2I().
WlzErrorNum WlzNextLine | ( | WlzIntervalWSpace * | iwsp, |
int | step | ||
) |
Moving to the line which is step away from the present line (beware when both nextline() and nextinterval() are used since nextinterval() will locate the first interval in that line)
iwsp | Interval scanning workspace. |
step | Distance to the required line (1 - next line etc.) |
References _WlzIntervalWSpace::colpos, _WlzIntervalWSpace::colraster, _WlzIntervalWSpace::colrmn, _WlzIntervalWSpace::dmntype, _WlzInterval::ileft, _WlzIntervalWSpace::intdmn, _WlzIntervalWSpace::intpos, _WlzIntervalWSpace::intrmn, _WlzIntervalWSpace::intvln, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::lineraster, _WlzIntervalWSpace::linpos, _WlzIntervalWSpace::linrmn, _WlzIntervalLine::nintvs, _WlzIntervalWSpace::nwlpos, _WlzIntervalWSpace::rgtpos, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_ERR_PARAM_NULL, WLZ_INTERVALDOMAIN_INTVL, and WLZ_INTERVALDOMAIN_RECT.
WlzErrorNum WlzInitLineScan | ( | WlzObject * | obj, |
WlzIntervalWSpace * | iwsp, | ||
WlzRasterDir | raster, | ||
int | scale, | ||
int | firstline | ||
) |
Initialise line scanning, must be called before the first call of WlzNextLine().
obj | Input object to be scanned. |
iwsp | Interval scanning work space. |
raster | Direction for the raster scan. |
scale | Step for line increments. |
firstline | Starting line for scanning. |
References _WlzIntervalWSpace::colraster, _WlzIntervalWSpace::colrmn, _WlzIntervalWSpace::dmntype, _WlzObject::domain, _WlzDomain::i, _WlzIntervalWSpace::intdmn, _WlzIntervalWSpace::intrmn, _WlzIntervalDomain::intvlines, _WlzIntervalWSpace::intvln, _WlzIntervalDomain::lastln, _WlzIntervalWSpace::linbot, _WlzIntervalDomain::line1, _WlzIntervalWSpace::lineraster, _WlzIntervalWSpace::linpos, _WlzIntervalWSpace::linrmn, _WlzIntervalWSpace::objaddr, _WlzObject::type, _WlzIntervalDomain::type, WLZ_2D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_NULL, WLZ_ERR_RASTERDIR_TYPE, WLZ_INTERVALDOMAIN_INTVL, WLZ_INTERVALDOMAIN_RECT, WLZ_RASTERDIR_DLDC, WLZ_RASTERDIR_DLIC, WLZ_RASTERDIR_ILDC, and WLZ_RASTERDIR_ILIC.
int WlzIWSpIntersection | ( | WlzInterval * | dstItv, |
WlzIntervalWSpace * | iWSp0, | ||
WlzIntervalWSpace * | iWSp1, | ||
int * | dstIsn | ||
) |
Classifies the possible intersections between the intervals of the two given interval workspaces.
There are six possible cases which are returned as an intersection code. The destination interval pointer will have it's values set to cover the intersection where it exists. Given first interval F, second interval S and overlaps between the two intervals represented by O and gaps by - then the intersection codes returned are:
Code | Intersection |
0 | S-F |
1 | F-S |
2 | FOF or O |
3 | SOS |
4 | SOF |
5 | FOS |
dstItv | Destination pointer for the interval values, must be valid. |
iWSp0 | First interval workspace, must be valid. |
iWSp1 | Second interval workspace, must be valid. |
dstIsn | Destination pointer for the intersection code, may be NULL. |
References _WlzInterval::ileft, _WlzInterval::iright, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linpos, and _WlzIntervalWSpace::rgtpos.
Referenced by WlzCopyObjectGreyValues(), and WlzDGTensorSDFeature().
WlzRasterDir WlzRasterDir2D | ( | WlzRasterDir | dir | ) |
Masks a 2 or 3D raster direction so that it is valid for 2D.
dir | Given raster direction. |
References WLZ_RASTERDIR_DLDC.
Referenced by WlzIterate(), and WlzIterateInit().
WlzIterateWSpace* WlzIterateInit | ( | WlzObject * | obj, |
WlzRasterDir | dir, | ||
int | grey, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a new domain object iteration workspace that may be used to iterate through either a 2 or 3D domain object.
obj | Given object which must be either of the type WLZ_2D_DOMAINOBJ or WLZ_3D_DOMAINOBJ. |
dir | Raster scan direction. |
grey | Non-zero if grey value access is needed (not required if the object does not have grey values). |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::core, _WlzObject::domain, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WlzIterateWSpFree(), and WlzRasterDir2D().
Referenced by WlzCMeshClosePointDom2D5(), and WlzGreySetIncValues().
void WlzIterateWSpFree | ( | WlzIterateWSpace * | itWSp | ) |
Frees the given iteration workspace including it's interval and grey workspaces. The object and 2D object are freed if non NULL.
itWSp | Given iteration workspace. |
References AlcFree(), _WlzIterateWSpace::gWSp, _WlzIterateWSpace::iWSp, _WlzIterateWSpace::obj2D, WlzEndGreyScan(), and WlzFreeObj().
Referenced by WlzCMeshClosePointDom2D5(), WlzGreySetIncValues(), and WlzIterateInit().
WlzErrorNum WlzIterate | ( | WlzIterateWSpace * | itWSp | ) |
Iterates through an object for which the given workspace was initialised. This function will return WLZ_ERR_EOO when there are no more pixels/voxels remaining.
itWSp | Given iteration workspace. |
References AlcCalloc(), AlcMalloc(), _WlzIntervalWSpace::colrmn, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzIterateWSpace::dir, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzIterateWSpace::gP, _WlzIterateWSpace::grey, _WlzIterateWSpace::gType, _WlzIterateWSpace::gWSp, _WlzGreyP::inp, _WlzIterateWSpace::itvPos, _WlzIterateWSpace::iWSp, _WlzPlaneDomain::lastpl, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linpos, _WlzIntervalWSpace::linrmn, _WlzGreyP::lnp, _WlzIterateWSpace::obj, _WlzIterateWSpace::obj2D, _WlzIntervalWSpace::objaddr, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzIterateWSpace::plnIdx, _WlzIterateWSpace::plnRmn, _WlzIterateWSpace::pos, _WlzGreyP::rgbp, _WlzGreyP::shp, _WlzObject::type, _WlzCoreDomain::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_DOMAIN, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_NULL, WLZ_GREY_BIT, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_LONG, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_RASTERDIR_DP, WlzFreeObj(), WlzInitGreyRasterScan(), WlzInitRasterScan(), WlzMakeMain(), WlzNextGreyInterval(), WlzNextInterval(), and WlzRasterDir2D().
Referenced by WlzCMeshClosePointDom2D5(), and WlzGreySetIncValues().
WlzDomain WlzLBTDomainFromObj | ( | WlzObject * | obj, |
WlzErrorNum * | dstErr | ||
) |
Creates a new 2D or 3D linear binary tree domain from the given object's domain. The given object must be either a 2D or 3D domain object. domain.
obj | Given object. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::core, _WlzObject::domain, _WlzDomain::l2, _WlzDomain::l3, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WlzLBTDomain2DFromDomain(), and WlzLBTDomain3DFromDomain().
Referenced by WlzLBTTestOutputNodesVtk().
WlzLBTDomain2D* WlzLBTDomain2DFromDomain | ( | WlzDomain | dom, |
WlzErrorNum * | dstErr | ||
) |
Creates a new 2D linear binary tree domain from the given domain.
dom | Given domain, which must be 2D. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::core, _WlzDomain::i, _WlzCoreDomain::type, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_INTERVALDOMAIN_INTVL, WLZ_INTERVALDOMAIN_RECT, and WlzLBTDomain2DFromIDomain().
Referenced by WlzCMeshFromObj2D(), and WlzLBTDomainFromObj().
WlzLBTDomain3D* WlzLBTDomain3DFromDomain | ( | WlzDomain | dom, |
WlzErrorNum * | dstErr | ||
) |
Creates a new 2D linear binary tree domain from the given domain.
dom | Given domain, which must be 2D. |
dstErr | Destination error pointer, may be NULL. |
References _WlzDomain::core, _WlzDomain::p, _WlzCoreDomain::type, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_PLANEDOMAIN_DOMAIN, and WlzLBTDomain3DFromPDomain().
Referenced by WlzCMeshFromObj3D(), and WlzLBTDomainFromObj().
WlzIntervalDomain* WlzLBTDomainToIDomain | ( | WlzLBTDomain2D * | lDom, |
WlzErrorNum * | dstErr | ||
) |
Creates a new interval domain from the given 2D linear binary tree domain.
lDom | Given 2D linear binary tree domain. |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), AlcFree(), _WlzPartialItv2D::ileft, _WlzPartialItv2D::iright, _WlzLBTNode2D::keys, _WlzLBTDomain2D::kol1, _WlzLBTDomain2D::lastkl, _WlzLBTDomain2D::lastln, _WlzLBTDomain2D::line1, _WlzPartialItv2D::ln, _WlzLBTDomain2D::nNodes, _WlzLBTDomain2D::nodes, _WlzLBTDomain2D::type, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_LBTDOMAIN_2D, WlzIDomainFromPItv2D(), WlzLBTKeyToPos2I(), and WlzLBTNodeSz2D().
Referenced by WlzLBTMakeNodeIndexObj2D(), and WlzLBTTestOutputNodesVtk().
WlzPlaneDomain* WlzLBTDomainToPDomain | ( | WlzLBTDomain3D * | lDom, |
WlzErrorNum * | dstErr | ||
) |
Creates a new plane domain from the given 3D linear binary tree domain.
lDom | Given 3D linear binary tree domain. |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), AlcFree(), _WlzPartialItv3D::ileft, _WlzPartialItv3D::iright, _WlzLBTNode3D::keys, _WlzLBTDomain3D::kol1, _WlzLBTDomain3D::lastkl, _WlzLBTDomain3D::lastln, _WlzLBTDomain3D::lastpl, _WlzLBTDomain3D::line1, _WlzPartialItv3D::ln, _WlzLBTDomain3D::nNodes, _WlzLBTDomain3D::nodes, _WlzPartialItv3D::pl, _WlzLBTDomain3D::plane1, _WlzLBTDomain3D::type, _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_LBTDOMAIN_3D, WlzLBTKeyToPos3I(), WlzLBTNodeSz3D(), and WlzPDomainFromPItv3D().
Referenced by WlzLBTMakeNodeIndexObj3D(), and WlzLBTTestOutputNodesVtk().
WlzIntervalDomain* WlzIDomainFromPItv2D | ( | int | line1, |
int | lastln, | ||
int | kol1, | ||
int | lastkl, | ||
int | nPItv, | ||
WlzPartialItv2D * | pItv, | ||
WlzErrorNum * | dstErr | ||
) |
Allocates and computes an interval domain from the given table of partial intervals. The given partial intervals must fit within the given domain bounding box.
line1 | First line. |
lastln | Last line. |
kol1 | First column. |
lastkl | last column. |
nPItv | Number of partial intervals. |
pItv | Array of partial intervals. |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), AlcFreeStackPush(), AlgQSort(), _WlzIntervalDomain::freeptr, _WlzInterval::ileft, _WlzPartialItv2D::ileft, _WlzIntervalDomain::intvlines, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzPartialItv2D::iright, _WlzIntervalDomain::line1, _WlzPartialItv2D::ln, _WlzIntervalLine::nintvs, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_INTERVALDOMAIN_INTVL, WlzFreeIntervalDomain(), and WlzMakeIntervalDomain().
Referenced by WlzLBTDomainToIDomain().
WlzPlaneDomain* WlzPDomainFromPItv3D | ( | int | plane1, |
int | lastpl, | ||
int | line1, | ||
int | lastln, | ||
int | kol1, | ||
int | lastkl, | ||
int | nPItv, | ||
WlzPartialItv3D * | pItv, | ||
WlzErrorNum * | dstErr | ||
) |
Allocates and computes a plane domain from the given table of partial intervals. The given partial intervals must fit within the given domain bounding box.
plane1 | First plane. |
lastpl | Last plane. |
line1 | First line. |
lastln | Last line. |
kol1 | First column. |
lastkl | last column. |
nPItv | Number of partial intervals. |
pItv | Array of partial intervals. |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), AlcFreeStackPush(), AlgQSort(), _WlzPlaneDomain::domains, _WlzIntervalDomain::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzPartialItv3D::ileft, _WlzIntervalDomain::intvlines, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzPartialItv3D::iright, _WlzIntervalDomain::line1, _WlzPartialItv3D::ln, _WlzIntervalLine::nintvs, _WlzPartialItv3D::pl, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_INTERVALDOMAIN_INTVL, WLZ_PLANEDOMAIN_DOMAIN, WlzAssignDomain(), WlzFreePlaneDomain(), WlzMakeIntervalDomain(), WlzMakePlaneDomain(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, and _WlzIBox2::yMin.
Referenced by WlzLBTDomainToPDomain().
WlzLBTDomain3D* WlzLBTDomain3DFromPDomain | ( | WlzPlaneDomain * | pDom, |
WlzErrorNum * | dstErr | ||
) |
Creates a new 3D linear binary tree domain from the given interval domain.
pDom | Given plane domain. |
dstErr | Destination error pointer, may be NULL. |
References ALC_ER_NONE, AlcCalloc(), AlcFreeStackPush(), _WlzIntervalWSpace::colrmn, _WlzValues::core, _WlzDomain::core, _WlzPlaneDomain::domains, _WlzLBTNode3D::flags, _WlzLBTDomain3D::freeptr, _WlzLBTNode3D::keys, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalWSpace::lftpos, _WlzPlaneDomain::line1, _WlzIntervalWSpace::linpos, _WlzLBTDomain3D::maxNodes, _WlzLBTDomain3D::nNodes, _WlzLBTDomain3D::nodes, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzIntervalWSpace::rgtpos, _WlzCoreDomain::type, _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_26_CONNECTED, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_DOMAIN, WLZ_ERR_EOO, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_LBT_NODE_FLAG_BOUNDARY, WLZ_LBTDOMAIN_3D, WLZ_RASTERDIR_ILIC, WlzErosion(), WlzFreeObj(), WlzInitRasterScan(), WlzInsideDomain(), WlzLBTPosToKey3D(), WlzMakeLBTDomain3D(), WlzMakeMain(), and WlzNextInterval().
Referenced by WlzLBTDomain3DFromDomain().
WlzLBTDomain2D* WlzLBTDomain2DFromIDomain | ( | WlzIntervalDomain * | iDom, |
WlzErrorNum * | dstErr | ||
) |
Creates a new 2D linear binary tree domain from the given interval domain.
iDom | Given domain, which must be an interval domain. |
dstErr | Destination error pointer, may be NULL. |
References ALC_ER_NONE, AlcCalloc(), AlcFreeStackPush(), _WlzIntervalWSpace::colrmn, _WlzValues::core, _WlzLBTNode2D::flags, _WlzLBTDomain2D::freeptr, _WlzDomain::i, _WlzLBTNode2D::keys, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzIntervalDomain::lastln, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzIntervalWSpace::linpos, _WlzLBTDomain2D::maxNodes, _WlzLBTDomain2D::nNodes, _WlzLBTDomain2D::nodes, _WlzIntervalWSpace::rgtpos, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_8_CONNECTED, WLZ_ERR_EOO, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_LBT_NODE_FLAG_BOUNDARY, WLZ_LBTDOMAIN_2D, WLZ_RASTERDIR_ILIC, WlzErosion(), WlzFreeObj(), WlzInitRasterScan(), WlzInsideDomain(), WlzLBTPosToKey2D(), WlzMakeLBTDomain2D(), WlzMakeMain(), and WlzNextInterval().
Referenced by WlzLBTDomain2DFromDomain().
WlzErrorNum WlzLBTBalanceDomain2D | ( | WlzLBTDomain2D * | lDom, |
WlzObject * | iObj, | ||
int | maxSz, | ||
int | maxBndSz | ||
) |
Balances the given LBT domain so that the neighbouring nodes of each node are either of the same size or differ in size by a ratio of 2:1. The function also enforces maximum node size for all nodes and boundary nodes. The neighbour finding algorithm used is quick and simple but it requires an object in which the values are set to the corresponding LBT domain indices. For efficiency an associated interval domain may be given, if the associated domain pointer is NULL then a domain will be computed.
lDom | Given LBT domain. |
iObj | Index object for finding neighbours of nodes. |
maxSz | Maximum node size. |
maxBndSz | Maximum boundary node size |
References AlcCPQQueueFree(), AlcCPQQueueNew(), AlcHashTableFree(), AlcHashTableNew(), AlcRealloc(), AlgBitNextPowerOfTwo(), AlgQSort(), _WlzLBTNode2D::keys, _WlzLBTDomain2D::maxNodes, _WlzLBTDomain2D::nNodes, _WlzLBTDomain2D::nodes, WLZ_DIRECTION_DC, WLZ_DIRECTION_DL, WLZ_DIRECTION_IC, WLZ_DIRECTION_IL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WlzGreyValueFreeWSp(), WlzGreyValueMakeWSp(), WlzLBTNodeLogSz2D(), and WlzLBTNodeSz2D().
Referenced by WlzCMeshFromObj2D(), and WlzLBTTestOutputNodesVtk().
WlzErrorNum WlzLBTBalanceDomain3D | ( | WlzLBTDomain3D * | lDom, |
WlzObject * | iObj, | ||
int | maxSz, | ||
int | maxBndSz | ||
) |
Balances the given LBT domain so that the neighbouring nodes of each node are either of the same size or differ in size by a ratio of 2:1. The function also enforces maximum node size for all nodes and boundary nodes. The neighbour finding algorithm used is quick and simple but it requires an object in which the values are set to the corresponding LBT domain indices. For efficiency an associated interval domain may be given, if the associated domain pointer is NULL then a domain will be computed.
lDom | Given LBT domain. |
iObj | Index object for finding neighbours of nodes. |
maxSz | Maximum node size. |
maxBndSz | Maximum boundary node size |
References AlcCPQQueueFree(), AlcCPQQueueNew(), AlcHashTableFree(), AlcHashTableNew(), AlcRealloc(), AlgBitNextPowerOfTwo(), AlgQSort(), _WlzLBTNode3D::keys, _WlzLBTDomain3D::maxNodes, _WlzLBTDomain3D::nNodes, _WlzLBTDomain3D::nodes, WLZ_DIRECTION_DC, WLZ_DIRECTION_DL, WLZ_DIRECTION_DP, WLZ_DIRECTION_IC, WLZ_DIRECTION_IL, WLZ_DIRECTION_IP, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WlzGreyValueFreeWSp(), WlzGreyValueMakeWSp(), WlzLBTNodeLogSz3D(), and WlzLBTNodeSz3D().
Referenced by WlzCMeshFromObj3D(), and WlzLBTTestOutputNodesVtk().
WlzObject* WlzLBTMakeNodeIndexObj2D | ( | WlzLBTDomain2D * | lDom, |
WlzIntervalDomain * | iDom, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a new 2D domain object with integer values which are the indices of the nodes containing the pixels of the domain.
lDom | Given LBT domain. |
iDom | Corresponding interval domain, may be NULL. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzDomain::i, _WlzGreyV::inv, _WlzLBTDomain2D::nNodes, _WlzPixelV::type, _WlzIntervalDomain::type, _WlzGreyV::ubv, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_GREY_INT, WLZ_GREY_TAB_RAGR, WLZ_INTERVALDOMAIN_INTVL, WLZ_INTERVALDOMAIN_RECT, WlzAssignValues(), WlzFreeIntervalDomain(), WlzFreeObj(), WlzFreeValueTb(), WlzGreyValueFreeWSp(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzLBTDomainToIDomain(), WlzMakeMain(), WlzNewValueTb(), and WlzSetBackground().
Referenced by WlzCMeshFromObj2D(), and WlzLBTTestOutputNodesVtk().
WlzObject* WlzLBTMakeNodeIndexObj3D | ( | WlzLBTDomain3D * | lDom, |
WlzPlaneDomain * | pDom, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a new 3D domain object with integer values which are the indices of the nodes containing the pixels of the domain.
lDom | Given LBT domain. |
pDom | Corresponding interval domain, may be NULL. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzDomain::i, _WlzGreyV::inv, _WlzLBTDomain3D::nNodes, _WlzDomain::p, _WlzPixelV::type, _WlzGreyV::ubv, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, _WlzValues::vox, WLZ_3D_DOMAINOBJ, WLZ_ERR_NONE, WLZ_GREY_INT, WLZ_GREY_TAB_RAGR, WlzAssignValues(), WlzFreeIntervalDomain(), WlzFreeObj(), WlzFreeValueTb(), WlzGreyValueFreeWSp(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzLBTDomainToPDomain(), WlzMakeMain(), WlzNewValuesVox(), and WlzSetBackground().
Referenced by WlzCMeshFromObj3D(), and WlzLBTTestOutputNodesVtk().
WlzErrorNum WlzLBTIndexObjSetAllNodes2D | ( | WlzLBTDomain2D * | lDom, |
WlzObject * | iObj | ||
) |
Sets all index values in an existing 2D LBT node index object.
lDom | |
iObj |
References _WlzGreyV::inv, _WlzLBTDomain2D::nNodes, _WlzPixelV::type, _WlzPixelV::v, WLZ_ERR_NONE, WLZ_GREY_INT, WlzGreyValueFreeWSp(), WlzGreyValueMakeWSp(), and WlzSetBackground().
Referenced by WlzCMeshFromObj2D().
WlzErrorNum WlzLBTIndexObjSetAllNodes3D | ( | WlzLBTDomain3D * | lDom, |
WlzObject * | iObj | ||
) |
Sets all index values in an existing 3D LBT node index object.
lDom | |
iObj |
References _WlzGreyV::inv, _WlzLBTDomain3D::nNodes, _WlzPixelV::type, _WlzPixelV::v, WLZ_ERR_NONE, WLZ_GREY_INT, WLZ_LBT_NODE_CLASS_2D_0, WLZ_LBT_NODE_CLASS_2D_1, WLZ_LBT_NODE_CLASS_2D_2, WLZ_LBT_NODE_CLASS_2D_3, WLZ_LBT_NODE_CLASS_2D_4, WLZ_LBT_NODE_CLASS_2D_5, WlzGreyValueFreeWSp(), WlzGreyValueMakeWSp(), and WlzSetBackground().
Referenced by WlzCMeshFromObj3D().
void WlzLBTClassifyNode2D | ( | WlzLBTDomain2D * | lDom, |
WlzGreyValueWSpace * | iGVWSp, | ||
int | idN, | ||
WlzLBTNodeClass2D * | dstCls, | ||
int * | dstRot | ||
) |
Classifies the given LBT node by it's connectivity and returns it's class and the counter-clockwise rotation of the basic class pattern in multiples of 90 degrees.
lDom | Linear binary tree domain. |
iGVWSp | Grey workspace for index object. |
idN | Index of the LBT node. |
dstCls | Destination pointer for the class. |
dstRot | Destination pointer for the rotation. |
References _WlzGreyValueWSpace::gVal, _WlzGreyV::inv, _WlzLBTDomain2D::nodes, WLZ_LBT_NODE_CLASS_2D_0, WlzGreyValueGet(), WlzLBTKeyToBox2I(), WlzLBTNodeSz2D(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, and _WlzIBox2::yMin.
Referenced by WlzCMeshFromBalLBTDom3D().
void WlzLBTClassifyNodeFace3D | ( | WlzLBTDomain3D * | lDom, |
WlzGreyValueWSpace * | iGVWSp, | ||
int | idN, | ||
int | idF, | ||
WlzDVertex3 * | vtx, | ||
WlzLBTNodeClass2D * | dstCls, | ||
int * | dstRot | ||
) |
Classifies the given LBT node's face by it's connectivity and returns it's class and the counter-clockwise rotation of the basic class pattern, when viewed from outside of the node's cube looking at the face, in multiples of 90 degrees. This function uses the face index and orientation system defined in WlzCMeshFromBalLBTDom3D().
lDom | Linear binary tree domain. |
iGVWSp | Grey workspace for index object. |
idN | Index of the LBT node. |
idF | Index of the face. |
vtx | Coordinates of the 6 vertices at the origin of faces of the LBT node's bounding box. |
dstCls | Destination pointer for the class. |
dstRot | Destination pointer for the rotation. |
References ALC_ER_NONE, AlcCPQEntryInsert(), AlcCPQItemFree(), AlcCPQItemUnlink(), AlcHashItemGet(), AlcHashItemUnlink(), AlcHashTableEntryInsert(), _WlzGreyValueWSpace::bkdFlag, _AlcCPQItem::entry, _WlzGreyValueWSpace::gPtr, _WlzGreyValueWSpace::gVal, _WlzPartialItv2D::ileft, _WlzPartialItv3D::ileft, _WlzGreyP::inp, _WlzGreyV::inv, _WlzLBTNode2D::keys, _WlzLBTNode3D::keys, _WlzPartialItv2D::ln, _WlzPartialItv3D::ln, _WlzLBTDomain2D::nodes, _WlzLBTDomain3D::nodes, _WlzPartialItv3D::pl, _WlzDVertex3::vtX, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_DIRECTION_DC, WLZ_DIRECTION_DL, WLZ_DIRECTION_DP, WLZ_DIRECTION_IC, WLZ_DIRECTION_IL, WLZ_DIRECTION_IP, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_LBT_NODE_CLASS_2D_0, WLZ_VTX_3_ADD, WlzGreyValueGet(), WlzLBTKeyToBox2I(), WlzLBTKeyToBox3I(), WlzLBTNodeLogSz2D(), WlzLBTNodeLogSz3D(), WlzLBTNodeSz3D(), _WlzIBox2::xMax, _WlzIBox3::xMax, _WlzIBox2::xMin, _WlzIBox3::xMin, _WlzIBox2::yMax, _WlzIBox3::yMax, _WlzIBox2::yMin, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzCMeshFromBalLBTDom3D().
int WlzLBTCountNodNbrDir2D | ( | WlzLBTDomain2D * | lDom, |
WlzGreyValueWSpace * | iGVWSp, | ||
int | idN, | ||
WlzDirection | dir | ||
) |
Counts the number of neighbours of the given node in the given direction.
lDom | Given LBT domain. |
iGVWSp | Grey workspace for index object. |
idN | Index of node in the LBT domain. |
dir | Given direction. |
References _WlzGreyValueWSpace::gVal, _WlzGreyV::inv, _WlzLBTNode2D::keys, _WlzLBTNode3D::keys, _WlzLBTDomain2D::nodes, _WlzLBTDomain3D::nodes, WLZ_DIRECTION_DC, WLZ_DIRECTION_DL, WLZ_DIRECTION_DP, WLZ_DIRECTION_IC, WLZ_DIRECTION_IL, WLZ_DIRECTION_IP, WlzGreyValueGet(), WlzLBTKeyToBox2I(), WlzLBTKeyToBox3I(), WlzLBTNodeLogSz2D(), WlzLBTNodeLogSz3D(), _WlzIBox2::xMax, _WlzIBox3::xMax, _WlzIBox2::xMin, _WlzIBox3::xMin, _WlzIBox2::yMax, _WlzIBox3::yMax, _WlzIBox2::yMin, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
int WlzLBTNodeSz2D | ( | WlzLBTNode2D * | nod | ) |
Computes the size of a 2D linear binary tree node.
nod | Given node. |
References _WlzLBTNode2D::keys.
Referenced by WlzCMeshFromBalLBTDom3D(), WlzLBTBalanceDomain2D(), WlzLBTClassifyNode2D(), and WlzLBTDomainToIDomain().
int WlzLBTNodeLogSz2D | ( | WlzLBTNode2D * | nod | ) |
Computes the log (base 2) of the size of a 2D linear binary tree node.
nod | Given node. |
References _WlzLBTNode2D::keys.
Referenced by WlzLBTBalanceDomain2D(), WlzLBTClassifyNodeFace3D(), and WlzLBTCountNodNbrDir2D().
int WlzLBTNodeSz3D | ( | WlzLBTNode3D * | nod | ) |
Computes the size of a 3D linear binary tree node.
nod | Given node. |
References _WlzLBTNode3D::keys.
Referenced by WlzCMeshFromBalLBTDom3D(), WlzLBTBalanceDomain3D(), WlzLBTClassifyNodeFace3D(), and WlzLBTDomainToPDomain().
int WlzLBTNodeLogSz3D | ( | WlzLBTNode3D * | nod | ) |
Computes the log (base 2) of the size of a 3D linear binary tree node.
nod | Given node. |
References _WlzLBTDomain2D::depth, _WlzLBTNode3D::keys, _WlzLBTDomain2D::nNodes, and _WlzLBTDomain2D::nodes.
Referenced by WlzLBTBalanceDomain3D(), WlzLBTClassifyNodeFace3D(), and WlzLBTCountNodNbrDir2D().
void WlzLBTPosToKey3D | ( | WlzIVertex3 | pos, |
unsigned * | keys | ||
) |
Sets the value of the LBT key for the given position, where the position is relative to the first line and column of the domain. The key is encoded by interleaving the bits of the column coordinate, line coordinate, plane coordinate and term value in that order. The keys are ordered so that bit 0 is least significant.
pos | Position. |
keys | Keys to be set in line, column and term order. |
References _WlzIVertex3::vtX, _WlzIVertex3::vtY, and _WlzIVertex3::vtZ.
Referenced by WlzLBTDomain3DFromPDomain().
void WlzLBTPosToKey2D | ( | WlzIVertex2 | pos, |
unsigned * | keys | ||
) |
Sets the value of the LBT key for the given position, where the position is relative to the first line and column of the domain. The key is encoded by interleaving the bits of the column coordinate, line coordinate and term value in that order. The keys are ordered so that bit 0 is least significant.
pos | Position. |
keys | Keys to be set in line, column and term order. |
References _WlzIVertex2::vtX, and _WlzIVertex2::vtY.
Referenced by WlzLBTDomain2DFromIDomain().
void WlzLBTGetKeyDigits3D | ( | unsigned * | keys, |
WlzUByte * | digits | ||
) |
Gets an array of WLZ_LBTDOMAIN_MAXDIGITS location digits from the given 3D keys.
keys | Keys to be read. |
digits | Array of WLZ_LBTDOMAIN_MAXDIGITS digits. |
References WLZ_LBTDOMAIN_MAXDIGITS.
Referenced by WlzLBTTestOutputNodesTxt().
void WlzLBTGetKeyDigits2D | ( | unsigned * | keys, |
WlzUByte * | digits | ||
) |
Gets an array of WLZ_LBTDOMAIN_MAXDIGITS location digits from the given 2D keys.
keys | Keys to be read. |
digits | Array of WLZ_LBTDOMAIN_MAXDIGITS digits. |
References WLZ_LBTDOMAIN_MAXDIGITS.
Referenced by WlzLBTTestOutputNodesTxt().
void WlzLBTKeyToPos3I | ( | unsigned * | key, |
WlzIVertex3 * | pos | ||
) |
Sets position (relative to the first line and column of the domain) which corresponds to the given 3D LBT key.
key | Keys in line, column and term order. |
pos | Position to be set. |
References _WlzIVertex3::vtX, _WlzIVertex3::vtY, and _WlzIVertex3::vtZ.
Referenced by WlzCMeshFromBalLBTDom3D(), WlzLBTDomainToPDomain(), and WlzLBTKeyToBox2I().
void WlzLBTKeyToPos2I | ( | unsigned * | key, |
WlzIVertex2 * | pos | ||
) |
Sets position (relative to the first line and column of the domain) which corresponds to the given 3D LBT key.
key | Keys in line, column and term order. |
pos | Position to be set. |
References _WlzIVertex2::vtX, and _WlzIVertex2::vtY.
Referenced by WlzCMeshFromBalLBTDom3D(), WlzLBTDomainToIDomain(), and WlzLBTKeyToBox2I().
void WlzLBTKeyToBox3I | ( | unsigned * | key, |
WlzIBox3 * | box | ||
) |
Sets bounding box which corresponds to the given 3D LBT key.
key | Keys in line, column and term order. |
box | Position to be set. |
References _WlzIBox3::xMax, _WlzIBox3::xMin, _WlzIBox3::yMax, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzCMeshFromBalLBTDom3D(), WlzLBTClassifyNodeFace3D(), WlzLBTCountNodNbrDir2D(), WlzLBTTestOutputNodesTxt(), and WlzLBTTestOutputNodesVtk().
void WlzLBTKeyToBox2I | ( | unsigned * | key, |
WlzIBox2 * | box | ||
) |
Sets bounding box which corresponds to the given 2D LBT key.
key | Keys in line, column and term order. |
box | Position to be set. |
References AlgQSort(), _WlzLBTDomain2D::depth, _WlzLBTDomain3D::depth, _WlzLBTNode2D::flags, _WlzLBTNode3D::flags, _WlzLBTNode2D::keys, _WlzLBTNode3D::keys, _WlzDomain::l2, _WlzDomain::l3, _WlzLBTDomain2D::nNodes, _WlzLBTDomain3D::nNodes, _WlzLBTDomain2D::nodes, _WlzLBTDomain3D::nodes, _WlzIVertex2::vtX, _WlzIVertex3::vtX, _WlzIVertex2::vtY, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_LBT_NODE_FLAG_BOUNDARY, WLZ_LBTDOMAIN_MAXDIGITS, WlzInsideDomain2D(), WlzInsideDomain3D(), WlzLBTKeyToPos2I(), WlzLBTKeyToPos3I(), WlzLBTTestOutputNodesTxt(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, and _WlzIBox2::yMin.
Referenced by WlzLBTClassifyNode2D(), WlzLBTClassifyNodeFace3D(), WlzLBTCountNodNbrDir2D(), WlzLBTTestOutputNodesTxt(), and WlzLBTTestOutputNodesVtk().
WlzErrorNum WlzLBTTestOutputNodesTxt | ( | FILE * | fP, |
WlzDomain | dom | ||
) |
Outputs the nodes of the LBT ask text for testing.
fP | Output file. |
dom | The LBT domain to output. |
References _WlzDomain::core, _WlzLBTDomain2D::depth, _WlzLBTDomain3D::depth, _WlzLBTDomain2D::freeptr, _WlzLBTDomain3D::freeptr, _WlzBox::i2, _WlzBox::i3, _WlzLBTNode2D::keys, _WlzLBTNode3D::keys, _WlzLBTDomain2D::kol1, _WlzLBTDomain3D::kol1, _WlzDomain::l2, _WlzDomain::l3, _WlzLBTDomain2D::lastkl, _WlzLBTDomain3D::lastkl, _WlzLBTDomain2D::lastln, _WlzLBTDomain3D::lastln, _WlzLBTDomain3D::lastpl, _WlzLBTDomain2D::line1, _WlzLBTDomain3D::line1, _WlzLBTDomain2D::linkcount, _WlzLBTDomain3D::linkcount, _WlzLBTDomain2D::maxNodes, _WlzLBTDomain3D::maxNodes, _WlzLBTDomain2D::nNodes, _WlzLBTDomain3D::nNodes, _WlzLBTDomain2D::nodes, _WlzLBTDomain3D::nodes, _WlzLBTDomain3D::plane1, _WlzLBTDomain2D::type, _WlzLBTDomain3D::type, _WlzCoreDomain::type, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_LBTDOMAIN_2D, WLZ_LBTDOMAIN_3D, WLZ_LBTDOMAIN_MAXDIGITS, WlzLBTGetKeyDigits2D(), WlzLBTGetKeyDigits3D(), WlzLBTKeyToBox2I(), WlzLBTKeyToBox3I(), _WlzIBox2::xMax, _WlzIBox3::xMax, _WlzIBox2::xMin, _WlzIBox3::xMin, _WlzIBox2::yMax, _WlzIBox3::yMax, _WlzIBox2::yMin, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzLBTKeyToBox2I(), and WlzLBTTestOutputNodesVtk().
WlzErrorNum WlzLBTTestOutputNodesVtk | ( | FILE * | fP, |
WlzDomain | dom | ||
) |
Outputs the nodes of the LBT as VTK polydata for testing.
fP | Output file. |
dom | The LBT domain to output. |
References _WlzValues::core, _WlzDomain::core, getopt(), _WlzDomain::i, _WlzBox::i2, _WlzBox::i3, _WlzLBTNode2D::keys, _WlzLBTNode3D::keys, _WlzDomain::l2, _WlzDomain::l3, main(), _WlzLBTDomain2D::nNodes, _WlzLBTDomain3D::nNodes, _WlzLBTDomain2D::nodes, _WlzLBTDomain3D::nodes, optarg, opterr, optind, optopt, _WlzDomain::p, _WlzCoreDomain::type, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_READ_EOF, WLZ_ERR_WRITE_EOF, WLZ_LBTDOMAIN_2D, WLZ_LBTDOMAIN_3D, WlzAssignObject(), WlzFreeIntervalDomain(), WlzFreeLBTDomain2D(), WlzFreeObj(), WlzLBTBalanceDomain2D(), WlzLBTBalanceDomain3D(), WlzLBTDomainFromObj(), WlzLBTDomainToIDomain(), WlzLBTDomainToPDomain(), WlzLBTKeyToBox2I(), WlzLBTKeyToBox3I(), WlzLBTMakeNodeIndexObj2D(), WlzLBTMakeNodeIndexObj3D(), WlzLBTTestOutputNodesTxt(), WlzMakeMain(), WlzReadObj(), WlzStringFromErrorNum(), WlzWriteObj(), _WlzIBox2::xMax, _WlzIBox3::xMax, _WlzIBox2::xMin, _WlzIBox3::xMin, _WlzIBox2::yMax, _WlzIBox3::yMax, _WlzIBox2::yMin, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
WlzObject* WlzSkeleton | ( | WlzObject * | srcObj, |
int | smoothpasses, | ||
WlzConnectType | minCon, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the skeleton of the given object using Hilditch's method. See detail.
This algorithm iterates a two-stage process with three interval domain objects as follows:
Stage 1 - remove points according to algorithm:
Stage 2 - tidy up for next pass:
The method can be further improved by reducing the number of points scanned in the first pass to edge points. These are extracted as the difference between the original object and its erosion. Implement Hilditch's tests 1-6 by table look up (48 words, 32 bits). Neighbour order is as follows:
|
asterisk marks neighbourswhere "removed this pass" (RTP) is relevant to algorithm |
Use neighbours 0 - 4 and RTP 2 to generate an address in range 0 - 47 (neighbour 2 has three effective values: not in object previously, in object now, removed this pass), bit values as follows:
8 | 16/32* | 4 |
2 | - | 1 |
- | - | - |
or without 4 connected points:
2 | 16/32* | 1 |
8 | - | 4 |
- | - | - |
Use neighbours 5-7, RTP 4, and the smoothing criterion to generate a 5 bit bit-address, look at corresponding bit in addressed word in look-up table. If zero, retain point. Address values as follows:
- | - | - |
8* | - | - |
2 | 4 | 1 |
Thus lookup table is 48 words long, 32 bit unsigned values.
srcObj | Input object. |
smoothpasses | Number of smoothing passes to be applied. |
minCon | Minimum connectivity required. |
dstErr | Error return. |
References _WlzDomain::core, _WlzObject::domain, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WlzMakeEmpty(), and WlzSkeleton3D().
WlzLong WlzVolume | ( | WlzObject * | obj, |
WlzErrorNum * | wlzErr | ||
) |
Calculate the volume of the input 3D domain object.
obj | Input object pointer. |
wlzErr | Error return. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzPlaneDomain::lastpl, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzCoreDomain::type, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_PLANEDOMAIN_DOMAIN, WlzArea(), WlzFreeObj(), and WlzMakeMain().
Referenced by WlzCompDispIncGrey(), WlzGreySetHilbertRankValues(), WlzOffsetDist(), WlzRegConCalcRCC(), WlzSplitMontageObj(), WlzSplitObj(), WlzThinToPoints(), and WlzVerticesFromObj3I().
WlzObject* WlzXORDom | ( | WlzObject * | o0, |
WlzObject * | o1, | ||
WlzErrorNum * | dstErr | ||
) |
Calculates the domain exclusive or of the two given objects. The exclusive or object \(O_x\) is computed using
\[ O_x = (O_0 - O_1) \cup (O_1 - O_0) \]
where \(-\) and \(\cup\) are the set difference and union operators respectively. This seems to be slightly quicker than the alternative:
\[ O_x = (O_0 \cup O_1) - (O_1 \cap O_0) \]
.
o0 | First object. |
o1 | Second object. |
dstErr | Destination error pointer, may be NULL. |
References WLZ_ERR_NONE, WlzAssignObject(), WlzDiffDomain(), WlzFreeObj(), and WlzUnion2().
Referenced by WlzRegConCalcRCC().