From 19d296598ae194968ed29f9f8d3c6de6abae39d7 Mon Sep 17 00:00:00 2001
From: Ruben Verweij <ruben@lighthacking.nl>
Date: Fri, 23 Apr 2021 12:38:42 +0200
Subject: [PATCH] Fixes issue #50

---
 nd2reader/stitched.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nd2reader/stitched.py b/nd2reader/stitched.py
index 9721e21..a2f6850 100644
--- a/nd2reader/stitched.py
+++ b/nd2reader/stitched.py
@@ -9,8 +9,9 @@ def get_unwanted_bytes_ids(image_group_data, image_data_start, height, width):
     # rows (height), as the same unmber of unwanted bytes is expected to be
     # appended at the end of each row. Then, returns the indexes of the unwanted
     # bytes.
+    # Skip the first 4 elements that correspond to the time stamp
     number_of_true_channels = int(len(image_group_data[4:]) / (height * width))
-    n_unwanted_bytes = (len(image_group_data[image_data_start:])) % (height * width)
+    n_unwanted_bytes = (len(image_group_data[4:])) % (height * width)
     if not n_unwanted_bytes:
         return np.arange(0)
     assert 0 == n_unwanted_bytes % height, (
-- 
GitLab