Skip to content

Add sorting reader#23

Draft
JoeZiminski wants to merge 8 commits into
int-brain-lab:mainfrom
JoeZiminski:add_sorting_reader
Draft

Add sorting reader#23
JoeZiminski wants to merge 8 commits into
int-brain-lab:mainfrom
JoeZiminski:add_sorting_reader

Conversation

@JoeZiminski
Copy link
Copy Markdown
Collaborator

@JoeZiminski JoeZiminski commented Feb 18, 2026

This is a rough prototyping PR to add spikes loaded from kilosort output to the GUI. It is branched from #22. Currently it does not load spikeinterface sorting analyzer, that is reserved for a separate PR.

Since #22 makes it possible to show only a single shank, there are four cases to consider:

  1. The file is displayed with all shanks, and the sorting contains all shanks
  2. The file is displayed with all shanks, but the sorting is for a single shank
  3. The file displays a single shank, and the sorting contains all shanks
  4. The file displays a single shank, and the sorting is for a single shank

Currently the user must input the shank that the sorting is one (None for all) because I couldn't quickly figure out a way to infer the shank from the sorting output, however it is probably possible.

TODO MAJOR:

  • it is also possible that the raw data is split per shank. This case is not currently handled as it assumes the data is always multi-shank (even if we are only viewing a single shank).

TODO:

  • refactor
  • get feedback
  • check carefully and think about all possible use cases, for example I have not tested the 1-shank case yet
  • write some tests

An example script:

from viewephys.gui import EphysBinViewer
from pathlib import Path
import easyqc
import numpy as np

app = easyqc.qt.create_app()

sorting_path = r"Y:\...\path_to_sorter_output"


# i.e. only display the first shank, + the sorting is multi-shank
# (the software will figure out displaying the correct spikes)
viewer = EphysBinViewer(
    r"path/to/data/g0_tcat.imec0.ap.bin",
    shank_idx=1, sorting_path=dat_path, sorting_shank_idx=None,
)

app.exec()

@JoeZiminski JoeZiminski marked this pull request as draft February 18, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant