int lkstats (
kobject src_obj,
kobject gate_obj,
kobject stats_obj,
unsigned long active_stats,
unsigned long aux_info,
unsigned long stats_region,
kfile *ascii_file,
int ascii_flag)
Data with corresponding mask or gate values of zero (gating defined by gate_obj) are not included in any statistics calculations. If the gating object is different sized than the source object, it will be resized to match the source object, padded with 1.
If the input data object contains a map, the data will be mapped before the statistics are calcualted. All output information will reflect this mapping.
The following statistics are available:
mean = 1/N*sum(x(i)) i=1..N var = 1/(N-1)*sum( (x(i) - mean)**2 ) i=1..N stddev = sqrt(var) i=1..N rms = sqrt(1/N*sum(x(i)**2)) i=1..N skew = 1/N*sum( ((x(i) - mean)/stddev) **3 ) i=1..N kurtosis=(1/N*sum( ((x(i) - mean)/stddev) **4)) - 3 i=1..N minimum value maximum value minimum value coordinates maximum value coordinates sum of all points sum of all positive points sum of all negative points number of contributing points number of positive contributing points number of negative contributing points number of zero-valued contributing points dimensions of data
Statistics are stored in the stats_obj as double float. Each statistic is stored as an element of a N-D vector defined along the value data "elements" dimension of the stats_obj, where N is the number of statistics defined by the active_stats variable.
The order in which the elements of the statistics vector are stored in the statistics data object is given in the object's comment attribute.
When M sets of statistics are calculated for M multiple regions of the input data object (defined by the flags set in the stats_region variable), the statistics vectors are stored along the width dimension (width=M, elements=N).
The stats_region variable defines how the data object is sliced along the dimensions for calculation of statistics over sub-regions. For example, if the width and height flags are set in the "stats_region" variable, the statistics for each width-height plane will be calculated separately. For an image object this can be viewed as calculating the statistics across the various bands of the image. The stats_region flag can be built by or'ing the region dimensionality flags defined in include/kdatamanip/kstats.h.
While computing variance, the division factor is set to (N-1) in order to obtain a more accurate estimate. For a more detailed explanation refer to any standard statistics text.
none
none
$DATAMANIP/objects/library/kdatamanip/src/lkstats.c