tedana.utils
.threshold_map
- threshold_map(img, min_cluster_size, threshold=None, mask=None, binarize=True, sided='bi')[source]
Cluster-extent threshold and binarize image.
- Parameters:
img (img_like or array_like) – Image object or 3D array to be clustered
min_cluster_size (int) – Minimum cluster size (in voxels)
threshold (float or None, optional) – Cluster-defining threshold for img. If None (default), assume img is already thresholded.
mask ((S,) array_like or None, optional) – Boolean array for masking resultant data array. Default is None.
binarize (bool, optional) – Default is True.
sided ({‘bi’, ‘two’, ‘one’}, optional) – How to apply thresholding. One-sided thresholds on the positive side. Two-sided thresholds positive and negative values together. Bi-sided thresholds positive and negative values separately. Default is ‘bi’.
- Returns:
clust_thresholded ((M)
numpy.ndarray
) – Cluster-extent thresholded (and optionally binarized) map.