25 #ifndef WMTEEMGLYPHS_H
26 #define WMTEEMGLYPHS_H
33 #include "core/common/WItemSelection.h"
34 #include "core/common/WItemSelector.h"
35 #include "core/dataHandler/WDataSetScalar.h"
36 #include "core/dataHandler/WDataSetSphericalHarmonics.h"
37 #include "core/graphicsEngine/shaders/WGEShader.h"
38 #include "core/kernel/WModule.h"
39 #include "core/kernel/WModuleInputData.h"
40 #include "core/kernel/WModuleOutputData.h"
67 virtual const std::string
getName()
const;
81 virtual std::shared_ptr< WModule >
factory()
const;
116 std::shared_ptr< WModuleInputData< WDataSetSphericalHarmonics > >
m_input;
140 std::shared_ptr< WDataSetSphericalHarmonics >
m_dataSet;
142 std::shared_ptr< WModuleInputData< WDataSetScalar > >
m_inputGFA;
193 GlyphGeneration( std::shared_ptr< WDataSetSphericalHarmonics > dataSet,
194 std::shared_ptr< WDataSetScalar > dataGFA,
196 const size_t& sliceId,
198 const size_t& subdivisionLevel,
199 const size_t& modulo,
200 const size_t& sliceType,
201 const bool& usePolar,
203 const bool& useNormalization,
204 const bool& useRadiusNormalization,
205 const bool& hideNegativeLobes );
240 std::shared_ptr< WDataSetSphericalHarmonics >
m_dataSet;
242 std::shared_ptr< WGridRegular3D >
m_grid;
This class actually generated the glyph geometry.
~GlyphGeneration()
Destructor freeing the data.
size_t m_sliceId
Stores option from property.
bool m_useNormalization
Stores option from property.
osg::ref_ptr< osg::Vec3Array > m_normals
Normals of the vertices of the glyphs.
size_t m_sliceType
Stores option from property.
size_t m_nB
Internal variable holding the number of glyphs in the second direction of the slice.
size_t m_nY
Number of voxels in y direction.
osg::ref_ptr< osg::DrawElementsUInt > m_glyphElements
Indices of the vertices of the triangles of the glyphs.
size_t m_nZ
Number of voxels in z direction.
osg::ref_ptr< osg::Geode > getGraphics()
Get the geode of the computed glyphs.
limnPolyData * m_sphere
The geometry of the subdivided icosahedron.
osg::ref_ptr< osg::Vec4Array > m_colors
Colors of the vertices of the glyphs.
std::shared_ptr< WDataSetSphericalHarmonics > m_dataSet
Pointer to the treated data set.
bool m_usePolar
Stores option from property.
size_t m_nA
Internal variable holding the number of glyphs in the first direction of the slice.
std::shared_ptr< WDataSetScalar > m_dataGFA
Pointer to possible GFA data set.
std::shared_ptr< WGridRegular3D > m_grid
Pointer to the grid of the treated data set.
float m_scale
Stores option from property.
double m_thresholdGFA
Stores the GFA threshold from the property.
size_t m_subdivisionLevel
Store option from property.
GlyphGeneration(std::shared_ptr< WDataSetSphericalHarmonics > dataSet, std::shared_ptr< WDataSetScalar > dataGFA, double thresholdGFA, const size_t &sliceId, const size_t &order, const size_t &subdivisionLevel, const size_t &modulo, const size_t &sliceType, const bool &usePolar, const float &scale, const bool &useNormalization, const bool &useRadiusNormalization, const bool &hideNegativeLobes)
Constructor setting the data pointers and the properties from the module.
void minMaxNormalization(limnPolyData *glyph, const size_t &nbVertCoords)
Makes the radii of the glyph be distributed between [0,1].
bool m_hideNegativeLobes
Stores option from property.
size_t m_nX
Number of voxels in x direction.
size_t m_modulo
Store option from property.
size_t m_order
Stores option from property.
void operator()(size_t id, size_t numThreads, WBoolFlag &b)
Computes the glyphs.
bool m_useRadiusNormalization
Stores option from property.
osg::ref_ptr< osg::Vec3Array > m_vertArray
Vertices of the triangles of the glyphs.
Spherical harmonics glyphs using teem (http://teem.sourceforge.net/).
std::shared_ptr< WCondition > m_exceptionCondition
condition indicating if any exception was thrown.
virtual const std::string getName() const
Gives back the name of this module.
WPropSelection m_sliceOrientationSelectionProp
To choose whether to x, y or z slice.
WPropInt m_subdivisionLevelProp
Property holding information on the subdivision level of the spheres (resolution).
void handleException(WException const &e)
Handle an exception that was thrown by the threaded function in any worker thread.
osg::ref_ptr< WGEGroupNode > m_moduleNode
Pointer to the modules group node.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
void execute()
Just a preliminary function to avoid polluting moduleMain()
std::shared_ptr< WException > m_lastException
The last exception thrown by any worker thread.
std::shared_ptr< WItemSelection > m_orders
A list of the selectable orders.
std::shared_ptr< WModuleInputData< WDataSetSphericalHarmonics > > m_input
An input connector that accepts spherical harmonics datasets.
virtual void connectors()
Initialize the connectors this module is using.
WPropBool m_hideNegativeLobesProp
Indicates whether to hide negativ radius lobes of glyphs.
virtual const std::string getDescription() const
Gives back a description of this module.
std::shared_ptr< WModuleInputData< WDataSetScalar > > m_inputGFA
The input for the GFA.
WPropSelection m_orderProp
Property holding the order of the SH to show.
std::shared_ptr< WItemSelection > m_sliceOrientations
A list of the selectable slice orientations, i.e x, y and z.
virtual void properties()
Initialize the properties for this module.
std::shared_ptr< WCondition > m_recompute
This condition denotes whether we need to recompute the surface.
void activate()
Gets signaled from the properties object when something was changed.
WPropInt m_moduloProp
Property holding information on how many glyphs will be omited between two glyphs (modulo-1).
osg::ref_ptr< osg::Geode > m_glyphsGeode
Pointer to geode containing the glyphs.
osg::ref_ptr< WGEShader > m_shader
The shader used for the glyph surfaces.
WPropDouble m_GFAThresholdProp
Property holding the threshold of GFA above which glyphs should be drawn.
WMTeemGlyphs()
Nothing special with this constructor.
WPropDouble m_glyphSizeProp
Property holding the size of the displayed glyphs.
WPropBool m_useRadiusNormalizationProp
Indicates whether to use radius normalization.
boost::mutex m_moduleNodeLock
Lock to prevent concurrent threads trying access m_moduleNode.
void renderSlice(size_t sliceId)
Renders all glyphs for the given slice.
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...
WPropBool m_usePolarPlotProp
Property indicating whether to use polar plot instead of HOME glyph.
WPropBool m_useNormalizationProp
Indicates whether to use min max normalization.
virtual void moduleMain()
Entry point after loading the module.
virtual ~WMTeemGlyphs()
Nothing special with this constructor.
std::shared_ptr< WDataSetSphericalHarmonics > m_dataSet
Pointer to the treated data set.
WPropInt m_sliceIdProp
Property holding the slice ID.
Class representing a single module of OpenWalnut.