Woolz Image Processing
Version 1.7.5
|
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... | |
WlzObject * | WlzBoundaryDomain (WlzObject *gvnObj, WlzErrorNum *dstErr) |
Computes a new domain object with pixels/voxels only at the boundary of the given object. More... | |
WlzObject * | WlzBoundaryToObj (WlzObject *boundary, WlzPolyFillMode fillMode, WlzErrorNum *dstErr) |
Return a domain object corresponding to the input boundary object. More... | |
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. More... | |
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. More... | |
WlzBoundList * | WlzBoundDecimate (WlzBoundList *bound, double maxDist, WlzErrorNum *dstErr) |
Decimate a boundary list using WlzPolyDecimate() on the boundary polylines. More... | |
WlzBoundList * | WlzBoundSmooth (WlzBoundList *bound, int iterations, WlzErrorNum *dstErr) |
Smooth a boundary list using WlzPolySmooth(). More... | |
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. More... | |
WlzErrorNum WlzBoundaryToPolyObjArray | ( | WlzObject * | bndObj, |
int * | dstNumObjs, | ||
WlzObject *** | dstObjArray | ||
) |
decomposes a boundary into it's component polygons.
bndObj | Given boundary. |
dstNumObjs | Destination pointer for the number of polygons. |
dstObjArray | Destination 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.
bndObj | Given boundary list object. |
dstArySz | Destination ptr for array size. |
dstPolyAry | Destination 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.
bnd | Given boundary list. |
dstErr | Destination 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.
bnd | Given boundary list. |
dstErr | Destination 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.
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.
gvnObj | Given object. |
dstErr | Destination 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.
boundary | Input boundary object. |
fillMode | Fill 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(). |
dstErr | Error return |
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.
bound | Input boundary list domain. |
fillMode | Polyline fill mode, see WlzPolyToObj(). |
dstNum | Error return. |
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.
obj | Given input object. |
wrap | Number of overlapping vertices within each polygon. |
dstErr | Destination 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.
bound | input boundary list |
maxDist | distance parameter to test for vertex removal |
dstErr | error return |
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().
bound | input boundary list |
iterations | number of iterations for smoothing the polylines |
dstErr | error return |
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.
gvnObj | Object with given boundary list. |
dstErr | Destination 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().