From b63477a1088e523cb4e25ce2443e61f29f99c6c3 Mon Sep 17 00:00:00 2001 From: Leon Foks Date: Tue, 17 Oct 2023 16:50:24 -0700 Subject: [PATCH] Fixes #11 The last column of the dat file was not being read in due to incorrect parsing of ;END DEFN on the last line. --- gspy/src/utilities/aseg_gdf_handler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gspy/src/utilities/aseg_gdf_handler.py b/gspy/src/utilities/aseg_gdf_handler.py index 165ff52..162786a 100644 --- a/gspy/src/utilities/aseg_gdf_handler.py +++ b/gspy/src/utilities/aseg_gdf_handler.py @@ -106,10 +106,14 @@ def parse_dfn_file(self, dfn_file_name): dfn_md = {} for line in lines[1:]: if "END DEFN" in line: - break + line = line.replace(";END DEFN", "") info = line.split(";")[-1] tmp = info.split(":") + + if len(tmp) == 1: + break + standard_name, format = tmp[:2] if ' ' in standard_name: