Woolz Image Processing
Version 1.8.3
|
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 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, and WLZ_ERR_NONE.
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(), WlzLineSkeleton(), WlzLineSkeletonSegment(), 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 WlzBoundaryToObj(), and WlzDomainFill().
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 _WlzDomain::b, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzBoundList::down, _WlzBoundList::freeptr, _WlzDomain::i, _WlzPlaneDomain::kol1, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzPlaneDomain::line1, _WlzBoundList::linkcount, _WlzBoundList::next, _WlzValues::obj, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzDomain::poly, _WlzBoundList::poly, _WlzObject::type, _WlzPlaneDomain::type, _WlzBoundList::type, _WlzBoundList::up, _WlzObject::values, _WlzPlaneDomain::voxel_size, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_BOUNDLIST, WLZ_BOUNDLIST_HOLE, WLZ_BOUNDLIST_PIECE, 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_PLANEDOMAIN_POLYGON, WLZ_TRANS_OBJ, WlzAssignDomain(), WlzFreeObj(), WlzFreePlaneDomain(), WlzIntervalCount(), WlzMakeBoundList(), WlzMakeMain(), WlzMakePlaneDomain(), and _WlzBoundList::wrap.
Referenced by WlzCMeshCompSurfMapToDomain(), WlzDomainFill(), WlzDomainFill3D(), 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::next, _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(), WlzPolyTo8Polygon(), and _WlzBoundList::wrap.