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

Error in pix_select: exceeds dimension #55

Open
martinjendryka opened this issue Feb 16, 2021 · 5 comments
Open

Error in pix_select: exceeds dimension #55

martinjendryka opened this issue Feb 16, 2021 · 5 comments

Comments

@martinjendryka
Copy link

martinjendryka commented Feb 16, 2021

Im getting the same error message (see below) for two of my sessions and I dont know how to fix it.
in pix_select (line 254)
sa = rtmp(rg(1, 1): rg(1, 2), rg(2, 1): rg(2, 2), 1: nf);
rtmp has dimension 480, 725, 8975,
rg(2, 2) = 726,
so it throws the exceeds array bounds error

Previous processing with an earlier version of min1pipe_hpc did not cause any problems. Also for all my other sessions the latest min1pipe version worked perfectly fine. When I run the script for a single video from the same session, I also dont get any error msgs.
There is enough disk space and I have all necessary toolboxes. using matlab 2020
Fsi = 20; Fsi_new = 5; spatialr = 1; se = 5; ismc = true; flag = 1;

Error msg:
Index in position 2 exceeds array bounds (must not exceed 358).

Error in pix_select (line 254)
sa = rtmp(rg(1, 1): rg(1, 2), rg(2, 1): rg(2, 2), 1: nf);

Error in iter_seeds_select (line 25)
[roi, sig, bg, bgf, seeds, datasmth0, cutoff0, pkcutoff0]
= pix_select(m_tmp, mask, sz, Fsi_new, sigthres,
corrthres);

Error in min1pipe (line 142)
[sigrf, roirf, seedsupdt, bgrf, bgfrf, datasmthf1,
cutofff1, pkcutofff1] = iter_seeds_select(m, mask, Params,
P, options, flag);

Error in demo_min1pipe (line 13)
min1pipe(Fsi, Fsi_new, spatialr, se, ismc, flag);

@JinghaoLu
Copy link
Owner

It might be because of the small SNR that the algorithm could not correctly get the FOV in your video. You can send the session to the email [email protected] if it is not too large so that I can take a look, or just a file of the session (but I cannot guarantee that I can replicate the problem) if the whole session share is impossible.

@mgraupe
Copy link

mgraupe commented Mar 1, 2021

Hello,
I am getting the same error message for some (but not all) of my recordings. So min1pipe code runs fine but aborts when analyzing specific experiments. My configuration is the same as @martinjendryka . I am also running Matlab2020b.
Did you figure out on how to avoid error?

Thanks,
Michael

@martinjendryka
Copy link
Author

Hi Michael,
Jinghao suggested me changing the spatial downsampling factor 'spatialr'. You can try out spatialr = 0.25. This will downsample the video by the factor 4. This worked at least for one of my sessions that could not be preprocessed with "spatialr = 1" previously.

According to Jinghao, the issue arises from the mismatch between the spatial resolution and the variable "se = 5". "se" should be selected based on the number of pixels along the radius of a typical neuron in your FOV and it is preferably 5~9.

Hope it helps!
Martin

@mgraupe
Copy link

mgraupe commented Mar 2, 2021 via email

@JinghaoLu
Copy link
Owner

@mgraupe spatialr = 0.5 + se = 5 is equivalent to spatialr = 1 + se = 10 in theory, but can be different due to the implementation details and simply the structure element shape for the morphological operations. However, whenever possible, it is much more beneficial to use the previous parameter set, which 1. decrease the impact of some dirts in the FOV, and most importantly 2. decrease processing time (especially motion correction) drastically.

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

3 participants