1from smilPython import *
2
3
4im1 = Image("https://smil.cmm.minesparis.psl.eu/images/tools.png")
5im2 = Image(im1)
6im3 = Image(im1)
7im4 = Image(im1)
8imOverl = Image(im1)
9
10gradient(im1, im2)
11
12im1.show()
13im3.show()
14im4.showLabel()
15
16v = im1.getViewer()
17
18class slot(EventSlot):
19 def run(self, event=None):
20 v.getOverlay(imOverl)
21 watershed(im2, imOverl, im3, im4)
22
23s = slot()
24
25v.onOverlayModified.connect(s)
26v.onOverlayModified.trigger()
27
28
29print("1) Right click on im1")
30print("2) In the \"Tools\" menu select \"Draw\"")
31print("3) Draw markers (with different colors) on im1 and view the resulting segmentation")
32
33
34Gui.execLoop()
35