Commit f18b259c authored by schurade's avatar schurade

[CHANGE] use marching lego for arbitrary rois

parent 7ad4710f
......@@ -30,9 +30,7 @@
#include <osg/LineWidth>
#include <osg/LightModel>
#include "../common/WProgressCombiner.h"
#include "algorithms/WMarchingCubesAlgorithm.h"
#include "algorithms/WMarchingLegoAlgorithm.h"
#include "WGraphicsEngine.h"
......@@ -151,13 +149,11 @@ void WROIArbitrary::updateGFX()
{
if ( m_dirty->get() )
{
boost::shared_ptr< WProgressCombiner > progress = boost::shared_ptr< WProgressCombiner >( new WProgressCombiner() );
WMarchingCubesAlgorithm mcAlgo;
m_triMesh = mcAlgo.generateSurface( m_nbCoordsVec[0], m_nbCoordsVec[1], m_nbCoordsVec[2],
WMarchingLegoAlgorithm mlAlgo;
m_triMesh = mlAlgo.generateSurface( m_nbCoordsVec[0], m_nbCoordsVec[1], m_nbCoordsVec[2],
m_matrix,
&m_vals,
m_threshold->get(),
progress );
m_threshold->get() );
osg::Geometry* surfaceGeometry = new osg::Geometry();
setName( "roi" );
......
......@@ -40,7 +40,7 @@
#include "../../graphicsEngine/WROIArbitrary.h"
#include "../../graphicsEngine/WROIBox.h"
#include "../../graphicsEngine/algorithms/WMarchingCubesAlgorithm.h"
#include "../../graphicsEngine/algorithms/WMarchingLegoAlgorithm.h"
#include "WMArbitraryRois.h"
#include "WMArbitraryRois.xpm"
......@@ -104,7 +104,7 @@ void WMArbitraryRois::properties()
m_propCondition = boost::shared_ptr< WCondition >( new WCondition() );
m_finalizeTrigger = m_properties->addProperty( "Finalize", "Finalize and add to ROI manager", WPVBaseTypes::PV_TRIGGER_READY, m_propCondition );
m_threshold = m_properties->addProperty( "Threshold", "", 0., m_propCondition );
m_threshold = m_properties->addProperty( "Threshold", "", 1.0, m_propCondition );
m_surfaceColor = m_properties->addProperty( "Surface color", "", WColor( 1.0, 0.3, 0.3, 1.0 ), m_propCondition );
WModule::properties();
......@@ -138,7 +138,7 @@ void WMArbitraryRois::moduleMain()
m_threshold->setMin( m_dataSet->getMin() );
m_threshold->setMax( m_dataSet->getMax() );
m_threshold->set( 0. );
m_threshold->set( ( m_dataSet->getMax() - m_dataSet->getMin() ) / 2.0 );
initSelectionRoi();
}
......@@ -240,12 +240,11 @@ void WMArbitraryRois::createCutDataset()
WAssert( false, "Unknown data type in MarchingCubes module" );
}
m_newValueSet = boost::shared_ptr< WValueSet< float > >( new WValueSet< float >( order, vDim, data, W_DT_FLOAT ) );
WMarchingCubesAlgorithm mcAlgo;
m_triMesh = mcAlgo.generateSurface( grid->getNbCoordsX(), grid->getNbCoordsY(), grid->getNbCoordsZ(),
WMarchingLegoAlgorithm mlAlgo;
m_triMesh = mlAlgo.generateSurface( grid->getNbCoordsX(), grid->getNbCoordsY(), grid->getNbCoordsZ(),
grid->getTransformationMatrix(),
m_newValueSet->rawDataVectorPointer(),
threshold,
m_progress );
threshold );
}
template< typename T > std::vector< float > WMArbitraryRois::cutArea( boost::shared_ptr< WGrid > inGrid, boost::shared_ptr< WValueSet< T > > vals )
......
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