Woolz Image Processing  Version 1.7.5
WlzSeqPar.c File Reference

Performs sequential or local transformation of an object. Jim Piper derived the original seqpar.c from Fortran code by Marshall Presser. More...

Functions

WlzObjectWlzSeqPar (WlzObject *srcObj, int newObjFlag, int sequentialFlag, WlzRasterDir rasterDir, int bdrSz, int bkgVal, void *transformData, int(*transformFn)(WlzSeqParWSpace *, void *), WlzErrorNum *dstErr)
 WlzSeqPar performs a sequential or parallel local transform. A distance transform is an example of a sequential transform and a laplacian is an example of a parallel transform. Only WLZ_2D_DOMAINOBJ objects with values may be passed to WlzSeqPar(). More...
 

Detailed Description

Performs sequential or local transformation of an object. Jim Piper derived the original seqpar.c from Fortran code by Marshall Presser.

Author
Jim Piper, Bill Hill
Date
March 1999
Version
Id
55eb8508c6b7e79757173c650bff93281938a0c2
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2012], The University Court of the University of Edinburgh, Old College, Edinburgh, UK.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Function Documentation

WlzObject* WlzSeqPar ( WlzObject srcObj,
int  newObjFlag,
int  sequentialFlag,
WlzRasterDir  rasterDir,
int  bdrSz,
int  bkgVal,
void *  transformData,
int(*)(WlzSeqParWSpace *, void *)  transformFn,
WlzErrorNum dstErr 
)

WlzSeqPar performs a sequential or parallel local transform. A distance transform is an example of a sequential transform and a laplacian is an example of a parallel transform. Only WLZ_2D_DOMAINOBJ objects with values may be passed to WlzSeqPar().

Returns
The filtered object, maybe NULL on error.
Note
If the point to be transformed is at line l and col k, there is an array of pointers spWSpace->adrptr[-7:7], whose i'th entry gives the address of the point (l + (i * spWSpace->ldelta), k), but which is only meaningful for lines within bdrSz of the point. For example: spWSpace->adrptr[-3] and spWSpace->adrptr[3] are undefined if bdrSz < 3.
Parameters
srcObjThe given WLZ_2D_DOMAINOBJ object.
newObjFlagIf zero then the given object is overwritten otherwise a new object is created.
sequentialFlagIf non zero the transform is seqential and transformed values are used in calculating the neighbouring values. If zero the transform always works on the original grey values.
rasterDirDirection of raster scan.
bdrSzLocal transform kernel half-size, must be in range 0 - 7. The usual 8 immediate neighbors correspond to bdrSz == 1.
bkgValBackground grey value.
transformDataData supplied to the transform function.
transformFnSupplied transform function.
dstErrDestination error pointer, may be NULL.

References _WlzSeqParWSpace::adrptr, AlcCalloc(), AlcFree(), _WlzSeqParWSpace::brdrsz, _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzGreyWSpace::gvio, _WlzDomain::i, _WlzGreyP::inp, _WlzSeqParWSpace::kdelta, _WlzIntervalDomain::kol1, _WlzIntervalDomain::lastkl, _WlzIntervalDomain::lastln, _WlzSeqParWSpace::ldelta, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzIntervalWSpace::linpos, _WlzIntervalWSpace::nwlpos, _WlzIntervalWSpace::rgtpos, _WlzObject::type, _WlzCoreValues::type, _WlzGreyWSpace::u_grintptr, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_3, WLZ_DBG_LVL_FN, WLZ_ERR_DOMAIN_DATA, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_RASTERDIR_DLDC, WLZ_RASTERDIR_DLIC, WLZ_RASTERDIR_ILDC, WLZ_RASTERDIR_ILIC, WlzGreyInterval(), WlzGreyTableIsTiled(), WlzInitGreyRasterScan(), WlzNewGrey(), WlzNextGreyInterval(), WlzNextInterval(), and WlzValueSetInt().

Referenced by WlzConvolveObj(), WlzGreyCrossing(), and WlzGreyVariance().