|
6 | 6 | from PyQt5 import QtWidgets, QtCore, QtGui, uic |
7 | 7 | import pyqtgraph as pg |
8 | 8 | from brainbox.processing import bincount2D |
9 | | -import qt |
10 | | -from iblutil.numerical import ismember |
| 9 | + |
11 | 10 | from easyqc.gui import viewseis |
| 11 | +import one.alf.io as alfio |
| 12 | +from one.alf.files import get_session_path |
| 13 | +from iblutil.numerical import ismember |
12 | 14 | from ibllib.io import spikeglx |
13 | 15 | from ibllib.dsp import voltage |
14 | 16 |
|
| 17 | +import qt |
| 18 | +from brainbox.io.one import SpikeSortingLoader |
| 19 | + |
15 | 20 | T_BIN = .007 # time bin size in secs |
16 | 21 | D_BIN = 10 # depth bin size in um |
17 | 22 |
|
|
28 | 33 |
|
29 | 34 | YMAX = 4000 |
30 | 35 |
|
| 36 | + |
| 37 | +def view_raster(bin_file): |
| 38 | + bin_file = Path(bin_file) |
| 39 | + pname = bin_file.parent.name |
| 40 | + session_path = get_session_path(bin_file) |
| 41 | + ssl = SpikeSortingLoader(session_path=session_path, pname=pname) |
| 42 | + spikes, clusters, channels = ssl.load_spike_sorting(dataset_types=['spikes.samples']) |
| 43 | + trials = alfio.load_object(ssl.session_path.joinpath('alf'), 'trials') |
| 44 | + return RasterView(bin_file, spikes, clusters, trials=trials) |
| 45 | + |
| 46 | + |
31 | 47 | class RasterView(QtWidgets.QMainWindow): |
32 | 48 | def __init__(self, bin_file, spikes, clusters, channels=None, trials=None, *args, **kwargs): |
33 | 49 | self.sr = spikeglx.Reader(bin_file) |
|
0 commit comments