Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewephys integtration for single recording #2953

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/spikeinterface/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def set_default_plotter_backend(backend):
},
"ephyviewer": {},
"spikeinterface_gui": {},
"viewephys": {},
}

default_backend_kwargs = {
Expand All @@ -55,6 +56,7 @@ def set_default_plotter_backend(backend):
"ipywidgets": {"width_cm": 25, "height_cm": 10, "display": True, "controllers": None},
"ephyviewer": {},
"spikeinterface_gui": {},
"viewephys": {},
}


Expand Down
2 changes: 1 addition & 1 deletion src/spikeinterface/widgets/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def setUpClass(cls):
cls.sorting_analyzer_sparse.compute("random_spikes")
cls.sorting_analyzer_sparse.compute(extensions_to_compute, **job_kwargs)

cls.skip_backends = ["ipywidgets", "ephyviewer", "spikeinterface_gui"]
cls.skip_backends = ["ipywidgets", "ephyviewer", "spikeinterface_gui", "viewephys"]
# cls.skip_backends = ["ipywidgets", "ephyviewer", "sortingview"]

if ON_GITHUB and not KACHERY_CLOUD_SET:
Expand Down
15 changes: 15 additions & 0 deletions src/spikeinterface/widgets/traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,21 @@ def plot_ephyviewer(self, data_plot, **backend_kwargs):
win.show()
app.exec()

def plot_viewephys(self, data_plot, **backend_kwargs):
from viewephys.gui import SpikeInterfaceViewer
import easyqc.qt
from ..preprocessing import depth_order

dp = to_attr(data_plot)
assert len(dp.recordings) == 1

recording = list(dp.recordings.values())[0]
recording = depth_order(recording)
app = easyqc.qt.create_app()
siv = SpikeInterfaceViewer(recording) # TODO dict of recordings
self.siv = siv
app.exec()


def _get_trace_list(recordings, channel_ids, time_range, segment_index, return_scaled=False, times=None):
# function also used in ipywidgets plotter
Expand Down