Woolz Image Processing
Version 1.8.3
|
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 _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPixelV::type, _WlzCoreValues::type, _WlzGreyV::ubv, _WlzPixelV::v, _WlzObject::values, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_UBYTE, and WlzGreyTableIsTiled().
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 _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, and WlzGreyTableIsTiled().
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().
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().
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 _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzCompoundArray::n, _WlzCompoundArray::o, _WlzObject::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_COMPOUND_ARR_1, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_VALUES_NULL, WLZ_NULL, WlzFreeObj(), and WlzMakeCompoundArray().
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 _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_TRANS_OBJ, and WlzGreyTableIsTiled().
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, _WlzObject::domain, _WlzObject::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, and WLZ_ERR_VALUES_NULL.