Skip to content

Commit

Permalink
Get default frame number for 3-D data earlier
Browse files Browse the repository at this point in the history
Instead of waiting until the retrieval of the 2-D/3-D data slice, check
to determine what the selected frame is at the beginning of `get_image`.
  • Loading branch information
jakirkham committed Dec 6, 2017
1 parent 6a3f8b3 commit ffc6a13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mplview/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ def get_image(self, i=None):
numpy.ndarray: the current image.
"""

if (len(self.neuron_images.shape) == 3) and (i is None):
i = self.time_nav.stime.val

cur_img = self.neuron_images
if (len(self.neuron_images.shape) == 3):
i = self.time_nav.stime.val if i is None else i
cur_img = cur_img[i]
else:
cur_img = cur_img[...]
Expand Down

0 comments on commit ffc6a13

Please sign in to comment.