Skip to content

Commit

Permalink
[FIX] Make bi-sided clustering default (#331)
Browse files Browse the repository at this point in the history
* Change default thresholding to bi-sided.

We should treat positively and negatively weighted voxels separately
when performing cluster-extent thresholding.
  • Loading branch information
tsalo authored Dec 16, 2019
1 parent 99c578f commit 5e6918a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tedana/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def get_spectrum(data: np.array, tr: float = 1.0):


def threshold_map(img, min_cluster_size, threshold=None, mask=None,
binarize=True, sided='two'):
binarize=True, sided='bi'):
"""
Cluster-extent threshold and binarize image.
Expand All @@ -255,10 +255,15 @@ def threshold_map(img, min_cluster_size, threshold=None, mask=None,
Boolean array for masking resultant data array. Default is None.
binarize : bool, optional
Default is True.
sided : {'two', 'one', 'bi'}, optional
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 'two'.
thresholds positive and negative values separately. Default is 'bi'.
Returns
-------
clust_thresholded : (M) :obj:`numpy.ndarray`
Cluster-extent thresholded (and optionally binarized) map.
"""
if not isinstance(img, np.ndarray):
arr = img.get_data()
Expand Down

0 comments on commit 5e6918a

Please sign in to comment.