Commit 32a7ae10 authored by Artur Grunau's avatar Artur Grunau
Browse files

Modify processor properties in the test Lua pipeline

To check if existing bindings for property classes work, the test Lua
pipeline has been updated to modify processor properties in its init
method.

References #1
parent e53c9f06
......@@ -4,8 +4,8 @@ pipeline = campvis.newPipeline()
function pipeline:ctor()
print("I'm being constructed!")
self.mir = vis.MhdImageReader()
self.addProcessor(instance, self.mir)
self.image_reader = vis.MhdImageReader()
self.addProcessor(instance, self.image_reader)
local iv = campvis.ivec2(50, 10)
......@@ -14,7 +14,7 @@ function pipeline:ctor()
local ivp = campvis.IVec2Property("a", "b", iv, campvis.ivec2_zero, campvis.ivec2(100, 30))
self.ve = vis.VolumeExplorer(ivp)
self.gir = vis.GlImageResampler(ivp)
self.resampler = vis.GlImageResampler(ivp)
--self.addProcessor(instance, self.gir)
--self.addProcessor(instance, self.ve)
......@@ -22,6 +22,26 @@ end
function pipeline:init()
print("I'm being inited!")
self.ve.p_outputImage:setValue("result")
self.image_reader.p_url:setValue("CAMPVIS_SOURCE_DIR/modules/vis/sampledata/smallHeart.mhd")
self.image_reader.p_targetImageID:setValue("reader.output")
self.image_reader.p_targetImageID:addSharedProperty(self.resampler.p_inputImage)
self.resampler.p_outputImage:setValue("resampled")
self.resampler.p_outputImage:addSharedProperty(self.ve.p_inputVolume)
local geometry1 = campvis.TFGeometry1D_createQuad(campvis.vec2(0.1, 0.125), campvis.col4(255, 0, 0, 32),
campvis.vec4(255, 0, 0, 32))
local geometry2 = campvis.TFGeometry1D_createQuad(campvis.vec2(.4, .5), campvis.col4(0, 255, 0, 128),
campvis.vec4(0, 255, 0, 128))
local dvrTF = campvis.Geometry1DTransferFunction(128, campvis.vec2(0, 0.05))
dvrTF:addGeometry(geometry1)
dvrTF:addGeometry(geometry2)
self.ve:getProperty("TransferFunction"):replaceTF(dvrTF)
end
function pipeline:deinit()
......
%module vis
%include "std_string.i"
%include "campvis.i"
%include std_string.i
%include campvis.i
%{
#include "modules/io/processors/mhdimagereader.h"
#include "modules/preprocessing/processors/glimageresampler.h"
......@@ -42,6 +42,7 @@ namespace campvis {
const std::string getName() const;
%immutable;
campvis::DataNameProperty p_inputImage;
campvis::DataNameProperty p_outputImage;
%mutable;
};
......@@ -54,6 +55,7 @@ namespace campvis {
const std::string getName() const;
%immutable;
campvis::DataNameProperty p_inputVolume;
campvis::DataNameProperty p_outputImage;
%mutable;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment