Skip to content

Commit e068774

Browse files
luiztaufferalejoe91h-mayorquin
authored
BlackrockSortingExtractor - load only .nev files, ignore nsX (#3843)
* nev alone * get sampling rate from spike channels * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * try to fix error, give preference to estimate rate from signal channels * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * overwrite method in extractor * remove method, add nsx_to_load kwarg * docstring * Apply suggestions from code review --------- Co-authored-by: Alessio Buccino <alejoe9187@gmail.com> Co-authored-by: Heberto Mayorquin <h.mayorquin@gmail.com>
1 parent 01ee4f7 commit e068774

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/spikeinterface/extractors/neoextractors/blackrock.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from packaging import version
55
from typing import Optional
66

7-
87
from spikeinterface.core.core_tools import define_function_from_class
98

109
from .neobaseextractor import NeoBaseRecordingExtractor, NeoBaseSortingExtractor
@@ -76,14 +75,17 @@ class BlackrockSortingExtractor(NeoBaseSortingExtractor):
7675
----------
7776
file_path : str
7877
The file path to load the recordings from
79-
sampling_frequency : float, default: None
80-
The sampling frequency for the sorting extractor. When the signal data is available (.ncs) those files will be
81-
used to extract the frequency automatically. Otherwise, the sampling frequency needs to be specified for
82-
this extractor to be initialized
8378
stream_id : str, default: None
8479
Used to extract information about the sampling frequency and t_start from the analog signal if provided.
8580
stream_name : str, default: None
8681
Used to extract information about the sampling frequency and t_start from the analog signal if provided.
82+
sampling_frequency : float, default: None
83+
The sampling frequency for the sorting extractor. When the signal data is available (.ncs) those files will be
84+
used to extract the frequency automatically. Otherwise, the sampling frequency needs to be specified for
85+
this extractor to be initialized.
86+
nsx_to_load : int | list | str, default: None
87+
IDs of nsX file from which to load data, e.g., if set to 5 only data from the ns5 file are loaded.
88+
If 'all', then all nsX will be loaded. If None, all nsX files will be loaded. If empty list, no nsX files will be loaded.
8789
"""
8890

8991
NeoRawIOClass = "BlackrockRawIO"
@@ -92,16 +94,18 @@ class BlackrockSortingExtractor(NeoBaseSortingExtractor):
9294
def __init__(
9395
self,
9496
file_path,
95-
sampling_frequency: Optional[float] = None,
9697
stream_id: Optional[str] = None,
9798
stream_name: Optional[str] = None,
99+
sampling_frequency: Optional[float] = None,
100+
nsx_to_load: Optional[int | list | str] = None,
98101
):
99102
neo_kwargs = self.map_to_neo_kwargs(file_path)
100103
NeoBaseSortingExtractor.__init__(
101104
self,
102-
sampling_frequency=sampling_frequency,
103105
stream_id=stream_id,
104106
stream_name=stream_name,
107+
sampling_frequency=sampling_frequency,
108+
nsx_to_load=nsx_to_load,
105109
**neo_kwargs,
106110
)
107111

0 commit comments

Comments
 (0)