From e8cb08f4ccec268a8a9c5212905986db881d6a07 Mon Sep 17 00:00:00 2001 From: Jim Rybarski Date: Sun, 31 May 2015 03:14:05 +0000 Subject: [PATCH] #39: calculating channel and z_level works right --- nd2reader/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nd2reader/__init__.py b/nd2reader/__init__.py index 6905c98..47ccdaa 100644 --- a/nd2reader/__init__.py +++ b/nd2reader/__init__.py @@ -84,13 +84,13 @@ class Nd2(Nd2Parser): return image def _calculate_field_of_view(self, frame_number): - return (frame_number - (frame_number % (len(self.channels) + len(self.z_levels)))) % len(self.fields_of_view) + return frame_number - (frame_number % (len(self.z_levels) + len(self.channels))) def _calculate_channel(self, frame_number): return self._channels[frame_number % len(self.channels)] def _calculate_z_level(self, frame_number): - return self.z_levels[frame_number % len(self.channels) % len(self.fields_of_view)] + return self.z_levels[(frame_number * len(self.channels)) % len(self.z_levels) - frame_number % len(self.channels)] @property def image_sets(self):