From 6ffe14f6ee4396a22c973126f8052fe80314c7b7 Mon Sep 17 00:00:00 2001
From: Vedrana Andersen Dahl <vedranaa@gmail.com>
Date: Wed, 15 Mar 2023 02:02:18 +0100
Subject: [PATCH] fixed np.bool

---
 Chapter07/in_region_cost_example.py       | 7 ++++++-
 Chapter07/on_surface_cost_example.py      | 8 +++++++-
 Chapter07/w1_unwrapping_image_exercise.py | 4 +++-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/Chapter07/in_region_cost_example.py b/Chapter07/in_region_cost_example.py
index c1ac7ce..a4962d1 100755
--- a/Chapter07/in_region_cost_example.py
+++ b/Chapter07/in_region_cost_example.py
@@ -3,8 +3,11 @@ import matplotlib.pyplot as plt
 import skimage.io 
 import slgbuilder
 
+# This is to fix deprecated alias in numpy, but still used in slgbuilder
+np.bool = bool
+np.int = int
 
-I = skimage.io.imread('../../../../Data/week7/peaks_image.png').astype(np.int32)
+I = skimage.io.imread('../../data/week7/peaks_image.png').astype(np.int32)
 
 fig, ax = plt.subplots(1,2)
 ax[0].imshow(I, cmap='gray')
@@ -34,5 +37,7 @@ ax[1].imshow(I, cmap='gray')
 for line in segmentation_lines:
     ax[1].plot(line, 'r')
 
+plt.show()
+
 
 
diff --git a/Chapter07/on_surface_cost_example.py b/Chapter07/on_surface_cost_example.py
index eeab4b9..a82524e 100755
--- a/Chapter07/on_surface_cost_example.py
+++ b/Chapter07/on_surface_cost_example.py
@@ -3,8 +3,12 @@ import matplotlib.pyplot as plt
 import skimage.io 
 import slgbuilder
 
+# This is to fix deprecated alias in numpy, but still used in slgbuilder
+np.bool = bool
+np.int = int
+
 #%% input
-I = skimage.io.imread('../../../../Data/week7/layers_A.png').astype(np.int32)
+I = skimage.io.imread('../../data/week7/layers_A.png').astype(np.int32)
 
 fig, ax = plt.subplots(1,4)
 ax[0].imshow(I, cmap='gray')
@@ -64,3 +68,5 @@ ax[3].imshow(I, cmap='gray')
 for line in segmentation_lines:
     ax[3].plot(line, 'r')
 ax[3].set_title('two dark lines')
+
+plt.show()
\ No newline at end of file
diff --git a/Chapter07/w1_unwrapping_image_exercise.py b/Chapter07/w1_unwrapping_image_exercise.py
index c67fffe..e5f5b2a 100644
--- a/Chapter07/w1_unwrapping_image_exercise.py
+++ b/Chapter07/w1_unwrapping_image_exercise.py
@@ -13,7 +13,7 @@ import numpy as np
 import scipy.interpolate
 import matplotlib.pyplot as plt
 
-I = skimage.io.imread('../../../../Data/week1/dental/slice100.png')
+I = skimage.io.imread('../../data/week1/dental/slice100.png')
 
 
 a = 180 # number of angles for unfolding
@@ -33,3 +33,5 @@ U = U.reshape((r,a)).astype(np.uint8)
 fig, ax = plt.subplots(1,2)
 ax[0].imshow(I, cmap='gray')
 ax[1].imshow(U, cmap='gray')
+
+plt.show()
-- 
GitLab