Skip to content

Commit a22590e

Browse files
committed
view raster function
1 parent ecec9a1 commit a22590e

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

viewspikes/gui.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
from PyQt5 import QtWidgets, QtCore, QtGui, uic
77
import pyqtgraph as pg
88
from brainbox.processing import bincount2D
9-
import qt
10-
from iblutil.numerical import ismember
9+
1110
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
1214
from ibllib.io import spikeglx
1315
from ibllib.dsp import voltage
1416

17+
import qt
18+
from brainbox.io.one import SpikeSortingLoader
19+
1520
T_BIN = .007 # time bin size in secs
1621
D_BIN = 10 # depth bin size in um
1722

@@ -28,6 +33,17 @@
2833

2934
YMAX = 4000
3035

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+
3147
class RasterView(QtWidgets.QMainWindow):
3248
def __init__(self, bin_file, spikes, clusters, channels=None, trials=None, *args, **kwargs):
3349
self.sr = spikeglx.Reader(bin_file)

0 commit comments

Comments
 (0)