Woolz Image Processing  Version 1.7.0
WlzMorphologyOps

Files

file  WlzDilation.c
 Functions for dilating objects with spatial domains.
 
file  WlzDistTransform.c
 Distance transform functions which calculate the distance of every pixel/voxel in a foreground object from a reference object.
 
file  WlzDomainNearby.c
 Functions for computing the portion of a domain which is nearby (all pixels/voxels less than a given distance from) given locations.
 
file  WlzErosion.c
 Morphological erosion of domain objects.
 
file  WlzErosion4.c
 Performs 4-connected erosion on domain objects.
 
file  WlzStdStructElements.c
 Standard structuring elements in 2D and 3D.
 
file  WlzStructDilation.c
 Performs dilation using a structuring element.
 
file  WlzStructErosion.c
 Performs erosion using a structuring element.
 

Enumerations

enum  _WlzSpecialStructElmType {
  WLZ_SPEC_STRUCT_ELM_H4,
  WLZ_SPEC_STRUCT_ELM_EX4,
  WLZ_SPEC_STRUCT_ELM_A8,
  WLZ_SPEC_STRUCT_ELM_H6,
  WLZ_SPEC_STRUCT_ELM_H5,
  WLZ_SPEC_STRUCT_ELM_H7,
  WLZ_SPEC_STRUCT_ELM_A3,
  WLZ_SPEC_STRUCT_ELM_E1,
  WLZ_SPEC_STRUCT_ELM_E2,
  WLZ_SPEC_STRUCT_ELM_V2
}
 Special structuring elements for morphological operations. Typedef: WlzSpecialStructElmType. More...
 

Functions

WlzObjectWlzDilation (WlzObject *obj, WlzConnectType connectivity, WlzErrorNum *dstErr)
 Dilate the given object using the given connectivity type. Since the dilated object is bigger than the original, the size of the valuetable may be smaller than the dilated object. User has to take fully responsibility for using grey value of dilated object. More...
 
WlzObjectWlzDistanceTransform (WlzObject *forObj, WlzObject *refObj, WlzDistanceType dFn, double dParam, double dMax, WlzErrorNum *dstErr)
 Computes the distance of every pixel/voxel in the foreground object from the reference object. More...
 
WlzObjectWlzDomainNearby3D (WlzObject *refObj, int nPos, WlzDVertex3 *pos, WlzDistanceType dFn, double dMax, WlzErrorNum *dstErr)
 This function is just a wrapper for WlzDomainNearby(). More...
 
WlzObjectWlzDomainNearby (WlzObject *refObj, int nPos, WlzVertexP pos, WlzDistanceType dFn, double dMax, WlzErrorNum *dstErr)
 Computes a new domain in which all pixels/voxels are nearby given location(s) and within the reference domain. More...
 
WlzObjectWlzErosion (WlzObject *obj, WlzConnectType connectivity, WlzErrorNum *dstErr)
 Calculates the morphological erosion of a woolz object with a structuring element defined by the connectivity. More...
 
WlzObjectWlzErosion4 (WlzObject *obj, WlzErrorNum *dstErr)
 4-connected erosion of a woolz domain object.2D objects only.This should not really be publicly accessible, but is present for historical reasons. Therefore the prototype does not appear in WlzProto.h. WlzErosion should be used to access 4-connected erosion. More...
 
WlzObjectWlzMakeSpecialStructElement (WlzSpecialStructElmType eType, int elmIndex, WlzErrorNum *dstErr)
 Return a pointer to a specific requested "special" structuring element. These are inherited from the original woolz library with rather cryptic names. See detail for more explanation of the elements and the additional parameters. More...
 
WlzObjectWlzMakeSinglePixelObject (WlzObjectType oType, int k, int l, int p, WlzErrorNum *dstErr)
 Make a single pixel/voxel object at the specified coordinate position. More...
 
WlzObjectWlzMakeCircleObject (double radius, double x, double y, WlzErrorNum *dstErr)
 Generate a discretised circle domain centered at (x,y). More...
 
WlzObjectWlzMakeRectangleObject (double radiusX, double radiusY, double x, double y, WlzErrorNum *dstErr)
 Generate a rectangular object centered at (x,y) with half-width radiusX and half-height radius Y. More...
 
WlzObjectWlzMakeSphereObject (WlzObjectType oType, double radius, double x, double y, double z, WlzErrorNum *dstErr)
 Make a spherical domain object. More...
 
WlzObjectWlzMakeCuboidObject (WlzObjectType oType, double radiusX, double radiusY, double radiusZ, double x, double y, double z, WlzErrorNum *dstErr)
 Generate a cuboid object centered at (x,y,z). More...
 
WlzObjectWlzMakeQuadrilateral (double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, WlzErrorNum *dstErr)
 Generate 2D interval domain object corresponding to the arbitrarily oriented quadrilateral with the given ordered vertex coordinates. The ordering is such that the vertices allow the rectangle to be drawn by line segments conecting v[i] to v[(i + 1)%4], with i \(\in\) [0-3]. More...
 
WlzObjectWlzMakeStdStructElement (WlzObjectType oType, WlzDistanceType dType, double radius, WlzErrorNum *dstErr)
 Makes a standard structure element - basicaly a sphere but with the appropriate connectivity or distance metric. More...
 
WlzObjectWlzStructDilation (WlzObject *obj, WlzObject *structElm, WlzErrorNum *dstErr)
 Dilate an object with respect to the given structuring element. This is defined as the domain obtained as the union of the SE placed at every pixel of the input domain. More...
 
WlzObjectWlzStructErosion (WlzObject *obj, WlzObject *structElm, WlzErrorNum *dstErr)
 Performs erosion using a structuring element. More...
 

Detailed Description

Enumeration Type Documentation

Special structuring elements for morphological operations. Typedef: WlzSpecialStructElmType.

Enumerator
WLZ_SPEC_STRUCT_ELM_H4 
WLZ_SPEC_STRUCT_ELM_EX4 
WLZ_SPEC_STRUCT_ELM_A8 
WLZ_SPEC_STRUCT_ELM_H6 
WLZ_SPEC_STRUCT_ELM_H5 
WLZ_SPEC_STRUCT_ELM_H7 
WLZ_SPEC_STRUCT_ELM_A3 
WLZ_SPEC_STRUCT_ELM_E1 
WLZ_SPEC_STRUCT_ELM_E2 
WLZ_SPEC_STRUCT_ELM_V2 

Function Documentation

WlzObject* WlzDilation ( WlzObject obj,
WlzConnectType  connectivity,
WlzErrorNum dstErr 
)

Dilate the given object using the given connectivity type. Since the dilated object is bigger than the original, the size of the valuetable may be smaller than the dilated object. User has to take fully responsibility for using grey value of dilated object.

Returns
Dilated object.
Parameters
objGiven object.
connectivityRequired type of conectivity.
dstErrDestination error pointer, may be NULL.

References AlcFree(), AlcFreeStackPush(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzIntervalDomain::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzIntervalDomain::intvlines, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzIntervalLine::nintvs, _WlzValues::obj, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzIntervalDomain::type, _WlzPlaneDomain::type, _WlzObject::values, _WlzPlaneDomain::voxel_size, WLZ_18_CONNECTED, WLZ_26_CONNECTED, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_4_CONNECTED, WLZ_6_CONNECTED, WLZ_8_CONNECTED, WLZ_EMPTY_DOMAIN, WLZ_EMPTY_OBJ, WLZ_ERR_CONNECTIVITY_TYPE, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_INTERVALDOMAIN_INTVL, WLZ_INTERVALDOMAIN_RECT, WLZ_MAX, WLZ_MIN, WLZ_PLANEDOMAIN_BOUNDLIST, WLZ_PLANEDOMAIN_DOMAIN, WLZ_TRANS_OBJ, WlzAssignDomain(), WlzAssignObject(), WlzFreeDomain(), WlzFreeObj(), WlzIDomMaxItvLn(), WlzIntervalCount(), WlzMakeEmpty(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakePlaneDomain(), WlzStandardPlaneDomain(), and WlzUnionN().

Referenced by WlzContourGrdObj2D(), WlzDistanceTransform(), WlzHyThreshold(), WlzLabel3D(), WlzMakeStdStructElement(), and WlzRegConCalcRCC().

WlzObject* WlzDistanceTransform ( WlzObject forObj,
WlzObject refObj,
WlzDistanceType  dFn,
double  dParam,
double  dMax,
WlzErrorNum dstErr 
)

Computes the distance of every pixel/voxel in the foreground object from the reference object.

Returns
Distance object which shares the given foreground object's domain and has integer distance values, null on error.

A distance transform maps all position within a forground domain to their distances from a reference domain. The distance transforms implemented within this function use efficient morphological primitives.

Given two domains, \(\Omega_r\) the reference domain and \(\Omega_f\) the domain specifying the region of interest, a domain with a thin shell \(\Omega_i\) is iteratively expanded from it's initial domain corresponding to the reference domain \(\Omega_r\). At each iteration \(\Omega_i\) is dilated and clipped by it's intersection with \(\Omega_f\) until \(\Omega_i\) becomes the null domain \(\emptyset\). At each iteration the current distance is recorded in a value table which covers the domain \(\Omega_f\).

An octagonal distance scheme may be used in which the distance metric is alternated between 4 and 8 connected for 2D and 6 and 26 connectivities in 3D. See: G. Borgefors. "Distance Transformations in Arbitrary Dimensions" CVGIP 27:321-345, 1984.

    An approximate Euclidean distance transform may be computed
    by: Scaling the given foreground and reference objects using
    the given approximation scale parameter, dilating the
    reference domain using a sphere with a radius having the same
    value as the scale parameter and then finaly sampling the
    scaled distances.
Parameters
forObjForeground object.
refObjReference object.
dFnDistance function which must be appropriate to the dimension of the foreground and reference objects.
dParamParameter required for distance function. Currently only WLZ_APX_EUCLIDEAN_DISTANCE requires a parameter. In this case the parameter is the approximation scale.
dMaxMaximum distance before itteration stops, <= 0 implies an infinite maximum distance.
dstErrDestination error pointer, may be NULL.

References _WlzValues::core, _WlzDomain::core, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyV::inv, _WlzDomain::p, _WlzDomain::pts, _WlzPixelV::type, _WlzObject::type, _WlzPixelV::v, _WlzValues::v, _WlzVoxelValues::values, _WlzValues::vox, WLZ_0_CONNECTED, WLZ_18_CONNECTED, WLZ_18_DISTANCE, WLZ_26_CONNECTED, WLZ_26_DISTANCE, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_4_CONNECTED, WLZ_4_DISTANCE, WLZ_6_CONNECTED, WLZ_6_DISTANCE, WLZ_8_CONNECTED, WLZ_8_DISTANCE, WLZ_APX_EUCLIDEAN_DISTANCE, WLZ_ERR_CONNECTIVITY_TYPE, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_UNIMPLEMENTED, WLZ_EUCLIDEAN_DISTANCE, WLZ_GREY_DOUBLE, WLZ_GREY_INT, WLZ_GREY_TAB_RAGR, WLZ_INTERPOLATION_LINEAR, WLZ_INTERPOLATION_NEAREST, WLZ_OCTAGONAL_DISTANCE, WLZ_POINTS, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_3D_AFFINE, WLZ_VOXELVALUETABLE_GREY, WlzAffineTransformFromScale(), WlzAffineTransformObj(), WlzAssignObject(), WlzAssignValues(), WlzDiffDomain(), WlzDilation(), WlzFreeAffineTransform(), WlzFreeObj(), WlzGreySetValue(), WlzGreyValueTableType(), WlzIntersect2(), WlzIntersectN(), WlzIsEmpty(), WlzMakeMain(), WlzMakeSphereObject(), WlzMakeVoxelValueTb(), WlzNewValuesVox(), WlzNewValueTb(), WlzPointsToDomObj(), and WlzStructDilation().

Referenced by WlzDomainNearby(), WlzInteriority(), WlzOffsetDist(), and WlzRegConCalcRCC().

WlzObject* WlzDomainNearby3D ( WlzObject refObj,
int  nPos,
WlzDVertex3 pos,
WlzDistanceType  dFn,
double  dMax,
WlzErrorNum dstErr 
)

This function is just a wrapper for WlzDomainNearby().

Returns
A new domain in which all pixels/voxels are nearby the given location(s). The object returned will either be of the same type as the reference object or an empty object if (all) the given location(s) are outside of the reference object's domain. On error a NULL pointer will be returned.
Parameters
refObjReference object which must be of type WLZ_EMPTY_OBJ or WLZ_3D_DOMAINOBJ.
nPosNumber of locations.
pos3D locations.
dFnThe connectivity to use when establishing distance. This must be one of:
  • WLZ_OCTAGONAL_DISTANCE
  • WLZ_4_DISTANCE
  • WLZ_6_DISTANCE
  • WLZ_8_DISTANCE
  • WLZ_18_DISTANCE
  • WLZ_26_DISTANCE
Distances must be appropriate for the given object type although all are acceptable for an empty object.
dMaxMaximum distance for a pixel/voxel to be considered nearby.
dstErrDestination error pointer, may be NULL.

References _WlzVertexP::d3, and WlzDomainNearby().

WlzObject* WlzDomainNearby ( WlzObject refObj,
int  nPos,
WlzVertexP  pos,
WlzDistanceType  dFn,
double  dMax,
WlzErrorNum dstErr 
)

Computes a new domain in which all pixels/voxels are nearby given location(s) and within the reference domain.

Returns
A new domain in which all pixels/voxels are nearby the given location(s). The object returned will either be of the same type as the reference object or an empty object if (all) the given location(s) are outside of the reference object's domain. On error a NULL pointer will be returned.
Parameters
refObjReference object which must be of type WLZ_EMPTY_OBJ, WLZ_2D_DOMAINOBJ or WLZ_3D_DOMAINOBJ.
nPosNumber of locations.
posLocations which are either of type WlzDVertex2 if the given object is of type WLZ_2D_DOMAINOBJ or WlzDVertex3 if the given object is of type WLZ_3D_DOMAINOBJ.
dFnThe connectivity to use when establishing distance. This must be one of:
  • WLZ_OCTAGONAL_DISTANCE
  • WLZ_4_DISTANCE
  • WLZ_6_DISTANCE
  • WLZ_8_DISTANCE
  • WLZ_18_DISTANCE
  • WLZ_26_DISTANCE
Distances must be appropriate for the given object type although all are acceptable for an empty object.
dMaxMaximum distance for a pixel/voxel to be considered nearby.
dstErrDestination error pointer, may be NULL.

References AlcCalloc(), AlcFree(), _WlzDomain::core, _WlzVertexP::d2, _WlzVertexP::d3, _WlzObject::domain, _WlzDomain::i, _WlzGreyV::inv, _WlzDomain::p, _WlzPixelV::type, _WlzObject::type, _WlzPixelV::v, _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_18_DISTANCE, WLZ_26_DISTANCE, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_4_DISTANCE, WLZ_6_DISTANCE, WLZ_8_DISTANCE, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_GREY_INT, WLZ_OCTAGONAL_DISTANCE, WLZ_THRESH_HIGH, WLZ_VTX_2_NINT, WLZ_VTX_3_NINT, WLZ_VTX_3_ZERO, WlzAssignObject(), WlzDistanceTransform(), WlzFreeObj(), WlzInsideDomain2D(), WlzInsideDomain3D(), WlzMakeEmpty(), WlzMakeSinglePixelObject(), WlzThreshold(), WlzUnion2(), and WlzUnionN().

Referenced by WlzDomainNearby3D().

WlzObject* WlzErosion ( WlzObject obj,
WlzConnectType  connectivity,
WlzErrorNum dstErr 
)

Calculates the morphological erosion of a woolz object with a structuring element defined by the connectivity.

Returns
Eroded object or without values or NULL on error.
Parameters
objObject to be eroded, must be a 2D or 3D domain object (including a WlzTransObj).
connectivityType of connectivity.
dstErrDestination error pointer, may be NULL.

References AlcFree(), AlcFreeStackPush(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzIntervalDomain::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzIntervalDomain::intvlines, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzIntervalLine::nintvs, _WlzValues::obj, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzIntervalDomain::type, _WlzPlaneDomain::type, _WlzObject::values, _WlzPlaneDomain::voxel_size, WLZ_18_CONNECTED, WLZ_26_CONNECTED, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_4_CONNECTED, WLZ_6_CONNECTED, WLZ_8_CONNECTED, WLZ_EMPTY_DOMAIN, WLZ_EMPTY_OBJ, WLZ_ERR_CONNECTIVITY_TYPE, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_INTERVALDOMAIN_INTVL, WLZ_INTERVALDOMAIN_RECT, WLZ_MAX, WLZ_MIN, WLZ_PLANEDOMAIN_BOUNDLIST, WLZ_PLANEDOMAIN_DOMAIN, WLZ_TRANS_OBJ, WlzAssignDomain(), WlzAssignObject(), WlzErosion4(), WlzFreeDomain(), WlzFreeObj(), WlzIDomMaxItvLn(), WlzIntersectN(), WlzIntervalCount(), WlzMakeEmpty(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakePlaneDomain(), and WlzStandardPlaneDomain().

Referenced by WlzBoundaryDomain(), WlzBoundToObj(), WlzContourRBFBndObj3D(), WlzLBTDomain2DFromIDomain(), WlzLBTDomain3DFromPDomain(), WlzThinToPoints(), and WlzVerticesFromObjBnd3I().

WlzObject* WlzMakeSpecialStructElement ( WlzSpecialStructElmType  eType,
int  elmIndex,
WlzErrorNum dstErr 
)

Return a pointer to a specific requested "special" structuring element. These are inherited from the original woolz library with rather cryptic names. See detail for more explanation of the elements and the additional parameters.

Returns
Structuring element object pointer.
Special element types:
WLZ_SPEC_STRUCT_ELM_H4 2D SE, origin - centre:
010
111
010
   
WLZ_SPEC_STRUCT_ELM_EX4 2D SE, origin - centre:
111
010
111
   
WLZ_SPEC_STRUCT_ELM_A8 2D SE, origin - centre:
111
111
111
   
WLZ_SPEC_STRUCT_ELM_H6 elmIndex = 0,1,2 2D SE, origin - centre:
011
111
110
110
111
011
111
111
010
 
WLZ_SPEC_STRUCT_ELM_H6 elmIndex = 3,4,5 2D SE, origin - centre:
110
111
110
010
111
111
011
111
011
 
WLZ_SPEC_STRUCT_ELM_H5 elmIndex = 0,1,2,3 2D SE, origin - centre:
010
111
110
010
111
011
011
111
010
110
111
010
WLZ_SPEC_STRUCT_ELM_H7 elmIndex = 0,1,2,3 2D SE, origin - centre:
111
111
011
111
111
110
110
111
111
011
111
111
WLZ_SPEC_STRUCT_ELM_A3 elmIndex = 0,1,2,3 2D SE, origin - centre:
000
111
010
010
011
010
010
111
000
010
110
010
WLZ_SPEC_STRUCT_ELM_E1 2D SE, origin - left:/td>
11
WLZ_SPEC_STRUCT_ELM_E2 2D SE, origin - centre:
111
WLZ_SPEC_STRUCT_ELM_V2 2D SE, origin - centre:
1
1
1
Parameters
eTypeEnumerated type of the requested special element.
elmIndexAdditional parameter for a particular element if required (see details).
dstErrDestination error pointer, may be NULL.

References AlcFreeStackPush(), AlcMalloc(), _WlzDomain::core, _WlzPlaneDomain::domains, _WlzIntervalDomain::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzIntervalDomain::intvlines, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzIntervalLine::nintvs, _WlzDomain::p, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_TYPE, WLZ_INTERVALDOMAIN_INTVL, WLZ_PLANEDOMAIN_DOMAIN, WLZ_SPEC_STRUCT_ELM_A3, WLZ_SPEC_STRUCT_ELM_A8, WLZ_SPEC_STRUCT_ELM_E1, WLZ_SPEC_STRUCT_ELM_E2, WLZ_SPEC_STRUCT_ELM_EX4, WLZ_SPEC_STRUCT_ELM_H4, WLZ_SPEC_STRUCT_ELM_H5, WLZ_SPEC_STRUCT_ELM_H6, WLZ_SPEC_STRUCT_ELM_H7, WLZ_SPEC_STRUCT_ELM_V2, WlzAssignDomain(), WlzFreePlaneDomain(), WlzMakeIntervalDomain(), and WlzMakePlaneDomain().

WlzObject* WlzMakeSinglePixelObject ( WlzObjectType  oType,
int  k,
int  l,
int  p,
WlzErrorNum dstErr 
)

Make a single pixel/voxel object at the specified coordinate position.

Returns
Single pixel object with coordinates (k,l,p).
Parameters
oTypeObject type - WLZ_2D_DOMAINOBJ or WLZ_3D_DOMAINOBJ.
kColumn (x) coordinate.
lLine (y) coordinate.
pPlane (z) coordinate.
dstErrDestination error pointer, may be NULL.

References _WlzValues::core, WLZ_ERR_NONE, WlzFreeDomain(), and WlzMakeMain().

Referenced by WlzDomainNearby(), WlzMakeCircleObject(), WlzMakeMarkers(), WlzMakeQuadrilateral(), WlzMakeRectangleObject(), WlzMakeStdStructElement(), and WlzPointsToDomObj().

WlzObject* WlzMakeCircleObject ( double  radius,
double  x,
double  y,
WlzErrorNum dstErr 
)

Generate a discretised circle domain centered at (x,y).

Returns
Object with circular domain.
Parameters
radiusCircle radius.
xColumn/x coordinate of the circle centre.
yRow/y coordinate of the circle centre.
dstErrDestination error pointer, may be NULL.

References AlcCalloc(), AlcFreeStackPush(), _WlzValues::core, _WlzIntervalDomain::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzInterval::iright, WLZ_2D_DOMAINOBJ, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_INTERVALDOMAIN_INTVL, WLZ_NINT, WlzFreeIntervalDomain(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakeSinglePixelObject(), and WlzStandardIntervalDomain().

Referenced by WlzCMeshFromObj2D(), WlzDrawDomainObj(), WlzMakeSphereObject(), and WlzMeshFromObjBox().

WlzObject* WlzMakeRectangleObject ( double  radiusX,
double  radiusY,
double  x,
double  y,
WlzErrorNum dstErr 
)

Generate a rectangular object centered at (x,y) with half-width radiusX and half-height radius Y.

Returns
Rectangular object
Parameters
radiusXColumn half-width of rectangle
radiusYLine (y) half-width of rectangle
xColumn (x) rectangle centre.
yLine (y) rectangle centre.
dstErrDestination error pointer, may be NULL.

References _WlzValues::core, _WlzDomain::i, WLZ_2D_DOMAINOBJ, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_INTERVALDOMAIN_RECT, WLZ_NINT, WlzMakeIntervalDomain(), WlzMakeMain(), and WlzMakeSinglePixelObject().

Referenced by WlzCMeshFromObj2D(), WlzMakeCuboidObject(), WlzMakeTiledValuesObj2D(), and WlzPointsFromDomObj().

WlzObject* WlzMakeSphereObject ( WlzObjectType  oType,
double  radius,
double  x,
double  y,
double  z,
WlzErrorNum dstErr 
)

Make a spherical domain object.

Returns
Sphere object
Parameters
oTypeObject type - make a circle if 2D.
radiusSphere radius
xColumn (x) centre.
yLine (y) centre.
zPlane (x) centre.
dstErrDestination error pointer, may be NULL.

References _WlzValues::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzDomain::p, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_NINT, WLZ_PLANEDOMAIN_DOMAIN, WlzAssignDomain(), WlzFreeObj(), WlzFreePlaneDomain(), WlzMakeCircleObject(), WlzMakeMain(), WlzMakePlaneDomain(), and WlzStandardPlaneDomain().

Referenced by WlzConComThreshold(), WlzContourRBFBndObj3D(), WlzDistanceTransform(), WlzMakeMarkers(), WlzMakeStdStructElement(), WlzOffsetDist(), WlzPointsToDomObj(), and WlzRegConCalcRCC().

WlzObject* WlzMakeCuboidObject ( WlzObjectType  oType,
double  radiusX,
double  radiusY,
double  radiusZ,
double  x,
double  y,
double  z,
WlzErrorNum dstErr 
)

Generate a cuboid object centered at (x,y,z).

Returns
Cuboid domain object
Parameters
oTypeObject type use WlzMakerectangleObject() if 2D.
radiusXCuboid half-width (x)
radiusYCuboid half-height (y).
radiusZCuboid half-depth (z).
xColumn (x) centre.
yLine (y) centre.
zPlane (z) centre.
dstErrDestination error pointer, may be NULL.

References _WlzValues::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzDomain::p, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_NINT, WLZ_PLANEDOMAIN_DOMAIN, WlzAssignDomain(), WlzFreeObj(), WlzFreePlaneDomain(), WlzMakeMain(), WlzMakePlaneDomain(), WlzMakeRectangleObject(), and WlzStandardPlaneDomain().

Referenced by WlzCMeshFromObj3D(), WlzMakeTiledValuesObj3D(), and WlzPointsFromDomObj().

WlzObject* WlzMakeQuadrilateral ( double  x0,
double  y0,
double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3,
WlzErrorNum dstErr 
)

Generate 2D interval domain object corresponding to the arbitrarily oriented quadrilateral with the given ordered vertex coordinates. The ordering is such that the vertices allow the rectangle to be drawn by line segments conecting v[i] to v[(i + 1)%4], with i \(\in\) [0-3].

Returns
Object with quadrilateral domain.
Parameters
x0Column coordinate of the first vertex.
y0Row coordinate of the first vertex.
x1Column coordinate of the second vertex.
y1Row coordinate of the second vertex.
x2Column coordinate of the third vertex.
y2Row coordinate of the third vertex.
x3Column coordinate of the forth vertex.
y3Row coordinate of the forth vertex.
dstErrDestination error pointer, may be NULL.

References AlcCalloc(), AlcFreeStackPush(), _WlzValues::core, _WlzIntervalDomain::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzInterval::iright, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_INTERVALDOMAIN_INTVL, WlzFreeDomain(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakeSinglePixelObject(), WlzRasterLineSetItv2D(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, and _WlzIBox2::yMin.

Referenced by WlzDrawDomainObj().

WlzObject* WlzMakeStdStructElement ( WlzObjectType  oType,
WlzDistanceType  dType,
double  radius,
WlzErrorNum dstErr 
)

Makes a standard structure element - basicaly a sphere but with the appropriate connectivity or distance metric.

Returns
Parameters
oTypeObject type - WLZ_2D_DOMAINOBJ or WLZ_3D_DOMAINOBJ.
dTypeDistance metric.
radiusSphere radius.
dstErrDestination error pointer, may be NULL.

References WLZ_18_DISTANCE, WLZ_26_DISTANCE, WLZ_4_CONNECTED, WLZ_4_DISTANCE, WLZ_6_DISTANCE, WLZ_8_CONNECTED, WLZ_8_DISTANCE, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_TYPE, WLZ_EUCLIDEAN_DISTANCE, WLZ_NINT, WLZ_OCTAGONAL_DISTANCE, WlzDilation(), WlzFreeObj(), WlzMakeEmpty(), WlzMakeSinglePixelObject(), and WlzMakeSphereObject().

WlzObject* WlzStructDilation ( WlzObject obj,
WlzObject structElm,
WlzErrorNum dstErr 
)

Dilate an object with respect to the given structuring element. This is defined as the domain obtained as the union of the SE placed at every pixel of the input domain.

Returns
Dilated domain object.
Parameters
objInput object to be dilated
structElmStructuring element.
dstErrError return.
Source:
WlzStructDilation.c

References AlcFree(), AlcFreeStackPush(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzIntervalDomain::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzIntervalDomain::intvlines, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzIntervalLine::nintvs, _WlzValues::obj, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzIntervalDomain::type, _WlzPlaneDomain::type, _WlzObject::values, _WlzPlaneDomain::voxel_size, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_DOMAIN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_INTERVALDOMAIN_INTVL, WLZ_PLANEDOMAIN_DOMAIN, WLZ_TRANS_OBJ, WlzAssignDomain(), WlzAssignObject(), WlzFreeDomain(), WlzFreeIntervalDomain(), WlzFreeObj(), WlzFreePlaneDomain(), WlzIDomMaxItvLn(), WlzIntervalCount(), WlzMakeEmpty(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakePlaneDomain(), WlzNewIDomain(), WlzStandardPlaneDomain(), and WlzUnionN().

Referenced by WlzCMeshFromObj2D(), WlzCMeshFromObj3D(), WlzContourRBFBndObj3D(), WlzDistanceTransform(), WlzMakeTiledValuesObj2D(), WlzMakeTiledValuesObj3D(), WlzMeshFromObjBox(), WlzOffsetDist(), and WlzRegConCalcRCC().

WlzObject* WlzStructErosion ( WlzObject obj,
WlzObject structElm,
WlzErrorNum dstErr 
)

Performs erosion using a structuring element.

Returns
New object or NULL on error.
Parameters
objGiven object to be eroded.
structElmStructuring element.
dstErrDestination error pointer, may be NULL.

References AlcFree(), AlcFreeStackPush(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzIntervalDomain::freeptr, _WlzDomain::i, _WlzInterval::ileft, _WlzIntervalDomain::intvlines, _WlzIntervalLine::intvs, _WlzInterval::iright, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzIntervalLine::nintvs, _WlzValues::obj, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzIntervalDomain::type, _WlzPlaneDomain::type, _WlzObject::values, _WlzPlaneDomain::voxel_size, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_DOMAIN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_INTERVALDOMAIN_INTVL, WLZ_PLANEDOMAIN_DOMAIN, WLZ_TRANS_OBJ, WlzAssignDomain(), WlzAssignObject(), WlzFreeDomain(), WlzFreeObj(), WlzFreePlaneDomain(), WlzIDomMaxItvLn(), WlzIntersectN(), WlzIntervalCount(), WlzMakeEmpty(), WlzMakeInterval(), WlzMakeIntervalDomain(), WlzMakeMain(), WlzMakePlaneDomain(), WlzNewIDomain(), WlzStandardIntervalDomain(), and WlzStandardPlaneDomain().

Referenced by WlzContourRBFBndObj3D(), and WlzPointsFromDomObj().