Skip to content

Commit

Permalink
fixing bug with multi-plane nonrigid ops
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed Feb 9, 2024
1 parent c6e2915 commit 02fe382
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions suite2p/registration/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def compute_reference_masks(refImg, ops=default_ops()):
if isinstance(refImg, list):
refAndMasks_all = []
for rimg in refImg:
refAndMasks = compute_reference_masks(rimg)
refAndMasks = compute_reference_masks(rimg, ops=ops)
refAndMasks_all.append(refAndMasks)
return refAndMasks_all
else:
Expand Down Expand Up @@ -227,7 +227,6 @@ def register_frames(refAndMasks, frames, rmin=-np.inf, rmax=np.inf, bidiphase=0,
"""

if nZ > 1:
cmax_best = -np.inf * np.ones(len(frames), "float32")
cmax_all = -np.inf * np.ones((len(frames), nZ), "float32")
Expand All @@ -252,7 +251,6 @@ def register_frames(refAndMasks, frames, rmin=-np.inf, rmax=np.inf, bidiphase=0,
outputs = register_frames(refAndMasks[z], frames[[i]], rmin=rmin[z],
rmax=rmax[z], bidiphase=bidiphase, ops=ops,
nZ=1)

if i == 0:
outputs_best = []
for output in outputs[:-1]:
Expand Down Expand Up @@ -437,7 +435,6 @@ def compute_reference_and_register_frames(f_align_in, f_align_out=None, refImg=N
bidiphase = 0

refAndMasks = compute_reference_masks(refImg, ops)

### ------------- register frames to reference image ------------ ###

mean_img = np.zeros((Ly, Lx), "float32")
Expand Down Expand Up @@ -642,7 +639,6 @@ def registration_wrapper(f_reg, f_raw=None, f_reg_chan2=None, f_raw_chan2=None,
else:
nchannels = 1


outputs = compute_reference_and_register_frames(f_align_in, f_align_out=f_align_out,
refImg=refImg, ops=ops)
refImg, rmin, rmax, mean_img, rigid_offsets, nonrigid_offsets, zest = outputs
Expand Down

0 comments on commit 02fe382

Please sign in to comment.