Commit c62c2951f3b148197fdf10e22c6a603fb80ce281
1 parent
8655534f
Exists in
master
and in
68 other branches
STL: Removed prints
Showing
2 changed files
with
4 additions
and
45 deletions
Show diff stats
invesalius/data/slice_.py
| ... | ... | @@ -88,22 +88,13 @@ class Slice(object): |
| 88 | 88 | ps.Publisher().subscribe(self.OnDuplicateMasks, 'Duplicate masks') |
| 89 | 89 | |
| 90 | 90 | def OnRemoveMasks(self, pubsub_evt): |
| 91 | - print "slice_: OnRemoveMasks" | |
| 92 | 91 | selected_items = pubsub_evt.data |
| 93 | - print "selected_items:", selected_items | |
| 92 | + | |
| 94 | 93 | proj = Project() |
| 95 | - print "1", proj.mask_dict | |
| 96 | 94 | for item in selected_items: |
| 97 | 95 | proj.RemoveMask(item) |
| 98 | - #print "2", proj.mask_dict | |
| 99 | - ##index = self.current_mask.index | |
| 100 | - #print "current_mask", self.current_mask.index | |
| 101 | - #if (proj.mask_dict) and (self.current_mask.index in selected_items): | |
| 102 | - # print "first mask exist" | |
| 103 | - # self.current_mask = proj.mask_dict[0] | |
| 104 | - # self.SelectCurrentMask(0) | |
| 96 | + | |
| 105 | 97 | if not proj.mask_dict: |
| 106 | - print "no mask" | |
| 107 | 98 | self.blend_filter.SetOpacity(1, 0) |
| 108 | 99 | self.blend_filter.Update() |
| 109 | 100 | ps.Publisher().sendMessage('Update slice viewer') | ... | ... |
invesalius/gui/data_notebook.py
| ... | ... | @@ -148,16 +148,7 @@ class ButtonControlPanel(wx.Panel): |
| 148 | 148 | ps.Publisher().sendMessage('Create new mask', mask_name) |
| 149 | 149 | |
| 150 | 150 | def OnRemove(self): |
| 151 | - #print "button -- OnRemove" | |
| 152 | - #selected_items = self.parent.listctrl.GetSelected() | |
| 153 | - #print "selected_items:",selected_items | |
| 154 | - | |
| 155 | - #if selected_items: | |
| 156 | - # ps.Publisher().sendMessage('Remove masks', selected_items) | |
| 157 | - # for item in selected_items: | |
| 158 | 151 | self.parent.listctrl.RemoveMasks() |
| 159 | - #else: | |
| 160 | - # dlg.MaskSelectionRequiredForRemoval() | |
| 161 | 152 | |
| 162 | 153 | def OnDuplicate(self): |
| 163 | 154 | selected_items = self.parent.listctrl.GetSelected() |
| ... | ... | @@ -212,22 +203,17 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
| 212 | 203 | """ |
| 213 | 204 | Remove selected items. |
| 214 | 205 | """ |
| 215 | - print "---------------------------------------------------" | |
| 216 | - print "Remove item" | |
| 217 | 206 | selected_items = self.GetSelected() |
| 218 | - print "selected_items:",selected_items | |
| 219 | 207 | |
| 220 | 208 | if selected_items: |
| 221 | 209 | ps.Publisher().sendMessage('Remove masks', selected_items) |
| 222 | 210 | else: |
| 223 | - dlg.MaskSelectionRequiredForRemoval() | |
| 224 | - | |
| 211 | + dlg.MaskSelectionRequiredForRemoval() | |
| 212 | + return | |
| 225 | 213 | |
| 226 | 214 | # it is necessary to update internal dictionary |
| 227 | 215 | # that maps bitmap given item index |
| 228 | 216 | old_dict = self.mask_list_index |
| 229 | - print "current_index", self.current_index | |
| 230 | - print "old_dict", old_dict | |
| 231 | 217 | new_dict = {} |
| 232 | 218 | for index in selected_items: |
| 233 | 219 | self.DeleteItem(index) |
| ... | ... | @@ -238,11 +224,9 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
| 238 | 224 | new_dict[i-1] = old_dict[i] |
| 239 | 225 | old_dict = new_dict |
| 240 | 226 | self.mask_list_index = new_dict |
| 241 | - print "new_dict", new_dict | |
| 242 | 227 | |
| 243 | 228 | if new_dict: |
| 244 | 229 | if index == self.current_index: |
| 245 | - print "a) set to zero" | |
| 246 | 230 | self.SetItemImage(0, 1) |
| 247 | 231 | ps.Publisher().sendMessage('Show mask', (0, 1)) |
| 248 | 232 | ps.Publisher().sendMessage('Change mask selected', 0) |
| ... | ... | @@ -251,13 +235,8 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
| 251 | 235 | self.SetItemImage(key, 0) |
| 252 | 236 | |
| 253 | 237 | elif index < self.current_index: |
| 254 | - print "b) minor, keep the same" | |
| 255 | 238 | self.current_index -= 1 |
| 256 | 239 | self.SetItemImage(self.current_index, 1) |
| 257 | - else: | |
| 258 | - pass | |
| 259 | - # enchanged | |
| 260 | - print "---------------------------------------------------" | |
| 261 | 240 | |
| 262 | 241 | |
| 263 | 242 | def OnCloseProject(self, pubsub_evt): |
| ... | ... | @@ -267,10 +246,8 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
| 267 | 246 | def OnChangeCurrentMask(self, pubsub_evt): |
| 268 | 247 | mask_index = pubsub_evt.data |
| 269 | 248 | try: |
| 270 | - print "try" | |
| 271 | 249 | self.SetItemImage(mask_index, 1) |
| 272 | 250 | self.current_index = mask_index |
| 273 | - print "except" | |
| 274 | 251 | except wx._core.PyAssertionError: |
| 275 | 252 | #in SetItem(): invalid item index in SetItem |
| 276 | 253 | pass |
| ... | ... | @@ -315,11 +292,9 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
| 315 | 292 | self.ToggleItem(evt.m_itemIndex) |
| 316 | 293 | |
| 317 | 294 | def OnCheckItem(self, index, flag): |
| 318 | - print "OnCheckItem", index, flag | |
| 319 | 295 | if flag: |
| 320 | 296 | for key in self.mask_list_index.keys(): |
| 321 | 297 | if key != index: |
| 322 | - print "x" | |
| 323 | 298 | self.SetItemImage(key, 0) |
| 324 | 299 | ps.Publisher().sendMessage('Change mask selected',index) |
| 325 | 300 | self.current_index = index |
| ... | ... | @@ -365,7 +340,6 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
| 365 | 340 | |
| 366 | 341 | def EditMaskThreshold(self, pubsub_evt): |
| 367 | 342 | index, threshold_range = pubsub_evt.data |
| 368 | - print "EditMaskThreshold: ", index | |
| 369 | 343 | self.SetStringItem(index, 2, str(threshold_range)) |
| 370 | 344 | |
| 371 | 345 | def EditMaskColour(self, pubsub_evt): |
| ... | ... | @@ -381,7 +355,6 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
| 381 | 355 | """ |
| 382 | 356 | selected = [] |
| 383 | 357 | for index in self.mask_list_index: |
| 384 | - print 'index', index | |
| 385 | 358 | if self.IsSelected(index): |
| 386 | 359 | selected.append(index) |
| 387 | 360 | # it is important to revert items order, so |
| ... | ... | @@ -574,9 +547,7 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
| 574 | 547 | self.RemoveSurface(item) |
| 575 | 548 | |
| 576 | 549 | def __remove_items(self): |
| 577 | - print "Remove items - surface" | |
| 578 | 550 | selected_items = self.GetSelected() |
| 579 | - print selected_items | |
| 580 | 551 | if selected_items: |
| 581 | 552 | for item in selected_items: |
| 582 | 553 | self.RemoveSurface(item) |
| ... | ... | @@ -759,11 +730,9 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
| 759 | 730 | """ |
| 760 | 731 | Remove item given its index. |
| 761 | 732 | """ |
| 762 | - print "RemoveSurface" | |
| 763 | 733 | # it is necessary to update internal dictionary |
| 764 | 734 | # that maps bitmap given item index |
| 765 | 735 | old_dict = self.surface_list_index |
| 766 | - print old_dict | |
| 767 | 736 | new_dict = {} |
| 768 | 737 | for i in old_dict: |
| 769 | 738 | if i < index: |
| ... | ... | @@ -771,7 +740,6 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
| 771 | 740 | if i > index: |
| 772 | 741 | new_dict[i-1] = old_dict[i] |
| 773 | 742 | self.surface_list_index = new_dict |
| 774 | - print new_dict | |
| 775 | 743 | |
| 776 | 744 | self.DeleteItem(index) |
| 777 | 745 | ... | ... |