From 0cde9cf562b98df98c28f871cefbbcaa0db8f597 Mon Sep 17 00:00:00 2001 From: CsatiZoltan Date: Tue, 25 Feb 2020 14:32:38 +0100 Subject: [PATCH 1/2] Fix: linspace accepts integer divisions only. --- imagepy/tools/Measure/profile_tol.py | 4 ++-- imagepy/tools/Network/graphcut_tol.py | 4 ++-- imagepy/tools/Network/graphpen_tol.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/imagepy/tools/Measure/profile_tol.py b/imagepy/tools/Measure/profile_tol.py index 3bd0ed48..035e1acf 100644 --- a/imagepy/tools/Measure/profile_tol.py +++ b/imagepy/tools/Measure/profile_tol.py @@ -131,8 +131,8 @@ def profile(self, body, img): (x1, y1), (x2, y2) = body[0] dx, dy = x2-x1, y2-y1 n = max(abs(dx), abs(dy)) + 1 - xs = np.linspace(x1, x2, n).round().astype(np.int16) - ys = np.linspace(y1, y2, n).round().astype(np.int16) + xs = np.linspace(x1, x2, int(n)).round().astype(np.int16) + ys = np.linspace(y1, y2, int(n)).round().astype(np.int16) msk = (xs>=0) * (xs=0) * (ysimg.shape[1]: continue if y<0 or y>img.shape[0]: continue From df44caef2822f2c543b9fa4ef6132a7b1014623e Mon Sep 17 00:00:00 2001 From: CsatiZoltan Date: Tue, 25 Feb 2020 16:14:53 +0100 Subject: [PATCH 2/2] Fix: undefined variable in the image overlay widget. --- imagepy/widgets/histogram/channels_wgt.py | 1 + 1 file changed, 1 insertion(+) diff --git a/imagepy/widgets/histogram/channels_wgt.py b/imagepy/widgets/histogram/channels_wgt.py index 9ea50f45..93e16f17 100644 --- a/imagepy/widgets/histogram/channels_wgt.py +++ b/imagepy/widgets/histogram/channels_wgt.py @@ -172,6 +172,7 @@ def on_setback(self, event): name = self.com_back.GetValue() if name is None: return ImageManager.get().back = ImageManager.get(name) + curwin = WindowsManager.get() curwin.ips.update() def on_mode(self, event):