Skip to content
Snippets Groups Projects
Commit 1622d378 authored by Aleksandar's avatar Aleksandar
Browse files

Updated the process main to show that it works for 2d images and slices from 3d images.

parent 0b4619eb
No related branches found
No related tags found
2 merge requests!117New Layered Surface Segmentation,!42Layered Surface Segmentation Feature
......@@ -358,6 +358,7 @@ class Layers2d:
import matplotlib.pyplot as plt
from skimage.io import imread
from qim3d.io import load
if __name__ == "__main__":
# Draw results.
......@@ -375,9 +376,26 @@ if __name__ == "__main__":
ax.plot(line)
plt.show()
# Data input
d_switch = False
if d_switch:
path = os.path.join(os.getcwd(), "qim3d", "img_examples", "slice_218x193.png")
data = imread(path).astype(np.int32)
else:
path = os.path.join(os.getcwd(), "qim3d", "img_examples", "bone_128x128x128.tif")
data3D = load(
path,
virtual_stack=True,
dataset_name="",
)
x = data3D.shape[0]
y = data3D.shape[1]
z = data3D.shape[2]
data = data3D[x//2, :, :]
data = data3D[:, y//2, :]
data = data3D[:, :, z//2]
layers2d = Layers2d(data = data, n_layers = 3, delta = 1, min_margin = 10)
layers2d.update()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment