Commit ba2e8753fcf2b560cf8865aceca7ece1ef826aef

Authored by Thiago Franco de Moraes
1 parent d0d3a69b
Exists in master

Removed prints

invesalius/control.py
@@ -273,7 +273,6 @@ class Controller(): @@ -273,7 +273,6 @@ class Controller():
273 def ShowDialogCloseProject(self): 273 def ShowDialogCloseProject(self):
274 session = ses.Session() 274 session = ses.Session()
275 st = session.project_status 275 st = session.project_status
276 - print('Status', st, type(st))  
277 if st == const.PROJ_CLOSE: 276 if st == const.PROJ_CLOSE:
278 return -1 277 return -1
279 try: 278 try:
@@ -476,7 +475,6 @@ class Controller(): @@ -476,7 +475,6 @@ class Controller():
476 def ImportMedicalImages(self, directory, gui=True): 475 def ImportMedicalImages(self, directory, gui=True):
477 patients_groups = dcm.GetDicomGroups(directory) 476 patients_groups = dcm.GetDicomGroups(directory)
478 name = directory.rpartition('\\')[-1].split('.') 477 name = directory.rpartition('\\')[-1].split('.')
479 - print("patients: ", patients_groups)  
480 478
481 if len(patients_groups): 479 if len(patients_groups):
482 # OPTION 1: DICOM 480 # OPTION 1: DICOM
@@ -881,7 +879,6 @@ class Controller(): @@ -881,7 +879,6 @@ class Controller():
881 def OnOpenDicomGroup(self, group, interval, file_range): 879 def OnOpenDicomGroup(self, group, interval, file_range):
882 dicom = group.GetDicomSample() 880 dicom = group.GetDicomSample()
883 samples_per_pixel = dicom.image.samples_per_pixel 881 samples_per_pixel = dicom.image.samples_per_pixel
884 - print("\n\n\n\n{}\n\n\n".format(samples_per_pixel))  
885 if samples_per_pixel == 3: 882 if samples_per_pixel == 3:
886 dlg = wx.MessageDialog(wx.GetApp().GetTopWindow(), _("this is a rgb image, it's necessary to convert to grayscale to open on invesalius.\ndo you want to convert it to grayscale?"), _("Confirm"), wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION) 883 dlg = wx.MessageDialog(wx.GetApp().GetTopWindow(), _("this is a rgb image, it's necessary to convert to grayscale to open on invesalius.\ndo you want to convert it to grayscale?"), _("Confirm"), wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
887 if dlg.ShowModal() != wx.ID_YES: 884 if dlg.ShowModal() != wx.ID_YES:
@@ -926,8 +923,6 @@ class Controller(): @@ -926,8 +923,6 @@ class Controller():
926 xyspacing = dicom.image.spacing 923 xyspacing = dicom.image.spacing
927 orientation = dicom.image.orientation_label 924 orientation = dicom.image.orientation_label
928 samples_per_pixel = dicom.image.samples_per_pixel 925 samples_per_pixel = dicom.image.samples_per_pixel
929 - print("\n\n\n\n{}\n\n\n".format(samples_per_pixel))  
930 -  
931 926
932 wl = float(dicom.image.level) 927 wl = float(dicom.image.level)
933 ww = float(dicom.image.window) 928 ww = float(dicom.image.window)
@@ -968,11 +963,8 @@ class Controller(): @@ -968,11 +963,8 @@ class Controller():
968 elif orientation == 'SAGITTAL': 963 elif orientation == 'SAGITTAL':
969 spacing = zspacing, xyspacing[1], xyspacing[0] 964 spacing = zspacing, xyspacing[1], xyspacing[0]
970 else: 965 else:
971 - print(">>>>>> filelist", filelist)  
972 self.matrix, scalar_range, spacing, self.filename = image_utils.dcmmf2memmap(filelist[0], orientation) 966 self.matrix, scalar_range, spacing, self.filename = image_utils.dcmmf2memmap(filelist[0], orientation)
973 967
974 - print(">>>>>> spacing", spacing)  
975 -  
976 self.Slice = sl.Slice() 968 self.Slice = sl.Slice()
977 self.Slice.matrix = self.matrix 969 self.Slice.matrix = self.matrix
978 self.Slice.matrix_filename = self.filename 970 self.Slice.matrix_filename = self.filename
invesalius/data/imagedata_utils.py
@@ -362,9 +362,6 @@ def bitmap2memmap(files, slice_size, orientation, spacing, resolution_percentage @@ -362,9 +362,6 @@ def bitmap2memmap(files, slice_size, orientation, spacing, resolution_percentage
362 362
363 for n, f in enumerate(files): 363 for n, f in enumerate(files):
364 image_as_array = bitmap_reader.ReadBitmap(f) 364 image_as_array = bitmap_reader.ReadBitmap(f)
365 -  
366 - print(image_as_array.dtype)  
367 -  
368 image = converters.to_vtk( 365 image = converters.to_vtk(
369 image_as_array, 366 image_as_array,
370 spacing=spacing, 367 spacing=spacing,
@@ -428,7 +425,6 @@ def bitmap2memmap(files, slice_size, orientation, spacing, resolution_percentage @@ -428,7 +425,6 @@ def bitmap2memmap(files, slice_size, orientation, spacing, resolution_percentage
428 matrix.flush() 425 matrix.flush()
429 scalar_range = min_scalar, max_scalar 426 scalar_range = min_scalar, max_scalar
430 427
431 - print("MATRIX", matrix.shape)  
432 return matrix, scalar_range, temp_file 428 return matrix, scalar_range, temp_file
433 429
434 430
@@ -488,7 +484,6 @@ def dcmmf2memmap(dcm_file, orientation): @@ -488,7 +484,6 @@ def dcmmf2memmap(dcm_file, orientation):
488 np_image = converters.gdcm_to_numpy(image, pf.GetSamplesPerPixel() == 1) 484 np_image = converters.gdcm_to_numpy(image, pf.GetSamplesPerPixel() == 1)
489 if samples_per_pixel == 3: 485 if samples_per_pixel == 3:
490 np_image = image_normalize(rgb2gray(np_image), 0, 255) 486 np_image = image_normalize(rgb2gray(np_image), 0, 255)
491 - print("\n\n\nnp_image.min = {} - np_image.max = {}\n\n\n".format(np_image.min(), np_image.max()))  
492 temp_file = tempfile.mktemp() 487 temp_file = tempfile.mktemp()
493 matrix = numpy.memmap(temp_file, mode="w+", dtype="int16", shape=np_image.shape) 488 matrix = numpy.memmap(temp_file, mode="w+", dtype="int16", shape=np_image.shape)
494 z, y, x = np_image.shape 489 z, y, x = np_image.shape
invesalius/gui/data_notebook.py
@@ -473,11 +473,6 @@ class MasksListCtrlPanel(InvListCtrl): @@ -473,11 +473,6 @@ class MasksListCtrlPanel(InvListCtrl):
473 """ 473 """
474 selected_items = self.GetSelected() 474 selected_items = self.GetSelected()
475 475
476 - print("mask_list_index = {}".format(self.mask_list_index))  
477 - mask_dict = project.Project().mask_dict  
478 - for i in mask_dict:  
479 - print("{} - {}".format(i, mask_dict[i].index))  
480 -  
481 if selected_items: 476 if selected_items:
482 Publisher.sendMessage('Remove masks', mask_indexes=selected_items) 477 Publisher.sendMessage('Remove masks', mask_indexes=selected_items)
483 else: 478 else:
@@ -488,7 +483,6 @@ class MasksListCtrlPanel(InvListCtrl): @@ -488,7 +483,6 @@ class MasksListCtrlPanel(InvListCtrl):
488 self.imagelist.RemoveAll() 483 self.imagelist.RemoveAll()
489 self.__init_image_list() 484 self.__init_image_list()
490 485
491 - print("mask_list_index = {}".format(self.mask_list_index))  
492 new_dict = {} 486 new_dict = {}
493 self.current_index = 0 487 self.current_index = 0
494 self.mask_list_index = {} 488 self.mask_list_index = {}
@@ -500,11 +494,6 @@ class MasksListCtrlPanel(InvListCtrl): @@ -500,11 +494,6 @@ class MasksListCtrlPanel(InvListCtrl):
500 if mask.is_shown: 494 if mask.is_shown:
501 self.current_index = n 495 self.current_index = n
502 496
503 -  
504 - for i in mask_dict:  
505 - print("{} - {}".format(i, mask_dict[i].index))  
506 - print("mask_list_index = {}".format(self.mask_list_index))  
507 -  
508 self.SetItemImage(self.current_index, 1) 497 self.SetItemImage(self.current_index, 1)
509 Publisher.sendMessage('Change mask selected', index=self.current_index) 498 Publisher.sendMessage('Change mask selected', index=self.current_index)
510 Publisher.sendMessage('Show mask', index=self.current_index, value=1) 499 Publisher.sendMessage('Show mask', index=self.current_index, value=1)
@@ -515,7 +504,6 @@ class MasksListCtrlPanel(InvListCtrl): @@ -515,7 +504,6 @@ class MasksListCtrlPanel(InvListCtrl):
515 self.mask_list_index = {} 504 self.mask_list_index = {}
516 505
517 def OnChangeCurrentMask(self, index): 506 def OnChangeCurrentMask(self, index):
518 - print("index = {}".format(index))  
519 try: 507 try:
520 self.SetItemImage(index, 1) 508 self.SetItemImage(index, 1)
521 self.current_index = index 509 self.current_index = index
@@ -586,7 +574,6 @@ class MasksListCtrlPanel(InvListCtrl): @@ -586,7 +574,6 @@ class MasksListCtrlPanel(InvListCtrl):
586 def InsertNewItem(self, index=0, label=_("Mask"), threshold="(1000, 4500)", colour=None): 574 def InsertNewItem(self, index=0, label=_("Mask"), threshold="(1000, 4500)", colour=None):
587 image = self.CreateColourBitmap(colour) 575 image = self.CreateColourBitmap(colour)
588 image_index = self.imagelist.Add(image) 576 image_index = self.imagelist.Add(image)
589 - print("image_index = {}".format(image_index))  
590 self.InsertItem(index, "") 577 self.InsertItem(index, "")
591 self.SetItemImage(index, 0) 578 self.SetItemImage(index, 0)
592 self.SetItem(index, 1, label, imageId=image_index) 579 self.SetItem(index, 1, label, imageId=image_index)
@@ -599,7 +586,6 @@ class MasksListCtrlPanel(InvListCtrl): @@ -599,7 +586,6 @@ class MasksListCtrlPanel(InvListCtrl):
599 586
600 def AddMask(self, mask): 587 def AddMask(self, mask):
601 image_index = len(self.mask_list_index) 588 image_index = len(self.mask_list_index)
602 - # print("image_index = {}".format(image_index))  
603 self.mask_list_index[image_index] = mask.index 589 self.mask_list_index[image_index] = mask.index
604 self.InsertNewItem(image_index, mask.name, str(mask.threshold_range), mask.colour) 590 self.InsertNewItem(image_index, mask.name, str(mask.threshold_range), mask.colour)
605 591
@@ -607,7 +593,6 @@ class MasksListCtrlPanel(InvListCtrl): @@ -607,7 +593,6 @@ class MasksListCtrlPanel(InvListCtrl):
607 self.SetItem(index, 2, str(threshold_range)) 593 self.SetItem(index, 2, str(threshold_range))
608 594
609 def EditMaskColour(self, index, colour): 595 def EditMaskColour(self, index, colour):
610 - print("EDITMASKCOLOUR {}".format(index))  
611 image = self.CreateColourBitmap(colour) 596 image = self.CreateColourBitmap(colour)
612 # image_index = self.mask_list_index[index] 597 # image_index = self.mask_list_index[index]
613 self.imagelist.Replace(index + 2, image) 598 self.imagelist.Replace(index + 2, image)
@@ -974,7 +959,6 @@ class SurfacesListCtrlPanel(InvListCtrl): @@ -974,7 +959,6 @@ class SurfacesListCtrlPanel(InvListCtrl):
974 959
975 def UpdateItemInfo(self, index=0, label="Surface 1", volume="0 mm3", 960 def UpdateItemInfo(self, index=0, label="Surface 1", volume="0 mm3",
976 area="0 mm2", transparency="0%%", colour=None): 961 area="0 mm2", transparency="0%%", colour=None):
977 - print("UpdateItemInfo", index)  
978 # TODO: Retornar esse codigo 962 # TODO: Retornar esse codigo
979 self.SetItem(index, 1, label, 963 self.SetItem(index, 1, label,
980 imageId = self.surface_list_index[index]) 964 imageId = self.surface_list_index[index])