Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
264447dd
Commit
264447dd
authored
Aug 25, 2011
by
Mathias Goldau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CHANGE] Renamed connector variables and identifiers to a standard scheme.
parent
d11d80d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
22 deletions
+68
-22
src/modules/detTractCulling/WMDetTractCulling.cpp
src/modules/detTractCulling/WMDetTractCulling.cpp
+8
-8
src/modules/detTractCulling/WMDetTractCulling.h
src/modules/detTractCulling/WMDetTractCulling.h
+60
-14
No files found.
src/modules/detTractCulling/WMDetTractCulling.cpp
View file @
264447dd
...
...
@@ -72,22 +72,22 @@ const char** WMDetTractCulling::getXPMIcon() const
void
WMDetTractCulling
::
moduleMain
()
{
m_moduleState
.
setResetable
(
true
,
true
);
// remember actions when actually not waiting for actions
m_moduleState
.
add
(
m_tractI
nput
->
getDataChangedCondition
()
);
m_moduleState
.
add
(
m_tractI
C
->
getDataChangedCondition
()
);
m_moduleState
.
add
(
m_recompute
);
ready
();
while
(
!
m_shutdownFlag
()
)
// loop until the module container requests the module to quit
{
if
(
!
m_tractI
nput
->
getData
().
get
()
)
// ok, the output has not yet sent data
if
(
!
m_tractI
C
->
getData
().
get
()
)
// ok, the output has not yet sent data
{
m_moduleState
.
wait
();
continue
;
}
if
(
m_rawDataset
!=
m_tractI
nput
->
getData
()
)
// in case data has changed
if
(
m_rawDataset
!=
m_tractI
C
->
getData
()
)
// in case data has changed
{
m_rawDataset
=
m_tractI
nput
->
getData
();
m_rawDataset
=
m_tractI
C
->
getData
();
boost
::
shared_ptr
<
WProgress
>
convertProgress
(
new
WProgress
(
"Converting tracts"
,
1
)
);
m_progress
->
addSubProgress
(
convertProgress
);
m_dataset
=
boost
::
shared_ptr
<
WDataSetFiberVector
>
(
new
WDataSetFiberVector
(
m_rawDataset
)
);
...
...
@@ -114,8 +114,8 @@ void WMDetTractCulling::moduleMain()
void
WMDetTractCulling
::
connectors
()
{
m_tractI
nput
=
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_tractI
C
=
WModuleInputData
<
WDataSetFibers
>::
createAndAdd
(
shared_from_this
(),
"tractInput"
,
"A loaded tract dataset."
);
m_
tractOC
=
WModuleOutputData
<
WDataSetFibers
>::
createAndAdd
(
shared_from_this
(),
"tractOutput"
,
"The tracts that survied culling."
);
WModule
::
connectors
();
// call WModules initialization
}
...
...
@@ -202,10 +202,10 @@ void WMDetTractCulling::saveGainedTracts( const std::vector< bool >& unusedTract
boost
::
shared_ptr
<
WProgress
>
eraseProgress
(
new
WProgress
(
"Erasing tracts"
,
unusedTracts
.
size
()
)
);
m_progress
->
addSubProgress
(
eraseProgress
);
boost
::
shared_ptr
<
const
WDataSetFiberVector
>
result
=
m_dataset
->
generateDataSetOutOfUsedFibers
(
unusedTracts
);
m_
output
->
updateData
(
result
->
toWDataSetFibers
()
);
m_
tractOC
->
updateData
(
result
->
toWDataSetFibers
()
);
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
()
)
);
m_progress
->
addSubProgress
(
saveProgress
);
...
...
src/modules/detTractCulling/WMDetTractCulling.h
View file @
264447dd
...
...
@@ -126,20 +126,66 @@ protected:
*/
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
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
<
WCondition
>
m_recompute
;
//!< A condition which indicates complete recomputation
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
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
WPropInt
m_numTracts
;
//!< Displays the number of tracts which are processed
WPropInt
m_numRemovedTracts
;
//!< Displays the number of tracts which were removed
/**
* Input connector for a tract dataset.
*/
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetFibers
>
>
m_tractIC
;
/**
* Output connector for the culled tracts
*/
boost
::
shared_ptr
<
WModuleOutputData
<
WDataSetFibers
>
>
m_tractOC
;
/**
* Pointer to the tract data set in WDataSetFiberVector format
*/
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:
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment