Skip to content

Commit

Permalink
Merge pull request #3193 from h-mayorquin/plexon_use_names_as_ids
Browse files Browse the repository at this point in the history
Use names as ids in Plexon1 recording extractor
  • Loading branch information
alejoe91 authored Jul 12, 2024
2 parents 53933e6 + ec05c1d commit b338357
Showing 1 changed file with 22 additions and 3 deletions.
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

0 comments on commit b338357

Please sign in to comment.