Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Partial analysis on subset of data does not work #1113

Open
knowblesse opened this issue Apr 2, 2024 · 0 comments
Open

BUG: Partial analysis on subset of data does not work #1113

knowblesse opened this issue Apr 2, 2024 · 0 comments

Comments

@knowblesse
Copy link

Describe the issue:

Behavior

In the latest document, frames_include option is implemented for the following reason.

frames_include: (int, default: -1) if greater than zero, only frames_include frames are processed. useful for testing parameters on a subset of data.

However this option does not work and also is not implemented in the GUI.

The source of the error : suite2p/registration/register.py#L493


Cause

The line compares xoff and yoff (probably movement correction values for each frame) with frames_include.

Those two variables have the matching size of frames_include, but the n_frames parameter is loaded from suite2p/run_s2p.py#L500, and has the total number of frame number instead.

Reproduce the code example:

from suite2p import default_ops
from suite2p.run_s2p import run_s2

base_ops = default_ops()
# with other necessary options..
base_ops.update({'frames_include': 100})

run_s2p(base_ops)

Error message:

Traceback (most recent call last):
  File "/home/jihoon_jeong/miniforge3/envs/2p_prep/lib/python3.9/site-packages/suite2p/run_s2p.py", line 336, in run_plane
    ops = pipeline(f_reg, f_raw, f_reg_chan2, f_raw_chan2, run_registration, ops,
  File "/home/jihoon_jeong/miniforge3/envs/2p_prep/lib/python3.9/site-packages/suite2p/run_s2p.py", line 108, in pipeline
    registration_outputs = registration.registration_wrapper(
  File "/home/jihoon_jeong/miniforge3/envs/2p_prep/lib/python3.9/site-packages/suite2p/registration/register.py", line 652, in registration_wrapper
    mean_img_alt = shift_frames_and_write(f_alt_in, f_alt_out, yoff, xoff, yoff1,
  File "/home/jihoon_jeong/miniforge3/envs/2p_prep/lib/python3.9/site-packages/suite2p/registration/register.py", line 492, in shift_frames_and_write
    raise ValueError(
ValueError: rigid registration offsets are not the same size as input frames

Version information:

0.14.0

Context for the issue:

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant