Commit 8546c55c authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[ADD #119] added code calling marchingCubes to the distance computation. By

now it seem that I have a problem with the data types store in the ValueSet.
parent 8d62517a
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
#include "WMDistanceMap.h" #include "WMDistanceMap.h"
#include "../../kernel/WKernel.h" #include "../../kernel/WKernel.h"
#include "../../dataHandler/WSubject.h"
#include "../../dataHandler/WGridRegular3D.h"
#include "../marchingCubes/WMMarchingCubes.h"
WMDistanceMap::WMDistanceMap(): WMDistanceMap::WMDistanceMap():
WModule() WModule()
...@@ -76,6 +79,23 @@ void WMDistanceMap::moduleMain() ...@@ -76,6 +79,23 @@ void WMDistanceMap::moduleMain()
{ {
sleep( 1 ); sleep( 1 );
} }
boost::shared_ptr< WDataHandler > dh = WKernel::getRunningKernel()->getDataHandler();
boost::shared_ptr< WSubject > subject = (*dh)[0];
boost::shared_ptr< const WDataSetSingle > dataSet;
dataSet = boost::shared_dynamic_cast< const WDataSetSingle >( (*subject)[0] );
boost::shared_ptr< const WDataSetSingle > distanceMapDataSet = createOffset( dataSet );
WMMarchingCubes mc;
mc.generateSurface( distanceMapDataSet, .1);
WLogger::getLogger()->addLogMessage( "Rendering surface ...", "Distance Map", LL_INFO );
mc.renderSurface();
WLogger::getLogger()->addLogMessage( "Done!", "Distance Map", LL_INFO );
} }
void WMDistanceMap::connectors() void WMDistanceMap::connectors()
...@@ -99,7 +119,7 @@ void WMDistanceMap::properties() ...@@ -99,7 +119,7 @@ void WMDistanceMap::properties()
// ( m_properties->addDouble( "isoValue", 80 ) )->connect( boost::bind( &WMMarchingCubes::slotPropertyChanged, this, _1 ) ); // ( m_properties->addDouble( "isoValue", 80 ) )->connect( boost::bind( &WMMarchingCubes::slotPropertyChanged, this, _1 ) );
} }
boost::shared_ptr< WDataSetSingle > WMDistanceMap::createOffset( boost::shared_ptr< WDataSetSingle > dataSet ) boost::shared_ptr< WDataSetSingle > WMDistanceMap::createOffset( boost::shared_ptr< const WDataSetSingle > dataSet )
{ {
std::vector<float> floatDataset; std::vector<float> floatDataset;
......
...@@ -94,7 +94,7 @@ private: ...@@ -94,7 +94,7 @@ private:
* Function to create a distance map from Anatomy data set. * Function to create a distance map from Anatomy data set.
* Take from FiberNavigator. * Take from FiberNavigator.
*/ */
boost::shared_ptr< WDataSetSingle > createOffset( boost::shared_ptr< WDataSetSingle > dataSet ); boost::shared_ptr< WDataSetSingle > createOffset( boost::shared_ptr< const WDataSetSingle > dataSet );
double xxgauss( double x, double sigma ); double xxgauss( double x, double sigma );
}; };
......
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