spikeinterface icon indicating copy to clipboard operation
spikeinterface copied to clipboard

getting extras from estimate_motion has a bug

Open JeffreyBoucher opened this issue 3 weeks ago • 2 comments

Hello,

estimate_motion() has an option extra_outputs which currently (in my version 103.0) doesn't work, at least with the iterative template method. The specific problem comes from two things: in estimate motion lines 104-107

if extra_outputs:
    extra = {}
else:
    extra = None

and then in iterative_template lines 133 to 139:

    if extra:
        extra["non_rigid_windows"] = non_rigid_windows
        extra["motion_histograms"] = motion_histograms
        extra["target_histogram"] = target_histogram
        extra["shift_covs_block"] = shift_covs_block
        extra["temporal_hist_bin_edges"] = temporal_hist_bin_edges
        extra["spatial_hist_bin_edges"] = spatial_hist_bin_edges

both options for extra in the former code block return false, so the latter code block is inaccessible

I have bypassed this for now by doing:

if extra_outputs:
    extra = 1
else:
    extra = None

But perhaps this breaks other things...

Thanks!

Jeff Boucher

JeffreyBoucher avatar Dec 01 '25 14:12 JeffreyBoucher

(In fact, my solution didn't work for an obvious reason (extra can't be an integer) but I think the issue is otherwise well-specified)

JeffreyBoucher avatar Dec 01 '25 14:12 JeffreyBoucher

Hi Thanks for reporting. OUps. This should be if extra is not None: can you try a PR ?

samuelgarcia avatar Dec 03 '25 16:12 samuelgarcia

See #4280

samuelgarcia avatar Dec 22 '25 13:12 samuelgarcia