deeptrack.statistics Module#

Contains features that perform some statistics operation on the input.

These features reduce some dimension of the input by calculating some statistical metric. They follow the syntax of the equivalent numpy function, meaning that axis and keepdims are valid arguments. Moreover, they all accept the distributed keyword, which determines if each image in the input list should be handled individually or not. For example:

>>> input_values = [np.ones((2,)), np.zeros((2,))]
>>> Sum(axis=0, distributed=True)(input_values) # [1+1, 0+0]
>>> [2, 0]
>>> Sum(axis=0, distributed=False)(input_values) # [1+0, 1+0]
>>> [1, 1]

Reducers can be added to the pipeline in two ways:

>>> some_pipeline_of_features
>>> summed_pipeline = some_pipeline_of_features >> Sum(axis=0)
>>> summed_pipeline = Sum(some_pipeline_of_features, axis=0)

Combining the two, eg:

>>> incorrectly_summed_pipline = some_feature >> Sum(some_pipeline_of_features, axis=0)

is not supported and the behaviour is not guaranteed. However, other operators can be used in this way:

>>> correctly_summed_and_subtracted_pipline = some_feature - Sum(some_pipeline_of_features, axis=0)

Classes#

Cumsum([feature, axis, distributed])

Compute the cummulative sum along the specified axis.

Feature([_input])

Base feature class.

Image(value[, copy])

Wrapper for array-like values with property tracking.

Max([feature, axis, keepdims, distributed])

Return the maximum of an array or maximum along an axis.

Mean([feature, axis, keepdims, distributed])

Compute the arithmetic mean along the specified axis.

Median([feature, axis, keepdims, distributed])

Compute the median along the specified axis.

Min([feature, axis, keepdims, distributed])

Return the minimum of an array or minimum along an axis.

PeakToPeak([feature, axis, keepdims, ...])

Range of values (maximum - minimum) along an axis.

Percentile([feature, q, axis, keepdims, ...])

Compute the q-th percentile of the data along the specified axis.

Prod([feature, axis, keepdims, distributed])

Compute the product along the specified axis

Quantile([feature, q, axis, keepdims, ...])

Compute the q-th quantile of the data along the specified axis.

Reducer(function[, feature, distributed])

Base class of features that reduce the dimensionality of the input.

Std([feature, axis, keepdims, distributed])

Compute the standard deviation along the specified axis.

Sum([feature, axis, keepdims, distributed])

Compute the sum along the specified axis

Variance([feature, axis, keepdims, distributed])

Compute the variance along the specified axis.