Woolz Image Processing
Version 1.8.3
|
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 | |
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. More... | |
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(). More... | |
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. More... | |
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. More... | |
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. More... | |
enum _WlzContourTriIsn2D |
Classification of the intersection of a line segment with a triangle. Typedef: WlzContourTriIsn2D.
Boudary point sampling methods. Typedef: WlzContourBndSamMethod.
Enumerator | |
---|---|
WLZ_CONTOUR_BNDPTS_REGULAR | |
WLZ_CONTOUR_BNDPTS_RANDOM |
enum _WlzContourMethod |
Contour generation methods. Typedef: WlzContourMethod.
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.
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. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_VALUES_NULL, and WlzContourGrdObj2D().
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().
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. |
References _WlzDomain::core, _WlzObject::domain, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_CONTOUR_MTD_ISO, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, and WLZ_ERR_OBJECT_NULL.
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.
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. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzVertexP::v, _WlzObject::values, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_VALUES_NULL, WLZ_VERTEX_D3, WLZ_VERTEX_F3, and WLZ_VERTEX_I3.
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.
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 \| +------+------+
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. |
References ALC_ER_NONE, AlcBit2Calloc(), AlcDouble2Calloc(), AlcUnchar2Calloc(), _WlzRsvFilter::c, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzObject::domain, _WlzDomain::i, _WlzIntervalWSpace::intrmn, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzIntervalWSpace::linpos, _WlzContour::model, _WlzIntervalWSpace::nwlpos, _WlzGreyWSpace::pixeltype, _WlzIntervalWSpace::rgtpos, _WlzGreyWSpace::u_grintptr, _WlzGreyP::v, _WlzObject::values, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_BIT_GET, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_VALUES_NULL, WLZ_GMMOD_2D, WLZ_GMMOD_2N, WLZ_GREY_DOUBLE, WLZ_RSVFILTER_ACTION_X, WLZ_RSVFILTER_ACTION_Y, WLZ_RSVFILTER_NAME_DERICHE_1, WlzAssignGMModel(), WlzBitLnSetItv(), WlzGMModelNew(), WlzInitGreyScan(), WlzMakeContour(), WlzNextGreyInterval(), WlzRsvFilterFreeFilter(), WlzRsvFilterMakeFilter(), WlzRsvFilterObj(), WlzValueCopyGreyToGrey(), WlzValueSetDouble(), and WlzValueSetUByte().
Referenced by 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.
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. |
References _WlzDomain::core, _WlzObject::domain, _WlzVertexP::i3, _WlzObject::type, _WlzVertexP::v, WLZ_3D_DOMAINOBJ, WLZ_CONTOUR_BNDPTS_RANDOM, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WlzFreeObj(), WlzMakeSphereObject(), WlzStructDilation(), WlzStructErosion(), and WlzWriteObj().