Woolz Image Processing
Version 1.8.3
|
Files | |
file | WlzCbThreshold.c |
Threshold an object using a callback function to determine if the pixel value satifies the threshold criteria. | |
file | WlzCompThresh.c |
Functions for computing a threshold value from a histogram object. | |
file | WlzConComThreshold.c |
Functions to perform connected component thresholding. | |
file | WlzHyThreshold.c |
A hysteresis threshold filter. | |
file | WlzRGBAThreshold.c |
Threshold functions for RGBA objects. | |
file | WlzThreshold.c |
Thresholds 2D or 3D domain objects with values. | |
Macros | |
#define | WLZ_THRESH_ADD_ITV_1(N, NL1, NLL, NK1, NKL, G, IWS, TV, P, OP, K, OV) |
Computes the number of intervals for WlzThreshold() from integral grey values or floating point if not comparing equality. The following parameters are required: More... | |
#define | WLZ_THRESH_ADD_ITV_FE_1(N, NL1, NLL, NK1, NKL, G, IWS, TV, P, E, K, OV) |
Computes the number of intervals for WlzThreshold() from floating point grey values using an equality operator. The following parameters are required: More... | |
#define | WLZ_THRESH_ADD_ITV_RGB_1(N, NL1, NLL, NK1, NKL, G, IWS, TV, OP, K, OV) |
Computes the number of intervals for WlzThreshold() from RGBA grey values using a modulus operator to compute a scalar grey value from the RGBA value. The following parameters are required: More... | |
#define | WLZ_THRESH_ADD_ITV_2(N, NK1, G, ITV, IWS, TV, P, OP, K, OV) |
Constructs the intervals for WlzThreshold() from integral grey values or floating point if not comparing equality. The following parameters are required: More... | |
#define | WLZ_THRESH_ADD_ITV_FE_2(N, NK1, G, ITV, IWS, TV, P, E, K, OV) |
Constructs the intervals for WlzThreshold() from floating point grey values using an equality operator. The following parameters are required: More... | |
#define | WLZ_THRESH_ADD_ITV_RGB_2(N, NK1, G, ITV, IWS, TV, P, OP, K, OV) |
Constructs the intervals for WlzThreshold() from RGBA grey values using a modulus operator to compute a scalar grey value from the RGBA value. The following parameters are required: More... | |
Enumerations | |
enum | _WlzCompThreshType { WLZ_COMPTHRESH_FOOT, WLZ_COMPTHRESH_DEPTH, WLZ_COMPTHRESH_GRADIENT, WLZ_COMPTHRESH_FRACMIN, WLZ_COMPTHRESH_SMOOTHSPLIT, WLZ_COMPTHRESH_OTSU } |
Automatic threshold computation methods. The histogram may need to be smoothed for these algorithms to work. Typedef: WlzCompThreshType. More... | |
enum | _WlzThresholdType { WLZ_THRESH_LOW = 0, WLZ_THRESH_HIGH, WLZ_THRESH_EQUAL } |
Threshold value selection. Typedef: WlzThresholdType. More... | |
enum | _WlzRGBAThresholdType { WLZ_RGBA_THRESH_NONE, WLZ_RGBA_THRESH_SINGLE, WLZ_RGBA_THRESH_MULTI, WLZ_RGBA_THRESH_PLANE, WLZ_RGBA_THRESH_SLICE, WLZ_RGBA_THRESH_BOX, WLZ_RGBA_THRESH_SPHERE } |
Colour threshold type selection. Typedef: WlzRGBAThresholdType. More... | |
Functions | |
WlzErrorNum | WlzCompThresholdVT (WlzObject *hObj, WlzCompThreshType method, double param0, double param1, double extraFrac, WlzPixelV *dstTV, WlzThresholdType *dstTType) |
Computes a threshold value and type using the given histogram and method. More... | |
WlzErrorNum | WlzCompThreshold (double *dstThrVal, WlzObject *histObj, WlzCompThreshType method, double extraFrac) |
Computes a threshold value from the given histogram object using the given method. More... | |
WlzObject * | WlzConComThreshold2D (WlzObject *gObj, int nSeeds, WlzIVertex2 *seeds, WlzThresholdType tHiLo, int xtr, double rad, WlzThresholdType rHiLo, WlzErrorNum *dstErr) |
Performs connected component thresholding of the given object using the given 2D seed points. See also WlzConComThreshold3D(), WlzConComThreshold() and WlzThreshold(). More... | |
WlzObject * | WlzConComThreshold3D (WlzObject *gObj, int nSeeds, WlzIVertex3 *seeds, WlzThresholdType tHiLo, int xtr, double rad, WlzThresholdType rHiLo, WlzErrorNum *dstErr) |
Performs connected component thresholding of the given object using the given 3D seed points. See also WlzConComThreshold2D(), WlzConComThreshold() and WlzThreshold(). More... | |
WlzObject * | WlzConComThreshold (WlzObject *gObj, int nSeeds, WlzVertexType seedType, WlzVertexP seeds, WlzThresholdType tHiLo, int xtr, double rad, WlzThresholdType rHiLo, WlzErrorNum *dstErr) |
Performs connected component thresholding of the given object using the given coordinates of seed points within the given object. See also WlzConComThreshold2D(), WlzConComThreshold3D() and WlzThreshold(). More... | |
WlzObject * | WlzHyThreshold (WlzObject *srcObj, WlzPixelV pThrV, WlzPixelV sThrV, WlzThresholdType hilo, WlzConnectType con, WlzErrorNum *dstErr) |
Hysteresis thresholds the given Woolz object. Values are in the domain of the hysteresis threshold'd object if they are above/below the primary threshold or above/below the secondary threshold and connected to values above/below the primary threshold. More... | |
WlzObject * | WlzRGBAMultiThreshold (WlzObject *obj, WlzPixelV lowVal, WlzPixelV highVal, WlzUInt combineMode, WlzErrorNum *dstErr) |
Apply independent thresholds to each colour channel independently and combine according to the settings encoded in combineMode. Each channel can have one of two modes: WLZ_BO_AND and WLZ_BO_OR. These are encoded into a single mode variable using the RGBA macro, e.g.: WLZ_RGBA_RGBA_SET(combineMode, redMode, greenMode, blueMode, 255);. More... | |
WlzObject * | WlzThreshold (WlzObject *obj, WlzPixelV threshV, WlzThresholdType highlow, WlzErrorNum *dstErr) |
Thresholds a woolz grey-level object, 2D or 3D. More... | |
#define WLZ_THRESH_ADD_ITV_1 | ( | N, | |
NL1, | |||
NLL, | |||
NK1, | |||
NKL, | |||
G, | |||
IWS, | |||
TV, | |||
P, | |||
OP, | |||
K, | |||
OV | |||
) |
Computes the number of intervals for WlzThreshold() from integral grey values or floating point if not comparing equality. The following parameters are required:
#define WLZ_THRESH_ADD_ITV_FE_1 | ( | N, | |
NL1, | |||
NLL, | |||
NK1, | |||
NKL, | |||
G, | |||
IWS, | |||
TV, | |||
P, | |||
E, | |||
K, | |||
OV | |||
) |
Computes the number of intervals for WlzThreshold() from floating point grey values using an equality operator. The following parameters are required:
#define WLZ_THRESH_ADD_ITV_RGB_1 | ( | N, | |
NL1, | |||
NLL, | |||
NK1, | |||
NKL, | |||
G, | |||
IWS, | |||
TV, | |||
OP, | |||
K, | |||
OV | |||
) |
Computes the number of intervals for WlzThreshold() from RGBA grey values using a modulus operator to compute a scalar grey value from the RGBA value. The following parameters are required:
#define WLZ_THRESH_ADD_ITV_2 | ( | N, | |
NK1, | |||
G, | |||
ITV, | |||
IWS, | |||
TV, | |||
P, | |||
OP, | |||
K, | |||
OV | |||
) |
Constructs the intervals for WlzThreshold() from integral grey values or floating point if not comparing equality. The following parameters are required:
#define WLZ_THRESH_ADD_ITV_FE_2 | ( | N, | |
NK1, | |||
G, | |||
ITV, | |||
IWS, | |||
TV, | |||
P, | |||
E, | |||
K, | |||
OV | |||
) |
Constructs the intervals for WlzThreshold() from floating point grey values using an equality operator. The following parameters are required:
#define WLZ_THRESH_ADD_ITV_RGB_2 | ( | N, | |
NK1, | |||
G, | |||
ITV, | |||
IWS, | |||
TV, | |||
P, | |||
OP, | |||
K, | |||
OV | |||
) |
Constructs the intervals for WlzThreshold() from RGBA grey values using a modulus operator to compute a scalar grey value from the RGBA value. The following parameters are required:
enum _WlzCompThreshType |
Automatic threshold computation methods.
The histogram may need to be smoothed for these algorithms to work. Typedef: WlzCompThreshType.
enum _WlzThresholdType |
Threshold value selection. Typedef: WlzThresholdType.
Enumerator | |
---|---|
WLZ_THRESH_LOW | Threshold < given value |
WLZ_THRESH_HIGH | Threshold >= given value |
WLZ_THRESH_EQUAL | Threshold == given value |
Colour threshold type selection. Typedef: WlzRGBAThresholdType.
Enumerator | |
---|---|
WLZ_RGBA_THRESH_NONE | |
WLZ_RGBA_THRESH_SINGLE | |
WLZ_RGBA_THRESH_MULTI | |
WLZ_RGBA_THRESH_PLANE | |
WLZ_RGBA_THRESH_SLICE | |
WLZ_RGBA_THRESH_BOX | |
WLZ_RGBA_THRESH_SPHERE |
WlzErrorNum WlzCompThresholdVT | ( | WlzObject * | hObj, |
WlzCompThreshType | method, | ||
double | param0, | ||
double | param1, | ||
double | extraFrac, | ||
WlzPixelV * | dstTV, | ||
WlzThresholdType * | dstTType | ||
) |
Computes a threshold value and type using the given histogram and method.
hObj | |
method | Threshold value method. |
param0 | First passed parameter:
|
param1 | First passed parameter:
|
extraFrac | Extra fraction to be added or subtracted from the threshold value. |
dstTV | Destination pointer for threshold value, may be NULL. |
dstTType | Destination pointer for threshold type, may be NULL. |
References _WlzHistogramDomain::binSize, _WlzGreyV::dbv, _WlzObject::domain, _WlzDomain::hist, _WlzHistogramDomain::maxBins, _WlzHistogramDomain::nBins, _WlzHistogramDomain::origin, _WlzPixelV::type, _WlzObject::type, _WlzHistogramDomain::type, _WlzPixelV::v, WLZ_COMPTHRESH_DEPTH, WLZ_COMPTHRESH_FOOT, WLZ_COMPTHRESH_GRADIENT, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_UNIMPLEMENTED, WLZ_GREY_DOUBLE, WLZ_HISTOGRAM, WLZ_HISTOGRAMDOMAIN_FLOAT, WLZ_HISTOGRAMDOMAIN_INT, WLZ_THRESH_HIGH, and WlzHistogramBinMax().
Referenced by WlzSplitObj().
WlzErrorNum WlzCompThreshold | ( | double * | dstThrVal, |
WlzObject * | histObj, | ||
WlzCompThreshType | method, | ||
double | extraFrac | ||
) |
Computes a threshold value from the given histogram object using the given method.
dstThrVal | Destination pointer for the threshold value. |
histObj | Given histogram object. |
method | Given method. |
extraFrac | Extra fraction added onto the threshold value, ie: thrVal += thrVal * extraFrac. |
References _WlzHistogramDomain::binSize, _WlzObject::domain, _WlzDomain::hist, _WlzHistogramDomain::maxBins, _WlzHistogramDomain::nBins, _WlzObject::type, _WlzHistogramDomain::type, WLZ_COMPTHRESH_FOOT, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_NULL, WLZ_HISTOGRAM, WLZ_HISTOGRAMDOMAIN_FLOAT, and WLZ_HISTOGRAMDOMAIN_INT.
WlzObject* WlzConComThreshold2D | ( | WlzObject * | gObj, |
int | nSeeds, | ||
WlzIVertex2 * | seeds, | ||
WlzThresholdType | tHiLo, | ||
int | xtr, | ||
double | rad, | ||
WlzThresholdType | rHiLo, | ||
WlzErrorNum * | dstErr | ||
) |
Performs connected component thresholding of the given object using the given 2D seed points. See also WlzConComThreshold3D(), WlzConComThreshold() and WlzThreshold().
gObj | Given object to threshold, this must be either an empty object or a 2D domain object with values. |
nSeeds | Number of seed positions supplied. |
seeds | The given seed positions. |
tHiLo | Threshold mode parameter. |
xtr | Percent extra to add to threshold value. |
rad | Radius of region around seed in which to establish threshold value. |
rHiLo | How to choose threshold from the region around each seed. |
dstErr | Destination error pointer, may be NULL. |
References _WlzVertexP::i2, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_VERTEX_I2, and WlzConComThreshold().
WlzObject* WlzConComThreshold3D | ( | WlzObject * | gObj, |
int | nSeeds, | ||
WlzIVertex3 * | seeds, | ||
WlzThresholdType | tHiLo, | ||
int | xtr, | ||
double | rad, | ||
WlzThresholdType | rHiLo, | ||
WlzErrorNum * | dstErr | ||
) |
Performs connected component thresholding of the given object using the given 3D seed points. See also WlzConComThreshold2D(), WlzConComThreshold() and WlzThreshold().
gObj | Given object to threshold, this must be an empty object or either a 2 or 3D domain object with values. |
nSeeds | Number of seed positions supplied. |
seeds | The given seed positions. |
tHiLo | Threshold mode parameter. |
xtr | Percent extra to add to threshold value. |
rad | Radius of region around seed in which to establish threshold value. |
rHiLo | How to choose threshold from the region around each seed. |
dstErr | Destination error pointer, may be NULL. |
References _WlzVertexP::i3, _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_VERTEX_I3, and WlzConComThreshold().
WlzObject* WlzConComThreshold | ( | WlzObject * | gObj, |
int | nSeeds, | ||
WlzVertexType | seedType, | ||
WlzVertexP | seeds, | ||
WlzThresholdType | tHiLo, | ||
int | xtr, | ||
double | rad, | ||
WlzThresholdType | rHiLo, | ||
WlzErrorNum * | dstErr | ||
) |
Performs connected component thresholding of the given object using the given coordinates of seed points within the given object. See also WlzConComThreshold2D(), WlzConComThreshold3D() and WlzThreshold().
gObj | Given object to threshold, this may be an empty object or either a 2 or 3D domain object with values. |
nSeeds | Number of seed positions supplied. |
seedType | |
seeds | The given seed positions. If the given object is a 3D domain object the the seeds must be of type WlzIVertex3 otherwise they may be WlzIVertex2 or WlzIVertex3. |
tHiLo | Threshold mode parameter with WLZ_THRESH_HIGH >= threshold value, WLZ_THRESH_EQUAL == threshold value and WLZ_THRESH_LOW <= threshold value. Watch out this is slightly different from WlzThreshold(). |
xtr | Percent extra to add to threshold value where \[ v_{thresh} = v_{seed} \frac{100 \pm xtr}{100} \] with the sign being: \(-\) for WLZ_THRESH_HIGH and \(+\) for WLZ_THRESH_LOW. If the value of tHiLo is WLZ_THRESH_EQUAL then this parameter is ignored. |
rad | Radius of region around seed in which to establish threshold value, 0.0 implies a single voxel. |
rHiLo | How to choose threshold from the region around each seed: WLZ_THRESH_HIGH - highest, WLZ_THRESH_EQUAL - mean and WLZ_THRESH_LOW - lowest. Unused if region radius is 0.0. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzVertexP::i2, _WlzVertexP::i3, _WlzPixelV::type, _WlzObject::type, _WlzObject::values, _WlzIVertex2::vtX, _WlzIVertex3::vtX, _WlzIVertex2::vtY, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_0_CONNECTED, WLZ_26_CONNECTED, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_8_CONNECTED, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_PARAM_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_FLOAT, WLZ_VERTEX_I2, WLZ_VERTEX_I3, WlzAssignObject(), WlzGreyValueMakeWSp(), WlzMakeEmpty(), and WlzMakeSphereObject().
Referenced by WlzConComThreshold2D(), and WlzConComThreshold3D().
WlzObject* WlzHyThreshold | ( | WlzObject * | srcObj, |
WlzPixelV | pThrV, | ||
WlzPixelV | sThrV, | ||
WlzThresholdType | hilo, | ||
WlzConnectType | con, | ||
WlzErrorNum * | dstErr | ||
) |
Hysteresis thresholds the given Woolz object. Values are in the domain of the hysteresis threshold'd object if they are above/below the primary threshold or above/below the secondary threshold and connected to values above/below the primary threshold.
srcObj | Object to be thresholded. |
pThrV | Primary hysteresis threshold value. |
sThrV | Threshold for above or below values. |
hilo | Threshold for above or below values. |
con | Connectivity to examine for hysteresis. |
dstErr | Destination error pointer, may be null. |
References _WlzValues::core, _WlzDomain::core, _WlzGreyV::dbv, _WlzObject::domain, _WlzGreyV::flv, _WlzGreyV::inv, _WlzObject::plist, _WlzGreyV::rgbv, _WlzGreyV::shv, _WlzPixelV::type, _WlzGreyV::ubv, _WlzPixelV::v, _WlzObject::values, WLZ_0_CONNECTED, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_VALUES_NULL, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WlzDilation(), WlzFreeObj(), WlzIntersect2(), WlzMakeMain(), WlzThreshold(), WlzUnion2(), and WlzValueConvertPixel().
Referenced by WlzCannyDeriche().
WlzObject* WlzRGBAMultiThreshold | ( | WlzObject * | obj, |
WlzPixelV | lowVal, | ||
WlzPixelV | highVal, | ||
WlzUInt | combineMode, | ||
WlzErrorNum * | dstErr | ||
) |
Apply independent thresholds to each colour channel independently and combine according to the settings encoded in combineMode. Each channel can have one of two modes: WLZ_BO_AND and WLZ_BO_OR. These are encoded into a single mode variable using the RGBA macro, e.g.: WLZ_RGBA_RGBA_SET(combineMode, redMode, greenMode, blueMode, 255);.
The macro WLZ_RGBA_RED_GET(combineMode) will return redMode and similarly for green and blue.
obj | Object to be thresholded |
lowVal | RGB low values |
highVal | RGB high values |
combineMode | Combination rules as an RGBA encoded unsigned integer |
dstErr | Error return |
References _WlzValues::core, _WlzObject::domain, _WlzGreyV::inv, _WlzCompoundArray::n, _WlzCompoundArray::o, _WlzValues::obj, _WlzGreyV::rgbv, _WlzPixelV::type, _WlzObject::type, _WlzPixelV::v, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_BO_AND, WLZ_COMPOUND_ARR_1, WLZ_COMPOUND_ARR_2, WLZ_EMPTY_OBJ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_DATA, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_RGBA_BLUE_GET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_RED_GET, WLZ_RGBA_SPACE_RGB, WLZ_THRESH_HIGH, WLZ_THRESH_LOW, WLZ_TRANS_OBJ, WlzAssignObject(), WlzFreeObj(), WlzIntersect2(), WlzIsEmpty(), WlzMakeEmpty(), WlzMakeMain(), WlzRGBAToCompound(), WlzThreshold(), and WlzUnion2().
Referenced by WlzRGBABoxThreshold().
WlzObject* WlzThreshold | ( | WlzObject * | obj, |
WlzPixelV | threshV, | ||
WlzThresholdType | highlow, | ||
WlzErrorNum * | dstErr | ||
) |
Thresholds a woolz grey-level object, 2D or 3D.
obj | Object to be thresholded. |
threshV | Threshold pixel value. |
highlow | Mode parameter with possible values:
|
dstErr | Destination pointer for error number, may be NULL. |
References _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_ERR_NONE, and WLZ_ERR_OBJECT_NULL.
Referenced by WlzBSplineToDomain(), WlzDomainFill3D(), WlzDomainNearby(), WlzGetProjectionFromObject(), WlzGreyExtremumObj(), WlzHyThreshold(), WlzIndexObjToCompound(), WlzOffsetDist(), WlzPointsFromDomObj(), WlzRGBAMultiThreshold(), WlzScalarFeatures2D(), WlzSplitMontageObj(), and WlzSplitObj().