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

Use names as ids in Plexon1 recording extractor #3193

Merged
merged 3 commits into from
Jul 12, 2024
Merged
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
25 changes: 22 additions & 3 deletions src/spikeinterface/extractors/neoextractors/plexon.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,41 @@ class PlexonRecordingExtractor(NeoBaseRecordingExtractor):

Parameters
----------
file_path : str
file_path : str | Path
The file path to load the recordings from.
stream_id : str, default: None
If there are several streams, specify the stream id you want to load.
stream_name : str, default: None
If there are several streams, specify the stream name you want to load.
all_annotations : bool, default: False
Load exhaustively all annotations from neo.
use_names_as_ids : bool, default: True
Determines the format of the channel IDs used by the extractor. If set to True, the channel IDs will be the
names from NeoRawIO. If set to False, the channel IDs will be the ids provided by NeoRawIO.

Example for wideband signals:
names: ["WB01", "WB02", "WB03", "WB04"]
ids: ["0" , "1", "2", "3"]
"""

NeoRawIOClass = "PlexonRawIO"

def __init__(self, file_path, stream_id=None, stream_name=None, all_annotations=False):
def __init__(
self,
file_path: str | Path,
stream_id=None,
stream_name=None,
all_annotations: bool = False,
use_names_as_ids: bool = True,
):
neo_kwargs = self.map_to_neo_kwargs(file_path)
NeoBaseRecordingExtractor.__init__(
self, stream_id=stream_id, stream_name=stream_name, all_annotations=all_annotations, **neo_kwargs
self,
stream_id=stream_id,
stream_name=stream_name,
all_annotations=all_annotations,
use_names_as_ids=use_names_as_ids,
**neo_kwargs,
)
self._kwargs.update({"file_path": str(Path(file_path).resolve())})

Expand Down