From 1437cfec0b6e0defe30c5b175833aee1393d2ed9 Mon Sep 17 00:00:00 2001 From: Christian Herz Date: Thu, 12 Oct 2023 14:24:00 -0400 Subject: [PATCH 1/2] BUG: cannot use encoding when writing in binary mode (issue #32) --- MONAIViz/MONAIViz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MONAIViz/MONAIViz.py b/MONAIViz/MONAIViz.py index ec3979d..f028d3d 100644 --- a/MONAIViz/MONAIViz.py +++ b/MONAIViz/MONAIViz.py @@ -395,7 +395,7 @@ def onEditTransform(self, row=-1, col=-1): doc_html = os.path.join(self.tmpdir, "transforms.html") doc_url = f"https://docs.monai.io/en/{self.ui.monaiVersionComboBox.currentText}/transforms.html" if not os.path.exists(doc_html): - with open(doc_html, "wb", encoding="utf-8") as fp: + with open(doc_html, "wb") as fp: fp.write(requests.get(doc_url).content) with open(doc_html, encoding="utf-8") as fp: From 0eb83529b6625b051ded885c0250ada0b161d925 Mon Sep 17 00:00:00 2001 From: Christian Herz Date: Thu, 12 Oct 2023 14:37:05 -0400 Subject: [PATCH 2/2] BUG: fixed call of undefined methods (issue #30) --- MONAIViz/MONAIViz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MONAIViz/MONAIViz.py b/MONAIViz/MONAIViz.py index f028d3d..8ce1a45 100644 --- a/MONAIViz/MONAIViz.py +++ b/MONAIViz/MONAIViz.py @@ -839,7 +839,7 @@ def importMONAI(self): try: import monai except ModuleNotFoundError: - with self.showWaitCursor(), self.peakPythonConsole(): + with slicer.util.WaitCursor(), slicer.util.displayPythonShell(): monai = self.installMONAI() logging.info(f"MONAI {monai.__version__} imported correctly") return monai