cortex-lab / phy

phy: interactive visualization and manual spike sorting of large-scale ephys data
BSD 3-Clause "New" or "Revised" License
311 stars 157 forks source link

How to get a cluster label after a merge of two clusters. #1098

Open FranciscoNaveros opened 3 years ago

FranciscoNaveros commented 3 years ago

Hi.

I'm implementing a sorting algorithm in phy to classify the neurons identified by kilosort 2.5. In a first step, I just analyze the clusters identified as "good" by kilosort (KSLabel column in clusterView window). These labels are loaded from a text file named "cluster_KSLabel.tsv" and stored in inside a dictionary in controller.model.metadata['KSLabel'] (this structure has a copy in controller.supervisor.cluster_labels['KSLabel']). The problem it is that when I perform a merge of two clusters, these "KSLabel structures" are not modified and the new cluster with a new ID does not has any KSLabel value (the ID is outside the ranged of the dictionary). Nevertheless, I don't know how, but the ClusterView window assigns a "KSLable value" to the new cluster. I would like to know how I can get the KSLabel value of the new cluster.

Francisco.