From f9b2672b8efd668059ca96044ac530b9dc3f2bac Mon Sep 17 00:00:00 2001 From: tfmoraes Date: Wed, 13 Apr 2011 18:08:02 +0000 Subject: [PATCH] When user scroll through the slices and last one reached is not more raised the scroll event --- invesalius/data/slice_.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index ecacded..ba1ae4c 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -128,13 +128,15 @@ class Slice(object): def GetMaxSliceNumber(self, orientation): shape = self.matrix.shape - + + # Because matrix indexing starts with 0 so the last slice is the shape + # minu 1. if orientation == 'AXIAL': - return shape[0] + return shape[0] - 1 elif orientation == 'CORONAL': - return shape[1] + return shape[1] - 1 elif orientation == 'SAGITAL': - return shape[2] + return shape[2] - 1 def OnRemoveMasks(self, pubsub_evt): selected_items = pubsub_evt.data -- libgit2 0.21.2