Woolz Image Processing Version 1.4.0
WlzRsvFilter.c File Reference

Recursive filters for Woolz, these are also known as Deriche and infinite impulse responce (IIR) filters. More...

Functions

void WlzRsvFilterFreeFilter (WlzRsvFilter *ftr)
 Free a recursive filter.
WlzRsvFilterWlzRsvFilterMakeFilter (WlzRsvFilterName name, double prm, WlzErrorNum *dstErr)
 Creates a new recursive filter.
WlzObjectWlzRsvFilterObj (WlzObject *srcObj, WlzRsvFilter *ftr, int actionMsk, WlzErrorNum *dstErr)
 Applies a recursive filter to the given object.
WlzErrorNum WlzRsvFilterBuffer (WlzRsvFilter *ftr, double *datBuf, double *tmpBuf0, double *tmpBuf1, int bufSz)
 Filters a given buffer using an IIR filter defined by the filter coefficients.

Detailed Description

Recursive filters for Woolz, these are also known as Deriche and infinite impulse responce (IIR) filters.

Author:
Bill Hill
Date:
May 1999
Version:
Id:
b7476aa173f06098bea74c3aefe663610bccc26d
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

void WlzRsvFilterFreeFilter ( WlzRsvFilter ftr)

Free a recursive filter.

Returns:
void
Parameters:
ftrFilter to free.

References AlcFree().

Referenced by WlzCannyDeriche(), WlzContourGrdObj2D(), and WlzHistogramRsvGauss().

WlzRsvFilter* WlzRsvFilterMakeFilter ( WlzRsvFilterName  name,
double  prm,
WlzErrorNum dstErr 
)

Creates a new recursive filter.

Returns:
New recursive filter.
Parameters:
nameName of filter.
prmParameter is alpha for Deriche's operators and sigma for Gaussians, must be $\geq$ 0.0.
dstErrDestination error pointer, may be null.

References _WlzRsvFilter::a, AlcCalloc(), _WlzRsvFilter::b, _WlzRsvFilter::c, _WlzRsvFilter::name, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_RSVFILTER_NAME_DERICHE_0, WLZ_RSVFILTER_NAME_DERICHE_1, WLZ_RSVFILTER_NAME_DERICHE_2, WLZ_RSVFILTER_NAME_GAUSS_0, WLZ_RSVFILTER_NAME_GAUSS_1, WLZ_RSVFILTER_NAME_GAUSS_2, and WLZ_RSVFILTER_NAME_NONE.

Referenced by WlzCannyDeriche(), WlzContourGrdObj2D(), and WlzHistogramRsvGauss().

WlzObject* WlzRsvFilterObj ( WlzObject srcObj,
WlzRsvFilter ftr,
int  actionMsk,
WlzErrorNum dstErr 
)

Applies a recursive filter to the given object.

Returns:
The filtered object, or NULL on error.
Parameters:
srcObjGiven object.
ftrRecursive filter.
actionMskAction mask.
dstErrDestination error pointer, may be null.

References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzObject::values, WLZ_2D_DOMAINOBJ, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_RSVFILTER_ACTION_X, WLZ_RSVFILTER_ACTION_Y, WLZ_RSVFILTER_ACTION_Z, WlzCopyValues(), WlzFreeObj(), WlzMakeEmpty(), WlzMakeMain(), and WlzNewGrey().

Referenced by WlzContourGrdObj2D().

WlzErrorNum WlzRsvFilterBuffer ( WlzRsvFilter ftr,
double *  datBuf,
double *  tmpBuf0,
double *  tmpBuf1,
int  bufSz 
)

Filters a given buffer using an IIR filter defined by the filter coefficients.

Returns:
Woolz error code.
Parameters:
ftrThe filter.
datBufThe data buffer to be filtered with bufSz elements.
tmpBuf0Temporary buffer with at least dataSz elements.
tmpBuf1Temporary buffer with at least dataSz elements.
bufSzNumber of data in buffer.

References WLZ_ERR_NONE, and WLZ_ERR_PARAM_NULL.

Referenced by WlzHistogramRsvFilter().