Skip to content

Commit d7915fa

Browse files
Merge pull request #873 from darikoneil/main
Two Bug Fixes
2 parents d0a454d + b29f89e commit d7915fa

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

suite2p/gui/rungui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ def create_buttons(self):
147147
'input average diameter of ROIs in recording (can give a list e.g. 6,9 if aspect not equal), if set to 0 auto-determination run by Cellpose',
148148
'cellprob_threshold for cellpose',
149149
'flow_threshold for cellpose (throws out masks, if getting too few masks, set to 0)',
150-
'high-pass image spatially by a multiple of the diameter (if field is non-uniform, a value of ~2 is recommended',
151150
'model type string from Cellpose (can be a built-in model or a user model that is added to the Cellpose GUI)',
151+
'high-pass image spatially by a multiple of the diameter (if field is non-uniform, a value of ~2 is recommended',
152152
'whether or not to extract neuropil; if 0, Fneu is set to 0',
153153
'allow shared pixels to be used for fluorescence extraction from overlapping ROIs (otherwise excluded from both ROIs)',
154154
'number of pixels between ROI and neuropil donut',

suite2p/registration/register.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,12 @@ def registration_wrapper(f_reg, f_raw=None, f_reg_chan2=None, f_raw_chan2=None,
612612
outputs = compute_reference_and_register_frames(f_align_in, f_align_out=f_align_out, refImg=refImg, ops=ops)
613613
refImg, rmin, rmax, mean_img, rigid_offsets, nonrigid_offsets, zest = outputs
614614
yoff, xoff, corrXY = rigid_offsets
615-
yoff1, xoff1, corrXY1 = nonrigid_offsets
615+
616+
617+
if ops['nonrigid']:
618+
yoff1, xoff1, corrXY1 = nonrigid_offsets
619+
else:
620+
yoff1, xoff1, corryXY1 = None, None, None
616621

617622
if nchannels > 1:
618623
mean_img_alt = shift_frames_and_write(f_alt_in, f_alt_out, yoff, xoff, yoff1, xoff1, ops)
@@ -750,7 +755,8 @@ def save_registration_outputs_to_ops(registration_outputs, ops):
750755
# assign rigid offsets to ops
751756
ops['yoff'], ops['xoff'], ops['corrXY'] = rigid_offsets
752757
# assign nonrigid offsets to ops
753-
ops['yoff1'], ops['xoff1'], ops['corrXY1'] = nonrigid_offsets
758+
if ops['nonrigid']:
759+
ops['yoff1'], ops['xoff1'], ops['corrXY1'] = nonrigid_offsets
754760
# assign mean images
755761
ops['meanImg'] = meanImg
756762
if meanImg_chan2 is not None:

0 commit comments

Comments
 (0)