diff --git a/invesalius/control.py b/invesalius/control.py index cf208c3..cfee9be 100755 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -7,7 +7,7 @@ import data.imagedata_utils as utils import data.surface as surface import data.volume as volume import reader.dicom_reader as dicom -import reader.analyze_reader as analyze +#import reader.analyze_reader as analyze DEFAULT_THRESH_MODE = 0 diff --git a/invesalius/data/cursor_actors.py b/invesalius/data/cursor_actors.py index b94aea6..2509dfe 100644 --- a/invesalius/data/cursor_actors.py +++ b/invesalius/data/cursor_actors.py @@ -56,9 +56,9 @@ class CursorCircle: Extracted equation. http://www.mathopenref.com/chord.html """ - xc = 0 - yc = 0 - z = 0 + xc = 0.0 + yc = 0.0 + z = 0.0 xs, ys, zs = self.spacing orientation_based_spacing = {"AXIAL" : (xs, ys), "SAGITAL" : (ys, zs), @@ -72,9 +72,9 @@ class CursorCircle: # line size line = sqrt(radius**2 - d**2) * 2 # line initial x - xi = xc - line/2 + xi = xc - line/2.0 # line final - xf = line/2 + xc + xf = line/2.0 + xc yi = i for k in utils.frange(xi,xf,xs): self.pixel_list.append((k, yi)) @@ -190,11 +190,11 @@ class CursorRectangle: seeds_xf.SetPoint1(0, 0, 0) seeds_xf.SetPoint2(self.x_length, 0, 0) - join_lines = self.join_lines - join_lines.AddInput(seeds_yi.GetOutput()) - join_lines.AddInput(seeds_yf.GetOutput()) - join_lines.AddInput(seeds_xi.GetOutput()) - join_lines.AddInput(seeds_xf.GetOutput()) + #join_lines = self.join_lines + #join_lines.AddInput(seeds_yi.GetOutput()) + #join_lines.AddInput(seeds_yf.GetOutput()) + #join_lines.AddInput(seeds_xi.GetOutput()) + #join_lines.AddInput(seeds_xf.GetOutput()) self.__calculate_area_pixels() @@ -215,8 +215,15 @@ class CursorRectangle: self.actor.RotateY(90) def SetPosition(self, position): - self.position = position - self.actor.SetPosition(position) + x,y,z = position + x_half = self.x_length / 2.0 + y_half = self.y_length / 2.0 + orientation_position_based = {"AXIAL" : (x - x_half,y - y_half, z), + "CORONAL" : (x - x_half, y, z - y_half), + "SAGITAL" : (x, y - y_half, z + x_half)} + xc,yc,zc = orientation_position_based[self.orientation] + self.position = (xc,yc,zc) + self.actor.SetPosition(xc,yc,zc) def SetEditionPosition(self, position): self.edition_position = position diff --git a/invesalius/data/viewer_slice.py b/invesalius/data/viewer_slice.py index 5679646..0e2180a 100755 --- a/invesalius/data/viewer_slice.py +++ b/invesalius/data/viewer_slice.py @@ -17,7 +17,6 @@ # detalhes. #-------------------------------------------------------------------------- - import vtk from vtk.wx.wxVTKRenderWindowInteractor import wxVTKRenderWindowInteractor import wx @@ -121,8 +120,6 @@ class Viewer(wx.Panel): style.AddObserver(event, action[mode][event]) - - def ChangeBrushSize(self, pubsub_evt): size = pubsub_evt.data self._brush_cursor_size = size @@ -146,8 +143,6 @@ class Viewer(wx.Panel): self.cursor.SetColour(colour_vtk) self.interactor.Render() - - def ChangeBrushActor(self, pubsub_evt): brush_type = pubsub_evt.data self._brush_cursor_type = brush_type @@ -208,7 +203,6 @@ class Viewer(wx.Panel): self.cursor.SetPosition(coord) self.cursor.SetEditionPosition(self.GetCoordinateCursorEdition()) self.__update_cursor_position(coord) - self.ren.Render() if self._brush_cursor_op == 'Erase': evt_msg = 'Erase mask pixel' @@ -221,8 +215,7 @@ class Viewer(wx.Panel): pixels = self.cursor.GetPixels() for coord in pixels: ps.Publisher().sendMessage(evt_msg, coord) - self.interactor.Render() - + self.interactor.Render() def OnCrossMove(self, obj, evt_vtk): coord = self.GetCoordinate() diff --git a/invesalius/reader/dicom_reader.py b/invesalius/reader/dicom_reader.py index d1b1e63..34b8963 100644 --- a/invesalius/reader/dicom_reader.py +++ b/invesalius/reader/dicom_reader.py @@ -158,4 +158,4 @@ def GetDicomFiles(path, recursive = False): result.append(files[x]) acquisition_modality = read_dicom.GetAcquisitionModality() # TODO!!! SUPER GAMBIARRA!!! DO THIS BETTER - return result, acquisition_modality \ No newline at end of file + return result, acquisition_modality -- libgit2 0.21.2