Woolz Image Processing
Version 1.7.5
|
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_OBJECT_TYPE, 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_3D_DOMAINOBJ, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_CONTOUR_MTD_BND, WLZ_CONTOUR_MTD_GRD, WLZ_CONTOUR_MTD_ISO, WLZ_CONTOUR_MTD_RBFBND, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WlzContourGrdObj2D(), and WlzContourRBFBndObj3D().
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.
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 Alc2Free(), ALC_ER_NONE, AlcBit1Calloc(), AlcBit2Calloc(), AlcDouble1Malloc(), AlcDouble2Malloc(), AlcFree(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzVertexP::d3, _WlzGreyP::dbp, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzVertexP::f3, _WlzGreyP::flp, _WlzDomain::i, _WlzVertexP::i3, _WlzGreyP::inp, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzIntervalDomain::lastln, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzIntervalWSpace::linpos, _WlzAffineTransform::mat, _WlzContour::model, _WlzIntervalWSpace::nwlpos, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzGreyP::rgbp, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzCoreDomain::type, _WlzCoreValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzVertexP::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, _WlzPlaneDomain::voxel_size, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzDVertex3::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzDVertex3::vtY, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_BIT_GET, WLZ_CONTOUR_MTD_ISO, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GMMOD_2D, WLZ_GMMOD_3D, WLZ_GREY_BIT, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_INTERPOLATION_LINEAR, WLZ_PLANEDOMAIN_DOMAIN, WLZ_TRANSFORM_3D_AFFINE, WLZ_VERTEX_D3, WLZ_VERTEX_F3, WLZ_VERTEX_I3, WlzAffineTransformContour(), WlzAffineTransformFromScale(), WlzAffineTransformGMModel(), WlzAffineTransformObj(), WlzAssignGMModel(), WlzBasisFnFree(), WlzBasisFnScalarMOS3DFromCPts(), WlzBasisFnValueScalarMOS3D(), WlzBitLnSetItv(), WlzBoundingBox2I(), WlzBoundingBox3I(), WlzContourObj(), WlzFreeAffineTransform(), WlzFreeContour(), WlzFreeObj(), WlzGMModelNew(), WlzGreyTableIsTiled(), WlzInitGreyScan(), WlzMakeAffineTransform(), WlzMakeContour(), WlzMakeMain(), WlzNextGreyInterval(), WlzToArray2D(), WlzValueCopyDoubleToDouble(), WlzValueCopyDVertexToDVertex3(), WlzValueCopyFloatToDouble(), WlzValueCopyFVertexToDVertex3(), WlzValueCopyIntToDouble(), WlzValueCopyIVertexToDVertex3(), WlzValueCopyRGBAToDouble(), WlzValueCopyShortToDouble(), WlzValueCopyUByteToDouble(), WlzValueSetDouble(), WlzValueSetUByte(), WlzWriteObj(), _WlzIBox2::xMax, _WlzIBox3::xMax, _WlzIBox2::xMin, _WlzIBox3::xMin, _WlzIBox2::yMax, _WlzIBox3::yMax, _WlzIBox2::yMin, _WlzIBox3::yMin, and _WlzIBox3::zMin.
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.
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 Alc2Free(), ALC_ER_NONE, AlcBit2Calloc(), AlcDouble2Calloc(), AlcDouble2Malloc(), AlcUnchar2Calloc(), AlcVectorItemGet(), _WlzDomain::b, _WlzRsvFilter::c, _WlzDomain::cm2, _WlzDomain::cm3, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzCMeshFace::edu, _WlzCMeshElm2D::edu, _WlzCMeshRes::elm, _WlzCMeshElm3D::face, _WlzDomain::i, _WlzCMeshElm2D::idx, _WlzCMeshElm3D::idx, _WlzIntervalWSpace::intrmn, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastpl, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzIntervalWSpace::linpos, _WlzCMeshEntRes::maxEnt, _WlzContour::model, _WlzCMeshEdgU2D::next, _WlzCMeshEdgU2D::nod, _WlzCMeshEdgU3D::nod, _WlzCMeshEntRes::numEnt, _WlzIntervalWSpace::nwlpos, _WlzCMeshEdgU2D::opp, _WlzCMeshFace::opp, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzCMeshNod2D::pos, _WlzCMeshNod3D::pos, _WlzCMesh2D::res, _WlzCMesh3D::res, _WlzIntervalWSpace::rgtpos, _WlzObject::type, _WlzCoreDomain::type, _WlzCoreValues::type, _WlzCMesh2D::type, _WlzCMesh3D::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::v, _WlzObject::values, _WlzVoxelValues::values, _WlzCMeshEntRes::vec, _WlzValues::vox, _WlzIVertex2::vtX, _WlzIVertex3::vtX, _WlzIVertex2::vtY, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_4_CONNECTED, WLZ_BIT_GET, WLZ_CMESH_2D, WLZ_CMESH_3D, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GMMOD_2D, WLZ_GMMOD_2N, WLZ_GMMOD_3D, WLZ_GREY_BIT, WLZ_GREY_DOUBLE, WLZ_PLANEDOMAIN_DOMAIN, WLZ_RSVFILTER_ACTION_X, WLZ_RSVFILTER_ACTION_Y, WLZ_RSVFILTER_ACTION_Z, WLZ_RSVFILTER_NAME_DERICHE_1, WlzAssignGMModel(), WlzAssignObject(), WlzBitLnSetItv(), WlzBoundingBox2I(), WlzBoundingBox3I(), WlzDilation(), WlzFreeContour(), WlzFreeObj(), WlzGMModelConstructSimplex2D(), WlzGMModelConstructSimplex3D(), WlzGMModelNew(), WlzGreyTableIsTiled(), WlzInitGreyScan(), WlzIntRescaleObj(), WlzMakeContour(), WlzMakeMain(), WlzNextGreyInterval(), WlzObjToBoundary(), WlzRsvFilterFreeFilter(), WlzRsvFilterMakeFilter(), WlzRsvFilterObj(), WlzToArray2D(), WlzValueCopyGreyToGrey(), WlzValueSetDouble(), WlzValueSetUByte(), _WlzIBox3::xMax, _WlzIBox2::xMin, _WlzIBox3::xMin, _WlzIBox3::yMax, _WlzIBox2::yMin, _WlzIBox3::yMin, and _WlzIBox3::zMin.
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.
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 Alc2Free(), ALC_ER_NONE, AlcBit2Calloc(), AlcFree(), AlcMalloc(), ALG_NINT, AlgRandUniform(), AlgShuffleIdx(), _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzBoundList::down, _WlzGreyV::flv, _WlzVertexP::i3, _WlzPlaneDomain::lastpl, _WlzContour::model, _WlzBoundList::next, _WlzPolygonDomain::nvertices, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzBoundList::poly, _WlzPixelV::type, _WlzObject::type, _WlzCoreDomain::type, _WlzVertexP::v, _WlzPixelV::v, _WlzValues::vox, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzPolygonDomain::vtx, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_6_CONNECTED, WLZ_BIT_GET, WLZ_CONTOUR_BNDPTS_RANDOM, WLZ_CONTOUR_BNDPTS_REGULAR, WLZ_CONTOUR_TIC2D_NONE, WLZ_CONTOUR_TIC2D_S02S21, WLZ_CONTOUR_TIC2D_S10S02, WLZ_CONTOUR_TIC2D_S21S10, WLZ_CONTOUR_TIC2D_V0S21, WLZ_CONTOUR_TIC2D_V0V2, WLZ_CONTOUR_TIC2D_V1S02, WLZ_CONTOUR_TIC2D_V1V0, WLZ_CONTOUR_TIC2D_V2S10, WLZ_CONTOUR_TIC2D_V2V1, WLZ_CTR_TOLERANCE, WLZ_EMPTY_DOMAIN, 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_PARAM_DATA, WLZ_ERR_UNIMPLEMENTED, WLZ_GMMOD_3D, WLZ_GREY_BIT, WLZ_GREY_FLOAT, WLZ_GREY_TAB_INTL, WLZ_PLANEDOMAIN_DOMAIN, WLZ_VERTEX_I3, WLZ_VTX_2_SCALE, WLZ_VTX_2_SQRLEN, WLZ_VTX_2_SUB, WLZ_VTX_3_ADD, WLZ_VTX_3_LENGTH, WLZ_VTX_3_SCALE, WLZ_VTX_3_SQRLEN, WLZ_VTX_3_SUB, WlzAssignGMModel(), WlzBoundingBox3I(), WlzContourFromPoints(), WlzDiffDomain(), WlzErosion(), WlzFreeContour(), WlzFreeObj(), WlzGeomUnitVector2D(), WlzGeomVtxEqual2D(), WlzGMModelConstructSimplex2D(), WlzGMModelConstructSimplex2N(), WlzGMModelConstructSimplex3D(), WlzGMModelNew(), WlzGreyValueTableType(), WlzMakeContour(), WlzMakeMain(), WlzMakeSphereObject(), WlzNewValuesVox(), WlzSampleObjPoint3D(), WlzStructDilation(), WlzStructErosion(), WlzToArray2D(), WlzVerticesFromObjBnd3I(), WlzWriteObj(), _WlzIBox3::xMax, _WlzIBox3::xMin, _WlzIBox3::yMax, and _WlzIBox3::yMin.
Referenced by WlzContourObj().