tedana.utils
.dice
- dice(arr1, arr2, axis=None)[source]
Compute Dice’s similarity index between two numpy arrays.
Arrays will be binarized before comparison.
This method was first proposed in Dice[1] and Sorensen[2].
- Parameters:
arr1, arr2 (array_like) – Input arrays, arrays to binarize and compare.
axis (None or int, optional) – Axis along which the DSIs are computed. The default is to compute the DSI of the flattened arrays.
- Returns:
dsi (
float
) – Dice-Sorenson index.
Notes
This implementation was based on https://gist.github.com/brunodoamaral/e130b4e97aa4ebc468225b7ce39b3137.
References