Commit c07d1aaf authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[CHANGE #453] order is a selector now

parent fd00ca8d
...@@ -158,19 +158,27 @@ void WMTeemGlyphs::properties() ...@@ -158,19 +158,27 @@ void WMTeemGlyphs::properties()
m_sliceOrientations->addItem( "x", "x-slice" ); m_sliceOrientations->addItem( "x", "x-slice" );
m_sliceOrientations->addItem( "y", "y-slice" ); m_sliceOrientations->addItem( "y", "y-slice" );
m_sliceOrientations->addItem( "z", "z-slice" ); m_sliceOrientations->addItem( "z", "z-slice" );
m_sliceOrientationSelection = m_properties->addProperty( "Slice orientation", m_sliceOrientationSelectionProp = m_properties->addProperty( "Slice orientation",
"Which slice will be shown?", "Which slice will be shown?",
m_sliceOrientations->getSelector( 1 ), m_sliceOrientations->getSelector( 1 ),
m_recompute ); m_recompute );
WPropertyHelper::PC_SELECTONLYONE::addTo( m_sliceOrientationSelection ); WPropertyHelper::PC_SELECTONLYONE::addTo( m_sliceOrientationSelectionProp );
m_sliceIdProp = m_properties->addProperty( "Slice ID", "Number of the slice to display", 100, m_recompute ); m_sliceIdProp = m_properties->addProperty( "Slice ID", "Number of the slice to display", 100, m_recompute );
m_sliceIdProp->setMin( 0 ); m_sliceIdProp->setMin( 0 );
m_sliceIdProp->setMax( 128 ); m_sliceIdProp->setMax( 128 );
m_orderProp = m_properties->addProperty( "Order", "Will be rounded to the next even order", 4, m_recompute ); m_orders = boost::shared_ptr< WItemSelection >( new WItemSelection() );
m_orderProp->setMin( 2 ); m_orders->addItem( "2", "Order 2" );
m_orderProp->setMax( 6 ); m_orders->addItem( "4", "Order 4" );
m_orders->addItem( "6", "Order 6" );
m_orderProp = m_properties->addProperty( "Order",
"Order of the displayed spherical harmonics."
" If actual order is higer, the additional coefficients are ignored.",
m_orders->getSelector( 1 ),
m_recompute );
WPropertyHelper::PC_SELECTONLYONE::addTo( m_orderProp );
m_GFAThresholdProp = m_properties->addProperty( "GFA threshold", "Show only glyphs at voxels above the given generalized fractional" m_GFAThresholdProp = m_properties->addProperty( "GFA threshold", "Show only glyphs at voxels above the given generalized fractional"
" anisotropy (GFA) threshold" " anisotropy (GFA) threshold"
...@@ -222,6 +230,7 @@ void WMTeemGlyphs::moduleMain() ...@@ -222,6 +230,7 @@ void WMTeemGlyphs::moduleMain()
m_moduleState.wait(); m_moduleState.wait();
continue; continue;
} }
// std::cout << "FA: " << m_GFAThresholdProp->get( true ) << std::endl;
if( m_input->getData().get() ) if( m_input->getData().get() )
{ {
bool dataChanged = false; bool dataChanged = false;
...@@ -233,7 +242,7 @@ void WMTeemGlyphs::moduleMain() ...@@ -233,7 +242,7 @@ void WMTeemGlyphs::moduleMain()
} }
boost::shared_ptr< WGridRegular3D > gridReg = boost::shared_dynamic_cast< WGridRegular3D >( m_input->getData().get()->getGrid() ); boost::shared_ptr< WGridRegular3D > gridReg = boost::shared_dynamic_cast< WGridRegular3D >( m_input->getData().get()->getGrid() );
switch( m_sliceOrientationSelection->get( true ).getItemIndexOfSelected( 0 ) ) switch( m_sliceOrientationSelectionProp->get( true ).getItemIndexOfSelected( 0 ) )
{ {
case 0: case 0:
m_sliceIdProp->setMax( gridReg->getNbCoordsX() - 1 ); m_sliceIdProp->setMax( gridReg->getNbCoordsX() - 1 );
...@@ -258,11 +267,6 @@ void WMTeemGlyphs::moduleMain() ...@@ -258,11 +267,6 @@ void WMTeemGlyphs::moduleMain()
m_GFAThresholdProp->setMin( gfa->getMin() ); m_GFAThresholdProp->setMin( gfa->getMin() );
} }
if( m_orderProp->get() % 2 != 0 )
{
m_orderProp->set( m_orderProp->get() + 1 );
}
renderSlice( m_sliceIdProp->get() ); renderSlice( m_sliceIdProp->get() );
} }
...@@ -277,7 +281,8 @@ void WMTeemGlyphs::renderSlice( size_t sliceId ) ...@@ -277,7 +281,8 @@ void WMTeemGlyphs::renderSlice( size_t sliceId )
progress = boost::shared_ptr< WProgress >( new WProgress( "Glyph Generation", 2 ) ); progress = boost::shared_ptr< WProgress >( new WProgress( "Glyph Generation", 2 ) );
m_progress->addSubProgress( progress ); m_progress->addSubProgress( progress );
size_t sliceType = m_sliceOrientationSelection->get( true ).getItemIndexOfSelected( 0 ); size_t sliceType = m_sliceOrientationSelectionProp->get( true ).getItemIndexOfSelected( 0 );
size_t order = boost::lexical_cast< float >( m_orders->getSelector( m_orderProp->get().getItemIndexOfSelected( 0 ) ) .at( 0 )->getName() );
// Please look here http://www.ci.uchicago.edu/~schultz/sphinx/home-glyph.htm // Please look here http://www.ci.uchicago.edu/~schultz/sphinx/home-glyph.htm
if( m_moduleNode ) if( m_moduleNode )
...@@ -293,7 +298,7 @@ void WMTeemGlyphs::renderSlice( size_t sliceId ) ...@@ -293,7 +298,7 @@ void WMTeemGlyphs::renderSlice( size_t sliceId )
boost::shared_dynamic_cast< WDataSetScalar >( m_inputGFA->getData() ), boost::shared_dynamic_cast< WDataSetScalar >( m_inputGFA->getData() ),
m_GFAThresholdProp->get(), m_GFAThresholdProp->get(),
sliceId, sliceId,
m_orderProp->get(), order,
m_subdivisionLevelProp->get(), m_subdivisionLevelProp->get(),
m_moduloProp->get(), m_moduloProp->get(),
sliceType, sliceType,
......
...@@ -29,8 +29,10 @@ ...@@ -29,8 +29,10 @@
#include <osg/Geode> #include <osg/Geode>
#include "../../dataHandler/WDataSetSphericalHarmonics.h" #include "../../common/WItemSelection.h"
#include "../../common/WItemSelector.h"
#include "../../dataHandler/WDataSetScalar.h" #include "../../dataHandler/WDataSetScalar.h"
#include "../../dataHandler/WDataSetSphericalHarmonics.h"
#include "../../graphicsEngine/WShader.h" #include "../../graphicsEngine/WShader.h"
#include "../../kernel/WModule.h" #include "../../kernel/WModule.h"
#include "../../kernel/WModuleInputData.h" #include "../../kernel/WModuleInputData.h"
...@@ -134,13 +136,15 @@ private: ...@@ -134,13 +136,15 @@ private:
boost::shared_ptr< WModuleInputData< WDataSetScalar > > m_inputGFA; //!< The input for the GFA. boost::shared_ptr< WModuleInputData< WDataSetScalar > > m_inputGFA; //!< The input for the GFA.
osg::ref_ptr< WShader > m_shader; //!< The shader used for the glyph surfaces osg::ref_ptr< WShader > m_shader; //!< The shader used for the glyph surfaces
boost::shared_ptr< WItemSelection > m_sliceOrientations; //!< A list of the selectable slice orientations, i.e x, y and z. boost::shared_ptr< WItemSelection > m_sliceOrientations; //!< A list of the selectable slice orientations, i.e x, y and z.
WPropSelection m_sliceOrientationSelection; //!< To choose whether to x, y or z slice. WPropSelection m_sliceOrientationSelectionProp; //!< To choose whether to x, y or z slice.
WPropBool m_usePolarPlotProp; //!< Property indicating whether to use polar plot instead of HOME glyph WPropBool m_usePolarPlotProp; //!< Property indicating whether to use polar plot instead of HOME glyph
WPropBool m_useNormalizationProp; //!< Indicates whether to us radius normalization. WPropBool m_useNormalizationProp; //!< Indicates whether to us radius normalization.
WPropDouble m_GFAThresholdProp; //!< Property holding the threshold of GFA above which glyphs should be drawn. WPropDouble m_GFAThresholdProp; //!< Property holding the threshold of GFA above which glyphs should be drawn.
WPropDouble m_glyphSizeProp; //!< Property holding the size of the displayed glyphs WPropDouble m_glyphSizeProp; //!< Property holding the size of the displayed glyphs
WPropInt m_sliceIdProp; //!< Property holding the slice ID WPropInt m_sliceIdProp; //!< Property holding the slice ID
WPropInt m_orderProp; //!< Property holding the order of the SH to show. boost::shared_ptr< WItemSelection > m_orders; //!< A list of the selectable orders
WPropSelection m_orderProp; //!< Property holding the order of the SH to show.
WPropInt m_moduloProp; //!< Property holding information on how many glyphs will be omited between two glyphs (modulo-1). WPropInt m_moduloProp; //!< Property holding information on how many glyphs will be omited between two glyphs (modulo-1).
WPropInt m_subdivisionLevelProp; //!< Property holding information on the subdivision level of the spheres (resolution). WPropInt m_subdivisionLevelProp; //!< Property holding information on the subdivision level of the spheres (resolution).
......
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