From 94c0f39d8a7f500043668bc849dd462f09693bfd Mon Sep 17 00:00:00 2001 From: Lucie Martinet Date: Fri, 29 May 2026 11:46:18 +0200 Subject: [PATCH] Intergrate changes to add micromed V5 reading --- neo/rawio/micromedrawio.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/neo/rawio/micromedrawio.py b/neo/rawio/micromedrawio.py index 018783574..008eb4288 100644 --- a/neo/rawio/micromedrawio.py +++ b/neo/rawio/micromedrawio.py @@ -68,7 +68,7 @@ def _parse_header(self): # header version (header_version,) = f.read_f("b", offset=175) - if header_version != 4: + if header_version not in [4,5]: raise NotImplementedError(f"`header_version {header_version} is not implemented in neo yet") # area @@ -92,10 +92,15 @@ def _parse_header(self): ] zones = {} for zname in zone_names: - zname2, pos, length = f.read_f("8sII") - zones[zname] = zname2, pos, length - if zname != zname2.decode("ascii").strip(" "): - raise NeoReadWriteError("expected the zone name to match") + if zname == "MONTAGE" and header_version==5: + f.seek(288) + if header_version==4 or zname not in ["IMPED_B","IMPED_E"]: + zname2, pos, length = f.read_f("8sII") + zones[zname] = zname2, pos, length + #print("match",repr(zname), repr(zname2.decode("ascii").strip(" ").strip("\x00")), zname != zname2.decode("ascii").strip(" ").strip("\x00")) + if zname != zname2.decode("ascii").strip(" ").strip("\x00"): + raise NeoReadWriteError("expected the zone name to match") + # "TRONCA" zone define segments zname2, pos, length = zones["TRONCA"]