Woolz Image Processing
Version 1.7.5
|
Files | |
file | WlzImageArithmetic.c |
Functions for performing arithmetic on a pair of domain objects with grey values. | |
file | WlzRGBAImageArithmetic.c |
Performs image arithmetic on RGBA data. Both input files must be RGBA value type. | |
file | WlzRGBAScalarBinaryOp.c |
Apply a scalar binary operation to an RGBA image. | |
file | WlzRGBChanRatio.c |
Computes log ratio of RGB channels in a RGBA object. | |
file | WlzScalarArithmeticOp.c |
Functions which apply scalar arithmetic operations to domain objects. | |
file | WlzScalarBinaryOp.c |
Applies scalar binary operators to objects. | |
file | WlzScalarFn.c |
Code to apply scalar functions to scalar image values in Woolz objects. | |
Enumerations | |
enum | _WlzBinaryOperatorType { WLZ_BO_ADD = 0, WLZ_BO_SUBTRACT, WLZ_BO_MULTIPLY, WLZ_BO_DIVIDE, WLZ_BO_MODULUS, WLZ_BO_EQ, WLZ_BO_NE, WLZ_BO_GT, WLZ_BO_GE, WLZ_BO_LT, WLZ_BO_LE, WLZ_BO_AND, WLZ_BO_OR, WLZ_BO_XOR, WLZ_BO_MAX, WLZ_BO_MIN, WLZ_BO_MAGNITUDE } |
Binary operators. Typedef: WlzBinaryOperatorType. More... | |
Functions | |
WlzObject * | WlzRGBAImageArithmetic (WlzObject *obj0, WlzObject *obj1, WlzBinaryOperatorType op, int overwrite, WlzErrorNum *dstErr) |
Performs image arithmetic on objects with RGBA values. See WlzImageArithmetic(). More... | |
WlzObject * | WlzRGBChanRatio (WlzObject *rgbObj, WlzRGBAColorChannel num, WlzRGBAColorChannel den, WlzRGBAColorChannel mul, int useMul, int norm, WlzErrorNum *dstErr) |
Computes log ratio of RGB channels in a RGBA object for each pixel using ratio \(r\) with \[ r = m \log(1 + \frac{n}{1 + d}). \] where m is the multipler channel value or unity if not used. This results in either an object with float values or if the normalise parameter is non-zero an object with unsigned byte values normalised to the range 0-255. The numerator and denominator channels must be red, green blue, yellow, magenta, cyan, hue, staturation, brightness, or grey (modulus). More... | |
WlzErrorNum | WlzGreyIncValuesInDomain (WlzObject *gObj, WlzObject *dObj) |
Increments all valus of the firstobjct which are within the domain of the second object. The domain of the first object must cover that of the second. More... | |
WlzErrorNum | WlzGreyIncValues2D (WlzObject *obj) |
Increments all values within the given object. More... | |
WlzObject * | WlzScalarBinaryOp2 (WlzObject *o1, WlzPixelV pval, WlzBinaryOperatorType op, WlzErrorNum *dstErr) |
Apply a binary operation (add subtract etc) to each pixel value in the given object. The operand value is in pval . More... | |
WlzObject * | WlzScalarAdd (WlzObject *o1, WlzPixelV pval, WlzErrorNum *dstErr) |
Add a value to each pixel of an object. More... | |
WlzObject * | WlzScalarSubtract (WlzObject *o1, WlzPixelV pval, WlzErrorNum *dstErr) |
Subtract a value from each pixel of an object. More... | |
WlzObject * | WlzScalarMultiply (WlzObject *o1, WlzPixelV pval, WlzErrorNum *dstErr) |
Multiply each pixel of an object. More... | |
WlzObject * | WlzScalarDivide (WlzObject *o1, WlzPixelV pval, WlzErrorNum *dstErr) |
Divide each pixel of an object. More... | |
WlzObject * | WlzScalarMulAdd (WlzObject *iObj, WlzPixelV m, WlzPixelV a, WlzGreyType rGType, WlzErrorNum *dstErr) |
Scales the values of the given Woolz object so that \(v_{new} = m v_{given} + a.\). More... | |
WlzErrorNum | WlzScalarBinaryOp (WlzObject *o1, WlzPixelV pval, WlzObject *o3, WlzBinaryOperatorType op) |
Perform the given binary operation for each grey value in image o1 with val putting the result in o3. The value table of o3 can be identical to that of o1 to allow overwriting. This function assumes that the domains of each object are the same. Unless overwriting is required then the functions WlzImageAdd, WlzImageSubtract etc. should be used. These return an object which is the intersection of the input objects. More... | |
WlzObject * | WlzScalarFn (WlzObject *sObj, WlzFnType fn, WlzErrorNum *dstErr) |
Computes a new object which shares the domain of the given object, but which has grey values that are the result of applying the given function to the grey values of the given object. More... | |
Binary operators. Typedef: WlzBinaryOperatorType.
WlzObject* WlzRGBAImageArithmetic | ( | WlzObject * | obj0, |
WlzObject * | obj1, | ||
WlzBinaryOperatorType | op, | ||
int | overwrite, | ||
WlzErrorNum * | dstErr | ||
) |
Performs image arithmetic on objects with RGBA values. See WlzImageArithmetic().
obj0 | First object. |
obj1 | Second object. |
op | Binary operator. |
overwrite | Allow the destination object to share values with one of the given objects if non zero. |
dstErr | Destination error pointer, may be NULL. |
References _WlzCompoundArray::o, _WlzObject::type, WLZ_COMPOUND_ARR_1, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_GREY_RGBA, WLZ_RGBA_SPACE_RGB, WlzCompoundToRGBA(), WlzFreeObj(), WlzGreyTypeFromObj(), WlzImageArithmetic(), WlzMakeCompoundArray(), and WlzRGBAToCompound().
Referenced by WlzShadeCorrectBFDF().
WlzObject* WlzRGBChanRatio | ( | WlzObject * | rgbObj, |
WlzRGBAColorChannel | num, | ||
WlzRGBAColorChannel | den, | ||
WlzRGBAColorChannel | mul, | ||
int | useMul, | ||
int | norm, | ||
WlzErrorNum * | dstErr | ||
) |
Computes log ratio of RGB channels in a RGBA object for each pixel using ratio \(r\) with
\[ r = m \log(1 + \frac{n}{1 + d}). \]
where m is the multipler channel value or unity if not used. This results in either an object with float values or if the normalise parameter is non-zero an object with unsigned byte values normalised to the range 0-255. The numerator and denominator channels must be red, green blue, yellow, magenta, cyan, hue, staturation, brightness, or grey (modulus).
rgbObj | The input RGBA object. |
num | Channel for numerator in ratio. |
den | Channel for denominator in ratio. |
mul | Channel for multiplier value. |
useMul | Multiplier used if non zero. |
norm | Normalise the object values and return a ubyte object. |
dstErr | Destination error pointer, may be NULL. |
References ALG_MAX3, ALG_MIN3, _WlzVoxelValues::bckgrnd, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzGreyV::flv, _WlzVoxelValues::lastpl, _WlzIntervalWSpace::lftpos, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzVoxelValues::plane1, _WlzGreyP::rgbp, _WlzIntervalWSpace::rgtpos, _WlzPixelV::type, _WlzObject::type, _WlzCoreValues::type, _WlzVoxelValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyV::ubv, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_FLOAT, WLZ_GREY_RGBA, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_NINT, WLZ_RGBA_BLUE_GET, WLZ_RGBA_CHANNEL_BLUE, WLZ_RGBA_CHANNEL_BRIGHTNESS, WLZ_RGBA_CHANNEL_CYAN, WLZ_RGBA_CHANNEL_GREEN, WLZ_RGBA_CHANNEL_GREY, WLZ_RGBA_CHANNEL_HUE, WLZ_RGBA_CHANNEL_MAGENTA, WLZ_RGBA_CHANNEL_RED, WLZ_RGBA_CHANNEL_SATURATION, WLZ_RGBA_CHANNEL_YELLOW, WLZ_RGBA_GREEN_GET, WLZ_RGBA_MODULUS, WLZ_RGBA_RED_GET, WlzAssignObject(), WlzAssignValues(), WlzConvertPix(), WlzFreeObj(), WlzFreeValues(), WlzGreyNormalise(), WlzGreyTableIsTiled(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzMakeMain(), WlzMakeVoxelValueTb(), WlzNewValueTb(), WlzNextGreyInterval(), and WlzSetBackground().
WlzErrorNum WlzGreyIncValuesInDomain | ( | WlzObject * | gObj, |
WlzObject * | dObj | ||
) |
Increments all valus of the firstobjct which are within the domain of the second object. The domain of the first object must cover that of the second.
gObj | First object. |
dObj | Second object. |
References ALG_MAX, ALG_MIN, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzPlaneDomain::lastpl, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WlzAssignObject(), WlzFreeObj(), WlzGreyIncValues2D(), WlzGreyTableIsTiled(), and WlzMakeMain().
Referenced by WlzDomainOccupancy().
WlzErrorNum WlzGreyIncValues2D | ( | WlzObject * | obj | ) |
Increments all values within the given object.
obj | Given object. |
References _WlzGreyP::dbp, _WlzGreyP::flp, _WlzGreyP::inp, _WlzIntervalWSpace::lftpos, _WlzGreyWSpace::pixeltype, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WlzEndGreyScan(), WlzInitGreyScan(), and WlzNextGreyInterval().
Referenced by WlzGreyIncValuesInDomain().
WlzObject* WlzScalarBinaryOp2 | ( | WlzObject * | o1, |
WlzPixelV | pval, | ||
WlzBinaryOperatorType | op, | ||
WlzErrorNum * | dstErr | ||
) |
Apply a binary operation (add subtract etc) to each pixel value in the given object. The operand value is in pval
.
o1 | Input object |
pval | Pixel value for binary operation. |
op | Opertor |
dstErr | Error return. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzValues::obj, _WlzDomain::p, _WlzGreyV::shv, _WlzPixelV::type, _WlzObject::type, _WlzPlaneDomain::type, _WlzCoreValues::type, _WlzVoxelValues::type, _WlzGreyV::ubv, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PLANEDOMAIN_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VOXELVALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_PLANEDOMAIN_DOMAIN, WLZ_TRANS_OBJ, WLZ_VOXELVALUETABLE_GREY, WlzAssignValues(), WlzFreeObj(), WlzGetBackground(), WlzGreyTableTypeToGreyType(), WlzGreyValueTableType(), WlzMakeEmpty(), WlzMakeMain(), WlzMakeVoxelValueTb(), WlzNewValueTb(), and WlzScalarBinaryOp().
Referenced by WlzScalarAdd(), WlzScalarDivide(), WlzScalarMultiply(), and WlzScalarSubtract().
WlzObject* WlzScalarAdd | ( | WlzObject * | o1, |
WlzPixelV | pval, | ||
WlzErrorNum * | dstErr | ||
) |
Add a value to each pixel of an object.
o1 | Input object |
pval | Value to be added. |
dstErr | Error return. |
References WLZ_BO_ADD, and WlzScalarBinaryOp2().
WlzObject* WlzScalarSubtract | ( | WlzObject * | o1, |
WlzPixelV | pval, | ||
WlzErrorNum * | dstErr | ||
) |
Subtract a value from each pixel of an object.
o1 | Input object |
pval | Value to be subtracted. |
dstErr | Error return. |
References WLZ_BO_SUBTRACT, and WlzScalarBinaryOp2().
WlzObject* WlzScalarMultiply | ( | WlzObject * | o1, |
WlzPixelV | pval, | ||
WlzErrorNum * | dstErr | ||
) |
Multiply each pixel of an object.
o1 | Input object |
pval | Multiplication factor. |
dstErr | Error return. |
References WLZ_BO_MULTIPLY, and WlzScalarBinaryOp2().
Referenced by WlzNObjGreyStats().
WlzObject* WlzScalarDivide | ( | WlzObject * | o1, |
WlzPixelV | pval, | ||
WlzErrorNum * | dstErr | ||
) |
Divide each pixel of an object.
o1 | Input object |
pval | Division value. |
dstErr | Error return. |
References WLZ_BO_DIVIDE, and WlzScalarBinaryOp2().
WlzObject* WlzScalarMulAdd | ( | WlzObject * | iObj, |
WlzPixelV | m, | ||
WlzPixelV | a, | ||
WlzGreyType | rGType, | ||
WlzErrorNum * | dstErr | ||
) |
Scales the values of the given Woolz object so that \(v_{new} = m v_{given} + a.\).
iObj | Given object. |
m | Value to multiply object values by. |
a | Value to add to product. |
rGType | Required grey type for returned object. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcMalloc(), _WlzObject::assoc, _WlzIntervalWSpace::colrmn, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzDomain::i, _WlzGreyP::inp, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastpl, _WlzCompoundArray::n, _WlzCompoundArray::o, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzObject::plist, _WlzGreyP::rgbp, _WlzGreyP::shp, _WlzObject::type, _WlzRagRValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CLAMP, WLZ_COMPOUND_ARR_1, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_NINT, WLZ_NULL, WLZ_RGBA_RGBA_SET, WlzAssignValues(), WlzEndGreyScan(), WlzFreeObj(), WlzFreeValueTb(), WlzFreeVoxelValueTb(), WlzGetBackground(), WlzGreyTableTypeToTableType(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzMakeCompoundArray(), WlzMakeMain(), WlzNewValuesVox(), WlzNewValueTb(), WlzNextGreyInterval(), WlzValueConvertPixel(), WlzValueCopyDoubleToDouble(), WlzValueCopyFloatToDouble(), WlzValueCopyIntToDouble(), WlzValueCopyRGBAToDouble(), WlzValueCopyShortToDouble(), and WlzValueCopyUByteToDouble().
Referenced by WlzEffReadObjNifti().
WlzErrorNum WlzScalarBinaryOp | ( | WlzObject * | o1, |
WlzPixelV | pval, | ||
WlzObject * | o3, | ||
WlzBinaryOperatorType | op | ||
) |
Perform the given binary operation for each grey value in image o1 with val putting the result in o3. The value table of o3 can be identical to that of o1 to allow overwriting. This function assumes that the domains of each object are the same. Unless overwriting is required then the functions WlzImageAdd, WlzImageSubtract etc. should be used. These return an object which is the intersection of the input objects.
o1 | Input object. |
pval | Operand value. |
o3 | Oject for the return values. Setting equal to o1 means values will be overwritten. |
op | Opertor to be applied. |
References AlcFree(), AlcMalloc(), _WlzIntervalWSpace::colrmn, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzGreyV::flv, _WlzGreyP::inp, _WlzIntervalWSpace::intdmn, _WlzGreyV::inv, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastpl, _WlzValues::obj, _WlzPixelP::p, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzGreyP::shp, _WlzGreyV::shv, _WlzPixelV::type, _WlzPixelP::type, _WlzObject::type, _WlzPlaneDomain::type, _WlzCoreValues::type, _WlzVoxelValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzGreyP::v, _WlzPixelV::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PLANEDOMAIN_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_ERR_VOXELVALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_PLANEDOMAIN_DOMAIN, WLZ_TRANS_OBJ, WLZ_VOXELVALUETABLE_GREY, WlzFreeObj(), WlzGreyTableIsTiled(), WlzInitGreyScan(), WlzMakeMain(), and WlzNextGreyInterval().
Referenced by WlzRGBAScalarBinaryOp(), and WlzScalarBinaryOp2().
WlzObject* WlzScalarFn | ( | WlzObject * | sObj, |
WlzFnType | fn, | ||
WlzErrorNum * | dstErr | ||
) |
Computes a new object which shares the domain of the given object, but which has grey values that are the result of applying the given function to the grey values of the given object.
sObj | Given source domainn object with values. |
fn | Scalar function to be applied. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzGreyV::flv, _WlzGreyP::inp, _WlzGreyV::inv, _WlzPlaneDomain::lastpl, _WlzIntervalWSpace::lftpos, _WlzGreyP::lnp, _WlzGreyV::lnv, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzGreyP::rgbp, _WlzGreyV::rgbv, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzGreyV::shv, _WlzPixelV::type, _WlzObject::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_VALUES_NULL, WLZ_FN_SCALAR_EXP, WLZ_FN_SCALAR_INVSQRT, WLZ_FN_SCALAR_LOG, WLZ_FN_SCALAR_MOD, WLZ_FN_SCALAR_SQR, WLZ_FN_SCALAR_SQRT, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_LONG, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_VOXELVALUETABLE_GREY, WlzAssignValues(), WlzFreeObj(), WlzGetBackground(), WlzGreyTypeFromObj(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzMakeMain(), WlzMakeVoxelValueTb(), WlzNewValueTb(), WlzNextGreyInterval(), WlzValueConvertPixel(), and WlzValueCopyGreyToGrey().
Referenced by WlzNObjGreyStats(), and WlzSepFilter().