Commit 68b01085108c4746bc31754544b9d7e9cd32dfea
1 parent
29ad776e
Exists in
master
and in
68 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 | 147 | "Vasculature - Hard":(240,80), |
| 148 | 148 | "Vasculature - Soft":(650,160)} |
| 149 | 149 | |
| 150 | -REDUCE_IMAGEDATA_QUALITY = 1 | |
| 150 | +REDUCE_IMAGEDATA_QUALITY = 0 | |
| 151 | 151 | |
| 152 | 152 | # if 1, use vtkVolumeRaycastMapper, if 0, use vtkFixedPointVolumeRayCastMapper |
| 153 | 153 | TYPE_RAYCASTING_MAPPER = 0 | ... | ... |
invesalius/data/slice_.py
| ... | ... | @@ -294,7 +294,7 @@ class Slice(object): |
| 294 | 294 | |
| 295 | 295 | |
| 296 | 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 | 338 | cross.Modified() |
| 339 | 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 | 350 | def UpdateCursorPosition(self, pubsub_evt): |
| ... | ... | @@ -352,7 +352,7 @@ class Slice(object): |
| 352 | 352 | new_pos = pubsub_evt.data |
| 353 | 353 | self.cross.SetCursorPosition(new_pos) |
| 354 | 354 | self.cross.Modified() |
| 355 | - self.cast_filter.Update() | |
| 355 | + self.cross.Update() | |
| 356 | 356 | ps.Publisher().sendMessage('Update slice viewer') |
| 357 | 357 | |
| 358 | 358 | def UpdateCursorPositionSingleAxis(self, pubsub_evt): |
| ... | ... | @@ -363,7 +363,7 @@ class Slice(object): |
| 363 | 363 | new_pos[key] = axis_pos[key] |
| 364 | 364 | self.cross.SetCursorPosition(new_pos) |
| 365 | 365 | self.cross.Modified() |
| 366 | - self.cast_filter.Update() | |
| 366 | + self.cross.Update() | |
| 367 | 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 | 40 | self.SetBackgroundColour(colour) |
| 41 | 41 | |
| 42 | 42 | # Interactor additional style |
| 43 | - self.modes = []#['DEFAULT'] | |
| 43 | + self.modes = ['DEFAULT'] | |
| 44 | 44 | self.mouse_pressed = 0 |
| 45 | 45 | |
| 46 | 46 | # All renderers and image actors in this viewer |
| 47 | 47 | self.slice_data_list = [] |
| 48 | 48 | # The layout from slice_data, the first is number of cols, the second |
| 49 | 49 | # is the number of rows |
| 50 | - self.layout = (1, 1) | |
| 50 | + self.layout = (2, 2) | |
| 51 | 51 | |
| 52 | 52 | self.__init_gui() |
| 53 | 53 | |
| ... | ... | @@ -102,7 +102,7 @@ class Viewer(wx.Panel): |
| 102 | 102 | def append_mode(self, mode): |
| 103 | 103 | |
| 104 | 104 | #TODO: Temporary |
| 105 | - self.modes = [] | |
| 105 | + #self.modes = [] | |
| 106 | 106 | |
| 107 | 107 | # Retrieve currently set modes |
| 108 | 108 | self.modes.append(mode) |
| ... | ... | @@ -238,9 +238,12 @@ class Viewer(wx.Panel): |
| 238 | 238 | |
| 239 | 239 | def ChangeZoomMode(self, pubsub_evt): |
| 240 | 240 | self.append_mode('ZOOM') |
| 241 | + print "Zoom" | |
| 241 | 242 | self.mouse_pressed = 0 |
| 242 | 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 | 248 | def ChangePanMode(self, pubsub_evt): |
| 246 | 249 | self.append_mode('PAN') |
| ... | ... | @@ -250,7 +253,7 @@ class Viewer(wx.Panel): |
| 250 | 253 | def ChangeZoomSelectMode(self, pubsub_evt): |
| 251 | 254 | self.append_mode('ZOOMSELECT') |
| 252 | 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 | 258 | def OnPanMove(self, evt, obj): |
| 256 | 259 | if (self.mouse_pressed): | ... | ... |