Skip to content

Commit ab821e7

Browse files
authored
Merge pull request #1715 from luiztauffer/blackrock-unit-class
BlackRock: add `unit_classification` to spike_channels annotation
2 parents 6a0c010 + 1596e54 commit ab821e7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

neo/rawio/blackrockrawio.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,17 @@ def _parse_header(self):
597597
for c in range(spike_channels.size):
598598
st_ann = seg_ann["spikes"][c]
599599
channel_id, unit_id = self.internal_unit_ids[c]
600-
unit_tag = {0: "unclassified", 255: "noise"}.get(unit_id, str(unit_id))
601600
st_ann["channel_id"] = channel_id
602601
st_ann["unit_id"] = unit_id
603-
st_ann["unit_tag"] = unit_tag
602+
if unit_id == 0:
603+
st_ann["unit_classification"] = "unclassified"
604+
elif 1 <= unit_id <= 16:
605+
st_ann["unit_classification"] = "sorted"
606+
elif unit_id == 255:
607+
st_ann["unit_classification"] = "noise"
608+
else: # 17-254 are reserved
609+
st_ann["unit_classification"] = "reserved"
610+
st_ann['unit_tag'] = st_ann['unit_classification']
604611
st_ann["description"] = f"SpikeTrain channel_id: {channel_id}, unit_id: {unit_id}"
605612
st_ann["file_origin"] = self._filenames["nev"] + ".nev"
606613

0 commit comments

Comments
 (0)