magland / ml_ms4alg

MountainSort v4
7 stars 19 forks source link

NumpySortingExtractor doesn't save primary channel information #24

Open BMT01 opened 4 years ago

BMT01 commented 4 years ago

Hello -

I'm using ml_ms4alg in the context of SpikeTemplate. I have a simple 3 channel dataset which I'm sorting units on. When I save firings.mda or curate the results in phy through spikesorters.run_mountainsort4(), all units are assigned channel 0. The units however are on distinct channels (see attached image). Figure_1

My three electrodes are 2 mm apart, so they are effectively independent. This occurs with adjacency_radius set to 0 or -1.

I was debugging and found that channel information is preserved within the firings array in ms4alg.MountainSort4(), but mountainsort4.py converts the sorting output to a spikeextractors.NumpySortingExtractor() object, which doesn't save channel information. Is this expected behavior within the SpikeTemplate ecosystem, or is there a way to pass channel information along? It would be helpful to have this information for curation (e.g. combining multiple channel clusters to a single unit in phy).

Would it be possible to potentially save MS4 results as a MdaSortingExtractor object, to preserve channel information? Please let me know if I'm asking too much.

Thank you.