Beispiel #1
0
    def _plot_traces(self, traces, color=None):
        traces = traces.T
        n_samples = traces.shape[1]
        n_ch = self.n_channels
        assert traces.shape == (n_ch, n_samples)

        if self.origin == 'bottom':
            traces = traces[::-1, ...]

        vmin, vmax = self.vrange
        image = _continuous_colormap(colormaps.diverging, traces, vmin=vmin, vmax=vmax)
        image = add_alpha(image, alpha=1.)
        self.trace_visual.set_data(image=image)
Beispiel #2
0
    def _plot_cluster(self, bunch):
        """Make the scatter plot."""
        ms = self._marker_size
        if not len(bunch.histogram):
            return

        # Histogram in the background.
        self.hist_visual.add_batch_data(
            hist=bunch.histogram,
            ylim=self._ylim,
            color=add_alpha(bunch.color, self.histogram_alpha))

        # Scatter plot.
        self.visual.add_batch_data(
            pos=bunch.pos, color=bunch.color, size=ms, data_bounds=self.data_bounds)
Beispiel #3
0
 def get_clusters_data(self, load_all=None):
     ccg = self.correlograms(self.cluster_ids, self.bin_size,
                             self.window_size)
     fr = self.firing_rate(self.cluster_ids,
                           self.bin_size) if self.firing_rate else None
     assert ccg.ndim == 3
     n_bins = ccg.shape[2]
     bunchs = []
     m = ccg.max()
     for i, j in self._iter_subplots(len(self.cluster_ids)):
         b = Bunch()
         b.correlogram = ccg[i, j, :]
         if not self.uniform_normalization:
             # Normalization row per row.
             m = ccg[i, j, :].max()
         b.firing_rate = fr[i, j] if fr is not None else None
         b.data_bounds = (0, 0, n_bins, m)
         b.pair_index = i, j
         b.color = selected_cluster_color(i, 1)
         if i != j:
             b.color = add_alpha(_override_hsv(b.color[:3], s=.1, v=1))
         bunchs.append(b)
     return bunchs