diff --git a/Chapter07/in_region_cost_example.py b/Chapter07/in_region_cost_example.py index c1ac7ce163472686335b664349e2d3d57e42d08d..a4962d15cfef8f8dc026615da8e17d4c6124c4f2 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 eeab4b9b6b4776db4c5ab83cfbe45dae7f18f313..a82524e4144ae3d865fd6b32b5866a7b492db4b1 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 c67fffe91ef1310c56cac640045228192d08eda3..e5f5b2a057c64b09b5ac45ad9d05b00291341110 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()