Commit 504af5c9 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

* Fixed missing shader in ManualSegmentation module

* Added OrCombinedPointPredicate implementation
* Updated default settings in PredicateDemoCarotid2 pipeline
parent b293e0b1
......@@ -157,6 +157,46 @@ namespace campvis {
AbstractPointPredicate::setupShader(shader);
}
// ================================================================================================
OrCombinedPointPredicate::OrCombinedPointPredicate(const std::string& name, const std::string& title, const std::vector<AbstractPointPredicate*>& predicates)
: AbstractPointPredicate("", name, title)
, _predicates(predicates)
{
for (size_t i = 0; i < _predicates.size(); ++i) {
addProperty(*_predicates[i]);
}
}
OrCombinedPointPredicate::~OrCombinedPointPredicate() {
for (size_t i = 0; i < _predicates.size(); ++i)
delete _predicates[i];
}
std::string OrCombinedPointPredicate::getGlslHeader() const {
std::string toReturn = AbstractPointPredicate::getGlslHeader();
for (size_t i = 0; i < _predicates.size(); ++i)
toReturn += _predicates[i]->getGlslHeader();
return toReturn;
}
std::string OrCombinedPointPredicate::getPredicateEvaluationGlslString() const {
std::string toReturn = "(" + _predicates.front()->getPredicateEvaluationGlslString();
for (size_t i = 1; i < _predicates.size(); ++i)
toReturn += " || " + _predicates[i]->getPredicateEvaluationGlslString();
toReturn += ")";
return toReturn;
}
void OrCombinedPointPredicate::setupShader(tgt::Shader* shader) const {
for (size_t i = 0; i < _predicates.size(); ++i)
_predicates[i]->setupShader(shader);
AbstractPointPredicate::setupShader(shader);
}
// ================================================================================================
......
......@@ -126,6 +126,23 @@ namespace campvis {
virtual ~AndCombinedPointPredicate();
virtual std::string getGlslHeader() const;
virtual std::string getPredicateEvaluationGlslString() const;
virtual void setupShader(tgt::Shader* shader) const;
protected:
std::vector<AbstractPointPredicate*> _predicates;
};
// ================================================================================================
class OrCombinedPointPredicate : public AbstractPointPredicate {
public:
OrCombinedPointPredicate(const std::string& name, const std::string& title, const std::vector<AbstractPointPredicate*>& predicates);
virtual ~OrCombinedPointPredicate();
virtual std::string getGlslHeader() const;
virtual std::string getPredicateEvaluationGlslString() const;
virtual void setupShader(tgt::Shader* shader) const;
......
......@@ -91,7 +91,7 @@ namespace campvis {
_snrFilter.p_outputImage.setValue("snr");
_snrFilter.p_outputImage.addSharedProperty(&_ve.p_inputSnr);
_gaussian.p_sigma.setValue(16.2f);
_gaussian.p_sigma.setValue(6.2f);
_gaussian.p_outputImage.addSharedProperty(&_vesselnesFilter.p_inputImage);
_vesselnesFilter.p_outputImage.setValue("vesselness");
......@@ -149,6 +149,7 @@ namespace campvis {
v.push_back(foo);
v.push_back(bar);
vpToAdd = new AndCombinedPointPredicate("CarotidVessel", "Vesselness & Carotid", v);
vpToAdd->p_intensityHack.setValue(.15f);
histogram->addPredicate(vpToAdd);
vpToAdd = new LabelBitPointPredicate("label", "Skin", "Skin Layer");
......@@ -159,8 +160,17 @@ namespace campvis {
static_cast<LabelBitPointPredicate*>(vpToAdd)->p_bit.setValue(1);
histogram->addPredicate(vpToAdd);
vpToAdd = new LabelBitPointPredicate("label", "Vessel", "Vessel Layer");
static_cast<LabelBitPointPredicate*>(vpToAdd)->p_bit.setValue(2);
// vpToAdd = new LabelBitPointPredicate("label", "Vessel", "Vessel Layer");
// static_cast<LabelBitPointPredicate*>(vpToAdd)->p_bit.setValue(2);
// histogram->addPredicate(vpToAdd);
a = new LabelBitPointPredicate("label", "Vessel3", "Vessel Layer");
static_cast<LabelBitPointPredicate*>(a)->p_bit.setValue(2);
b = new LabelBitPointPredicate("label", "Vessel4", "Vessel Layer 2");
static_cast<LabelBitPointPredicate*>(b)->p_bit.setValue(3);
std::vector<AbstractPointPredicate*> v2;
v2.push_back(a);
v2.push_back(b);
vpToAdd = new OrCombinedPointPredicate("VesselLayer", "Vessel Layer", v2);
histogram->addPredicate(vpToAdd);
histogram->resetPredicates();
......
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012-2014, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
// Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
//
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
//
// ================================================================================================
in vec3 ex_TexCoord;
out vec4 out_Color;
#include "tools/texture3d.frag"
#include "tools/transferfunction.frag"
uniform sampler3D _texture;
uniform TextureParameters3D _textureParams;
uniform sampler1D _transferFunction;
uniform TFParameters1D _transferFunctionParams;
uniform float _zTexCoord;
void main() {
float intensity = texture(_texture, vec3(ex_TexCoord.xy, _zTexCoord)).r;
out_Color = lookupTF(_transferFunction, _transferFunctionParams, intensity);
}
......@@ -10,10 +10,13 @@ IF(${ModuleEnabled})
# Header files (including GLSL files so that they'll appear in VS projects)
FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/manualsegmentation/glsl/*.h
modules/manualsegmentation/pipelines/*.h
modules/manualsegmentation/processors/*.h
modules/manualsegmentation/tools/*.h
)
SET(ThisModShaderDirectories "modules/manualsegmentation/glsl")
SET(ThisModDependencies io itk vis)
ENDIF(${ModuleEnabled})
......
......@@ -120,7 +120,7 @@ namespace campvis {
void ManualTissueSegmenter::init() {
VisualizationProcessor::init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/advancedusvis/glsl/manualtissuesegmenter.frag", "");
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/manualsegmentation/glsl/manualtissuesegmenter.frag", "");
_shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord");
......
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