Woolz Image Processing Version 1.4.0
WlzBoundary

Data Structures

struct  _WlzBoundList
 A complete list of a set of boundaries which is encoded in tree form. More...

Files

file  WlzBoundaryUtils.c
 

Simple functions that operate on boundary lists.


file  WlzBoundToObj.c
 

Functions to convert a boundary object or domain to a domain object.


file  WlzObjToBoundary.c
 

Computes a boundary list from a Woolz object.


Functions

WlzErrorNum WlzBoundaryToPolyObjArray (WlzObject *bndObj, int *dstNumObjs, WlzObject ***dstObjArray)
 decomposes a boundary into it's component polygons.
WlzErrorNum WlzBoundObjToPolyDomArray (WlzObject *bndObj, int *dstArySz, WlzPolygonDomain ***dstPolyAry)
 Given a boundary list object returns a simple array of polygon domains.
int WlzBoundPolyCount (WlzBoundList *bnd, WlzErrorNum *dstErr)
 Count the number of polygon domains in a boundary list.
int WlzBoundVtxCount (WlzBoundList *bnd, WlzErrorNum *dstErr)
 Recursive function which counts the total number of vertices in a boundary list.
WlzObjectWlzBoundaryToObj (WlzObject *boundary, WlzPolyFillMode fillMode, WlzErrorNum *dstErr)
 Return a domain object corresponding to the input boundary object.
WlzObjectWlzBoundToObj (WlzBoundList *bound, WlzPolyFillMode fillMode, WlzErrorNum *dstNum)
 Convert the input boundary list to a domain object. Use WlzBoundaryToObj if conversion of a 3D stack of boundary list is required or if the boundary is available as a first class object.
WlzObjectWlzObjToBoundary (WlzObject *obj, int wrap, WlzErrorNum *dstErr)
 Compute the recursive boundary structure of input object "obj",with "wrap" points repeated in each boundary polygon to ensurewrap-around (usual value for drawing purposes : 1). All boundary polygon arcs lie in one of the 8 directions vertical, horizontal, diagonal.
WlzBoundListWlzBoundDecimate (WlzBoundList *bound, double maxDist, WlzErrorNum *dstErr)
 Decimate a boundary list using WlzPolyDecimate() on the boundary polylines.
WlzBoundListWlzBoundSmooth (WlzBoundList *bound, int iterations, WlzErrorNum *dstErr)
 Smooth a boundary list using WlzPolySmooth().
WlzObjectWlzBoundTo8Bound (WlzObject *gvnObj, WlzErrorNum *dstErr)
 Computes a new boundary list from the given one, such that the new boundary list has 8-connected polylines.

Function Documentation

WlzErrorNum WlzBoundaryToPolyObjArray ( WlzObject bndObj,
int *  dstNumObjs,
WlzObject ***  dstObjArray 
)

decomposes a boundary into it's component polygons.

Returns:
Woolz error code.
Parameters:
bndObjGiven boundary.
dstNumObjsDestination pointer for the number of polygons.
dstObjArrayDestination pointer for the array of polygons.

References AlcFree(), AlcMalloc(), _WlzValues::core, _WlzDomain::poly, WLZ_2D_POLYGON, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_NULL, WlzAssignObject(), WlzBoundObjToPolyDomArray(), WlzFreePolyDmn(), and WlzMakeMain().

WlzErrorNum WlzBoundObjToPolyDomArray ( WlzObject bndObj,
int *  dstArySz,
WlzPolygonDomain ***  dstPolyAry 
)

Given a boundary list object returns a simple array of polygon domains.

Returns:
Array of polygon domains.
Parameters:
bndObjGiven boundary list object.
dstArySzDestination ptr for array size.
dstPolyAryDestination ptr for the array.

References AlcMalloc(), _WlzDomain::b, _WlzObject::domain, _WlzObject::type, WLZ_BOUNDLIST, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_NULL, and WlzBoundPolyCount().

Referenced by WlzBoundaryToPolyObjArray().

int WlzBoundPolyCount ( WlzBoundList bnd,
WlzErrorNum dstErr 
)

Count the number of polygon domains in a boundary list.

Returns:
The number of polygon domains in the given boundary list.
Parameters:
bndGiven boundary list.
dstErrDestination ptr for error, may be NULL.

References WLZ_ERR_DOMAIN_NULL, and WLZ_ERR_NONE.

Referenced by WlzBoundObjToPolyDomArray().

int WlzBoundVtxCount ( WlzBoundList bnd,
WlzErrorNum dstErr 
)

Recursive function which counts the total number of vertices in a boundary list.

Returns:
Parameters:
bndGiven boundary list.
dstErrDestination error pointer, may be NULL.

References _WlzBoundList::down, _WlzBoundList::next, _WlzPolygonDomain::nvertices, _WlzBoundList::poly, WLZ_ERR_DOMAIN_NULL, and WLZ_ERR_NONE.

WlzObject* WlzBoundaryToObj ( WlzObject boundary,
WlzPolyFillMode  fillMode,
WlzErrorNum dstErr 
)

Return a domain object corresponding to the input boundary object.

Returns:
Domain object corresponding to the input boundary, NULL on error.
Parameters:
boundaryInput boundary object.
fillModeFill mode for the individual polyline boundaries. If the input object is a genuine boundary object then there will be no self-intersecting polylines and fillMode = WLZ_SIMPLE_FILL is appropriate. See WlzPolyToObj().
dstErrError return
Source:
WlzBoundToObj.c

References _WlzDomain::b, _WlzValues::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzPlaneDomain::line1, _WlzValues::obj, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzPlaneDomain::type, _WlzObject::type, _WlzObject::values, _WlzPlaneDomain::voxel_size, WLZ_3D_DOMAINOBJ, WLZ_BOUNDLIST, 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_PLANEDOMAIN_BOUNDLIST, WLZ_PLANEDOMAIN_DOMAIN, WLZ_TRANS_OBJ, WlzAssignDomain(), WlzBoundToObj(), WlzFreeObj(), WlzFreePlaneDomain(), WlzMakeEmpty(), WlzMakeMain(), and WlzMakePlaneDomain().

WlzObject* WlzBoundToObj ( WlzBoundList bound,
WlzPolyFillMode  fillMode,
WlzErrorNum dstNum 
)

Convert the input boundary list to a domain object. Use WlzBoundaryToObj if conversion of a 3D stack of boundary list is required or if the boundary is available as a first class object.

Returns:
Domain object corresponding to the input boundary domain, NULL on error.
Parameters:
boundInput boundary list domain.
fillModePolyline fill mode, see WlzPolyToObj().
dstNumError return.
Source:
WlzBoundToObj.c

References _WlzBoundList::down, _WlzBoundList::next, _WlzBoundList::poly, _WlzBoundList::type, WLZ_4_CONNECTED, WLZ_BOUNDLIST_PIECE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_VERTEX_FILL, WlzDiffDomain(), WlzErosion(), WlzFreeObj(), WlzPolyToObj(), and WlzUnion2().

Referenced by WlzAffineTransformObjCb(), WlzBoundaryToObj(), WlzDomainFill(), WlzGreyMask(), WlzGreyTemplate(), and WlzTransposeObj().

WlzObject* WlzObjToBoundary ( WlzObject obj,
int  wrap,
WlzErrorNum dstErr 
)

Compute the recursive boundary structure of input object "obj",with "wrap" points repeated in each boundary polygon to ensurewrap-around (usual value for drawing purposes : 1). All boundary polygon arcs lie in one of the 8 directions vertical, horizontal, diagonal.

Returns:
Boundary object, NULL on error.
Parameters:
objInput domain object.
wrapNumber ov overlapping vertices within each polygon.
dstErrError return.
Source:
WlzObjToBoundary.c

References AlcFree(), AlcMalloc(), _WlzDomain::b, WlzBoundPoint::bi, WlzBoundPoint::bl, WlzBoundPoint::bwas, _WlzDomain::core, _WlzValues::core, _WlzObject::domain, _WlzPlaneDomain::domains, DOWN, _WlzBoundList::down, _WlzDomain::i, WlzBoundPoint::interval_props, WlzBoundPoint::k, _WlzPlaneDomain::kol1, WlzBoundPoint::l, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, WlzBoundInterval::left, LEFT_END, WlzBoundInterval::line, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzValues::obj, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzBoundList::poly, _WlzDomain::poly, WlzBoundInterval::rb, WlzBoundInterval::right, RIGHT_END, _WlzPlaneDomain::type, _WlzObject::type, UP, _WlzObject::values, _WlzPlaneDomain::voxel_size, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_BOUNDLIST, WLZ_BOUNDLIST_HOLE, WLZ_BOUNDLIST_PIECE, WLZ_DBG, WLZ_DBG_ALLOC, WLZ_DBG_LVL_1, WLZ_EMPTY_DOMAIN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_UNSPECIFIED, WLZ_PLANEDOMAIN_BOUNDLIST, WLZ_PLANEDOMAIN_DOMAIN, WLZ_PLANEDOMAIN_POLYGON, WLZ_POLYGON_INT, WLZ_TRANS_OBJ, WlzAssignDomain(), WlzAssignPolygonDomain(), WlzFreeObj(), WlzFreePlaneDomain(), WlzIntervalCount(), WlzMakeBoundList(), WlzMakeMain(), WlzMakePlaneDomain(), and WlzMakePolygonDomain().

Referenced by WlzAffineTransformObjCb(), WlzDomainFill(), WlzTransposeObj(), and WlzVerticesFromObjBnd2I().

WlzBoundList* WlzBoundDecimate ( WlzBoundList bound,
double  maxDist,
WlzErrorNum dstErr 
)

Decimate a boundary list using WlzPolyDecimate() on the boundary polylines.

Returns:
decimated boundary list, NULL on error
Parameters:
boundinput boundary list
maxDistdistance parameter to test for vertex removal
dstErrerror return
Source:
WlzPolyDecimate.c

References _WlzBoundList::down, _WlzBoundList::next, _WlzBoundList::poly, _WlzBoundList::type, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WlzAssignBoundList(), WlzAssignPolygonDomain(), WlzFreeBoundList(), WlzMakeBoundList(), WlzPolyDecimate(), and _WlzBoundList::wrap.

WlzBoundList* WlzBoundSmooth ( WlzBoundList bound,
int  iterations,
WlzErrorNum dstErr 
)

Smooth a boundary list using WlzPolySmooth().

Returns:
new boundlist, NULL on error
Parameters:
boundinput boundary list
iterationsnumber of iterations for smoothing the polylines
dstErrerror return
Source:
WlzPolySmooth.c

References _WlzBoundList::down, _WlzBoundList::next, _WlzBoundList::poly, _WlzBoundList::type, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WlzAssignBoundList(), WlzAssignPolygonDomain(), WlzFreeBoundList(), WlzMakeBoundList(), WlzPolySmooth(), and _WlzBoundList::wrap.

WlzObject* WlzBoundTo8Bound ( WlzObject gvnObj,
WlzErrorNum dstErr 
)

Computes a new boundary list from the given one, such that the new boundary list has 8-connected polylines.

Returns:
New object with boundary list or NULL on error.
Parameters:
gvnObjObject with given boundary list.
dstErrDestination error pointer, may be NULL.

References _WlzDomain::b, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzBoundList::down, _WlzBoundList::next, _WlzBoundList::poly, _WlzBoundList::type, _WlzObject::type, WLZ_BOUNDLIST, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WlzFreeObj(), WlzMakeBoundList(), WlzMakeMain(), WlzPolyTo8Polygon(), and _WlzBoundList::wrap.