Skip to content

Commit a416779

Browse files
authored
fix #3947
1 parent 8099784 commit a416779

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/spikeinterface/core/channelsaggregationrecording.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ def __init__(self, recording_list_or_dict=None, renamed_channel_ids=None, record
105105
"Locations are not unique! " "Cannot aggregate recordings!"
106106
)
107107

108+
planar_contour_keys = [key for recording in recording_list for key in recording.get_annotation_keys() if 'planar_contour' in key]

109+
if len(planar_contour_keys)>0:

110+
if all(k == planar_contour_keys[0] for k in planar_contour_keys): # we add the 'planar_contour' annotations only if there is a unique one in the recording_list

111+
planar_contour_key = planar_contour_keys[0]

112+
collect_planar_contours = []

113+
for rec in recording_list:

114+
collect_planar_contours.append(rec.get_annotation(planar_contour_key))

115+
if all(np.array_equal(arr, collect_planar_contours[0]) for arr in collect_planar_contours):

116+
self.set_annotation(planar_contour_key, collect_planar_contours[0])
117+
108118
# finally add segments, we need a channel mapping
109119
ch_id = 0
110120
channel_map = {}

0 commit comments

Comments
 (0)