Skip to content

Commit 42b615f

Browse files
loop instead of sum for threshold_reduce
1 parent a39faec commit 42b615f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

suite2p/extraction/sparsedetect.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,10 @@ def threshold_reduce(movu, Th2):
133133
134134
"""
135135
nbinned, Lyp, Lxp = movu.shape
136-
#Vt = np.zeros((1,Lyp,Lxp), 'float32')
137-
Vt = (((movu>Th2) * movu)**2).sum(axis=0)**0.5
138-
139-
#for t in range(nbinned):
140-
# Vt += movu[t]**2 * (movu[t]>Th2)
141-
#Vt = Vt**.5
136+
Vt = np.zeros((Lyp,Lxp), 'float32')
137+
for t in range(nbinned):
138+
Vt += movu[t]**2 * (movu[t]>Th2)
139+
Vt = Vt**.5
142140
return Vt
143141

144142
def multiscale_mask(ypix0,xpix0,lam0, Lyp, Lxp):

0 commit comments

Comments
 (0)