@@ -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