From b80ed8c75b1cc4ff0386a9ed72d0bd27f82b489c Mon Sep 17 00:00:00 2001 From: Jim Rybarski Date: Tue, 22 Mar 2016 14:02:19 -0500 Subject: [PATCH] possible fix for weird problem resulting from having many exposure times --- nd2reader/driver/v3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nd2reader/driver/v3.py b/nd2reader/driver/v3.py index 7fcecda..bf36a79 100644 --- a/nd2reader/driver/v3.py +++ b/nd2reader/driver/v3.py @@ -172,8 +172,8 @@ class V3Driver(object): # The images for the various channels are interleaved within the same array. For example, the second image # of a four image group will be composed of bytes 2, 6, 10, etc. If you understand why someone would design # a data structure that way, please send the author of this library a message. - - image_data = np.reshape(image_group_data[image_data_start::len(self._metadata.channels)], (height, width)) + number_of_true_channels = int((len(image_group_data) - 4) / (height * width)) + image_data = np.reshape(image_group_data[image_data_start::number_of_true_channels], (height, width)) # Skip images that are all zeros! This is important, since NIS Elements creates blank "gap" images if you # don't have the same number of images each cycle. We discovered this because we only took GFP images every