Woolz Image Processing  Version 1.7.0
AlgRank

Files

file  AlgRank.c
 Rank selection algorithms which provide fast rank selection from an array of values. This is the general case of mimimum, median and maximum value rank selection.
 

Functions

void AlgRankSelectI (int *elm, int nElm, int rank)
 Performs the minimum of sorting on an array of integers such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 
void AlgRankSelectUB (unsigned char *elm, int nElm, int rank)
 Performs the minimum of sorting on an array of unsigned bytes such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 
void AlgRankSelectS (short *elm, int nElm, int rank)
 Performs the minimum of sorting on an array of shorts such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 
void AlgRankSelectF (float *elm, int nElm, int rank)
 Performs the minimum of sorting on an array of floats such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 
void AlgRankSelectD (double *elm, int nElm, int rank)
 Performs the minimum of sorting on an array of doubles such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 
void AlgRankSelectV (void *elm, int nElm, unsigned int elmSz, int rank, void *buf, int(*compFn)(void *, void *))
 Performs the minimum of sorting on an array of values such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it. More...
 

Detailed Description

Function Documentation

void AlgRankSelectI ( int *  elm,
int  nElm,
int  rank 
)

Performs the minimum of sorting on an array of integers such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of elements.
nElmNumber of elements.
rankRequired rank in the range [0 - (nElm - 1)].

Referenced by WlzFilterNObjValues(), and WlzRankFilter().

void AlgRankSelectUB ( unsigned char *  elm,
int  nElm,
int  rank 
)

Performs the minimum of sorting on an array of unsigned bytes such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of elements.
nElmNumber of elements.
rankRequired rank in the range [0 - (nElm - 1)].

Referenced by WlzFilterNObjValues(), and WlzRankFilter().

void AlgRankSelectS ( short *  elm,
int  nElm,
int  rank 
)

Performs the minimum of sorting on an array of shorts such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of elements.
nElmNumber of elements.
rankRequired rank in the range [0 - (nElm - 1)].

Referenced by WlzFilterNObjValues(), and WlzRankFilter().

void AlgRankSelectF ( float *  elm,
int  nElm,
int  rank 
)

Performs the minimum of sorting on an array of floats such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of elements.
nElmNumber of elements.
rankRequired rank in the range [0 - (nElm - 1)].

Referenced by WlzFilterNObjValues(), and WlzRankFilter().

void AlgRankSelectD ( double *  elm,
int  nElm,
int  rank 
)

Performs the minimum of sorting on an array of doubles such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of elements.
nElmNumber of elements.
rankRequired rank in the range [0 - (nElm - 1)].

Referenced by WlzCMeshCmpElmFeat2D(), WlzCMeshCmpElmFeat3D(), WlzDistMetricDirVertex2D(), WlzDistMetricDirVertex3D(), WlzFilterNObjValues(), and WlzRankFilter().

void AlgRankSelectV ( void *  elm,
int  nElm,
unsigned int  elmSz,
int  rank,
void *  buf,
int(*)(void *, void *)  compFn 
)

Performs the minimum of sorting on an array of values such that the n'th value in the array has rank n. That is all values before the n'th are less than or equal to it and all values after the n'th are greater than or equal to it.

Returns
void
Parameters
elmArray of values.
nElmNumber of values.
elmSzSize of each value.
rankRequired rank in the range [0 - (nElm - 1)].
bufA pointer to a single value to be used as a workspace.
compFnA value comparison function in the same form as qsort(3).