Skip to content

Commit bcd9d82

Browse files
committed
Clean up chans_Saved slicing
1 parent 0855236 commit bcd9d82

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

src/probeinterface/neuropixels_tools.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,6 @@ def read_openephys(
11201120

11211121
if probe is None:
11221122
# check if subset of channels
1123-
chans_saved = get_saved_channel_indices_from_openephys_settings(settings_file, stream_name=stream_name)
11241123
shank_ids = np_probe_info["shank_ids"]
11251124
elec_ids = np_probe_info["elec_ids"]
11261125
pt_metadata = np_probe_info["pt_metadata"]
@@ -1130,16 +1129,9 @@ def read_openephys(
11301129
pt_metadata, probe_part_number, elec_ids, shank_ids=shank_ids, mux_info=mux_info
11311130
)
11321131

1133-
# if a recording state is found, slice probe
1134-
if chans_saved is not None:
1135-
positions = positions[chans_saved]
1136-
if shank_ids is not None:
1137-
shank_ids = np.array(shank_ids)[chans_saved]
1138-
if elec_ids is not None:
1139-
elec_ids = np.array(elec_ids)[chans_saved]
1140-
1141-
if chans_saved is not None:
1142-
probe = probe.get_slice(chans_saved)
1132+
chans_saved = get_saved_channel_indices_from_openephys_settings(settings_file, stream_name=stream_name)
1133+
if chans_saved is not None:
1134+
probe = probe.get_slice(chans_saved)
11431135

11441136
probe.serial_number = np_probe_info["serial_number"]
11451137
probe.name = np_probe_info["name"]

0 commit comments

Comments
 (0)