SMIL  1.0.4
links.py
1 from smilPython import *
2 import time
3 
4 # Load an image
5 imIn= Image("https://smil.cmm.minesparis.psl.eu/images/DNA_small.png")
6 imThresh = Image(imIn)
7 imDist = Image(imIn)
8 
9 imIn.show()
10 imThresh.show()
11 imDist.showLabel()
12 
13 def displMax():
14  print("Distance max value: " + str(rangeVal(imDist)[1]))
15 
16 links = linkManager()
17 links.add(imIn, threshold, imIn, 255, imThresh)
18 links.add(imThresh, dist, imThresh, imDist)
19 links.add(imDist, displMax)
20 
21 for i in range(1, 10):
22  print("\nThreshold level: " + str(i*10))
23  links[0].args[1] = i*10
24  Gui.processEvents() # refresh images
25  time.sleep(1)
vector< T > rangeVal(const Image< T > &imIn, bool onlyNonZero=false)
rangeVal() - Min and Max values of an image
Definition: DMeasures.hpp:416