JinghaoLu / MIN1PIPE

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

issue with spatial downsampling factor #27

Open AlvinAi-cloud opened 4 years ago

AlvinAi-cloud commented 4 years ago

I am trying the newest code and the provided demo data. There is no error when the spatial downsampling factor was set to 1, but the program only identified 33 neurons (your attached "demo_visualization.png" showed 78 neurons).

I thought the issue may be related to the spatial downsampling factor. When I reduce it to 0.5, the program show the following errors: Begin intra-section Error using intra_section (line 76) Expected BlockSize to be an array with all of the values >= 5.

Error in frame_reg (line 92) m = intra_section(m, stt, stp, pixs, scl, sigma_x, sigma_f, sigma_d, flag, maskc);

Error in min1pipe (line 108) [m, corr_score, raw_score, scl] = frame_reg(m, imaxy, se, Fsi_new, pixs, scl, sigma_x, sigma_f, sigma_d);

Error in demo_min1pipe_modified (line 13) [fname, frawname, fregname] = min1pipe(Fsi, Fsi_new, spatialr, se, ismc, flag);

Thank you ahead of time for your help.

JinghaoLu commented 4 years ago

You don't need to spatially downsample the demo video. The error is due to the pyramid level used in Lucas-Kanade tracker (which is 4) onto the demo video (75 X 75) causes a downsampled frame of size smaller than 5. The png figure was actually from the very initial version of the package, which has a liberal nature in selecting neurons, possibly consisting of more false positives, whereas the latest version of the package tends to only select most reliably identified ROIs.

AlvinAi-cloud commented 4 years ago

Thank you for the explanation.