tedana.utils.threshold_map

threshold_map(img, min_cluster_size, threshold=None, binarize=True, sided='bi')[source]

Cluster-extent threshold and binarize image.

Parameters:
  • img (img_like or array_like) – Image object or 3D/4D array to be clustered. If 4D, the last dimension is treated as independent volumes, and clustering is performed separately for each 3D volume.

  • min_cluster_size (int) – Minimum cluster size (in voxels)

  • threshold (float or None or (V,) array_like, optional) – Cluster-defining threshold for img. If None (default), assume img is already thresholded. If float, the same threshold is used for all volumes. If array_like and img is 4D, it must have length equal to the number of volumes in the last dimension; each threshold is applied to the corresponding volume.

  • 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. If img is 4D, returns a 4D array with the same shape.