# Voreen Python script import voreen import voreenqt voreen.info() voreenqt.info() from os import listdir from os.path import isfile, join mypath="D:/document/work/time-varying-visualization/run/CT-Knee" tfs = [f for f in listdir(mypath) if isfile(join(mypath, f)) and -1!=f.find(".tfi")] print(tfs) for f in tfs: tf_filename=join(mypath,f) voreen.loadTransferFunction("SingleVolumeRaycaster", "transferFunction", tf_filename) voreen.repaint() image_filename=tf_filename.replace(".tfi",".png") voreen.snapshotCanvas(0, image_filename) print("saved to image %s" % image_filename)
# Voreen Python script import voreen import voreenqt voreen.info() voreenqt.info() for i in range(0, 150): voreen.setPropertyValue("VolumeSelector", "volumeID", i) tf_filename = "../../../../output/tjet/%03d.tfi" % i voreen.loadTransferFunction("SingleVolumeRaycaster", "transferFunction", tf_filename) print "loaded transfer function %s" % tf_filename voreen.repaint() image_filename = "../../../../output/tjet_output/%03d.png" % i voreen.snapshotCanvas(0, image_filename) print "saved to image %s" % image_filename voreen.setPropertyValue("VolumeSelector", "volumeID", 0)
# Voreen Python script import voreen import voreenqt voreen.info() voreenqt.info() list=["D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_optimized_green_1000.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_optimized_green_1000_0.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_optimized_green_1000_1.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_optimized_green_1000_2.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_optimized_green_1000_3.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_optimized_red_1000.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_optimized_red_1000_0.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_optimized_red_1000_1.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_optimized_red_1000_2.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_optimized_red_1000_3.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_0.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_1.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_2.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_naive_3.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_strong_red.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_strong_red_0.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_strong_red_1.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_strong_red_2.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_strong_red_3.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_weak_red.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_weak_red_0.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_weak_red_1.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_weak_red_2.tfi", "D:\\document\\work\\time-varying-visualization\\ar\\nucleon_weak_red_3.tfi"] for i in range(len(list)): s=list[i] voreen.loadTransferFunction("SingleVolumeRaycaster", "transferFunction", s) print("loaded transfer function %s" % s) if i%5<2: voreen.setPropertyValue("Background", "texture", "D:/document/work/time-varying-visualization/ar/background.jpg") voreen.setPropertyValue("Background", "backgroundModeAsString", "texture") else: voreen.setPropertyValue("Background", "backgroundModeAsString", "monochrome") voreen.repaint() image_filename=s.replace(".tfi",".png") voreen.snapshotCanvas(0, image_filename) print("saved to image %s" % image_filename)
# 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")
# 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")