Defining a custom cluster metrics only in ClustersView (not in SimilarityView)

22 views
Skip to first unread message

Jose Guzman

unread,
Sep 29, 2019, 7:37:21 AM9/29/19
to phy-users
Hi everyone!

Following the examples in the documentation ( https://phy.readthedocs.io/en/latest/plugins/ ), I created a plugin that computes the median inter-spike interval of the clusters. I was wondering if there is a way to show that measurement only in the ClusterView (and not in the SimilarityView).

Thanks


class ISIClusterView(IPlugin):
   
"""
    This Pluging computes the median inter-spike interval of a cluster
    """

   
def attach_to_controller(self, controller):
       
"""
        This function is called at initialization time before
        creation of the supervisor object (s) which controls the
        clusters and the similarity view.
        """

       
       
def medianisi(cluster_id):
           
"""
            computes the average value of the interstimulus interval
            of the cluster_id
            """

            t
= controller.get_spike_times(cluster_id).data
           
return np.median(np.diff(t)) if len(t)>2 else 0


       
# will appear in ClusterView and SimilarityView
        controller
.cluster_metrics['ISI.median'] = \
            controller
.context.memcache(medianisi)



Cyrille Rossant

unread,
Oct 7, 2019, 8:54:29 AM10/7/19
to Jose Guzman, phy-users
Hi
no that's not possible at the moment, but I opened an issue on GitHub to add this feature.
Best,
Cyrille


--
You received this message because you are subscribed to the Google Groups "phy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phy-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/phy-users/5cc9d766-ae6d-4220-8713-41f298b996d1%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages