29 #include "WMProbTractDisplay.h"
30 #include "WMProbTractDisplay.xpm"
31 #include "core/common/WStringUtils.h"
32 #include "core/dataHandler/WDataSetScalar.h"
33 #include "core/kernel/WModuleFactory.h"
34 #include "core/kernel/WModuleInputForwardData.h"
55 return probtractdisplay_xpm;
60 return "Probabilistic Tract Rendering with multi transparent iso surfaces.";
65 return "This module display probabilistic DTI tractograms with iso surfaces.";
72 "The probabilistic tractogram as scalar dataset." );
87 debugLog() <<
"Module is now ready.";
102 static WColor colorInit[] = { defaultColor::GREEN, defaultColor::BLUE, defaultColor::RED };
103 std::vector< WColor > preDefinedColors( colorInit, colorInit +
sizeof colorInit /
sizeof colorInit[ 0 ] );
105 static int init[] = { 100, 30, 0 };
106 std::vector< int > preDefinedOpacities( init, init +
sizeof init /
sizeof init[ 0 ] );
108 WAssert( preDefinedOpacities.size() == preDefinedColors.size(),
"preDefinedColors.size() many iso surfaces => so many colors are needed!" );
111 for(
size_t i = 0; i < preDefinedOpacities.size(); ++i )
122 WPropGroup m_group =
m_properties->addPropertyGroup(
"Isosurface " + isoSurfaceNum,
"Property group for isosurface " + isoSurfaceNum );
123 WPropDouble p0 =
m_isoSurfaces.back()->getProperties()->getProperty(
"Iso value" )->toPropDouble();
124 p0->setMax( 1000.0 );
126 m_group->addProperty( p0 );
127 WPropInt p1 =
m_isoSurfaces.back()->getProperties()->getProperty(
"Opacity %" )->toPropInt();
128 p1->set( preDefinedOpacities[i] );
129 m_group->addProperty( p1 );
130 WPropColor p2 =
m_isoSurfaces.back()->getProperties()->getProperty(
"Surface color" )->toPropColor();
131 p2->set( preDefinedColors[i] );
132 m_group->addProperty( p2 );
virtual void wait() const
Wait for the condition.
void setResetable(bool resetable=true, bool autoReset=true)
Sets the resetable flag.
virtual void add(std::shared_ptr< WCondition > condition)
Adds another condition to the set of conditions to wait for.
This module generates a visualization of probabilistic tracts using iso surfaces.
WMProbTractDisplay()
Default constructor.
virtual void moduleMain()
Entry point after loading the module.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
virtual const std::string getName() const
Gives back the name of this module.
std::shared_ptr< WModuleInputForwardData< WDataSetScalar > > m_input
Scalar dataset representing the probability field either in real numbers in [0,1] or gray values or j...
virtual void properties()
Initialize the properties for this module.
virtual ~WMProbTractDisplay()
Destructor.
virtual void connectors()
Initialize the connectors this module is using.
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
std::vector< std::shared_ptr< WModule > > m_isoSurfaces
Submodules for the iso surface generation.
virtual const std::string getDescription() const
Gives back a description of this module.
void initSubModules()
In order to use sub modules we need to create, initialize (properties) and wire them.
Class able to contain other modules.
virtual void add(std::shared_ptr< WModule > module, bool run=true)
Add a module to this container and start it.
static SPtr getModuleFactory()
Returns instance of the module factory to use to create modules.
virtual void properties()
Initialize properties in this function.
wlog::WStreamedLogger debugLog() const
Logger instance for comfortable debug logging.
std::shared_ptr< WProperties > m_properties
The property object for the module.
void ready()
Call this whenever your module is ready and can react on property changes.
WConditionSet m_moduleState
The internal state of the module.
virtual void connectors()
Initialize connectors in this function.
WBoolFlag m_shutdownFlag
Condition getting fired whenever the thread should quit.
std::string toString(const T &value)
Convert a given value to a string.