Normalization
treat2p.normalisation.delta_over_F
¶
Performs deltaF over F0 ( with eq : DF0 = F - F0 / F0 )
Source code in src/treat2p/normalisation.py
treat2p.normalisation.center_normalize
¶
Normalizes and centers an input array around its mean. The values are then scaled so that the mean will be at equidistance of outmin and outmax in the output array. The relationship between outmin and outmax and the original data values are : outmin, outmax values are snapped from - , + (respectively) of max( abolute (min) vs abolute(max)) from the values of the data after mean substraction (at 0)
It accepts an input array, subtracts its mean (thus centering it around zero), and then normalizes it to be within a specified range (outmin and outmax). By default, the range is between 0 and 1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
array
|
ndarray
|
Input array to be centered and normalized. |
required |
outmin
|
float
|
Minimum value for the output normalized array. Defaults to 0. |
0
|
outmax
|
float
|
Maximum value for the output normalized array. Defaults to 1. |
1
|
percentile
|
float | None
|
The maximum percentile that corresponds to the un-normalized value that will snap to the output bounds (symetrically around the mean) If set to None (default) the current value snapped to the bounds is the maximum absolute value between array.min() and array.max() (e.g. normalization via scaling but not translation, to stay centered around the mean at 0, that occurs at the 2n line in the code) |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
numpy.ndarray: Normalized and centered array with values ranging between specified minimum and maximum values. |