From 0289234391d85911dafcbc3c2a8a5557378f9554 Mon Sep 17 00:00:00 2001 From: Jim Rybarski Date: Thu, 31 Dec 2015 01:05:02 -0600 Subject: [PATCH] Potential fix for #138. Makes select() work with ND2s that have a single frame by iterating over a range of integers instead of the frames. --- nd2reader/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nd2reader/main.py b/nd2reader/main.py index d6bd756..627b020 100644 --- a/nd2reader/main.py +++ b/nd2reader/main.py @@ -76,7 +76,7 @@ class Nd2(object): channels = self._to_tuple(channels, self.channels) z_levels = self._to_tuple(z_levels, self.z_levels) - for frame in self.frames: + for frame in range(len(self)): field_of_view, channel, z_level = self._parser.driver.calculate_image_properties(frame) if field_of_view in fields_of_view and channel in channels and z_level in z_levels: image = self._parser.driver.get_image(frame)