deltametrics.mobility.calculate_channelized_response_variance

deltametrics.mobility.calculate_channelized_response_variance(arr, threshold=0.2, normalize_input=False, normalize_output=False)

Calculate the Channelized Response Variance (CRV).

This function takes a t-x-y array and calculates its directional CRV [1]. In short, the function does the following:

  1. Normalizes the array at each time slice if desired.

  2. Calculates the CRV magnitude (aka variance along time-axis) and normalizes this array if desired.

  3. Does linear regressions through time for each pixel and returns the slopes.

  4. Calculates the directional CRV using a slope threshold value.

  5. Returns the CRV magnitude, slopes, and directional CRV values

Parameters:
  • arr (numpy.ndarray) – A t-x-y 3-D array to calculate the CRV on.

  • threshold (float, optional) – Threshold for CRV calculation. The default is 0.2.

  • normalize_input (bool, optional) – Whether to normalize the input images pixel values to 0-1. The default is False.

  • normalize_output (bool, optional) – Whether to normalize the output image pixel values to 0-1. The default is False.

Returns:

  • crv_magnitude (numpy.ndarray) – A t-x-y 3-D array with the CRV magnitude.

  • slopes (numpy.ndarray) – A t-x-y 3-D array with the slopes of the linear regressions.

  • directional_crv (numpy.ndarray) – A t-x-y 3-D array with the directional CRV.

Examples

(Source code, png, hires.png)

../_images/deltametrics-mobility-calculate_channelized_response_variance-1.png