Skip to content

Commit

Permalink
Merge pull request #3065 from h-mayorquin/change_ids_to_names_in_plex
Browse files Browse the repository at this point in the history
Use names as channel ids in plexon2
  • Loading branch information
alejoe91 authored Jun 24, 2024
2 parents 0a45e62 + 53b3ec9 commit 04120b2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/spikeinterface/extractors/neoextractors/plexon2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ class Plexon2RecordingExtractor(NeoBaseRecordingExtractor):
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.
use_names_as_ids:
If True, the names of the signals are used as channel ids. If False, the channel ids are a combination of the
source id and the channel index.
Example for widegain signals:
names: ["WB01", "WB02", "WB03", "WB04"]
ids: ["source3.1" , "source3.2", "source3.3", "source3.4"]
all_annotations : bool, default: False
Load exhaustively all annotations from neo.
"""
Expand All @@ -27,10 +34,15 @@ class Plexon2RecordingExtractor(NeoBaseRecordingExtractor):
NeoRawIOClass = "Plexon2RawIO"
name = "plexon2"

def __init__(self, file_path, stream_id=None, stream_name=None, all_annotations=False):
def __init__(self, file_path, stream_id=None, stream_name=None, use_names_as_ids=True, all_annotations=False):
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(file_path)})

Expand Down

0 comments on commit 04120b2

Please sign in to comment.