1from smilPython import *
2
3
4imIn = Image("https://smil.cmm.minesparis.psl.eu/images/DNA_small.png")
5imIn.show()
6
7
8imGrad = Image(imIn)
9gradient(imIn, imGrad)
10
11
12imMark = Image(imIn, "UINT16")
13imMark << 0
14
15imMark.setPixel(75, 40, 1)
16
17imMark.setPixel(78, 86, 2)
18imMark.setPixel(88, 76, 3)
19
20
21dilate(imMark, imMark, 2)
22
23
24
25imWS = Image(imIn)
26watershed(imGrad, imMark, imWS)
27
28
29imWS.show()
30
31
32imIn.getViewer().drawOverlay(imWS & 1)
33