soltanianzadeh / STNeuroNet

Software for the paper "Fast and robust active neuron segmentation in two-photon calcium imaging using spatio-temporal deep learning," Proceedings of the National Academy of Sciences (PNAS), 2019.
https://www.pnas.org/content/early/2019/04/10/1812995116
Apache License 2.0
61 stars 26 forks source link

MATLAB view_marking error #3

Closed MatthewPool256 closed 5 years ago

MatthewPool256 commented 5 years ago

When running view_marking on Neurofinder 100 train with neurofinder marking, I eventually get an error from line 21 round(CC.Centroid) in RemoveNeuropil.m. From the debugger, this is because the struct at this time (when k=322) is empty. Likewise, temp is an array of all zeros at this time, which I believe is what causes CC to be empty. I do not know why this happens, but it is preventing the code from running properly. Any help would be appreciated.

soltanianzadeh commented 5 years ago

@MatthewPool256 Thanks for reporting this issue. I have made minor edits to the ViewNeuronMarking.m code to prevent this issue. As you mentioned, the error was caused due to the presence of an all zero mask in the neurofinder marking. This all zero mask was most likely created when the borders of the masks were cropped and saved in the .mat file.

In general, it is best to avoid saving such masks (all zero pixels) as the FInalMasks.

MatthewPool256 commented 5 years ago

With the new files (and after installing the MATLAB GUI Layout Toolbox) I was able to run view_marking.m properly, thank you.