SkeletonWatershed
  • SkeletonWatershed
  • Example
    • Skeleton Watershed
  • Licence
SkeletonWatershed
  • Example

Example¶

Skeleton Watershed¶

This is a quick example to show how to use this simple package!

In [1]:
Copied!
from SkeletonWatershed import skel_watershed
import numpy as np
import matplotlib.pyplot as plt
from SkeletonWatershed import skel_watershed import numpy as np import matplotlib.pyplot as plt

Create test data:

In [8]:
Copied!
img = np.zeros((100,100))
img[1:20, 20:42] = 1
img[10:60, 30:80] = 1
img[55:96, 70:80]=1

plt.imshow(img)
img = np.zeros((100,100)) img[1:20, 20:42] = 1 img[10:60, 30:80] = 1 img[55:96, 70:80]=1 plt.imshow(img)
Out[8]:
<matplotlib.image.AxesImage at 0x1a3f0ba49d0>
No description has been provided for this image

Get labels

In [9]:
Copied!
labs = skel_watershed(img, True)

#can use for 3D as well using skel_watershed(img, True, True)
labs = skel_watershed(img, True) #can use for 3D as well using skel_watershed(img, True, True)
running 2d

Inspect:

In [10]:
Copied!
plt.imshow(labs)
plt.imshow(labs)
Out[10]:
<matplotlib.image.AxesImage at 0x1a3ef8f4250>
No description has been provided for this image
In [ ]:
Copied!

Previous Next

Copyright (c) 2024 Norbert Toth

Built with MkDocs using a theme provided by Read the Docs.