Browse Source

Merge pull request #55 from jimrybarski/54-feature-handle-index-error

resolves #54: raises Index error when you go out of bounds
feature/load_slices
Jim Rybarski 10 years ago
parent
commit
524ec8de84
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      nd2reader/__init__.py

+ 2
- 0
nd2reader/__init__.py View File

@ -61,6 +61,8 @@ class Nd2(Nd2Parser):
image = Image(timestamp, raw_image_data, fov, channel, z_level, self.height, self.width) image = Image(timestamp, raw_image_data, fov, channel, z_level, self.height, self.width)
except (TypeError, ValueError): except (TypeError, ValueError):
return None return None
except KeyError:
raise IndexError("Invalid frame number.")
else: else:
return image return image
elif isinstance(item, slice): elif isinstance(item, slice):


Loading…
Cancel
Save