Skip to content

Update read_kilosort_as_analyzer to allow for multiple-probes and user-defined recording#4529

Open
chrishalcrow wants to merge 8 commits into
SpikeInterface:mainfrom
chrishalcrow:pass-recording-to-kilosort-as-analyzer
Open

Update read_kilosort_as_analyzer to allow for multiple-probes and user-defined recording#4529
chrishalcrow wants to merge 8 commits into
SpikeInterface:mainfrom
chrishalcrow:pass-recording-to-kilosort-as-analyzer

Conversation

@chrishalcrow

@chrishalcrow chrishalcrow commented Apr 17, 2026

Copy link
Copy Markdown
Member

This PR improves the read_kilosort_as_analyzer function, as discussed in (#4366).

The plan:

  • Allow user to pass their own recording
  • Allow for probe groups
  • Use channel_map.npy for device channel indices instead of range
  • If recording given, make sure it's consistent with probe.prb file in output

@chrishalcrow chrishalcrow added the exporters Related to exporters module label Apr 17, 2026
Comment thread src/spikeinterface/extractors/phykilosortextractors.py
@chrishalcrow chrishalcrow marked this pull request as ready for review May 26, 2026 10:27

@zm711 zm711 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple questions @chrishalcrow.

----------
folder_path : str or Path
Path to the output Phy folder (containing the params.py).
recording : BaseRecording

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as an FYI this breaks positional arguments for people... What is your logic for being okay with that?

"The number of spikes does not match the number of spike locations in `spike_positions.npy`. Skipping spike locations."
)
return
locs_np = locs_np[:num_spikes]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we know this is the correct set? the problem is KS4 pads which means we have spikes both before and after the recording. So just taking 0...n_spikes means you might take some "fake" spikes at the beginning and lose "real" spikes at the end....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exporters Related to exporters module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants