JinghaoLu / MIN1PIPE

A MINiscope 1-photon-based Calcium Imaging Signal Extraction PIPEline.
GNU General Public License v3.0
59 stars 27 forks source link

Error indexing .AVI movie #24

Open mcg1298 opened 5 years ago

mcg1298 commented 5 years ago

Hi, When I try to run a video from a miniscope through the pipeline, I get this error:

min1pipe Begin collecting datasets info Done collecting datasets info, time: 0.36223 Array formation and parentheses-style indexing with objects of class 'VideoReader' is not allowed. Use objects of class 'VideoReader' only as scalars or use a cell array.

Error in data_cat (line 89) pixwo = info(1,1).Width;

Error in min1pipe (line 83) [m, filename_raw, imaxn, imeanf, pixh, pixw, nf] = data_cat(path_name, file_base{i}, file_fmt{i}, Fsi, Fsi_new, spatialr);

I have analyzed the video in the past on a previous computer and it was no issue, so I'm not too sure whats going on here. I'm running Matlab 2019b on a 2019 Macbook pro if that helps.

7kestrel commented 5 years ago

Try replacing lines 89 and 90 with these lines: 89 pixwo = info.Width 90 pixho = info.Height

for the UCLA Miniscope (.avi) data files, data_cat uses a VideoReader object, which is not a matrix

mcg1298 commented 5 years ago

That did the job!

Thank you so much, it's greatly appreciated.

JinghaoLu commented 5 years ago

Good catch. Codes updated. However I do not remember clearly why an indexing is called here, which I believe at that time there was a reason. Anyway, indexing was removed here for now.