JinghaoLu / MIN1PIPE

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

Stuck at lk_cluster.m #32

Closed plodocus closed 4 years ago

plodocus commented 4 years ago

Hi Jinghao,

I have a problem with the intra-section registration. In lk_loop() the outer while loop is never exited. I replaced all the parfor in intra_section()'s child functions with for and set fprintf statements in the while loops. Right now, it's at iteration 1000, counting, which doesn't seem right. Any ideas?

JinghaoLu commented 4 years ago

It's too general, and this is rarely seen. I would suggest you first locate the stable section chunk that results in the issue ("regtcur", line 79 of intra_section.m), maximally containing 10 frames, and just run that chunk. Then set a breakpoint at line 47 of lk_ld_hier.m to check the input arguments to lk_loop. If nothing weird, try to locate the issue inside lk_loop.

plodocus commented 4 years ago

I don't know what the code in lk_loop is supposed to be doing and can't determine whether and where something weird is happening. I sent you the variables that trigger the infinite loop by email to the gmail account.

JinghaoLu commented 4 years ago

I ran lk_loop with the inputs you sent me, and surprisingly no infinite loop found. You sure this is the trigger that leads to the loop inside lk_loop but not other functions?

plodocus commented 4 years ago

Sorry, I think I mixed up the function names. I actually meant lk_cluster(). Tried in Matlab 9.5.0.944444 (R2018b), Linux 64 bit.

JinghaoLu commented 4 years ago

Hi Daniel, The bug was fixed. It was due to the incorrect computing of the graph in lk_cluster.m when the frames were not successfully tracked using LK tracker.

plodocus commented 4 years ago

Thanks, Jinghao! I can confirm that it now works.