Woolz Image Processing  Version 1.7.5
WlzContour

## Files

file  WlzContour.c
Functions for extracting contours from objects.

## Data Structures

struct  _WlzContour
A collection of 2D polylines or 3D surface elements represented by a Woolz geometric model. Typedef: WlzContour. More...

## Enumerations

enum  _WlzContourTriIsn2D {
WLZ_CONTOUR_TIC2D_NONE,
WLZ_CONTOUR_TIC2D_V1V0,
WLZ_CONTOUR_TIC2D_V0V2,
WLZ_CONTOUR_TIC2D_V2V1,
WLZ_CONTOUR_TIC2D_V1S02,
WLZ_CONTOUR_TIC2D_V0S21,
WLZ_CONTOUR_TIC2D_V2S10,
WLZ_CONTOUR_TIC2D_S10S02,
WLZ_CONTOUR_TIC2D_S02S21,
WLZ_CONTOUR_TIC2D_S21S10
}
Classification of the intersection of a line segment with a triangle. Typedef: WlzContourTriIsn2D. More...

enum  _WlzContourBndSamMethod {
WLZ_CONTOUR_BNDPTS_REGULAR,
WLZ_CONTOUR_BNDPTS_RANDOM
}
Boudary point sampling methods. Typedef: WlzContourBndSamMethod. More...

enum  _WlzContourMethod {
WLZ_CONTOUR_MTD_ISO,
WLZ_CONTOUR_MTD_GRD,
WLZ_CONTOUR_MTD_BND,
WLZ_CONTOUR_MTD_RBFBND
}
Contour generation methods. Typedef: WlzContourMethod. More...

## Functions

WlzContourWlzContourObjGrd (WlzObject *srcObj, double ctrLo, double ctrHi, double ctrWth, int nrmFlg, WlzErrorNum *dstErr)
Creates a contour (list of connected edges or surface patches) from a Woolz object with values using a maximal gradient algorithm and retains the gradient vectors. The gradient vectors are only valid for valid vertex indicies and do not have unit length. More...

WlzContourWlzContourObj (WlzObject *srcObj, WlzContourMethod ctrMtd, double ctrVal, double ctrWth, int nrmFlg, WlzErrorNum *dstErr)
Creates a contour (list of connected edges or surface patches) from a Woolz object's values. The source object should either a 2D or 3D domain object with values. This is the top level contour generation function which calls the appropriate function for the given contour type (dimension) and generation method. The given contour value is taken to be the iso-value for iso-value contours and the minimum gradient threshold value for maximal gradient contours. The contour width parameter is only used for maximal gradient contours where it is used to generate a recursive Deriche filter, see WlzRsvFilter(). More...

WlzContourWlzContourFromPoints (WlzObject *dObj, WlzVertexType vtxType, int nSPts, WlzVertexP sPts, double sAlpha, int nIPts, WlzVertexP iPts, double iDist, double iAlpha, int nOPts, WlzVertexP oPts, double oDist, double oAlpha, double delta, double tau, double samFac, WlzErrorNum *dstErr)
Given three points sets: On, inside and outside some curve this function computes a contour for the curve. This is done by approximating (or interpolating) the distance function for the curve using multi order spline radial basis functions. The contour is then computed from the zero level set of the radial basis functions within the given distance object. The distance object sampling factor is used to subsample the distance object prior to cuting the zero value isosurface. The surface computed from a sampled distance object is then transformed using the inverse of the sampling transform. More...

WlzContourWlzContourGrdObj2D (WlzObject *srcObj, WlzObject *gGXObj, WlzObject *gGYObj, double grdLo, double grdHi, double ftrPrm, int nrmFlg, WlzErrorNum *dstErr)
Creates an maximal gradient contour (list of edges) from a 2D Woolz object's values. More...

WlzContourWlzContourRBFBndObj3D (WlzObject *gObj, int bErosion, int bDilation, int sDilation, int sFac, int oFac, double sAlpha, double oAlpha, double delta, double tau, double samFac, WlzErrorNum *dstErr)
Computes a 3D contour from the boundary of the given objects domain by extracting the zero level set of an approximate signed distance function computed using a multi-order spline radial basis function. The distance object sampling factor is used to subsample the distance object prior to cuting the zero value isosurface. The surface computed from a sampled distance object is then transformed using the inverse of the sampling transform. More...

## Enumeration Type Documentation

 enum _WlzContourTriIsn2D

Classification of the intersection of a line segment with a triangle. Typedef: WlzContourTriIsn2D.

Enumerator
WLZ_CONTOUR_TIC2D_NONE

No intersection

WLZ_CONTOUR_TIC2D_V1V0

Vertex 1 - vertex 0

WLZ_CONTOUR_TIC2D_V0V2

Vertex 0 - vertex 2

WLZ_CONTOUR_TIC2D_V2V1

Vertex 2 - vertex 1

WLZ_CONTOUR_TIC2D_V1S02

Vertex 1 - side 0-2

WLZ_CONTOUR_TIC2D_V0S21

Vertex 0 - side 2-1

WLZ_CONTOUR_TIC2D_V2S10

Vertex 2 - side 1-0

WLZ_CONTOUR_TIC2D_S10S02

Side 1-0 - side 0-2

WLZ_CONTOUR_TIC2D_S02S21

Side 0-2 - side 2-1

WLZ_CONTOUR_TIC2D_S21S10

Side 2-1 - side 1-0

Boudary point sampling methods. Typedef: WlzContourBndSamMethod.

Enumerator
WLZ_CONTOUR_BNDPTS_REGULAR
WLZ_CONTOUR_BNDPTS_RANDOM
 enum _WlzContourMethod

Contour generation methods. Typedef: WlzContourMethod.

Enumerator
WLZ_CONTOUR_MTD_ISO

Iso-value.

WLZ_CONTOUR_MTD_GRD

WLZ_CONTOUR_MTD_BND

Object boundary.

WLZ_CONTOUR_MTD_RBFBND

Object boundary established using a radial basis function.

## Function Documentation

 WlzContour* WlzContourObjGrd ( WlzObject * srcObj, double ctrLo, double ctrHi, double ctrWth, int nrmFlg, WlzErrorNum * dstErr )

Creates a contour (list of connected edges or surface patches) from a Woolz object with values using a maximal gradient algorithm and retains the gradient vectors. The gradient vectors are only valid for valid vertex indicies and do not have unit length.

Returns
Contour, or NULL on error.
Parameters
 srcObj Given object from which to compute the contours. required. ctrLo Lower maximal gradient threshold value. ctrHi Higher maximal gradient threshold value. ctrWth Contour filter width. nrmFlg Add image gradients as normals to contour if non zero. dstErr Destination error pointer, may be NULL.

Referenced by WlzRegICPObjsGrd().

 WlzContour* WlzContourObj ( WlzObject * srcObj, WlzContourMethod ctrMtd, double ctrVal, double ctrWth, int nrmFlg, WlzErrorNum * dstErr )

Creates a contour (list of connected edges or surface patches) from a Woolz object's values. The source object should either a 2D or 3D domain object with values. This is the top level contour generation function which calls the appropriate function for the given contour type (dimension) and generation method. The given contour value is taken to be the iso-value for iso-value contours and the minimum gradient threshold value for maximal gradient contours. The contour width parameter is only used for maximal gradient contours where it is used to generate a recursive Deriche filter, see WlzRsvFilter().

Returns
Contour, or NULL on error.
Parameters
 srcObj Given object from which to compute the contours. ctrMtd Contour generation method. ctrVal Contour value. ctrWth Contour filter width. nrmFlg Generate normals from image if possible. dstErr Destination error pointer, may be NULL.

Referenced by WlzContourFromPoints().

 WlzContour* WlzContourFromPoints ( WlzObject * dObj, WlzVertexType vtxType, int nSPts, WlzVertexP sPts, double sAlpha, int nIPts, WlzVertexP iPts, double iDist, double iAlpha, int nOPts, WlzVertexP oPts, double oDist, double oAlpha, double delta, double tau, double samFac, WlzErrorNum * dstErr )

Given three points sets: On, inside and outside some curve this function computes a contour for the curve. This is done by approximating (or interpolating) the distance function for the curve using multi order spline radial basis functions. The contour is then computed from the zero level set of the radial basis functions within the given distance object. The distance object sampling factor is used to subsample the distance object prior to cuting the zero value isosurface. The surface computed from a sampled distance object is then transformed using the inverse of the sampling transform.

Returns
New contour or NULL on error.
Parameters
 dObj Object with double values, within which the distance function will be evaluated. vtxType Type of all vertices. nSPts Number of on surface points. sPts Positions of the on surface points. sAlpha Alpha value for the on surface points. nIPts Number of inside points. iPts Positions of the inside points. iDist Distance from surface for the inside points. iAlpha Alpha value for the inside points. nOPts Number of outside points. oPts Positions of the outside points. oDist Distance from surface for the outside points. oAlpha Alpha value for the outside points. delta Multiorder spline $$\delta$$ smoothness parameter. tau Multiorder spline $$\tau$$ smoothness parameter. samFac Distance object sampling factor. dstErr Destination error pointer, may be NULL.

Referenced by WlzContourRBFBndObj3D().

 WlzContour* WlzContourGrdObj2D ( WlzObject * srcObj, WlzObject * gGXObj, WlzObject * gGYObj, double grdLo, double grdHi, double ftrPrm, int nrmFlg, WlzErrorNum * dstErr )

Creates an maximal gradient contour (list of edges) from a 2D Woolz object's values.

Returns
Contour , or NULL on error.
          Creates an maximal gradient contour (list of edges)
from a 2D Woolz object's values.
Direction of gradient is encoded as:

                  +------+------+
|\   2 | 1   /|
|  \   |   /  |
| 3  \ | /  0 |
+------+------+
| 4  / | \  7 |
|  /   |   \  |
|/   5 | 6   \|
+------+------+
Parameters
 srcObj Given object from which to compute gradients for the contours. gGXObj If non NULL used for gradients across columns. gGYObj If non NULL used for gradient through lines. grdLo Lower threshold for modulus of gradient. grdHi Upper threshold for modulus of gradient. ftrPrm Filter width parameter. nrmFlg Add image gradients as normals to contour if non zero. dstErr Destination error pointer, may be NULL.

Referenced by WlzContourObj(), and WlzContourObjGrd().

 WlzContour* WlzContourRBFBndObj3D ( WlzObject * gObj, int bErosion, int bDilation, int sDilation, int sFac, int oFac, double sAlpha, double oAlpha, double delta, double tau, double samFac, WlzErrorNum * dstErr )

Computes a 3D contour from the boundary of the given objects domain by extracting the zero level set of an approximate signed distance function computed using a multi-order spline radial basis function. The distance object sampling factor is used to subsample the distance object prior to cuting the zero value isosurface. The surface computed from a sampled distance object is then transformed using the inverse of the sampling transform.

Returns
Woolz contour or NULL on error.
Parameters
 gObj The given object. bErosion Object boundary erosion for interior points. bDilation Object boundary dilation for exterior points. sDilation Object boundary dilation for distance object used in surface extraction. sFac Sampling factor for surface points. oFac Sampling factor for interior and exterior points. sAlpha Degree of approximation for the surface boundary points. The multi-order spline $$\alpha$$ parameter. oAlpha Degree of approximation for the interior and exterior points. The multi-order spline $$\alpha$$ parameter. delta Multi-order spline $$\delta$$ parameter. tau Multi-order spline $$tau$$ parameter. samFac Distance object sampling factor. dstErr Destination error pointer, may be NULL.

Referenced by WlzContourObj().