-
Notifications
You must be signed in to change notification settings - Fork 280
Add main_channel_id when running Kilosort
#4725
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
base: main
Are you sure you want to change the base?
Changes from all commits
670e88a
e80696f
256d548
c6758c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| from spikeinterface.sorters.utils import ShellScript, get_matlab_shell_name, get_bash_path | ||
| from spikeinterface.sorters.basesorter import get_job_kwargs | ||
| from spikeinterface.extractors.extractor_classes import KiloSortSortingExtractor | ||
| from spikeinterface.core import write_binary_recording | ||
| from spikeinterface.core import write_binary_recording, load | ||
| from spikeinterface.preprocessing.zero_channel_pad import TracePaddedRecording | ||
|
|
||
|
|
||
|
|
@@ -254,6 +254,20 @@ def _get_result_from_folder(cls, sorter_output_folder): | |
| params_file = sorter_output_folder / "spikeinterface_params.json" | ||
| with params_file.open("r") as f: | ||
| sorter_params = json.load(f)["sorter_params"] | ||
|
|
||
| recording_file = sorter_output_folder.parent / "spikeinterface_recording.json" | ||
| if recording_file.is_file(): | ||
| try: | ||
| # TODO: load the channel ids without loading the recording | ||
| recording = load(recording_file) | ||
| channel_ids = recording.channel_ids | ||
| except: | ||
| channel_ids = None | ||
| else: | ||
| channel_ids = None | ||
|
Comment on lines
+258
to
+267
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's wait for #4671, where I added the So this should become:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then it will works only for recent run('kilosort') older folder will not have this main_channel_ids |
||
|
|
||
| keep_good_only = sorter_params.get("keep_good_only", False) | ||
| sorting = KiloSortSortingExtractor(folder_path=sorter_output_folder, keep_good_only=keep_good_only) | ||
| sorting = KiloSortSortingExtractor( | ||
| folder_path=sorter_output_folder, keep_good_only=keep_good_only, channel_ids=channel_ids | ||
| ) | ||
| return sorting | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also try the pickle if json do not exists no ?