From b7d73f1ce003f8e9c43fb0abfe09589583598b39 Mon Sep 17 00:00:00 2001 From: tatiana Date: Thu, 23 Jul 2009 18:37:06 +0000 Subject: [PATCH] ENC: Cross behaviour equal to comercial software --- invesalius/data/slice_.py | 15 +++++++++++++++ invesalius/data/viewer_slice.py | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 54d92c4..8a33f8f 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -25,6 +25,8 @@ class Slice(object): # Slice properties ps.Publisher().subscribe(self.UpdateCursorPosition, 'Update cursor position in slice') + ps.Publisher().subscribe(self.UpdateCursorPositionSingleAxis, + 'Update cursor single position in slice') # General slice control ps.Publisher().subscribe(self.CreateSurfaceFromIndex, 'Create surface from index') @@ -336,6 +338,19 @@ class Slice(object): self.cast_filter.Update() ps.Publisher().sendMessage('Update slice viewer') + + def UpdateCursorPositionSingleAxis(self, pubsub_evt): + axis_pos = pubsub_evt.data + x, y, z = self.cross.GetCursorPosition() + new_pos = [x,y,z] + for key in axis_pos: + new_pos[key] = axis_pos[key] + self.cross.SetCursorPosition(new_pos) + self.cross.Modified() + self.cast_filter.Update() + ps.Publisher().sendMessage('Update slice viewer') + + def __create_background(self, imagedata): thresh_min, thresh_max = imagedata.GetScalarRange() diff --git a/invesalius/data/viewer_slice.py b/invesalius/data/viewer_slice.py index 55513b8..5679646 100755 --- a/invesalius/data/viewer_slice.py +++ b/invesalius/data/viewer_slice.py @@ -463,7 +463,13 @@ class Viewer(wx.Panel): self.text_actor.SetInput(str(index)) self.slice_number = index self.__update_display_extent() - actor_bound = self.actor.GetBounds() + + position = {"SAGITAL": {0: self.slice_number}, + "CORONAL": {1: self.slice_number}, + "AXIAL": {2: self.slice_number}} + + ps.Publisher().sendMessage('Update cursor single position in slice', + position[self.orientation]) def ChangeSliceNumber(self, pubsub_evt): index = pubsub_evt.data -- libgit2 0.21.2