Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
f18b259c
Commit
f18b259c
authored
Oct 08, 2010
by
schurade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CHANGE] use marching lego for arbitrary rois
parent
7ad4710f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
src/graphicsEngine/WROIArbitrary.cpp
src/graphicsEngine/WROIArbitrary.cpp
+4
-8
src/modules/arbitraryRois/WMArbitraryRois.cpp
src/modules/arbitraryRois/WMArbitraryRois.cpp
+6
-7
No files found.
src/graphicsEngine/WROIArbitrary.cpp
View file @
f18b259c
...
...
@@ -30,9 +30,7 @@
#include <osg/LineWidth>
#include <osg/LightModel>
#include "../common/WProgressCombiner.h"
#include "algorithms/WMarchingCubesAlgorithm.h"
#include "algorithms/WMarchingLegoAlgorithm.h"
#include "WGraphicsEngine.h"
...
...
@@ -151,13 +149,11 @@ void WROIArbitrary::updateGFX()
{
if
(
m_dirty
->
get
()
)
{
boost
::
shared_ptr
<
WProgressCombiner
>
progress
=
boost
::
shared_ptr
<
WProgressCombiner
>
(
new
WProgressCombiner
()
);
WMarchingCubesAlgorithm
mcAlgo
;
m_triMesh
=
mcAlgo
.
generateSurface
(
m_nbCoordsVec
[
0
],
m_nbCoordsVec
[
1
],
m_nbCoordsVec
[
2
],
WMarchingLegoAlgorithm
mlAlgo
;
m_triMesh
=
mlAlgo
.
generateSurface
(
m_nbCoordsVec
[
0
],
m_nbCoordsVec
[
1
],
m_nbCoordsVec
[
2
],
m_matrix
,
&
m_vals
,
m_threshold
->
get
(),
progress
);
m_threshold
->
get
()
);
osg
::
Geometry
*
surfaceGeometry
=
new
osg
::
Geometry
();
setName
(
"roi"
);
...
...
src/modules/arbitraryRois/WMArbitraryRois.cpp
View file @
f18b259c
...
...
@@ -40,7 +40,7 @@
#include "../../graphicsEngine/WROIArbitrary.h"
#include "../../graphicsEngine/WROIBox.h"
#include "../../graphicsEngine/algorithms/WMarching
Cubes
Algorithm.h"
#include "../../graphicsEngine/algorithms/WMarching
Lego
Algorithm.h"
#include "WMArbitraryRois.h"
#include "WMArbitraryRois.xpm"
...
...
@@ -104,7 +104,7 @@ void WMArbitraryRois::properties()
m_propCondition
=
boost
::
shared_ptr
<
WCondition
>
(
new
WCondition
()
);
m_finalizeTrigger
=
m_properties
->
addProperty
(
"Finalize"
,
"Finalize and add to ROI manager"
,
WPVBaseTypes
::
PV_TRIGGER_READY
,
m_propCondition
);
m_threshold
=
m_properties
->
addProperty
(
"Threshold"
,
""
,
0.
,
m_propCondition
);
m_threshold
=
m_properties
->
addProperty
(
"Threshold"
,
""
,
1.0
,
m_propCondition
);
m_surfaceColor
=
m_properties
->
addProperty
(
"Surface color"
,
""
,
WColor
(
1.0
,
0.3
,
0.3
,
1.0
),
m_propCondition
);
WModule
::
properties
();
...
...
@@ -138,7 +138,7 @@ void WMArbitraryRois::moduleMain()
m_threshold
->
setMin
(
m_dataSet
->
getMin
()
);
m_threshold
->
setMax
(
m_dataSet
->
getMax
()
);
m_threshold
->
set
(
0.
);
m_threshold
->
set
(
(
m_dataSet
->
getMax
()
-
m_dataSet
->
getMin
()
)
/
2.0
);
initSelectionRoi
();
}
...
...
@@ -240,12 +240,11 @@ void WMArbitraryRois::createCutDataset()
WAssert
(
false
,
"Unknown data type in MarchingCubes module"
);
}
m_newValueSet
=
boost
::
shared_ptr
<
WValueSet
<
float
>
>
(
new
WValueSet
<
float
>
(
order
,
vDim
,
data
,
W_DT_FLOAT
)
);
WMarching
CubesAlgorithm
mc
Algo
;
m_triMesh
=
m
c
Algo
.
generateSurface
(
grid
->
getNbCoordsX
(),
grid
->
getNbCoordsY
(),
grid
->
getNbCoordsZ
(),
WMarching
LegoAlgorithm
ml
Algo
;
m_triMesh
=
m
l
Algo
.
generateSurface
(
grid
->
getNbCoordsX
(),
grid
->
getNbCoordsY
(),
grid
->
getNbCoordsZ
(),
grid
->
getTransformationMatrix
(),
m_newValueSet
->
rawDataVectorPointer
(),
threshold
,
m_progress
);
threshold
);
}
template
<
typename
T
>
std
::
vector
<
float
>
WMArbitraryRois
::
cutArea
(
boost
::
shared_ptr
<
WGrid
>
inGrid
,
boost
::
shared_ptr
<
WValueSet
<
T
>
>
vals
)
...
...
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