if app.network.f == None: p = factory.create('org.inviwo.FloatSliderTest', ivec2(75, -25)) p.identifier = "f" network.addProcessor(p) app.network.i.prop1.minValue = -10 app.network.i.prop1.maxValue = 10 app.network.f.prop1.minValue = -1 app.network.f.prop1.maxValue = 1 app.network.f.prop1.increment = 0.2 s = "" for i in app.network.i.prop1.foreach(-3, 8): s += str(i) + " " qt.update() print(s) s = "" for i in app.network.i.prop1.foreach(-3, 8, 2): s += str(i) + " " qt.update() print(s) for p in [app.network.i.prop1, app.network.f.prop1]: s = "" for i in p: s += str(i) + " " qt.update() print(s)
import math import time import ivw.regression import ivw.camera steps = 50 network = inviwopy.app.network m = ivw.regression.Measurements() for g in range(0, 2): isGauss = g == 0 network.ImageLowPass.gaussian.value = isGauss name = "Gaussian-" if isGauss else "Box-" r = [1, 3, 5, 10, 15, 30, 32] if isGauss else [1, 2, 3, 5, 11, 17, 32, 60] p = network.ImageLowPass.sigma if isGauss else network.ImageLowPass.kernelSize for size in r: start = time.clock() p.value = size inviwoqt.update() ivw.regression.saveCanvas(network.Lowpass, name + str(size) + "x" + str(size)) end = time.clock() m.addFrequency(name + 'time-' + str(size) + "x" + str(size), end - start) m.save()
def update(): try: from inviwopy import qt qt.update() except: pass