From f67d18fe0ec58f9dca153815f4bda933d41436e6 Mon Sep 17 00:00:00 2001 From: mrrezaie Date: Thu, 9 Jun 2022 21:42:48 +0430 Subject: [PATCH] More POINT:LABELS The 'POINT:LABELS' can only contain 255 points and for more points, there will be 'POINT:LABELS2'. This adjustment is able to retrieve the labels of any number of points. --- c3d/c3d.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/c3d/c3d.py b/c3d/c3d.py index 37f2656..a85d81a 100644 --- a/c3d/c3d.py +++ b/c3d/c3d.py @@ -1494,7 +1494,13 @@ def analog_resolution(self): @property def point_labels(self): - return self.get('POINT:LABELS').string_array + if self.header.point_count <= 255: + return self.get('POINT:LABELS').string_array + else: + labels = self.get('POINT:LABELS').string_array.tolist() + for i in range(2, int(np.ceil(1 + self.header.point_count/255))): + labels = labels + self.get(f'POINT:LABELS{i}').string_array.tolist() + return np.array(labels, dtype=object) @property def analog_labels(self):