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

"Unable to perform assignment because the left and right sides have a different number of elements." #58

Open
Gabrielle-Siemonsmeier opened this issue Apr 27, 2021 · 4 comments

Comments

@Gabrielle-Siemonsmeier
Copy link

Hi Jinghao,

I've started using MIN1PIPE recently to process recordings taken with a UCLA V3 miniscope running the newer version of the UCLA miniscope software. I ran into the following issue:

        Begin data cat
        Unable to perform assignment because the left and right sides have a different number of elements.
        Error in data_cat (line 205)
                                        stt(ii) = stt1 + stp;
        Error in min1pipe (line 84)
                    [m, filename_raw, imaxn, imeanf, pixh, pixw, nf, imx1, imn1] = data_cat(path_name, file_base{i},
                    file_fmt{i}, Fsi, Fsi_new, spatialr);

I'm using the following parameters:
FSI: 30
FSI_new = 30
spatialr: 0.25
se: 10
ismc = true
flag = 1

I'm running MIN1PIPE on our server; I have successfully processed other recordings that way, and have verified that all necessary packages are installed.
I first ran into this issue when I tried to process a .tif stack generated in Image J by concatenating four separate .avi recordings from a single session, so I figured that was the source of the problem, but the same error message now came up when trying to process single .avi recordings straight from the miniscope (but renamed to msCam01.avi as opposed to the new default 0.avi ). Those two recordings (from two animals) are continuous 16min recordings at 30fps, uncompressed, about 10gb each.

Thanks in advance for your help!

Cheers,

Gabrielle

@JinghaoLu
Copy link
Owner

Hi Gabrielle,

I am pretty sure that it is the problem with the avi format. There are so many different types of avi and in MIN1PIPE only the raw uncompressed grayscale avi can be processed due to the easy data structure that can be read in fastly. For future data collection, I suggest using the supported data structure. For the current one, you may want to either convert it to the supported formats, or use the default matlab VideoReader to collect the data frames and pass it to a variable called "frame_all" and save it with the name "*_frame_all.mat".

@Gabrielle-Siemonsmeier
Copy link
Author

Thanks for getting back to me so quickly! That's what surprised me, these are raw uncompressed grayscale .avi files as recorded by the UCLA miniscope software, I didn't modify them. I did also get the following warning message though:

          Warning: AVIINFO will be removed in a future release. Use VIDEOREADER instead.
          > In aviinfo (line 74)
          In data_cat (line 60)
          In min1pipe (line 84)
          In demo_min1pipe (line 14)

I'm not sure I understand your last suggestion; do you mean I should replace aviinfo by videoreader in data_cat.m ? or use videoreader instead of data_cat.m to generate the *_frame_all.mat file and then proceed? For reference I've never used Matlab before using MIN1PIPE so I'm really unfamiliar with...everything, unfortunately.
Would converting the .avi videos to .tif stacks be another option?

@JinghaoLu
Copy link
Owner

You can disregard any warning messages. For the last suggestion: you can disregard that as well, but what I intended to suggest is that you write your own loop for reading in the data based on matlab built-in video read functions, which is much slower but can handle many more video formats.

Yes avi to tiff would be another option, though cumbersome.

But back to the error message, this does look like a video format issue. However, more strange issue might happen, so I would like to either have you set breakpoints and debug it with me, or you can share a small video file so that I can do the debug. Let me know what you think.

@Gabrielle-Siemonsmeier
Copy link
Author

Thanks, I'll send you an email!

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

2 participants