Skip to content

Commit d105419

Browse files
author
Thinh Nguyen
committed
search recording channels for Open Ephys based on channel names
1 parent f55a6a7 commit d105419

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

element_array_ephys/ephys_no_curation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def make(self, key):
299299

300300
electrode_group_members = [
301301
probe_electrodes[channel_idx]
302-
for channel_idx in probe_data.ap_meta['channels_ids']]
302+
for channel_idx in probe_data.ap_meta['channels_indices']]
303303
else:
304304
raise NotImplementedError(
305305
'Processing for neuropixels'
@@ -905,7 +905,7 @@ def get_neuropixels_channel2electrode_map(ephys_recording_key, acq_software):
905905

906906
channel2electrode_map = {
907907
channel_idx: probe_electrodes[channel_idx]
908-
for channel_idx in probe_dataset.ap_meta['channels_ids']}
908+
for channel_idx in probe_dataset.ap_meta['channels_indices']}
909909

910910
return channel2electrode_map
911911

element_array_ephys/readers/openephys.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,13 @@ def load_probe_data(self):
9696

9797
meta = getattr(probe, continuous_type + '_meta')
9898
if not meta:
99+
# channel indices - 0-based indexing
100+
channels_indices = [int(re.search(r'\d+$', chn_name).group()) - 1
101+
for chn_name in analog_signal.channel_names]
102+
99103
meta.update(**continuous_info,
100-
channels_ids=[c['source_processor_index']
101-
for c in continuous_info['channels']],
104+
channels_indices=channels_indices,
105+
channels_ids=analog_signal.channels_ids,
102106
channels_names=analog_signal.channel_names,
103107
channels_gains=analog_signal.gains)
104108

0 commit comments

Comments
 (0)