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>
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>
In [ ]:
Copied!