Woolz Image Processing
Version 1.7.5
|
Files | |
file | WlzCannyDeriche.c |
A Canny-Deriche edge detection filter. | |
file | WlzConvolve.c |
Functions for convolving the values of domain objects. | |
file | WlzFilterNObjValues.c |
Computes a domain object in which the values are the filtered values of the input objects at the same positions. | |
file | WlzGauss.c |
Gaussian filter fo 2D objects with values. Uses WlzSepTrans() and for colour images can only do smoothing correctly (i.e. derivative zero). | |
file | WlzGaussNoise.c |
Functions for making Gaussian noise filled objects. | |
file | WlzGreyCrossing.c |
Computes a domain object with grey values in which the values encode the direction at each pixel of a grey value transition. If the given grey value is zero then this is the zero crossing direction. | |
file | WlzGreyGradient.c |
Computes objects in which the grey values are the gradient of the gray values in the original image. | |
file | WlzGreyNormalise.c |
Normalises the grey-values of an object to the range [0 - 255]. Colour images have each channel independently normalised. For proportional normalisation of colour use WlzGreySetRange directly. To determine the modulus range use WlzRGBAModulusRange(). | |
file | WlzGreyRange.c |
Computes the grey range of an object. Note that the colour range returned is the independent max and min values for each channel. | |
file | WlzGreySetRange.c |
Sets the new grey range for an object using simple linear interpolation. | |
file | WlzGreySetRangeLut.c |
Transforms the grey-values of a grey-level object using a look-up-table. | |
file | WlzGreyVariance.c |
Applies variance filters of domain objects with values. | |
file | WlzLUT.c |
Look up tables for value transformations. | |
file | WlzRank.c |
Rank filters for woolz objects, these are the generalization of minimum, maximum and median value filters. | |
file | WlzSepFilter.c |
A 2/3D implementation of seperable spatial kernel based convolution functions. | |
file | WlzSepTrans.c |
Execute a separable transform on a 2D domain object. | |
file | WlzValuesFromCoords.c |
Creates a new object with the values set to the coordinate values. | |
file | WlzWindow.c |
Weights the grey values of domain objects according to their spatial distribution using a weighting function. | |
Data Structures | |
struct | _WlzGreyVarianceWSp |
Used to pass size and scale through WlzSeqPar() to WlzGreyVarianceSeqParFn(). More... | |
struct | _WlzConvolution |
A 2D space domain convolution mask. To reduce computational cost at the expense of data storage the complete convolution is used even if highly symmetrical. Typedef: WlzConvolution. More... | |
struct | _WlzRsvFilter |
The parameters \(a_j\), \(b_j\) and \(c\) with \(j\in[0\cdots2]\) which define a recursive filter: \[ y^{+}[i] = a_0 x[i + 0] + a_1 x[i - 1] - b_0 y^{+}[i - 1] - b_1 y^{+}[i - 2] \] \[ y^{-}[i] = a_2 x[i + 1] + a_3 x[i + 2] - b_0 y^{-}[i + 1] - b_1 y^{-}[i + 2] \] \[ y[i] = c (y^{+}[i] + y^{-}[i]) \] Typedef: WlzRsvFilter. More... | |
struct | _WlzSeqParWSpace |
Typedef: WlzSeqParWSpace. More... | |
struct | _Wlz1DConvMask |
Typedef: Wlz1DConvMask. More... | |
struct | _WlzSepTransWSpace |
Typedef: WlzSepTransWSpace. More... | |
Functions | |
WlzObject * | WlzCannyDeriche (WlzObject **dstGObj, WlzObject *srcObj, double alpha, double mult, WlzPixelV pMinGrdV, WlzPixelV sMinGrdV, WlzErrorNum *dstErr) |
A Canny-Deriche edge detection filter which performs the following steps: More... | |
int | WlzConvolveSeqParFn (WlzSeqParWSpace *spWSpace, void *spData) |
Performs a general space-domain convolution for WlzSeqPar(). More... | |
WlzObject * | WlzConvolveObj (WlzObject *inObj, WlzConvolution *conv, int newObjFlag, WlzErrorNum *dstErr) |
Performs a general space-domain convolution using WlzSeqPar(). Only objects with WLZ_EMPTY_OBJ and WLZ_2D_DOMAINOBJ types are valid. WLZ_2D_DOMAINOBJ ojects must have non null domain and values fields, and only integral values (ie int, short or WlzUByte) are valid. More... | |
int | WlzConvolutionSum (WlzConvolution *conv) |
Calculates the sum of the values in the convolution object. More... | |
int | WlzConvolutionNormalise (WlzConvolution *conv) |
Normalises a convolution object by adjusting the scaling such that the components effectively sum to unity. More... | |
WlzObject * | WlzFilterNObjValues (WlzObject *rObj, int nObj, WlzObject **objs, int fn, double rank, WlzErrorNum *dstErr) |
Applies the a filter function to all pixels of the input objects, with the filter being applied to all pixels at each coordinate through all objects. The input and reference objects must all be 2D or 3D domain objects of the same type and all the input objects must have valid grey values of the same type. More... | |
WlzObject * | WlzGauss2 (WlzObject *obj, double wx, double wy, int x_deriv, int y_deriv, WlzErrorNum *wlzErr) |
Gaussian filter of grey-level 2D woolz object. x- and y-coordinate width parameters and derivative degree can be independently specified. For derivative zero, i.e. Gaussian smoothing, the filter is normalised. Derivatives are derivative of the normalised filter. RGB data will only return values for smoothing, higher derivatives are not implemented. The width parameter is the full-width half-height of the Gaussian distribution. Note RGB pixel types are converted to a compound object with each channel returned with WLZ_GREY_SHORT pixel type. More... | |
WlzErrorNum | Wlz1DConv (WlzSepTransWSpace *stwspc, void *params) |
Perform a 1D convolution on a 1D array of data. Typically used to pass to WlzSepTrans(). The params variable is a 1D convolution mask. More... | |
WlzErrorNum | WlzGaussNoise (WlzObject *obj, WlzPixelV val) |
Add Gaussian noise to each pixel with mean xero and sigma given by parameter val . More... | |
int | WlzGreyCrossingSeqParFn (WlzSeqParWSpace *spWSpace, void *spData) |
Tests for a grey value crossing using a 3x3 kernel. This function is called by WlzSeqPar(). Given an integer kernel about a given pixel (E): More... | |
WlzObject * | WlzGreyCrossing (WlzObject *inObj, int newObjFlag, int cVal, WlzErrorNum *dstErr) |
Uses a 3X3 kernel to examine the given object for transitions (grey value crossings) about the given grey value. Only objects with WLZ_EMPTY_OBJ and WLZ_2D_DOMAINOBJ types are valid. WLZ_2D_DOMAINOBJ objects must have a valid domain and integral (ie WLZ_GREY_INT, WLZ_GREY_SHORT or WLZ_GREY_UBYTE) values. More... | |
WlzObject * | WlzGreyGradient (WlzObject **dstGrdZ, WlzObject **dstGrdY, WlzObject **dstGrdX, WlzObject *srcObj, WlzRsvFilter *flt, WlzErrorNum *dstErr) |
Computes the gradient of the gray values in the given Woolz domain object. More... | |
WlzErrorNum | WlzGreyNormalise (WlzObject *obj, int dither) |
Normalizes the the grey values of the input object to fill the range 0-255. More... | |
WlzErrorNum | WlzGreyRange (WlzObject *obj, WlzPixelV *min, WlzPixelV *max) |
compute grey-range of a pixel/voxel object. More... | |
WlzErrorNum | WlzGreySetRange (WlzObject *obj, WlzPixelV min, WlzPixelV max, WlzPixelV Min, WlzPixelV Max, int dither) |
Set new grey-range by simple linear interpolation. More... | |
WlzObject * | WlzGreyVariance (WlzObject *inObj, int newObjFlag, int kernelSz, double scale, WlzErrorNum *dstErr) |
Uses a small kernel to compute the local variance of the given grey value object. Only objects with WLZ_EMPTY_OBJ and WLZ_2D_DOMAINOBJ types are valid. WLZ_2D_DOMAINOBJ objects must have a valid domain and integral (ie WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT or WLZ_GREY_UBYTE) values. More... | |
WlzObject * | WlzMakeLUTObject (WlzGreyType vType, int bin1, int lastbin, WlzErrorNum *dstErr) |
Creates a new look up table object by calling WlzMakeLUTDomain() and WlzMakeLUTValues(). The last bin of the look up table must be greater than the first. More... | |
WlzLUTDomain * | WlzMakeLUTDomain (int bin1, int lastbin, WlzErrorNum *dstErr) |
Makes a new look up table domain. The returned data structure should be freed using WlzFreeDomain(). More... | |
WlzLUTValues * | WlzMakeLUTValues (WlzGreyType vType, int maxVal, WlzErrorNum *dstErr) |
Makes a new look up table values data structure. The returned data structure should be freed using WlzFreeLUTValues(). More... | |
WlzErrorNum | WlzFreeLUTValues (WlzValues val) |
Frees a look up table values data structure. More... | |
WlzObject * | WlzLUTGreyTransformNew (WlzGreyTransformType gTrType, WlzGreyType gType, int il, int iu, WlzGreyV gol, WlzGreyV gou, double p0, double p1, WlzErrorNum *dstErr) |
Creates a new look up table object, setting it's look up table values using a grey transform. See also WlzMakeLUTObject() and WlzLUTGreyTransformSet(). More... | |
WlzErrorNum | WlzLUTGreyTransformSet (WlzObject *obj, WlzGreyTransformType gTrType, WlzGreyType gType, int il, int iu, WlzGreyV gol, WlzGreyV gou, double p0, double p1) |
Sets a given look up table using a grey transform. More... | |
WlzObject * | WlzLUTMergeToRGBA (WlzObject *r, WlzObject *g, WlzObject *b, WlzObject *a, WlzErrorNum *dstErr) |
Merges separate grey LUTs into a single RGBA LUT. All LUTs should either be NULL or have the same domain and integer LUT values, with at least one LUT object being non NULL. More... | |
WlzObject * | WlzLUTTransformObj (WlzObject *gObj, WlzObject *tObj, WlzGreyType rGType, int inplace, int dither, WlzErrorNum *dstErr) |
Applies a LUT to an domain object with grey values. More... | |
WlzPixelV | WlzLUTTransformPixelValue (WlzObject *tObj, WlzPixelV gPix, WlzGreyType rType, WlzErrorNum *dstErr) |
Transforms the grey value of a single pixel using the given look up table object. This function is not very efficient, use WlzLUTTransformGreyValues() (which this function calls) where possible. More... | |
WlzErrorNum | WlzLUTTransformGreyValues (WlzObject *tObj, WlzGreyP rP, WlzGreyType rType, WlzGreyP gP, WlzGreyType gType, int nVal, int dither) |
Transforms the grey values in the given buffer using the look up table object, putting the values into the return buffer. More... | |
WlzErrorNum | WlzRankFilter (WlzObject *gObj, int fSz, double rank) |
Applies a rank filter in place to the given Woolz object. Each value of the given object is replaced by the n'th ranked value of the values in it's immediate neighborhood, where the neighborhood is a simple axis aligned cuboid with the size. More... | |
WlzObject * | WlzGaussFilter (WlzObject *inObj, WlzDVertex3 sigma, WlzIVertex3 order, WlzIVertex3 direc, WlzGreyType gType, AlgPadType pad, double padVal, int sep, WlzErrorNum *dstErr) |
Applies a Gaussian filter to the given input spatial domain object. Only scalar valued image objects are valid for use with this function. More... | |
WlzObject * | WlzSepFilter (WlzObject *inObj, WlzIVertex3 cBufSz, double *cBuf[], WlzIVertex3 direc, WlzGreyType gType, AlgPadType pad, double padVal, int sep, WlzErrorNum *dstErr) |
Applies a seperable filter to the given object using the given convolution kernels. More... | |
WlzObject * | WlzSepTrans (WlzObject *obj, WlzIntervalConvFunc x_fun, void *x_params, WlzIntervalConvFunc y_fun, void *y_params, WlzErrorNum *dstErr) |
Perform 2D seperable transform on a 2D grey-level image. It is the users responsibility to ensure that the grey-value types are appropriate. Now extended to include compound objects. More... | |
WlzObject * | WlzValuesFromCoords (WlzObject *gObj, int radial, WlzGreyType gType, WlzErrorNum *dstErr) |
Given a spatial domain object (with or wthout values) this function creates a compound array object with the number of component objects set to the number of the dimensions of the input object. The domains of the component objects are those of the given object and the values are set to the coordinate values within the object domains. Components are ordered by column, line, plane or radial distance, angle (in radians), plane. More... | |
WlzObject * | WlzWindow (WlzObject *srcObj, WlzWindowFnType winFn, WlzIVertex2 org, WlzIVertex2 rad, WlzErrorNum *dstErr) |
Cuts a rectangular region from the given object and then applies the specified 2D data windowing function. The linkcount of the returned object is zero. More... | |
const char * | WlzWindowFnName (WlzWindowFnType winFnValue) |
Finds the appropriate name string for the given window function value. More... | |
WlzWindowFnType | WlzWindowFnValue (const char *winFnName) |
Finds the appropriate value for the given window function name string. More... | |
enum _WlzWindowFnType |
Types of window functions. Window functions are used to weight the grey values of Woolz domain objects according to the spatial distribution. Typedef: WlzWindowFnType.
The window functions are defined as:
\[ blackman(r,R) = 0.42 + 0.50 \cos{(\frac{2.00 \pi r}{R - 1.00})} + 0.08 \cos{(\frac{4.00 \pi r}{R - 1.00})} \]
\[ hamming(r,R) = 0.54 + 0.46 \cos{(\frac{2.00 \pi r}{R - 1.00})} \]
\[ hanning(r,R) = 0.50 + 0.50 \cos{(\frac{2.00 \pi r}{R - 1.00})} \]
\[ parzen(r,R) = 1.00 - |frac{2.00 r - (R - 1.00)}{R + 1.00}| \]
\[ welch(r,R) = 1.00 - {(\frac{2.00 r - (R - 1.00)}{R + 1.00})}^2 \]
\[ rectangle(r,R) = \left\{ \begin{array}{ll} 1.00 & |r_x| \leq R, |r_y| \leq R \\ 0.00 & |r_x| > R, |r_y| > R \end{array} \right. \]
Where \(R\) is the window radius and \(r\) the radial distance from the centre of the window.
The action to be performed by a recursive filter. These values are bit masks which may be combined. Typedef: WlzRsvFilterActionMask.
Enumerator | |
---|---|
WLZ_RSVFILTER_ACTION_NONE |
No filtering. |
WLZ_RSVFILTER_ACTION_X |
Filter along lines. |
WLZ_RSVFILTER_ACTION_Y |
Filter through columns. |
WLZ_RSVFILTER_ACTION_Z |
Filter through planes. |
enum _WlzRsvFilterName |
Recursive filter types that can be used to define a recursive filter along with a filter parameter (eg sigma for Gaussian). Typedef: WlzRsvFilterName.
WlzObject* WlzCannyDeriche | ( | WlzObject ** | dstGObj, |
WlzObject * | srcObj, | ||
double | alpha, | ||
double | mult, | ||
WlzPixelV | pMinGrdV, | ||
WlzPixelV | sMinGrdV, | ||
WlzErrorNum * | dstErr | ||
) |
A Canny-Deriche edge detection filter which performs the following steps:
dstGObj | Destination pointer for the gradient image, may be NULL. |
srcObj | Given domain object with grey values. |
alpha | Deriche filter parameter. |
mult | Filter multiplier. |
pMinGrdV | Primary hysteresis threshold value. |
sMinGrdV | Secondary hysteresis threshold value. |
dstErr | Destination error pointer, may be NULL. |
References _WlzRsvFilter::c, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzGreyV::inv, main(), _WlzPixelV::type, _WlzObject::type, _WlzPixelV::v, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_8_CONNECTED, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_INT, WLZ_RSVFILTER_NAME_DERICHE_1, WLZ_THRESH_HIGH, WlzAssignObject(), WlzFreeObj(), WlzGreyGradient(), WlzHyThreshold(), WlzMakeMain(), WlzNMSuppress(), WlzReadObj(), WlzRsvFilterFreeFilter(), WlzRsvFilterMakeFilter(), and WlzWriteObj().
int WlzConvolveSeqParFn | ( | WlzSeqParWSpace * | spWSpace, |
void * | spData | ||
) |
Performs a general space-domain convolution for WlzSeqPar().
spWSpace | Work space data structure from WlzSeqPar(). |
spData | Data passed on by WlzSeqPar(), which is used to pass the convolution structure. |
References _WlzSeqParWSpace::adrptr, _WlzConvolution::cv, _WlzConvolution::divscale, _WlzConvolution::modflag, _WlzConvolution::offset, WLZ_DBG, WLZ_DBG_LVL_3, WLZ_DBG_LVL_FN, _WlzConvolution::xsize, and _WlzConvolution::ysize.
Referenced by WlzConvolveObj().
WlzObject* WlzConvolveObj | ( | WlzObject * | inObj, |
WlzConvolution * | conv, | ||
int | newObjFlag, | ||
WlzErrorNum * | dstErr | ||
) |
Performs a general space-domain convolution using WlzSeqPar(). Only objects with WLZ_EMPTY_OBJ and WLZ_2D_DOMAINOBJ types are valid. WLZ_2D_DOMAINOBJ ojects must have non null domain and values fields, and only integral values (ie int, short or WlzUByte) are valid.
inObj | Given object. |
conv | Convolution data structure. |
newObjFlag | If zero the convolution is done in place, else a new object is created. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzGreyV::inv, _WlzGreyV::shv, _WlzPixelV::type, _WlzObject::type, _WlzCoreValues::type, _WlzConvolution::type, _WlzGreyV::ubv, _WlzPixelV::v, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_CONVOLVE_INT, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_GREY_DATA, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_MAX, WLZ_RASTERDIR_ILIC, WlzConvolveSeqParFn(), WlzGetBackground(), WlzGreyTableIsTiled(), WlzMakeEmpty(), WlzSeqPar(), _WlzConvolution::xsize, and _WlzConvolution::ysize.
Referenced by WlzLaplacian(), and WlzSobel().
int WlzConvolutionSum | ( | WlzConvolution * | conv | ) |
Calculates the sum of the values in the convolution object.
conv | Given convolution object. |
References _WlzConvolution::cv, _WlzConvolution::xsize, and _WlzConvolution::ysize.
Referenced by WlzConvolutionNormalise().
int WlzConvolutionNormalise | ( | WlzConvolution * | conv | ) |
Normalises a convolution object by adjusting the scaling such that the components effectively sum to unity.
conv | Given convolution object. |
References _WlzConvolution::divscale, and WlzConvolutionSum().
WlzObject* WlzFilterNObjValues | ( | WlzObject * | rObj, |
int | nObj, | ||
WlzObject ** | objs, | ||
int | fn, | ||
double | rank, | ||
WlzErrorNum * | dstErr | ||
) |
Applies the a filter function to all pixels of the input objects, with the filter being applied to all pixels at each coordinate through all objects. The input and reference objects must all be 2D or 3D domain objects of the same type and all the input objects must have valid grey values of the same type.
rObj | Reference object with domain in which the filtered values are computed. |
nObj | Number of input objects. |
objs | Array on input objects. |
fn | Filter function to apply, with value: 0 for rank, 1 for mean. |
rank | If applying a rank filter the required rank, otherwise ignored. Rank value is 0.0 minimum, 0.5 median and 1.0 maximum. Intermediate ranks may be given. |
dstErr | Destination error pointer, may be null. |
References AlcCalloc(), AlcFree(), AlcMalloc(), AlgRankSelectD(), AlgRankSelectF(), AlgRankSelectI(), AlgRankSelectS(), AlgRankSelectUB(), _WlzDomain::core, _WlzGreyP::dbp, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzGreyP::inp, _WlzGreyV::inv, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linpos, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzPixelV::type, _WlzObject::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyP::v, _WlzPixelV::v, _WlzValues::v, _WlzVoxelValues::values, _WlzValues::vox, _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CLAMP, 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_PARAM_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WLZ_NINT, WlzEndGreyScan(), WlzFreeObj(), WlzGreySetValue(), WlzGreyTableIsTiled(), WlzGreyTypeFromObj(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzInsideDomain(), WlzMakeMain(), WlzNewValuesVox(), WlzNewValueTb(), and WlzNextGreyInterval().
WlzObject* WlzGauss2 | ( | WlzObject * | obj, |
double | wx, | ||
double | wy, | ||
int | x_deriv, | ||
int | y_deriv, | ||
WlzErrorNum * | wlzErr | ||
) |
Gaussian filter of grey-level 2D woolz object. x- and y-coordinate width parameters and derivative degree can be independently specified. For derivative zero, i.e. Gaussian smoothing, the filter is normalised. Derivatives are derivative of the normalised filter. RGB data will only return values for smoothing, higher derivatives are not implemented. The width parameter is the full-width half-height of the Gaussian distribution. Note RGB pixel types are converted to a compound object with each channel returned with WLZ_GREY_SHORT pixel type.
obj | Input object |
wx | x-direction width parameter |
wy | y-direction width parameter |
x_deriv | x-direction derivative |
y_deriv | y-direction derivative |
wlzErr | error return |
References AFACTOR, AlcFree(), AlcMalloc(), _Wlz1DConvMask::mask_size, _Wlz1DConvMask::mask_values, _Wlz1DConvMask::norm_factor, _WlzCompoundArray::o, _WlzObject::type, Wlz1DConv(), WLZ_2D_DOMAINOBJ, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_PARAM_DATA, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_M_PI, WLZ_RGBA_SPACE_RGB, WlzAssignObject(), WlzConvertPix(), WlzFreeObj(), WlzGreyTypeFromObj(), WlzRGBAToCompound(), and WlzSepTrans().
Referenced by WlzGreyModGradient(), and WlzRGBAModGradient().
WlzErrorNum Wlz1DConv | ( | WlzSepTransWSpace * | stwspc, |
void * | params | ||
) |
Perform a 1D convolution on a 1D array of data. Typically used to pass to WlzSepTrans(). The params variable is a 1D convolution mask.
stwspc | Separable transfom work space |
params | parameters passed from top-level calling function, unchanged by WlzSepTrans() |
References _WlzGreyP::dbp, _WlzGreyP::flp, _WlzSepTransWSpace::inbuf, _WlzGreyP::inp, _WlzSepTransWSpace::len, _Wlz1DConvMask::mask_size, _Wlz1DConvMask::mask_values, _Wlz1DConvMask::norm_factor, _WlzSepTransWSpace::outbuf, _WlzPixelP::p, _WlzGreyP::rgbp, _WlzGreyP::shp, _WlzPixelP::type, _WlzGreyP::ubp, WLZ_CLAMP, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_RGBA_BLUE_GET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_RED_GET, and WLZ_RGBA_RGBA_SET.
Referenced by WlzGauss2().
WlzErrorNum WlzGaussNoise | ( | WlzObject * | obj, |
WlzPixelV | val | ||
) |
Add Gaussian noise to each pixel with mean xero and sigma given by parameter val
.
obj | Input object |
val | Sigma value for the aditive Guassian noise. |
References AlgRandNormal(), AlgRandSeed(), _WlzIntervalWSpace::colrmn, _WlzValues::core, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzDomain::i, _WlzGreyP::inp, _WlzPlaneDomain::lastpl, _WlzValues::obj, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzGreyP::rgbp, _WlzGreyP::shp, _WlzObject::type, _WlzPlaneDomain::type, _WlzCoreValues::type, _WlzVoxelValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzPixelV::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CLAMP, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_PLANEDOMAIN_DOMAIN, WLZ_TRANS_OBJ, WLZ_VOXELVALUETABLE_GREY, WlzEndGreyScan(), WlzFreeObj(), WlzGreyTableIsTiled(), WlzInitGreyScan(), WlzMakeMain(), WlzNextGreyInterval(), and WlzValueConvertPixel().
int WlzGreyCrossingSeqParFn | ( | WlzSeqParWSpace * | spWSpace, |
void * | spData | ||
) |
Tests for a grey value crossing using a 3x3 kernel. This function is called by WlzSeqPar(). Given an integer kernel about a given pixel (E):
A B C D E F G H I
The sums:
(A + B + C), (G + H + I); (B + C + F), (D + G + H) (A + D + G), (C + F + I) and (A + B + D), (F + H + I)
are computed about the pixel E. The crossing value is then the maximum difference between the sums which have opposite signs.
spWSpace | Work space data structure from WlzSeqPar(). |
spData | Data passed on by WlzSeqPar(), which is used to pass the crossing value. |
References _WlzSeqParWSpace::adrptr.
Referenced by WlzGreyCrossing().
WlzObject* WlzGreyCrossing | ( | WlzObject * | inObj, |
int | newObjFlag, | ||
int | cVal, | ||
WlzErrorNum * | dstErr | ||
) |
Uses a 3X3 kernel to examine the given object for transitions (grey value crossings) about the given grey value. Only objects with WLZ_EMPTY_OBJ and WLZ_2D_DOMAINOBJ types are valid. WLZ_2D_DOMAINOBJ objects must have a valid domain and integral (ie WLZ_GREY_INT, WLZ_GREY_SHORT or WLZ_GREY_UBYTE) values.
inObj | Given object. |
newObjFlag | If zero the convolution is done in place, else a new object is created. |
cVal | Grey value about which to test for transitions. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzGreyV::inv, _WlzObject::type, _WlzCoreValues::type, _WlzPixelV::v, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_GREY_TYPE, 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_UBYTE, WLZ_RASTERDIR_ILIC, WlzGetBackground(), WlzGreyCrossingSeqParFn(), WlzGreyTableTypeToGreyType(), WlzMakeEmpty(), WlzSeqPar(), and WlzValueConvertPixel().
WlzObject* WlzGreyGradient | ( | WlzObject ** | dstGrdZ, |
WlzObject ** | dstGrdY, | ||
WlzObject ** | dstGrdX, | ||
WlzObject * | srcObj, | ||
WlzRsvFilter * | flt, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the gradient of the gray values in the given Woolz domain object.
dstGrdZ | Destination pointer for the gradient (partial derivative) through planes, may be NULL. |
dstGrdY | Destination pointer for the gradient (partial derivative) through lines, may be NULL. |
dstGrdX | Destination pointer for the gradient (partial derivative) through columns, may be NULL. |
srcObj | Given source object. |
flt | Recursive filter to use. |
dstErr | Destination error pointer, may be null. |
References _WlzObject::type, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_NULL, and WlzMakeEmpty().
Referenced by WlzCannyDeriche(), and WlzNMSuppress().
WlzErrorNum WlzGreyNormalise | ( | WlzObject * | obj, |
int | dither | ||
) |
Normalizes the the grey values of the input object to fill the range 0-255.
Colour values are independently reset which will change colour balance. Use WlzGreySetRange directly to avoid this. Note grey-values are reset in place and not copied.
obj | Object with values to be normalised. |
dither | Dither values if non-zero. |
References _WlzGreyV::dbv, _WlzGreyV::flv, _WlzGreyV::inv, _WlzGreyV::rgbv, _WlzGreyV::shv, _WlzPixelV::type, _WlzGreyV::ubv, _WlzPixelV::v, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WlzGreyRange(), and WlzGreySetRange().
Referenced by WlzRGBChanRatio(), and WlzScalarFeatures2D().
WlzErrorNum WlzGreyRange | ( | WlzObject * | obj, |
WlzPixelV * | min, | ||
WlzPixelV * | max | ||
) |
compute grey-range of a pixel/voxel object.
obj | grey-level input object |
min | minimum values return |
max | maximum values return. |
References _WlzObject::assoc, _WlzIntervalWSpace::colrmn, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzGreyV::flv, _WlzGreyP::inp, _WlzGreyV::inv, _WlzPlaneDomain::lastpl, _WlzValues::obj, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzObject::plist, _WlzGreyP::rgbp, _WlzGreyV::rgbv, _WlzGreyP::shp, _WlzGreyV::shv, _WlzPixelV::type, _WlzObject::type, _WlzPlaneDomain::type, _WlzCoreValues::type, _WlzVoxelValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzGeomPolyListItem2D::v, _WlzPixelV::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, 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_VALUES_TYPE, WLZ_ERR_VOXELVALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_PLANEDOMAIN_DOMAIN, WLZ_TRANS_OBJ, WLZ_VOXELVALUETABLE_GREY, WlzEndGreyScan(), WlzGreyTableIsTiled(), WlzGreyTableTypeToGreyType(), WlzInitGreyScan(), and WlzNextGreyInterval().
Referenced by WlzEffReadObjTiff(), WlzGreyNormalise(), WlzHistogramObj(), WlzIndexObjToCompound(), WlzMeshFromObjBox(), and WlzWriteObj().
WlzErrorNum WlzGreySetRange | ( | WlzObject * | obj, |
WlzPixelV | min, | ||
WlzPixelV | max, | ||
WlzPixelV | Min, | ||
WlzPixelV | Max, | ||
int | dither | ||
) |
Set new grey-range by simple linear interpolation.
Set new grey-range by simple linear interpolation assuming that the min and max values enclose the true range of grey-values in the object. Failure to check this could result in a segmentation fault. The transform function is:
\[ g' = \frac{(gMax - gMin)} {(gmax - gmin)} (g - gmin) + gMin + \delta \]
Here \(\delta\) is the dither value.obj | Input grey-level object whose values are to be reset. |
min | Initial minimum value. |
max | Initial maximum value. |
Min | Final minimum value. |
Max | Final maximum value. |
dither | Dither values if destination range is greater than source range and this flag is non-zero. |
References ALG_MAX, ALG_MIN, AlgRandSeed(), AlgRandZigNormal(), _WlzIntervalWSpace::colrmn, _WlzValues::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzDomain::i, _WlzGreyP::inp, _WlzPlaneDomain::lastpl, _WlzValues::obj, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzGreyP::rgbp, _WlzGreyV::rgbv, _WlzGreyP::shp, _WlzObject::type, _WlzPlaneDomain::type, _WlzCoreValues::type, _WlzVoxelValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzPixelV::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_CLAMP, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_FLOAT_DATA, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PLANEDOMAIN_TYPE, WLZ_ERR_UNSPECIFIED, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_ERR_VOXELVALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_NINT, WLZ_PLANEDOMAIN_DOMAIN, WLZ_RGBA_ALPHA_GET, WLZ_RGBA_BLUE_GET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_RED_GET, WLZ_RGBA_RGBA_SET, WLZ_TRANS_OBJ, WLZ_VOXELVALUETABLE_GREY, WlzEndGreyScan(), WlzFreeObj(), WlzGreyTableIsTiled(), WlzGreyTypeFromObj(), WlzInitGreyScan(), WlzMakeMain(), WlzNextGreyInterval(), and WlzValueConvertPixel().
Referenced by WlzGreyNormalise(), and WlzRegCCorObjs().
WlzObject* WlzGreyVariance | ( | WlzObject * | inObj, |
int | newObjFlag, | ||
int | kernelSz, | ||
double | scale, | ||
WlzErrorNum * | dstErr | ||
) |
Uses a small kernel to compute the local variance of the given grey value object. Only objects with WLZ_EMPTY_OBJ and WLZ_2D_DOMAINOBJ types are valid. WLZ_2D_DOMAINOBJ objects must have a valid domain and integral (ie WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT or WLZ_GREY_UBYTE) values.
inObj | Given object. |
newObjFlag | If zero the filter is applied in place. |
kernelSz | Kernel size, must be 3, 5 or 7. |
scale | Variance data scale factor. |
dstErr | Destination error pointer, may be NULL. |
References _WlzSeqParWSpace::adrptr, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzGreyVarianceWSp::gType, _WlzGreyV::inv, _WlzGreyVarianceWSp::scale, _WlzGreyVarianceWSp::size, _WlzObject::type, _WlzCoreValues::type, _WlzPixelV::v, _WlzObject::values, WLZ_2D_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_PARAM_DATA, WLZ_ERR_VALUES_NULL, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_NINT, WLZ_RASTERDIR_ILIC, WlzGetBackground(), WlzGreyTableTypeToGreyType(), WlzMakeEmpty(), WlzSeqPar(), and WlzValueConvertPixel().
WlzObject* WlzMakeLUTObject | ( | WlzGreyType | vType, |
int | bin1, | ||
int | lastbin, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a new look up table object by calling WlzMakeLUTDomain() and WlzMakeLUTValues(). The last bin of the look up table must be greater than the first.
vType | Value type, which must be either WLZ_GREY_INT or WLZ_GREY_RGBA. |
bin1 | First bin of the look up table. |
lastbin | Last bin of the look up table. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzValues::lut, _WlzDomain::lut, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_LUT, WlzFreeDomain(), WlzFreeLUTValues(), WlzMakeLUTDomain(), WlzMakeLUTValues(), and WlzMakeMain().
Referenced by WlzLUTGreyTransformNew(), and WlzLUTMergeToRGBA().
WlzLUTDomain* WlzMakeLUTDomain | ( | int | bin1, |
int | lastbin, | ||
WlzErrorNum * | dstErr | ||
) |
Makes a new look up table domain. The returned data structure should be freed using WlzFreeDomain().
bin1 | First bin of look up table. |
lastbin | Last bin of look up table. |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), _WlzLUTDomain::bin1, _WlzLUTDomain::lastbin, _WlzLUTDomain::type, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, and WLZ_LUT.
Referenced by WlzCopyDomain(), WlzMakeLUTObject(), and WlzReadMeshTransform3D().
WlzLUTValues* WlzMakeLUTValues | ( | WlzGreyType | vType, |
int | maxVal, | ||
WlzErrorNum * | dstErr | ||
) |
Makes a new look up table values data structure. The returned data structure should be freed using WlzFreeLUTValues().
vType | Value type, which must be either WLZ_GREY_INT or WLZ_GREY_RGBA. |
maxVal | Number of values to allocate (may be zero if no look up table required). |
dstErr | Destination error pointer, may be NULL. |
References AlcCalloc(), AlcFree(), AlcFreeStackPush(), _WlzLUTValues::freeptr, _WlzLUTValues::maxVal, _WlzLUTValues::type, _WlzGreyP::v, _WlzLUTValues::val, _WlzLUTValues::vType, WLZ_ERR_GREY_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_LUT, and WlzGreySize().
Referenced by WlzCopyObjectGreyValues(), WlzMakeLUTObject(), and WlzReadMeshTransform3D().
WlzErrorNum WlzFreeLUTValues | ( | WlzValues | val | ) |
Frees a look up table values data structure.
val | Given look up table values. |
References AlcFree(), AlcFreeStackFree(), _WlzValues::core, _WlzLUTValues::freeptr, _WlzLUTValues::linkcount, _WlzValues::lut, _WlzCoreValues::type, WLZ_ERR_NONE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_LUT, and WlzUnlink().
Referenced by WlzFreeObj(), WlzMakeLUTObject(), and WlzReadMeshTransform3D().
WlzObject* WlzLUTGreyTransformNew | ( | WlzGreyTransformType | gTrType, |
WlzGreyType | gType, | ||
int | il, | ||
int | iu, | ||
WlzGreyV | gol, | ||
WlzGreyV | gou, | ||
double | p0, | ||
double | p1, | ||
WlzErrorNum * | dstErr | ||
) |
Creates a new look up table object, setting it's look up table values using a grey transform. See also WlzMakeLUTObject() and WlzLUTGreyTransformSet().
gTrType | Grey transform with valid transforms: WLZ_GREYTRANSFORMTYPE_IDENTITY, WLZ_GREYTRANSFORMTYPE_LINEAR, WLZ_GREYTRANSFORMTYPE_GAMMA and WLZ_GREYTRANSFORMTYPE_SIGMOID. |
gType | Grey type for the look up table values and supplied minimum and maximum values.. |
il | Input minimum grey value, must be integral. |
iu | Input maximum grey value, must be integral. |
gol | Output minimum grey value. |
gou | Output maximum grey value. |
p0 | First parameter, with meaning for transforms: unused, unused, gamma, |
p1 | Second parameter, with meaning for transforms: unused, unused, gamma, |
dstErr | Destination error pointer, may be NULL. |
References WLZ_ERR_NONE, WlzFreeObj(), WlzLUTGreyTransformSet(), and WlzMakeLUTObject().
WlzErrorNum WlzLUTGreyTransformSet | ( | WlzObject * | obj, |
WlzGreyTransformType | gTrType, | ||
WlzGreyType | gType, | ||
int | il, | ||
int | iu, | ||
WlzGreyV | gol, | ||
WlzGreyV | gou, | ||
double | p0, | ||
double | p1 | ||
) |
Sets a given look up table using a grey transform.
obj | Given look up table object with the domain bin1 and lastbin set along with the values first and last bin values. All types, fields and arrays must be appropriate. |
gTrType | Grey transform with valid transforms: WLZ_GREYTRANSFORMTYPE_IDENTITY, WLZ_GREYTRANSFORMTYPE_LINEAR, WLZ_GREYTRANSFORMTYPE_GAMMA and WLZ_GREYTRANSFORMTYPE_SIGMOID. |
gType | Grey type. |
il | First integer value to set in LUT. |
iu | Last integer value to set in LUT. |
gol | First grey value. |
gou | Last grey value. |
p0 | First parameter, with meaning for transforms: unused, unused, gamma, mean. |
p1 | Second parameter, with meaning for transforms: unused, unused, unused, sigma (minimum clamped to 1e-6). |
References ALG_MAX, ALG_MIN, _WlzLUTDomain::bin1, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzGreyP::inp, _WlzGreyV::inv, _WlzLUTDomain::lastbin, _WlzValues::lut, _WlzDomain::lut, _WlzGreyP::rgbp, _WlzGreyV::rgbv, _WlzLUTDomain::type, _WlzObject::type, _WlzLUTValues::type, _WlzLUTValues::val, _WlzObject::values, _WlzLUTValues::vType, WLZ_CLAMP, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_TRANSFORM_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREYTRANSFORMTYPE_GAMMA, WLZ_GREYTRANSFORMTYPE_IDENTITY, WLZ_GREYTRANSFORMTYPE_LINEAR, WLZ_GREYTRANSFORMTYPE_SIGMOID, WLZ_LUT, WLZ_RGBA_ALPHA_GET, WLZ_RGBA_BLUE_GET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_RED_GET, and WLZ_RGBA_RGBA_SET.
Referenced by WlzLUTGreyTransformNew().
WlzObject* WlzLUTMergeToRGBA | ( | WlzObject * | r, |
WlzObject * | g, | ||
WlzObject * | b, | ||
WlzObject * | a, | ||
WlzErrorNum * | dstErr | ||
) |
Merges separate grey LUTs into a single RGBA LUT. All LUTs should either be NULL or have the same domain and integer LUT values, with at least one LUT object being non NULL.
r | Red LUT, if NULL a constant value of 0 is assumed. |
g | Green LUT, if NULL a constant value of 0 is assumed. |
b | Blue LUT, if NULL a constant value of 0 is assumed. |
a | Alpha LUT, if NULL a constant value of 255 is assumed. |
dstErr | Destination error pointer, may be NULL. |
References _WlzLUTDomain::bin1, _WlzObject::domain, _WlzGreyP::inp, _WlzLUTDomain::lastbin, _WlzValues::lut, _WlzDomain::lut, _WlzGreyP::rgbp, _WlzObject::type, _WlzLUTValues::val, _WlzObject::values, WLZ_CLAMP, 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_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_LUT, WLZ_RGBA_RGBA_SET, and WlzMakeLUTObject().
WlzObject* WlzLUTTransformObj | ( | WlzObject * | gObj, |
WlzObject * | tObj, | ||
WlzGreyType | rGType, | ||
int | inplace, | ||
int | dither, | ||
WlzErrorNum * | dstErr | ||
) |
Applies a LUT to an domain object with grey values.
gObj | Given domain object with values. |
tObj | Given LUT transform object. |
rGType | Grey type for the return object. Ignored if the operation is done in place. |
inplace | Flag, which if non-zero, specifies that the given objects grey values should be modified in place. If set then the return grey type parameter is ignored. |
dither | Non-zero if value dithering is required. Dithering may make the value transformation significantly slower. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzIntervalWSpace::lftpos, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzIntervalWSpace::plnpos, _WlzIntervalWSpace::rgtpos, _WlzObject::type, _WlzCoreValues::type, _WlzGreyWSpace::u_grintptr, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_TAB_RAGR, WLZ_LUT, WlzEndGreyScan(), WlzFreeObj(), WlzFreeValueTb(), WlzFreeVoxelValueTb(), WlzGetBackground(), WlzGreyTableIsTiled(), WlzGreyTypeFromObj(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzLUTTransformGreyValues(), WlzLUTTransformPixelValue(), WlzMakeMain(), WlzNewValuesVox(), WlzNewValueTb(), and WlzNextGreyInterval().
WlzPixelV WlzLUTTransformPixelValue | ( | WlzObject * | tObj, |
WlzPixelV | gPix, | ||
WlzGreyType | rType, | ||
WlzErrorNum * | dstErr | ||
) |
Transforms the grey value of a single pixel using the given look up table object. This function is not very efficient, use WlzLUTTransformGreyValues() (which this function calls) where possible.
tObj | Look up table transform object. |
gPix | Given pixel value. |
rType | Return grey type. |
dstErr | Destination error pointer, may be NULL. |
References _WlzGreyP::inp, _WlzGreyV::inv, _WlzGreyP::rgbp, _WlzGreyV::rgbv, _WlzGreyP::shp, _WlzGreyV::shv, _WlzPixelV::type, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzPixelV::v, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, and WlzLUTTransformGreyValues().
Referenced by WlzLUTTransformObj().
WlzErrorNum WlzLUTTransformGreyValues | ( | WlzObject * | tObj, |
WlzGreyP | rP, | ||
WlzGreyType | rType, | ||
WlzGreyP | gP, | ||
WlzGreyType | gType, | ||
int | nVal, | ||
int | dither | ||
) |
Transforms the grey values in the given buffer using the look up table object, putting the values into the return buffer.
tObj | Look up table transform object. |
rP | Return grey value buffer. |
rType | Return grey type. |
gP | Given grey value buffer. |
gType | Given grey type. |
nVal | Number of grey values in buffer. |
dither | Flag, dither if non-zero. |
References _WlzLUTDomain::bin1, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzGreyP::inp, _WlzLUTDomain::lastbin, _WlzValues::lut, _WlzDomain::lut, _WlzGreyP::rgbp, _WlzGreyP::shp, _WlzObject::type, _WlzGreyP::ubp, _WlzLUTValues::val, _WlzObject::values, _WlzLUTValues::vType, WLZ_CLAMP, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_LUT, WLZ_RGBA_ALPHA_GET, WLZ_RGBA_BLUE_GET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_MODULUS, WLZ_RGBA_RED_GET, WLZ_RGBA_RGBA_SET, and WlzValueDitherI().
Referenced by WlzLUTTransformObj(), and WlzLUTTransformPixelValue().
WlzErrorNum WlzRankFilter | ( | WlzObject * | gObj, |
int | fSz, | ||
double | rank | ||
) |
Applies a rank filter in place to the given Woolz object. Each value of the given object is replaced by the n'th ranked value of the values in it's immediate neighborhood, where the neighborhood is a simple axis aligned cuboid with the size.
gObj | Given object. |
fSz | Rank filter size. |
rank | Required rank with values: 0.0 minimum, 0.5 median and 1.0 maximum. |
References Alc2Free(), Alc3Free(), ALC_ER_NONE, AlcBit2Calloc(), AlcBit3Calloc(), AlcDouble2Malloc(), AlcDouble3Malloc(), AlcFloat2Malloc(), AlcFloat3Malloc(), AlcFree(), AlcInt2Malloc(), AlcInt3Malloc(), AlcMalloc(), AlcShort2Malloc(), AlcShort3Malloc(), AlcUnchar2Malloc(), AlcUnchar3Malloc(), AlgRankSelectD(), AlgRankSelectF(), AlgRankSelectI(), AlgRankSelectS(), AlgRankSelectUB(), _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::flp, _WlzGreyV::flv, getopt(), _WlzGreyValueWSpace::gPtr, _WlzDomain::i, _WlzGreyP::inp, _WlzGreyV::inv, _WlzIntervalDomain::kol1, _WlzPlaneDomain::kol1, _WlzIntervalDomain::lastkl, _WlzPlaneDomain::lastkl, _WlzPlaneDomain::lastln, _WlzPlaneDomain::lastpl, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzPlaneDomain::line1, _WlzIntervalWSpace::linpos, main(), _WlzIntervalWSpace::nwlpos, optarg, opterr, optind, optopt, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzGreyP::rgbp, _WlzGreyV::rgbv, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzGreyV::shv, _WlzObject::type, _WlzCoreValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzGreyV::ubv, _WlzGreyP::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, _WlzIVertex2::vtX, _WlzIVertex3::vtX, _WlzIVertex2::vtY, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_BIT_GET, 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_PARAM_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_BIT, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WlzAssignObject(), WlzBitLnSetItv(), WlzEndGreyScan(), WlzFreeObj(), WlzGreyTableIsTiled(), WlzGreyTypeFromObj(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueMakeWSp(), WlzInitGreyScan(), WlzMakeMain(), WlzNextGreyInterval(), WlzReadObj(), WlzStringFromErrorNum(), WlzToArray2D(), WlzValueSetUByte(), and WlzWriteObj().
WlzObject* WlzGaussFilter | ( | WlzObject * | inObj, |
WlzDVertex3 | sigma, | ||
WlzIVertex3 | order, | ||
WlzIVertex3 | direc, | ||
WlzGreyType | gType, | ||
AlgPadType | pad, | ||
double | padVal, | ||
int | sep, | ||
WlzErrorNum * | dstErr | ||
) |
Applies a Gaussian filter to the given input spatial domain object. Only scalar valued image objects are valid for use with this function.
inObj | Input 2 or 3D spatial domain object which must have values. |
sigma | Gaussian sigma values for each of the Cartesian directions. |
order | Derivative order for each of the Cartesian directions, range 0-2, where 0 implies no derivative. |
direc | Required Cartesian directions, with zero value indicating that no filtering is to be applied for a direction. |
gType | Required return object grey type. Passing in WLZ_GREY_ERROR will request the given input object's grey type. |
pad | Type of padding. |
padVal | Padding value, only used when pad == ALG_PAD_VALUE. |
sep | If non zero each directional filter operation is applied to the input object rather than the output of the previous directional filter. The method by which the separate filter passes are combined is determined by the given value with the valid operations:
|
dstErr | Destination error pointer may be NULL. |
References AlcFree(), AlcMalloc(), _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzObject::values, _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, _WlzDVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_GREY_TYPE, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_PARAM_DATA, WLZ_ERR_VALUES_NULL, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WlzFreeObj(), WlzGreyTypeFromObj(), and WlzSepFilter().
Referenced by WlzTensorSmooth().
WlzObject* WlzSepFilter | ( | WlzObject * | inObj, |
WlzIVertex3 | cBufSz, | ||
double * | cBuf[], | ||
WlzIVertex3 | direc, | ||
WlzGreyType | gType, | ||
AlgPadType | pad, | ||
double | padVal, | ||
int | sep, | ||
WlzErrorNum * | dstErr | ||
) |
Applies a seperable filter to the given object using the given convolution kernels.
inObj | Input 2 or 3D spatial domain object to be filtered which must have scalar values. |
cBufSz | Convolution kernel sizes (sz), each kernel buffer is sized (2 * sz) + 1 with the centre indexed sz into the buffer. |
cBuf | Convolution kernel buffers. |
direc | Set to non-zero in directions for which the filter is to be applied. |
gType | Required return object grey type. Passing in WLZ_GREY_ERROR will request the given input object's grey type. |
pad | Type of padding. |
padVal | Padding value, only used when pad == ALG_PAD_VALUE. |
sep | If non zero each directional filter operation is applied to the input object rather than the output of the previous directional filter. The method by which the separate filter passes are combined is determined by the given value with the valid operations:
|
dstErr | Destination error pointer may be NULL. |
References AlcCalloc(), AlcFree(), AlcMalloc(), ALG_MAX3, AlgConvolveD(), _WlzGreyValueWSpace::bkdFlag, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyV::flv, _WlzGreyValueWSpace::gPtr, _WlzGreyValueWSpace::gType, _WlzGreyValueWSpace::gVal, _WlzGreyV::inv, _WlzPlaneDomain::lastpl, _WlzIntervalWSpace::lftpos, _WlzCompoundArray::n, _WlzCompoundArray::o, _WlzDomain::p, _WlzGreyWSpace::pixeltype, _WlzPlaneDomain::plane1, _WlzVoxelValues::plane1, _WlzIntervalWSpace::rgtpos, _WlzGreyV::shv, _WlzPixelV::type, _WlzObject::type, _WlzGreyWSpace::u_grintptr, _WlzGreyV::ubv, _WlzPixelV::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_BO_ADD, WLZ_COMPOUND_ARR_1, WLZ_COMPOUND_ARR_2, 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_FN_SCALAR_SQR, WLZ_FN_SCALAR_SQRT, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_SHORT, WLZ_GREY_TAB_RAGR, WLZ_GREY_UBYTE, WlzAssignObject(), WlzBoundingBox2I(), WlzBoundingBox3I(), WlzConvertPix(), WlzEndGreyScan(), WlzFreeObj(), WlzGreyTypeFromObj(), WlzGreyValueFreeWSp(), WlzGreyValueGet(), WlzGreyValueMakeWSp(), WlzGreyValueTableType(), WlzImageArithmetic(), WlzInitGreyScan(), WlzMakeCompoundArray(), WlzMakeMain(), WlzNewObjectValues(), WlzNextGreyInterval(), WlzScalarFn(), WlzValueCopyDoubleToDouble(), WlzValueCopyGreyToGrey(), _WlzIBox2::xMax, _WlzIBox3::xMax, _WlzIBox2::xMin, _WlzIBox3::xMin, _WlzIBox2::yMax, _WlzIBox3::yMax, _WlzIBox2::yMin, _WlzIBox3::yMin, _WlzIBox3::zMax, and _WlzIBox3::zMin.
Referenced by WlzGaussFilter().
WlzObject* WlzSepTrans | ( | WlzObject * | obj, |
WlzIntervalConvFunc | x_fun, | ||
void * | x_params, | ||
WlzIntervalConvFunc | y_fun, | ||
void * | y_params, | ||
WlzErrorNum * | dstErr | ||
) |
Perform 2D seperable transform on a 2D grey-level image. It is the users responsibility to ensure that the grey-value types are appropriate. Now extended to include compound objects.
obj | Input object pointer |
x_fun | Convolution function to be applied in the x-direction (along the rows). |
x_params | Parameter pointer to be passed to the x-function. |
y_fun | Convolution function to be applied in the y-direction (down the columns). |
y_params | Parameter pointer to be passed to the y-function. |
dstErr | error return. |
References AlcFree(), AlcMalloc(), _WlzSepTransWSpace::bckgrnd, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzObject::domain, _WlzGreyP::flp, _WlzDomain::i, _WlzSepTransWSpace::inbuf, _WlzGreyP::inp, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzIntervalDomain::lastln, _WlzSepTransWSpace::len, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzCompoundArray::n, _WlzCompoundArray::o, _WlzValues::obj, _WlzCompoundArray::otype, _WlzSepTransWSpace::outbuf, _WlzPixelP::p, _WlzGreyWSpace::pixeltype, _WlzGreyP::rgbp, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzPixelP::type, _WlzObject::type, _WlzCompoundArray::type, _WlzCoreValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_COMPOUND_ARR_1, WLZ_COMPOUND_ARR_2, WLZ_EMPTY_OBJ, 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_ERR_VALUES_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_TRANS_OBJ, WlzAssignObject(), WlzFreeObj(), WlzGetBackground(), WlzGreyTableIsTiled(), WlzGreyTableTypeToGreyType(), WlzInitGreyScan(), WlzMakeCompoundArray(), WlzMakeEmpty(), WlzMakeMain(), WlzNextGreyInterval(), and WlzTransposeObj().
Referenced by WlzGauss2().
WlzObject* WlzValuesFromCoords | ( | WlzObject * | gObj, |
int | radial, | ||
WlzGreyType | gType, | ||
WlzErrorNum * | dstErr | ||
) |
Given a spatial domain object (with or wthout values) this function creates a compound array object with the number of component objects set to the number of the dimensions of the input object. The domains of the component objects are those of the given object and the values are set to the coordinate values within the object domains. Components are ordered by column, line, plane or radial distance, angle (in radians), plane.
gObj | Given spatial domain object. |
radial | Use cylindrical coordinates if non-zero. |
gType | Required grey type; valid types are restricted to WLZ_GREY_INT and WLZ_GREY_DOUBLE any other grey type is an error. |
dstErr | Destination error pointer, may be NULL. |
References _WlzKrigModelFn::a, _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzObject::domain, _WlzPlaneDomain::domains, _WlzGreyP::inp, _WlzGreyV::inv, _WlzPlaneDomain::lastpl, _WlzIntervalWSpace::linpos, _WlzCompoundArray::o, _WlzDomain::p, _WlzPlaneDomain::plane1, _WlzIntervalWSpace::rgtpos, _WlzPixelV::type, _WlzObject::type, _WlzGreyWSpace::u_grintptr, _WlzPixelV::v, _WlzValues::v, _WlzObject::values, _WlzVoxelValues::values, _WlzValues::vox, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_COMPOUND_ARR_1, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_GREY_DOUBLE, WLZ_GREY_ERROR, WLZ_GREY_INT, WLZ_GREY_TAB_RECT, WLZ_NINT, WLZ_VOXELVALUETABLE_GREY, WlzAssignObject(), WlzAssignValues(), WlzFreeObj(), WlzGreySetValue(), WlzGreyValueTableType(), WlzInitGreyScan(), WlzMakeCompoundArray(), WlzMakeMain(), WlzMakeVoxelValueTb(), WlzNewValueTb(), and WlzNextGreyInterval().
WlzObject* WlzWindow | ( | WlzObject * | srcObj, |
WlzWindowFnType | winFn, | ||
WlzIVertex2 | org, | ||
WlzIVertex2 | rad, | ||
WlzErrorNum * | dstErr | ||
) |
Cuts a rectangular region from the given object and then applies the specified 2D data windowing function. The linkcount of the returned object is zero.
srcObj | Given source object. |
winFn | Required windowing function. |
org | Window origin with respect to the given given source object. |
rad | Window radius. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzCoreValues::type, _WlzObject::values, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WlzCutObjToBox2D(), WlzFreeObj(), WlzGreyTableTypeToGreyType(), WlzMakeEmpty(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, and _WlzIBox2::yMin.
Referenced by WlzRegCCorObjs().
const char* WlzWindowFnName | ( | WlzWindowFnType | winFnValue | ) |
Finds the appropriate name string for the given window function value.
winFnValue | Window function value. |
References WLZ_WINDOWFN_BLACKMAN, WLZ_WINDOWFN_HAMMING, WLZ_WINDOWFN_HANNING, WLZ_WINDOWFN_PARZEN, WLZ_WINDOWFN_RECTANGLE, WLZ_WINDOWFN_UNSPECIFIED, and WLZ_WINDOWFN_WELCH.
WlzWindowFnType WlzWindowFnValue | ( | const char * | winFnName | ) |
Finds the appropriate value for the given window function name string.
winFnName | Window function name string. |
References WLZ_WINDOWFN_BLACKMAN, WLZ_WINDOWFN_HAMMING, WLZ_WINDOWFN_HANNING, WLZ_WINDOWFN_PARZEN, WLZ_WINDOWFN_RECTANGLE, WLZ_WINDOWFN_UNSPECIFIED, WLZ_WINDOWFN_WELCH, and WlzStringMatchValue().