예제 #1
0
파일: gui.py 프로젝트: ablot/phy-contrib
 def get_waveforms_amplitude(self, cluster_id):
     nt = self.get_cluster_templates(cluster_id)
     # Find the template with the highest number of spikes belonging
     # to the selected cluster.
     template_id = np.argmax(nt)
     # Find the masked template waveform amplitude.
     mw = self.templates[[template_id]]
     mm = get_masks(mw)
     mw = mw[0, ...]
     mm = mm[0, ...]
     assert mw.ndim == 2
     assert mw.ndim == 2
     return get_waveform_amplitude(mm, mw)
예제 #2
0
 def get_waveforms_amplitude(self, cluster_id):
     nt = self.get_cluster_templates(cluster_id)
     # Find the template with the highest number of spikes belonging
     # to the selected cluster.
     template_id = np.argmax(nt)
     # Find the masked template waveform amplitude.
     mw = self.templates[[template_id]]
     mm = self.template_masks[[template_id]]
     mw = mw[0, ...]
     mm = mm[0, ...]
     assert mw.ndim == 2
     assert mw.ndim == 2
     return get_waveform_amplitude(mm, mw)
예제 #3
0
 def _get_waveforms(self, cluster_id):
     """Return a selection of waveforms for a cluster."""
     pos = self.model.channel_positions
     spike_ids = self.selector.select_spikes(
         [cluster_id],
         self.n_spikes_waveforms,
         self.batch_size_waveforms,
     )
     data = self.model.all_waveforms[spike_ids]
     mm = self._get_mean_masks(cluster_id)
     mw = np.mean(data, axis=0)
     amp = get_waveform_amplitude(mm, mw)
     masks = self._get_masks(cluster_id)
     # Find the best channels.
     channel_ids = np.argsort(amp)[::-1]
     return Bunch(
         data=data[..., channel_ids],
         channel_ids=channel_ids,
         channel_positions=pos[channel_ids],
         masks=masks[:, channel_ids],
     )
예제 #4
0
 def get_waveforms_amplitude(self, cluster_id):
     mm = self.get_mean_masks(cluster_id)
     mw = self.get_mean_waveforms(cluster_id)
     assert mw.ndim == 2
     return get_waveform_amplitude(mm, mw)
예제 #5
0
 def get_waveforms_amplitude(self, cluster_id):
     mm = self.get_mean_masks(cluster_id)
     mw = self.get_mean_waveforms(cluster_id)
     assert mw.ndim == 2
     return get_waveform_amplitude(mm, mw)