Skip to content

Commit 3e5bea3

Browse files
committed
Fix more explanation of CI and also add a tiny comment to stop puzzling about why it works.
1 parent 6324c1c commit 3e5bea3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

phys2bids/cli/run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ def _get_parser():
154154
help="The Confidence Interval (CI) to use in the estimation of the trigger clusters. "
155155
"The cluster algorithm considers triggers with duration (in samples) within this "
156156
"CI as part of the same group, thus the same. If CI is an integer, it will consider "
157-
"that amount of triggers. If CI is a float and < 1, it will consider that "
158-
"percentage of the trigger duration. CI cannot be a float > 1. Default is 1. "
159-
"Change to .25 if there is a CMRR DWI sequence or when recording sub-triggers.",
157+
"that amount of samples around the distance. If CI is a float and < 1, it will "
158+
"consider that percentage of the trigger duration. CI cannot be a float > 1. "
159+
"Default is 1. Change to .25 if there is a CMRR DWI sequence or when recording "
160+
"sub-triggers.",
160161
default=1,
161162
)
162163
optional.add_argument(

phys2bids/slice4phys.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def estimate_ntp_and_tr(phys_in, thr=None, ci=1):
2323
Confidence Interval (CI) to use in the estimation of the trigger clusters. The
2424
cluster algorithm considers triggers with duration (in samples) within this CI
2525
as part of the same group, thus the same. If CI is an integer, it will consider
26-
that amount of triggers. If CI is a float and < 1, it will consider that
26+
that amount of samples. If CI is a float and < 1, it will consider that
2727
percentage of the trigger duration. CI cannot be a float > 1. Default is 1.
2828
Change to .25 if there is a CMRR DWI sequence or when recording sub-triggers.
2929
@@ -67,6 +67,7 @@ def estimate_ntp_and_tr(phys_in, thr=None, ci=1):
6767
k = 0
6868
current_group = [unique_isi[0]]
6969

70+
# np.unique returns sorted elements → unique_isi[0] == min(unique_isi), so THIS WORKS.
7071
for n, i in enumerate(range(1, len(unique_isi))):
7172
if unique_isi[i] <= upper_ci_isi[n]:
7273
current_group.append(unique_isi[i])

0 commit comments

Comments
 (0)