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)
--
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.