Commit a0fbdadb authored by schultezub's avatar schultezub

* added VolumeExplorer stub

* minor changes

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@499 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 3c1babb7
......@@ -75,7 +75,9 @@ namespace campvis {
summed |= il;
}
_locked = false;
invalidate(summed);
if (summed != VALID)
invalidate(summed);
}
bool AbstractProcessor::isLocked() {
......
......@@ -160,7 +160,9 @@ namespace campvis {
FaceGeometry slice(corners, texCoords);
MeshGeometry bb = MeshGeometry::createCube(_bounds, tgt::Bounds(tgt::vec3(-1.f), tgt::vec3(-1.f)));
const unsigned char* tmp = (p_showConfidenceMap.getValue() ? _currentSweep->getConfidenceMap(frameNr) : _currentSweep->getTrackedUSFrame(frameNr)->getImageBuffer());
const unsigned char* tmp = (p_showConfidenceMap.getValue() ? _currentSweep->getConfidenceMap(frameNr) : _currentSweep->getTrackedUSFrame(frameNr)->getQuartsampledBuffer().Pointer());
size_t width = (p_showConfidenceMap.getValue() ? _currentSweep->Width() / 4 : _currentSweep->Width()/4);
size_t height = (p_showConfidenceMap.getValue() ? _currentSweep->Height() / 4 : _currentSweep->Height()/4);
if (tmp != 0) {
std::pair<ImageData*, ImageRepresentationRenderTarget*> rt = ImageRepresentationRenderTarget::createWithImageData(_renderTargetSize.getValue());
......@@ -177,7 +179,7 @@ namespace campvis {
tgt::Texture tex(
const_cast<unsigned char*>(tmp),
tgt::vec3(_currentSweep->Width(), _currentSweep->Height(), 1),
tgt::vec3(width, height, 1),
GL_ALPHA,
GL_ALPHA8,
GL_UNSIGNED_BYTE,
......
......@@ -187,7 +187,7 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords)
}
// early ray termination
if (result.a >= 1.0) {
if (result.a > 0.975) {
result.a = 1.0;
t = tend;
}
......
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universitt Mnchen
// Boltzmannstr. 3, 85748 Garching b. Mnchen, Germany
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// The licensing of this softare is not yet resolved. Until then, redistribution in source or
// binary forms outside the CAMP chair is not permitted, unless explicitly stated in legal form.
// However, the names of the original authors and the above copyright notice must retain in its
// original state in any case.
//
// Legal disclaimer provided by the BSD license:
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ================================================================================================
#include "volumeexplorer.h"
#include "tgt/logmanager.h"
#include "tgt/shadermanager.h"
#include "tgt/textureunit.h"
#include "core/datastructures/imagedata.h"
#include "core/datastructures/imagerepresentationgl.h"
#include "core/datastructures/imagerepresentationrendertarget.h"
#include "core/classification/simpletransferfunction.h"
namespace campvis {
const std::string VolumeExplorer::loggerCat_ = "CAMPVis.modules.vis.VolumeExplorer";
VolumeExplorer::VolumeExplorer(IVec2Property& canvasSize)
: VisualizationProcessor(canvasSize)
, p_inputVolume("InputVolume", "Input Volume", "", DataNameProperty::READ)
, p_camera("Camera", "Camera")
, p_xSlice("XSlice", "Slice in YZ Plane", 0, 0, 0)
, p_ySlice("YSlice", "Slice in XZ Plane", 0, 0, 0)
, p_zSlice("ZSlice", "Slice in XY Plane", 0, 0, 0)
, p_transferFunction("TransferFunction", "Transfer Function", new SimpleTransferFunction(128))
, p_outputImage("OutputImage", "Output Image", "ve.output", DataNameProperty::WRITE)
, _raycaster(canvasSize)
, _sliceExtractor(canvasSize)
{
addProperty(&p_inputVolume);
addProperty(&p_camera);
addProperty(&p_xSlice);
addProperty(&p_ySlice);
addProperty(&p_zSlice);
addProperty(&p_inputVolume);
addProperty(&p_outputImage);
p_inputVolume.addSharedProperty(&_raycaster.p_inputVolume);
p_inputVolume.addSharedProperty(&_sliceExtractor.p_sourceImageID);
p_camera.addSharedProperty(&_raycaster.p_camera);
}
VolumeExplorer::~VolumeExplorer() {
}
void VolumeExplorer::init() {
VisualizationProcessor::init();
_raycaster.init();
_sliceExtractor.init();
}
void VolumeExplorer::deinit() {
_raycaster.deinit();
_sliceExtractor.deinit();
VisualizationProcessor::deinit();
}
void VolumeExplorer::process(DataContainer& data) {
validate(INVALID_RESULT);
}
}
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universität München
// Boltzmannstr. 3, 85748 Garching b. München, Germany
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// The licensing of this softare is not yet resolved. Until then, redistribution in source or
// binary forms outside the CAMP chair is not permitted, unless explicitly stated in legal form.
// However, the names of the original authors and the above copyright notice must retain in its
// original state in any case.
//
// Legal disclaimer provided by the BSD license:
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ================================================================================================
#ifndef VOLUMEEXPLORER_H__
#define VOLUMEEXPLORER_H__
#include "core/pipeline/visualizationprocessor.h"
#include "core/properties/datanameproperty.h"
#include "core/properties/numericproperty.h"
#include "modules/vis/processors/volumerenderer.h"
#include "modules/vis/processors/sliceextractor.h"
namespace tgt {
class Shader;
}
namespace campvis {
/**
* Combines a volume raycaster and 3 slice views for explorative volume visualization.
*/
class VolumeExplorer : public VisualizationProcessor {
public:
/**
* Constructs a new VolumeExplorer Processor
**/
VolumeExplorer(IVec2Property& canvasSize);
/**
* Destructor
**/
virtual ~VolumeExplorer();
/// \see AbstractProcessor::init
virtual void init();
/// \see AbstractProcessor::deinit
virtual void deinit();
/// \see AbstractProcessor::getName()
virtual const std::string getName() const { return "VolumeExplorer"; };
/// \see AbstractProcessor::getDescription()
virtual const std::string getDescription() const { return "Combines a volume raycaster and 3 slice views for explorative volume visualization."; };
virtual void process(DataContainer& data);
DataNameProperty p_inputVolume; ///< image ID for first input image
CameraProperty p_camera;
IntProperty p_xSlice;
IntProperty p_ySlice;
IntProperty p_zSlice;
TransferFunctionProperty p_transferFunction;
DataNameProperty p_outputImage; ///< image ID for output image
protected:
/// Additional invalidation levels for this processor.
/// Not the most beautiful design though.
enum ProcessorInvalidationLevel {
VR_INVALID = 1 << 4,
X_SLICE_INVALID = 1 << 5,
Y_SLICE_INVALID = 1 << 6,
Z_SLICE_INVALID = 1 << 7,
};
/**
* Slot getting called when one of the observed processors got invalidated.
* Invalidates this meta-processor with the corresponding level.
* \param processor The processor that emitted the signal
*/
virtual void onProcessorInvalidated(AbstractProcessor* processor);
/**
* \see VisualizationProcessor::onPropertyChanged
*/
virtual void onPropertyChanged(const AbstractProperty* prop);
VolumeRenderer _raycaster;
SliceExtractor _sliceExtractor;
static const std::string loggerCat_;
};
}
#endif // VOLUMEEXPLORER_H__
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