Commit 0639101c authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[ADD] added module to sample points on a fiber dataset whose parameter-field is filled

parent 5354c09d
...@@ -179,7 +179,7 @@ void WMFibersToPoints::moduleMain() ...@@ -179,7 +179,7 @@ void WMFibersToPoints::moduleMain()
WProgress::SPtr progress = WProgress::SPtr( new WProgress( "Creating Points from Fibers." ) ); WProgress::SPtr progress = WProgress::SPtr( new WProgress( "Creating Points from Fibers." ) );
m_progress->addSubProgress( progress ); m_progress->addSubProgress( progress );
debugLog() << "Creating point data. Num Points = " << dataSet->getVertices()->size() << "."; debugLog() << "Creating point data. Num Points = " << dataSet->getVertices()->size() / 3 << ".";
WDataSetFibers::VertexArray fibVerts = dataSet->getVertices(); WDataSetFibers::VertexArray fibVerts = dataSet->getVertices();
WDataSetFibers::ColorArray fibColors = dataSet->getColorScheme()->getColor(); WDataSetFibers::ColorArray fibColors = dataSet->getColorScheme()->getColor();
WDataSetFibers::VertexParemeterArray fibParams = dataSet->getVertexParameters(); WDataSetFibers::VertexParemeterArray fibParams = dataSet->getVertexParameters();
...@@ -225,7 +225,7 @@ void WMFibersToPoints::moduleMain() ...@@ -225,7 +225,7 @@ void WMFibersToPoints::moduleMain()
} }
debugLog() << "Done filtering. Result are " << filteredVerts->size() << " points."; debugLog() << "Done filtering. Result are " << filteredVerts->size() / 3 << " points.";
WDataSetPoints::SPtr result( new WDataSetPoints( filteredVerts, filteredColors, filteredBB ) ); WDataSetPoints::SPtr result( new WDataSetPoints( filteredVerts, filteredColors, filteredBB ) );
m_pointsOutput->updateData( result ); m_pointsOutput->updateData( result );
......
...@@ -27,6 +27,7 @@ ADD_MODULE( mergePoints ) ...@@ -27,6 +27,7 @@ ADD_MODULE( mergePoints )
ADD_MODULE( paintTexture ) ADD_MODULE( paintTexture )
ADD_MODULE( pointRenderer ) ADD_MODULE( pointRenderer )
ADD_MODULE( probTractDisplay ) ADD_MODULE( probTractDisplay )
ADD_MODULE( sampleOnFibers )
ADD_MODULE( scalarSegmentation ) ADD_MODULE( scalarSegmentation )
ADD_MODULE( splineSurface ) ADD_MODULE( splineSurface )
ADD_MODULE( surfaceIllustrator ) ADD_MODULE( surfaceIllustrator )
......
This diff is collapsed.
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WMSAMPLEONFIBERS_H
#define WMSAMPLEONFIBERS_H
#include <string>
#include "core/dataHandler/WDataSetFibers.h"
#include "core/dataHandler/WDataSetPoints.h"
#include "core/kernel/WModule.h"
#include "core/kernel/WModuleInputData.h"
#include "core/kernel/WModuleOutputData.h"
/**
* This modules takes a fiber dataset and samples it at a given parameter value.
*
* \ingroup modules
*/
class WMSampleOnFibers: public WModule
{
public:
/**
* Default constructor.
*/
WMSampleOnFibers();
/**
* Destructor.
*/
virtual ~WMSampleOnFibers();
/**
* Gives back the name of this module.
* \return the module's name.
*/
virtual const std::string getName() const;
/**
* Gives back a description of this module.
* \return description to module.
*/
virtual const std::string getDescription() const;
/**
* Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
* should never be initialized or modified in some other way. A simple new instance is required.
*
* \return the prototype used to create every module in OpenWalnut.
*/
virtual boost::shared_ptr< WModule > factory() const;
/**
* Get the icon for this module in XPM format.
* \return The icon.
*/
virtual const char** getXPMIcon() const;
protected:
/**
* Entry point after loading the module. Runs in separate thread.
*/
virtual void moduleMain();
/**
* Initialize the connectors this module is using.
*/
virtual void connectors();
/**
* Initialize the properties for this module.
*/
virtual void properties();
private:
/**
* The fiber dataset which is going to be used.
*/
boost::shared_ptr< WModuleInputData< WDataSetFibers > > m_fiberInput;
/**
* The output connector used to provide the calculated point data to other modules.
*/
boost::shared_ptr< WModuleOutputData< WDataSetPoints > > m_pointsOutput;
/**
* A condition used to notify about changes in several properties.
*/
boost::shared_ptr< WCondition > m_propCondition;
/**
* A string which informs the user whether filtering is possible.
*/
WPropString m_paramHint;
/**
* The color to use for the resulting points.
*/
WPropColor m_color;
/**
* Filter fib point according to its parameter value and this value.
*/
WPropDouble m_parameter;
/**
* fiber parameter max
*/
double m_parameterMax;
/**
* fiber parameter min
*/
double m_parameterMin;
};
#endif // WMSAMPLEONFIBERS_H
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
// Provide additional material and descriptions for your module. You can
// provide this for multiple modules if you like.
// NOTE: everything but the module name is optional, even if this makes no
// sense at all.
// This defines some properties of the module "Template". This must
// match the name specified in WMTemplate::getName().
"Sample On Fibers"
{
// Provide an icon. If the icon exists, it overrides the one provided by your
// getXPMIcon method. This path is relative to your module's resource directory.
// icon="icon.png";
// Where to find the module?
website = "http://www.openwalnut.org";
// Provide a description, If you do so, this description overrides the one
// provided by your getDescription method.
// HINT: multi-line strings are not supported. Please provide long texts in
// one line.
description = "This module allows you to sample points on fibers using the parameters on ea fiber.";
// Provide a list of authors. These authors can have further information associated with them.
author = "OpenWalnut Project";
// Provide author information. Especially a contact address is very handy.
// This associates some URL and Mail contact info to "OpenWalnut Project".
"OpenWalnut Project"
{
url="http://www.openwalnut.org";
email="contact@openwalnut.org";
what="Design, Development and Bug fixing";
};
};
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