Skip to content

The relationship between win_step_um and contact positions. #3564

Open
@BEGINRX

Description

@BEGINRX

I met a bug.


Traceback (most recent call last):
  File "/home/NITD/lxr/code/spike_sorting/run_sorter1014.py", line 405, in start_sorting
    rec_corrected, rec_ww = preprocess(raw_rec_part, detection, filting, need_correct_motion)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/NITD/lxr/code/spike_sorting/run_sorter1014.py", line 199, in preprocess
    recording_f = si.correct_motion(recording=recording_f, preset='kilosort_like', detect_kwargs=detection,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/NITD/anaconda3/envs/si_env_rolling/lib/python3.11/site-packages/spikeinterface/preprocessing/motion.py", line 436, in correct_motion
    motion = estimate_motion(recording, peaks, peak_locations, progress_bar=progress_bar, **estimate_motion_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/NITD/anaconda3/envs/si_env_rolling/lib/python3.11/site-packages/spikeinterface/sortingcomponents/motion/motion_estimation.py", line 111, in estimate_motion
    motion = method_class.run(
             ^^^^^^^^^^^^^^^^^
  File "/home/NITD/anaconda3/envs/si_env_rolling/lib/python3.11/site-packages/spikeinterface/sortingcomponents/motion/iterative_template.py", line 117, in run
    shift_indices, target_histogram, shift_covs_block = iterative_template_registration(
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/NITD/anaconda3/envs/si_env_rolling/lib/python3.11/site-packages/spikeinterface/sortingcomponents/motion/iterative_template.py", line 246, in iterative_template_registration
    window_slice = slice(window_slice[0], window_slice[-1])
                         ~~~~~~~~~~~~^^^
IndexError: index 0 is out of bounds for axis 0 with size 0

The contacts' positions are computed by positions = [[i*100, j*100] for j in range(0, 2) for i in range(0, 4) ]. How can I set the win_step to aviod the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmotion correctionQuestions related to motion correction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions