def _plot(self): feats = self._get_features() labels = self.cluster_src.labels if self.show_cells =='all': show_labels = list(np.unique(labels)) if 0 in show_labels: show_labels.remove(0) else: show_labels = self.show_cells data_range = None if self._autoscale else [0,1] plotting.plot_features(feats, labels, show_cells=show_labels, datarange=data_range, fig=self.fig)
def _plot(self): feats = self._get_features() labels = self.cluster_src.labels if self.show_cells == 'all': show_labels = list(np.unique(labels)) if 0 in show_labels: show_labels.remove(0) else: show_labels = self.show_cells data_range = None if self._autoscale else [0, 1] plotting.plot_features(feats, labels, show_cells=show_labels, datarange=data_range, fig=self.fig)
#!/usr/bin/env python #coding=utf-8 from spike_sort.io.filters import PyTablesFilter from spike_sort import extract from spike_sort import features from spike_sort import cluster from spike_sort.ui import plotting import os dataset = '/SubjectA/session01/el1' datapath = '../../../data/tutorial.h5' io_filter = PyTablesFilter(datapath) raw = io_filter.read_sp(dataset) spt = extract.detect_spikes(raw, contact=3, thresh='auto') sp_win = [-0.2, 0.8] spt = extract.align_spikes(raw, spt, sp_win, type="max", resample=10) sp_waves = extract.extract_spikes(raw, spt, sp_win) sp_feats = features.combine( (features.fetP2P(sp_waves), features.fetPCs(sp_waves))) clust_idx = cluster.cluster("gmm", sp_feats, 4) plotting.plot_features(sp_feats, clust_idx) plotting.show() io_filter.close()
#!/usr/bin/env python # -*- coding: utf-8 -*- from spike_sort.io.filters import PyTablesFilter from spike_sort import extract from spike_sort import features from spike_sort import cluster from spike_sort.ui import plotting import os dataset = '/SubjectA/session01/el1' datapath = '../../../data/tutorial.h5' io_filter = PyTablesFilter(datapath) raw = io_filter.read_sp(dataset) spt = extract.detect_spikes(raw, contact=3, thresh='auto') sp_win = [-0.2, 0.8] spt = extract.align_spikes(raw, spt, sp_win, type="max", resample=10) sp_waves = extract.extract_spikes(raw, spt, sp_win) sp_feats = features.combine( ( features.fetP2P(sp_waves), features.fetPCA(sp_waves) ) ) plotting.plot_features(sp_feats) plotting.show()
# -*- coding: utf-8 -*- from spike_sort.io.filters import PyTablesFilter from spike_sort import extract from spike_sort import features from spike_sort import cluster from spike_sort.ui import plotting import os dataset = '/SubjectA/session01/el1' datapath = '../../../data/tutorial.h5' io_filter = PyTablesFilter(datapath) raw = io_filter.read_sp(dataset) spt = extract.detect_spikes(raw, contact=3, thresh='auto') sp_win = [-0.2, 0.8] spt = extract.align_spikes(raw, spt, sp_win, type="max", resample=10) sp_waves = extract.extract_spikes(raw, spt, sp_win) sp_feats = features.combine( ( features.fetP2P(sp_waves), features.fetPCA(sp_waves) ) ) clust_idx = cluster.cluster("gmm",sp_feats,4) plotting.plot_features(sp_feats, clust_idx) plotting.show() io_filter.close()