Skip to content

Commit 59cca8c

Browse files
authored
Merge pull request #400 from alejoe91/add-channel-name-to-open-ephys
Add `channel_name` contact annotation for open ephys
2 parents 6869f54 + d6ed636 commit 59cca8c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/probeinterface/neuropixels_tools.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,6 @@ def read_openephys(
12211221
"probe": sliced_probe,
12221222
}
12231223
else:
1224-
12251224
channel_names = np.array(list(channels.attrib.keys()))
12261225
channel_ids = np.array([int(ch[2:]) for ch in channel_names])
12271226
channel_order = np.argsort(channel_ids)
@@ -1307,6 +1306,7 @@ def read_openephys(
13071306
np_probe_dict = {
13081307
"shank_ids": shank_ids,
13091308
"elec_ids": elec_ids,
1309+
"channel_names": channel_names,
13101310
"pt_metadata": pt_metadata,
13111311
"slot": slot,
13121312
"port": port,
@@ -1429,6 +1429,9 @@ def read_openephys(
14291429
pt_metadata, probe_part_number, elec_ids, shank_ids=shank_ids, mux_info=mux_info
14301430
)
14311431

1432+
if "channel_names" in np_probe_info:
1433+
probe.annotate_contacts(channel_name=np_probe_info["channel_names"])
1434+
14321435
chans_saved = get_saved_channel_indices_from_openephys_settings(settings_file, stream_name=stream_name)
14331436
if chans_saved is not None:
14341437
probe = probe.get_slice(chans_saved)

0 commit comments

Comments
 (0)