Commit 264447dd authored by Mathias Goldau's avatar Mathias Goldau

[CHANGE] Renamed connector variables and identifiers to a standard scheme.

parent d11d80d9
...@@ -72,22 +72,22 @@ const char** WMDetTractCulling::getXPMIcon() const ...@@ -72,22 +72,22 @@ const char** WMDetTractCulling::getXPMIcon() const
void WMDetTractCulling::moduleMain() void WMDetTractCulling::moduleMain()
{ {
m_moduleState.setResetable( true, true ); // remember actions when actually not waiting for actions m_moduleState.setResetable( true, true ); // remember actions when actually not waiting for actions
m_moduleState.add( m_tractInput->getDataChangedCondition() ); m_moduleState.add( m_tractIC->getDataChangedCondition() );
m_moduleState.add( m_recompute ); m_moduleState.add( m_recompute );
ready(); ready();
while( !m_shutdownFlag() ) // loop until the module container requests the module to quit while( !m_shutdownFlag() ) // loop until the module container requests the module to quit
{ {
if( !m_tractInput->getData().get() ) // ok, the output has not yet sent data if( !m_tractIC->getData().get() ) // ok, the output has not yet sent data
{ {
m_moduleState.wait(); m_moduleState.wait();
continue; continue;
} }
if( m_rawDataset != m_tractInput->getData() ) // in case data has changed if( m_rawDataset != m_tractIC->getData() ) // in case data has changed
{ {
m_rawDataset = m_tractInput->getData(); m_rawDataset = m_tractIC->getData();
boost::shared_ptr< WProgress > convertProgress( new WProgress( "Converting tracts", 1 ) ); boost::shared_ptr< WProgress > convertProgress( new WProgress( "Converting tracts", 1 ) );
m_progress->addSubProgress( convertProgress ); m_progress->addSubProgress( convertProgress );
m_dataset = boost::shared_ptr< WDataSetFiberVector >( new WDataSetFiberVector( m_rawDataset ) ); m_dataset = boost::shared_ptr< WDataSetFiberVector >( new WDataSetFiberVector( m_rawDataset ) );
...@@ -114,8 +114,8 @@ void WMDetTractCulling::moduleMain() ...@@ -114,8 +114,8 @@ void WMDetTractCulling::moduleMain()
void WMDetTractCulling::connectors() void WMDetTractCulling::connectors()
{ {
m_tractInput = WModuleInputData< WDataSetFibers >::createAndAdd( shared_from_this(), "tractInput", "A loaded tract dataset." ); m_tractIC = WModuleInputData< WDataSetFibers >::createAndAdd( shared_from_this(), "tractInput", "A loaded tract dataset." );
m_output = WModuleOutputData< WDataSetFibers >::createAndAdd( shared_from_this(), "tractOutput", "The tracts that survied culling." ); m_tractOC = WModuleOutputData< WDataSetFibers >::createAndAdd( shared_from_this(), "tractOutput", "The tracts that survied culling." );
WModule::connectors(); // call WModules initialization WModule::connectors(); // call WModules initialization
} }
...@@ -202,10 +202,10 @@ void WMDetTractCulling::saveGainedTracts( const std::vector< bool >& unusedTract ...@@ -202,10 +202,10 @@ void WMDetTractCulling::saveGainedTracts( const std::vector< bool >& unusedTract
boost::shared_ptr< WProgress > eraseProgress( new WProgress( "Erasing tracts", unusedTracts.size() ) ); boost::shared_ptr< WProgress > eraseProgress( new WProgress( "Erasing tracts", unusedTracts.size() ) );
m_progress->addSubProgress( eraseProgress ); m_progress->addSubProgress( eraseProgress );
boost::shared_ptr< const WDataSetFiberVector > result = m_dataset->generateDataSetOutOfUsedFibers( unusedTracts ); boost::shared_ptr< const WDataSetFiberVector > result = m_dataset->generateDataSetOutOfUsedFibers( unusedTracts );
m_output->updateData( result->toWDataSetFibers() ); m_tractOC->updateData( result->toWDataSetFibers() );
eraseProgress->finish(); eraseProgress->finish();
m_numRemovedTracts->set( unusedTracts.size() - m_output->getData()->size() ); m_numRemovedTracts->set( unusedTracts.size() - m_tractOC->getData()->size() );
boost::shared_ptr< WProgress > saveProgress( new WProgress( "Saving tracts", unusedTracts.size() ) ); boost::shared_ptr< WProgress > saveProgress( new WProgress( "Saving tracts", unusedTracts.size() ) );
m_progress->addSubProgress( saveProgress ); m_progress->addSubProgress( saveProgress );
......
...@@ -126,20 +126,66 @@ protected: ...@@ -126,20 +126,66 @@ protected:
*/ */
boost::filesystem::path saveFileName( std::string dataFileName ) const; boost::filesystem::path saveFileName( std::string dataFileName ) const;
boost::shared_ptr< WModuleInputData< WDataSetFibers > > m_tractInput; //!< Input connector for a tract dataset. /**
boost::shared_ptr< WDataSetFiberVector > m_dataset; //!< Pointer to the tract data set in WDataSetFiberVector format * Input connector for a tract dataset.
boost::shared_ptr< WDataSetFibers > m_rawDataset; //!< Pointer to the tract data set in WDataSetFibers format */
boost::shared_ptr< WModuleOutputData< WDataSetFibers > > m_output; //!< Output connector for the culled tracts boost::shared_ptr< WModuleInputData< WDataSetFibers > > m_tractIC;
boost::shared_ptr< WCondition > m_recompute; //!< A condition which indicates complete recomputation /**
* Output connector for the culled tracts
WPropDouble m_dSt_culling_t; //!< Minimum distance of two different tracts. If below, the shorter tract is culled out */
WPropDouble m_proximity_t; //!< Minimum distance of points of two tracts which should be considered boost::shared_ptr< WModuleOutputData< WDataSetFibers > > m_tractOC;
WPropBool m_saveCulledCurves; //!< If true, remaining tracts are saved to a file
WPropFilename m_savePath; //!< Path where remaining tracts should be stored /**
WPropTrigger m_run; //!< Trigger button for starting the long time consuming culling operation * Pointer to the tract data set in WDataSetFiberVector format
WPropInt m_numTracts; //!< Displays the number of tracts which are processed */
WPropInt m_numRemovedTracts; //!< Displays the number of tracts which were removed boost::shared_ptr< WDataSetFiberVector > m_dataset;
/**
* Pointer to the tract data set in WDataSetFibers format
*/
boost::shared_ptr< WDataSetFibers > m_rawDataset;
/**
* A condition which indicates complete recomputation
*/
boost::shared_ptr< WCondition > m_recompute;
/**
* Minimum distance of two different tracts. If below, the shorter tract is culled out
*/
WPropDouble m_dSt_culling_t;
/**
* Minimum distance of points of two tracts which should be considered
*/
WPropDouble m_proximity_t;
/**
* If true, remaining tracts are saved to a file
*/
WPropBool m_saveCulledCurves;
/**
* Path where remaining tracts should be stored
*/
WPropFilename m_savePath;
/**
* Trigger button for starting the long time consuming culling operation
*/
WPropTrigger m_run;
/**
* Displays the number of tracts which are processed
*/
WPropInt m_numTracts;
/**
* Displays the number of tracts which were removed
*/
WPropInt m_numRemovedTracts;
private: private:
}; };
......
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