Skip to content

Commit f3c071c

Browse files
fixing mean image weights
1 parent 429dc5c commit f3c071c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

suite2p/detection/detect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def detect(ops, classfile: Path):
4949
weights = max_proj
5050
else:
5151
mproj = mean_img
52-
weights = mean_img - mean_img.min()*1.1
52+
weights = 0.1 + np.clip((mean_img - np.percentile(mean_img,1)) /
53+
(np.percentile(mean_img,99) - np.percentile(mean_img,1)), 0, 1)
5354
stats = anatomical.select_rois(mproj, weights, ops['Ly'], ops['Lx'],
5455
ops['yrange'][0], ops['xrange'][0])
5556

0 commit comments

Comments
 (0)