Commit 68b01085108c4746bc31754544b9d7e9cd32dfea
1 parent
29ad776e
Exists in
master
and in
6 other branches
Fix: Removed an apparently unecessary cast, now opening cases with +1000 slices
Showing
3 changed files
with
18 additions
and
15 deletions
Show diff stats
invesalius/constants.py
@@ -147,7 +147,7 @@ WINDOW_LEVEL = {"Abdomen":(350,50), | @@ -147,7 +147,7 @@ WINDOW_LEVEL = {"Abdomen":(350,50), | ||
147 | "Vasculature - Hard":(240,80), | 147 | "Vasculature - Hard":(240,80), |
148 | "Vasculature - Soft":(650,160)} | 148 | "Vasculature - Soft":(650,160)} |
149 | 149 | ||
150 | -REDUCE_IMAGEDATA_QUALITY = 1 | 150 | +REDUCE_IMAGEDATA_QUALITY = 0 |
151 | 151 | ||
152 | # if 1, use vtkVolumeRaycastMapper, if 0, use vtkFixedPointVolumeRayCastMapper | 152 | # if 1, use vtkVolumeRaycastMapper, if 0, use vtkFixedPointVolumeRayCastMapper |
153 | TYPE_RAYCASTING_MAPPER = 0 | 153 | TYPE_RAYCASTING_MAPPER = 0 |
invesalius/data/slice_.py
@@ -294,7 +294,7 @@ class Slice(object): | @@ -294,7 +294,7 @@ class Slice(object): | ||
294 | 294 | ||
295 | 295 | ||
296 | def GetOutput(self): | 296 | def GetOutput(self): |
297 | - return self.cast_filter.GetOutput() | 297 | + return self.cross.GetOutput() |
298 | 298 | ||
299 | 299 | ||
300 | 300 | ||
@@ -338,13 +338,13 @@ class Slice(object): | @@ -338,13 +338,13 @@ class Slice(object): | ||
338 | cross.Modified() | 338 | cross.Modified() |
339 | self.cross = cross | 339 | self.cross = cross |
340 | 340 | ||
341 | - cast = vtk.vtkImageCast() | ||
342 | - cast.SetInput(cross.GetOutput()) | ||
343 | - cast.GetOutput().SetUpdateExtentToWholeExtent() | ||
344 | - cast.SetOutputScalarTypeToUnsignedChar() | ||
345 | - cast.Update() | 341 | + #cast = vtk.vtkImageCast() |
342 | + #cast.SetInput(cross.GetOutput()) | ||
343 | + #cast.GetOutput().SetUpdateExtentToWholeExtent() | ||
344 | + #cast.SetOutputScalarTypeToUnsignedChar() | ||
345 | + #cast.Update() | ||
346 | 346 | ||
347 | - self.cast_filter = cast | 347 | + #self.cast_filter = cast |
348 | 348 | ||
349 | 349 | ||
350 | def UpdateCursorPosition(self, pubsub_evt): | 350 | def UpdateCursorPosition(self, pubsub_evt): |
@@ -352,7 +352,7 @@ class Slice(object): | @@ -352,7 +352,7 @@ class Slice(object): | ||
352 | new_pos = pubsub_evt.data | 352 | new_pos = pubsub_evt.data |
353 | self.cross.SetCursorPosition(new_pos) | 353 | self.cross.SetCursorPosition(new_pos) |
354 | self.cross.Modified() | 354 | self.cross.Modified() |
355 | - self.cast_filter.Update() | 355 | + self.cross.Update() |
356 | ps.Publisher().sendMessage('Update slice viewer') | 356 | ps.Publisher().sendMessage('Update slice viewer') |
357 | 357 | ||
358 | def UpdateCursorPositionSingleAxis(self, pubsub_evt): | 358 | def UpdateCursorPositionSingleAxis(self, pubsub_evt): |
@@ -363,7 +363,7 @@ class Slice(object): | @@ -363,7 +363,7 @@ class Slice(object): | ||
363 | new_pos[key] = axis_pos[key] | 363 | new_pos[key] = axis_pos[key] |
364 | self.cross.SetCursorPosition(new_pos) | 364 | self.cross.SetCursorPosition(new_pos) |
365 | self.cross.Modified() | 365 | self.cross.Modified() |
366 | - self.cast_filter.Update() | 366 | + self.cross.Update() |
367 | ps.Publisher().sendMessage('Update slice viewer') | 367 | ps.Publisher().sendMessage('Update slice viewer') |
368 | 368 | ||
369 | 369 |
invesalius/data/viewer_slice.py
@@ -40,14 +40,14 @@ class Viewer(wx.Panel): | @@ -40,14 +40,14 @@ class Viewer(wx.Panel): | ||
40 | self.SetBackgroundColour(colour) | 40 | self.SetBackgroundColour(colour) |
41 | 41 | ||
42 | # Interactor additional style | 42 | # Interactor additional style |
43 | - self.modes = []#['DEFAULT'] | 43 | + self.modes = ['DEFAULT'] |
44 | self.mouse_pressed = 0 | 44 | self.mouse_pressed = 0 |
45 | 45 | ||
46 | # All renderers and image actors in this viewer | 46 | # All renderers and image actors in this viewer |
47 | self.slice_data_list = [] | 47 | self.slice_data_list = [] |
48 | # The layout from slice_data, the first is number of cols, the second | 48 | # The layout from slice_data, the first is number of cols, the second |
49 | # is the number of rows | 49 | # is the number of rows |
50 | - self.layout = (1, 1) | 50 | + self.layout = (2, 2) |
51 | 51 | ||
52 | self.__init_gui() | 52 | self.__init_gui() |
53 | 53 | ||
@@ -102,7 +102,7 @@ class Viewer(wx.Panel): | @@ -102,7 +102,7 @@ class Viewer(wx.Panel): | ||
102 | def append_mode(self, mode): | 102 | def append_mode(self, mode): |
103 | 103 | ||
104 | #TODO: Temporary | 104 | #TODO: Temporary |
105 | - self.modes = [] | 105 | + #self.modes = [] |
106 | 106 | ||
107 | # Retrieve currently set modes | 107 | # Retrieve currently set modes |
108 | self.modes.append(mode) | 108 | self.modes.append(mode) |
@@ -238,9 +238,12 @@ class Viewer(wx.Panel): | @@ -238,9 +238,12 @@ class Viewer(wx.Panel): | ||
238 | 238 | ||
239 | def ChangeZoomMode(self, pubsub_evt): | 239 | def ChangeZoomMode(self, pubsub_evt): |
240 | self.append_mode('ZOOM') | 240 | self.append_mode('ZOOM') |
241 | + print "Zoom" | ||
241 | self.mouse_pressed = 0 | 242 | self.mouse_pressed = 0 |
242 | ICON_IMAGE = wx.Image("../icons/tool_zoom.png",wx.BITMAP_TYPE_PNG) | 243 | ICON_IMAGE = wx.Image("../icons/tool_zoom.png",wx.BITMAP_TYPE_PNG) |
243 | - self.interactor.SetCursor(wx.CursorFromImage(ICON_IMAGE)) | 244 | + ICON_IMAGE.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 0) |
245 | + ICON_IMAGE.SetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 0) | ||
246 | + wx.SetCursor(wx.CursorFromImage(ICON_IMAGE)) | ||
244 | 247 | ||
245 | def ChangePanMode(self, pubsub_evt): | 248 | def ChangePanMode(self, pubsub_evt): |
246 | self.append_mode('PAN') | 249 | self.append_mode('PAN') |
@@ -250,7 +253,7 @@ class Viewer(wx.Panel): | @@ -250,7 +253,7 @@ class Viewer(wx.Panel): | ||
250 | def ChangeZoomSelectMode(self, pubsub_evt): | 253 | def ChangeZoomSelectMode(self, pubsub_evt): |
251 | self.append_mode('ZOOMSELECT') | 254 | self.append_mode('ZOOMSELECT') |
252 | ICON_IMAGE = wx.Image("../icons/tool_zoom.png",wx.BITMAP_TYPE_PNG) | 255 | ICON_IMAGE = wx.Image("../icons/tool_zoom.png",wx.BITMAP_TYPE_PNG) |
253 | - self.interactor.SetCursor(wx.CursorFromImage(ICON_IMAGE)) | 256 | + wx.SetCursor(wx.CursorFromImage(ICON_IMAGE)) |
254 | 257 | ||
255 | def OnPanMove(self, evt, obj): | 258 | def OnPanMove(self, evt, obj): |
256 | if (self.mouse_pressed): | 259 | if (self.mouse_pressed): |