Beispiel #1
0
# Sample script for taking canvas snapshots.
# Writes a snapshot of each canvas to disc.
import voreen
import time

filename = voreen.getBasePath() + "/data/screenshots/snapshot-%d.png"

start = time.time()
count = voreen.canvasCount()
print "canvas count is %d:" % count
for i in range(0, count):
    voreen.snapshotCanvas(i, filename % (i + 1))
    print " * saved snapshot to file %s" % (filename % (i + 1))

end = time.time()
runtime = end - start
print "total runtime: %fs" % runtime
Beispiel #2
0
# Consecutively loads the ten time steps of the golf ball data set
# (http://www.voreen.org/files/volumedynamics.zip), 
# and takes a snapshot of each frame.

import voreen
import voreenqt

golfBallPath = voreen.getBasePath() + "/data/volumes/golfball"
snapshotPath = voreen.getBasePath() + "/data/screenshots"

for i in range(0, 10):
    # usage: voreen.loadVolume(filepath, [VolumeSource processor]) 
    voreen.loadVolume(golfBallPath + "/golfball0_%d-512x256x256.dat" % (i))
    
    # alternative: use VolumeSeriesSource as data supplier
    #voreen.setPropertyValue("VolumeSeriesSource", "step", i) 

    voreen.repaint()
    voreenqt.processEvents() # to see each frame on screen
    voreen.snapshot(snapshotPath + "/golfball0_%d.png" % (i))

voreenqt.messageBox("Wrote ten frames to %s/golfball0_*.png" % snapshotPath)
Beispiel #3
0
# Sample script for taking canvas snapshots.
# Writes a snapshot of each canvas to disc.
import voreen
import time

filename = voreen.getBasePath() + "/data/screenshots/snapshot-%d.png"

start = time.time()
count = voreen.canvasCount()
print "canvas count is %d:" % count
for i in range(0, count):
    voreen.snapshotCanvas(i, filename % (i + 1))
    print " * saved snapshot to file %s" % (filename % (i + 1))

end = time.time()
runtime = (end - start)
print 'total runtime: %fs' % runtime
Beispiel #4
0
# Sample script for loading a transfer function from disc.
import voreen
import voreenqt

# usage: 
# voreen.loadTransferFunction(processor name, 
#                             property id, 
#                             transfunc path)
voreen.loadTransferFunction(
    "SingleVolumeRaycaster", 
    "transferFunction", 
    voreen.getBasePath() + "/data/transferfuncs/nucleon.tfi")
Beispiel #5
0
# Sample script for loading a transfer function from disc.
import voreen
import voreenqt

# usage: 
# voreen.loadTransferFunction(processor name, 
#                             property id, 
#                             transfunc path)
voreen.loadTransferFunction(
    "SingleVolumeRaycaster", 
    "transferFunction", 
    voreen.getBasePath() + "/resource/transferfuncs/nucleon.tfi")
Beispiel #6
0
# Sample script for loading volume data.
import voreen

# usage: voreen.loadVolume(filepath, [name of VolumeSource processor])
voreen.loadVolume(voreen.getBasePath() + "/data/volumes/nucleon.dat", "VolumeSource")
Beispiel #7
0
# Sample script for loading a transfer function from disc.
import voreen
import voreenqt

# usage:
# voreen.loadTransferFunction(processor name,
#                             property id,
#                             transfunc path)
voreen.loadTransferFunction(
    "SingleVolumeRaycaster", "transferFunction", voreen.getBasePath() + "/resource/transferfuncs/nucleon.tfi"
)
Beispiel #8
0
# Sample script for loading volume data.
import voreen

# usage: voreen.loadVolume(filepath, [name of VolumeSource processor])
voreen.loadVolume(voreen.getBasePath() + "/resource/volumes/nucleon.vvd",
                  "VolumeSource")