Woolz Image Processing  Version 1.7.5
WlzBoundary

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.
 

Data Structures

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

Functions

WlzErrorNum WlzBoundaryToPolyObjArray (WlzObject *bndObj, int *dstNumObjs, WlzObject ***dstObjArray)
 decomposes a boundary into it's component polygons. More...
 
WlzErrorNum WlzBoundObjToPolyDomArray (WlzObject *bndObj, int *dstArySz, WlzPolygonDomain ***dstPolyAry)
 Given a boundary list object returns a simple array of polygon domains. More...
 
int WlzBoundPolyCount (WlzBoundList *bnd, WlzErrorNum *dstErr)
 Count the number of polygon domains in a boundary list. More...
 
int WlzBoundVtxCount (WlzBoundList *bnd, WlzErrorNum *dstErr)
 Recursive function which counts the total number of vertices in a boundary list. More...
 
WlzObjectWlzBoundaryDomain (WlzObject *gvnObj, WlzErrorNum *dstErr)
 Computes a new domain object with pixels/voxels only at the boundary of the given object. More...
 
WlzObjectWlzBoundaryToObj (WlzObject *boundary, WlzPolyFillMode fillMode, WlzErrorNum *dstErr)
 Return a domain object corresponding to the input boundary object. More...
 
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. More...
 
WlzObjectWlzObjToBoundary (WlzObject *obj, int wrap, WlzErrorNum *dstErr)
 Computes a recursive boundary structure for the given input object, with the specified number of vertices repeated in each boundary polygon to ensure wrap-around. All boundary polygon arcs lie in one of the 8 directions vertical, horizontal, diagonal. More...
 
WlzBoundListWlzBoundDecimate (WlzBoundList *bound, double maxDist, WlzErrorNum *dstErr)
 Decimate a boundary list using WlzPolyDecimate() on the boundary polylines. More...
 
WlzBoundListWlzBoundSmooth (WlzBoundList *bound, int iterations, WlzErrorNum *dstErr)
 Smooth a boundary list using WlzPolySmooth(). More...
 
WlzObjectWlzBoundTo8Bound (WlzObject *gvnObj, WlzErrorNum *dstErr)
 Computes a new boundary list from the given one, such that the new boundary list has 8-connected polylines. More...
 

Detailed Description

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 _WlzBoundList::down, _WlzBoundList::next, 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, WLZ_ERR_NONE, and WlzAssignPolygonDomain().

WlzObject* WlzBoundaryDomain ( WlzObject gvnObj,
WlzErrorNum dstErr 
)

Computes a new domain object with pixels/voxels only at the boundary of the given object.

Returns
New domain object.
            The boundary pixels/voxels are computed using erosion and
            diffdom. The alternative of computing the boundary and then
            filling along polygon vertices gets it wrong in places.
Parameters
gvnObjGiven object.
dstErrDestination error pointer, may be NULL.

References _WlzObject::type, WLZ_26_CONNECTED, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_8_CONNECTED, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WlzAssignObject(), WlzDiffDomain(), WlzErosion(), and WlzFreeObj().

Referenced by WlzDomainFill3D(), WlzInteriority(), and WlzPointsFromDomObj().

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, _WlzObject::type, _WlzPlaneDomain::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(), WlzDomainFill3D(), WlzGreyMask(), WlzGreyTemplate(), WlzMeshAffineProduct(), and WlzTransposeObj().

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

Computes a recursive boundary structure for the given input object, with the specified number of vertices repeated in each boundary polygon to ensure wrap-around. All boundary polygon arcs lie in one of the 8 directions vertical, horizontal, diagonal.

Returns
New boundary object, NULL on error.
Parameters
objGiven input object.
wrapNumber of overlapping vertices within each polygon.
dstErrDestination error pointer, mat be NULL.

References AlcCalloc(), AlcFree(), AlcMalloc(), _WlzDomain::b, WlzBoundPoint::bi, WlzBoundPoint::bl, WlzBoundPoint::bwas, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, DOWN, _WlzBoundList::down, _WlzBoundList::freeptr, _WlzDomain::i, WlzBoundPoint::interval_props, WlzBoundPoint::k, _WlzPlaneDomain::kol1, WlzBoundPoint::l, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, WlzBoundInterval::lb, WlzBoundInterval::left, LEFT_END, _WlzIntervalWSpace::lftpos, WlzBoundInterval::line, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzBoundList::linkcount, _WlzIntervalWSpace::linpos, _WlzBoundList::next, _WlzPolygonDomain::nvertices, _WlzValues::obj, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzDomain::poly, _WlzBoundList::poly, WlzBoundInterval::rb, _WlzIntervalWSpace::rgtpos, WlzBoundInterval::right, RIGHT_END, _WlzObject::type, _WlzPlaneDomain::type, _WlzBoundList::type, UP, _WlzBoundList::up, _WlzObject::values, _WlzPlaneDomain::voxel_size, _WlzIVertex2::vtX, _WlzPolygonDomain::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_RASTERDIR_ILIC, WLZ_TRANS_OBJ, WlzAssignDomain(), WlzAssignPolygonDomain(), WlzFreeObj(), WlzFreePlaneDomain(), WlzInitRasterScan(), WlzIntervalCount(), WlzMakeBoundList(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakePolygonDomain(), WlzNextInterval(), and _WlzBoundList::wrap.

Referenced by WlzAffineTransformObjCb(), WlzCentrality(), WlzCMeshCompSurfMapToDomain(), WlzContourGrdObj2D(), WlzDomainFill(), WlzDomainFill3D(), WlzMeshAffineProduct(), WlzObjToConvexHull(), 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, _WlzDomain::poly, _WlzBoundList::poly, _WlzObject::type, _WlzBoundList::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.

Referenced by WlzCentrality().