We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f04f76 commit 5399ca5Copy full SHA for 5399ca5
tedana/decay.py
@@ -37,7 +37,11 @@ def _apply_t2s_floor(t2s, echo_times):
37
echo_times = echo_times[:, None]
38
39
eps = np.finfo(dtype=t2s.dtype).eps # smallest value for datatype
40
- temp_arr = np.exp(-echo_times / t2s) # (E x V) array
+ nonzerovox = t2s != 0
41
+ # Exclude values where t2s is 0 when dividing by t2s.
42
+ # These voxels are also excluded from bad_voxel_idx
43
+ temp_arr = np.zeros((len(echo_times), len(t2s)))
44
+ temp_arr[:, nonzerovox] = np.exp(-echo_times / t2s[nonzerovox]) # (E x V) array
45
bad_voxel_idx = np.any(temp_arr == 0, axis=0) & (t2s != 0)
46
n_bad_voxels = np.sum(bad_voxel_idx)
47
if n_bad_voxels > 0:
0 commit comments