Commit 1783be82f4ea7f50260467045a0b8fe9defef0ed
1 parent
ee06f3ce
Exists in
master
FIX: Print format incompatible with python 3.7
Showing
3 changed files
with
12 additions
and
12 deletions
Show diff stats
invesalius/control.py
... | ... | @@ -881,7 +881,7 @@ class Controller(): |
881 | 881 | def OnOpenDicomGroup(self, group, interval, file_range): |
882 | 882 | dicom = group.GetDicomSample() |
883 | 883 | samples_per_pixel = dicom.image.samples_per_pixel |
884 | - print(f"\n\n\n\n{samples_per_pixel =}\n\n\n") | |
884 | + print("\n\n\n\n{}\n\n\n".format(samples_per_pixel)) | |
885 | 885 | if samples_per_pixel == 3: |
886 | 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) |
887 | 887 | if dlg.ShowModal() != wx.ID_YES: |
... | ... | @@ -926,7 +926,7 @@ class Controller(): |
926 | 926 | xyspacing = dicom.image.spacing |
927 | 927 | orientation = dicom.image.orientation_label |
928 | 928 | samples_per_pixel = dicom.image.samples_per_pixel |
929 | - print(f"\n\n\n\n{samples_per_pixel =}\n\n\n") | |
929 | + print("\n\n\n\n{}\n\n\n".format(samples_per_pixel)) | |
930 | 930 | |
931 | 931 | |
932 | 932 | wl = float(dicom.image.level) | ... | ... |
invesalius/data/imagedata_utils.py
... | ... | @@ -488,7 +488,7 @@ def dcmmf2memmap(dcm_file, orientation): |
488 | 488 | np_image = converters.gdcm_to_numpy(image, pf.GetSamplesPerPixel() == 1) |
489 | 489 | if samples_per_pixel == 3: |
490 | 490 | np_image = image_normalize(rgb2gray(np_image), 0, 255) |
491 | - print(f"\n\n\n{np_image.min() =} - {np_image.max() =}\n\n\n") | |
491 | + print("\n\n\nnp_image.min = {} - np_image.max = {}\n\n\n".format(np_image.min(), np_image.max())) | |
492 | 492 | temp_file = tempfile.mktemp() |
493 | 493 | matrix = numpy.memmap(temp_file, mode="w+", dtype="int16", shape=np_image.shape) |
494 | 494 | z, y, x = np_image.shape | ... | ... |
invesalius/gui/data_notebook.py
... | ... | @@ -473,10 +473,10 @@ class MasksListCtrlPanel(InvListCtrl): |
473 | 473 | """ |
474 | 474 | selected_items = self.GetSelected() |
475 | 475 | |
476 | - print(f"{self.mask_list_index =}") | |
476 | + print("mask_list_index = {}".format(self.mask_list_index)) | |
477 | 477 | mask_dict = project.Project().mask_dict |
478 | 478 | for i in mask_dict: |
479 | - print(f"{i} - {mask_dict[i].index}") | |
479 | + print("{} - {}".format(i, mask_dict[i].index)) | |
480 | 480 | |
481 | 481 | if selected_items: |
482 | 482 | Publisher.sendMessage('Remove masks', mask_indexes=selected_items) |
... | ... | @@ -488,7 +488,7 @@ class MasksListCtrlPanel(InvListCtrl): |
488 | 488 | self.imagelist.RemoveAll() |
489 | 489 | self.__init_image_list() |
490 | 490 | |
491 | - print(f"{self.mask_list_index =}") | |
491 | + print("mask_list_index = {}".format(self.mask_list_index)) | |
492 | 492 | new_dict = {} |
493 | 493 | self.current_index = 0 |
494 | 494 | self.mask_list_index = {} |
... | ... | @@ -502,8 +502,8 @@ class MasksListCtrlPanel(InvListCtrl): |
502 | 502 | |
503 | 503 | |
504 | 504 | for i in mask_dict: |
505 | - print(f"{i} - {mask_dict[i].index}") | |
506 | - print(f"{self.mask_list_index =}") | |
505 | + print("{} - {}".format(i, mask_dict[i].index)) | |
506 | + print("mask_list_index = {}".format(self.mask_list_index)) | |
507 | 507 | |
508 | 508 | self.SetItemImage(self.current_index, 1) |
509 | 509 | Publisher.sendMessage('Change mask selected', index=self.current_index) |
... | ... | @@ -515,7 +515,7 @@ class MasksListCtrlPanel(InvListCtrl): |
515 | 515 | self.mask_list_index = {} |
516 | 516 | |
517 | 517 | def OnChangeCurrentMask(self, index): |
518 | - print(f"{index=}") | |
518 | + print("index = {}".format(index)) | |
519 | 519 | try: |
520 | 520 | self.SetItemImage(index, 1) |
521 | 521 | self.current_index = index |
... | ... | @@ -586,7 +586,7 @@ class MasksListCtrlPanel(InvListCtrl): |
586 | 586 | def InsertNewItem(self, index=0, label=_("Mask"), threshold="(1000, 4500)", colour=None): |
587 | 587 | image = self.CreateColourBitmap(colour) |
588 | 588 | image_index = self.imagelist.Add(image) |
589 | - print(f"{image_index =}") | |
589 | + print("image_index = {}".format(image_index)) | |
590 | 590 | self.InsertItem(index, "") |
591 | 591 | self.SetItemImage(index, 0) |
592 | 592 | self.SetItem(index, 1, label, imageId=image_index) |
... | ... | @@ -599,7 +599,7 @@ class MasksListCtrlPanel(InvListCtrl): |
599 | 599 | |
600 | 600 | def AddMask(self, mask): |
601 | 601 | image_index = len(self.mask_list_index) |
602 | - # print(f"{image_index =}") | |
602 | + # print("image_index = {}".format(image_index)) | |
603 | 603 | self.mask_list_index[image_index] = mask.index |
604 | 604 | self.InsertNewItem(image_index, mask.name, str(mask.threshold_range), mask.colour) |
605 | 605 | |
... | ... | @@ -607,7 +607,7 @@ class MasksListCtrlPanel(InvListCtrl): |
607 | 607 | self.SetItem(index, 2, str(threshold_range)) |
608 | 608 | |
609 | 609 | def EditMaskColour(self, index, colour): |
610 | - print(f"EDITMASKCOLOUR {index=}") | |
610 | + print("EDITMASKCOLOUR {}".format(index)) | |
611 | 611 | image = self.CreateColourBitmap(colour) |
612 | 612 | # image_index = self.mask_list_index[index] |
613 | 613 | self.imagelist.Replace(index + 2, image) | ... | ... |