Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
86eec83b
Commit
86eec83b
authored
May 13, 2012
by
Alexander Wiebel
Browse files
[ADD
#163
] allow to change ROI size interactively
parent
ee419067
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
src/modules/eegView/WMEEGView.cpp
src/modules/eegView/WMEEGView.cpp
+17
-8
src/modules/eegView/WMEEGView.h
src/modules/eegView/WMEEGView.h
+5
-0
No files found.
src/modules/eegView/WMEEGView.cpp
View file @
86eec83b
...
...
@@ -128,7 +128,12 @@ void WMEEGView::properties()
"Overlay all curves in one row."
,
false
,
m_propCondition
);
m_ROIsize
=
m_properties
->
addProperty
(
"ROI size"
,
"The width ROI box."
,
10.0
,
m_propCondition
);
m_ROIsize
->
setMin
(
0.0
);
m_ROIsize
->
setMax
(
50.0
);
m_appearanceGroup
=
m_properties
->
addPropertyGroup
(
"Appearance"
,
...
...
@@ -214,6 +219,7 @@ void WMEEGView::moduleMain()
createColorMap
();
m_ROIsize
->
get
(
true
);
// reset changed state
// signal ready
ready
();
...
...
@@ -291,7 +297,8 @@ void WMEEGView::moduleMain()
// event position changed?
boost
::
shared_ptr
<
WEEGEvent
>
event
=
m_event
->
get
();
if
(
event
&&
event
->
getTime
()
!=
m_currentEventTime
)
if
(
(
event
&&
event
->
getTime
()
!=
m_currentEventTime
)
||
m_ROIsize
->
changed
()
)
{
debugLog
()
<<
"New event position: "
<<
event
->
getTime
();
...
...
@@ -305,17 +312,19 @@ void WMEEGView::moduleMain()
if
(
m_proofOfConcept
->
get
()
)
{
WPosition
position
=
m_sourceCalculator
->
calculate
(
event
);
m_roi
=
new
WROIBox
(
position
-
WVector3d
(
5.0
,
5.0
,
5.0
),
position
+
WVector3d
(
5.0
,
5.0
,
5.0
)
);
float
halfWidth
=
m_ROIsize
->
get
(
true
)
*
0.5
;
m_roi
=
new
WROIBox
(
position
-
WVector3d
(
halfWidth
,
halfWidth
,
halfWidth
),
position
+
WVector3d
(
halfWidth
,
halfWidth
,
halfWidth
)
);
WKernel
::
getRunningKernel
()
->
getRoiManager
()
->
addRoi
(
m_roi
);
}
else
if
(
m_dipoles
->
getData
()
)
{
if
(
m_dipoles
->
getData
()
->
getMagnitude
(
event
->
getTime
()
)
!=
0
)
{
float
halfWidth
=
m_ROIsize
->
get
(
true
)
*
0.5
;
WPosition
position
=
m_dipoles
->
getData
()
->
getPosition
();
m_roi
=
new
WROIBox
(
position
-
WVector3d
(
5.0
,
5.0
,
5.0
),
position
+
WVector3d
(
5.0
,
5.0
,
5.0
)
);
m_roi
=
new
WROIBox
(
position
-
WVector3d
(
halfWidth
,
halfWidth
,
halfWidth
),
position
+
WVector3d
(
halfWidth
,
halfWidth
,
halfWidth
)
);
WKernel
::
getRunningKernel
()
->
getRoiManager
()
->
addRoi
(
m_roi
);
}
}
...
...
@@ -469,7 +478,7 @@ void WMEEGView::redraw()
if
(
m_eeg
.
get
()
&&
m_eeg
->
getNumberOfSegments
()
>
0
)
{
const
float
text2dOffset
=
2.0
f
;
const
float
text2dSize
=
3
2.0
f
;
const
float
text2dSize
=
1
2.0
f
;
const
osg
::
Vec4
text2dColor
(
0.0
,
0.0
,
0.0
,
1.0
);
const
osg
::
Vec4
linesColor
(
0.0
,
0.0
,
0.0
,
1.0
);
...
...
@@ -736,7 +745,7 @@ osg::ref_ptr< osg::Node > WMEEGView::drawLabels()
// draw electrode labels in 3d
const
float
sphereSize
=
4.0
f
;
const
osg
::
Vec3
text3dOffset
(
0.0
,
0.0
,
sphereSize
);
const
double
text3dSize
=
32
.0
;
const
double
text3dSize
=
14
.0
;
const
osg
::
Vec4
text3dColor
(
0.0
,
0.0
,
0.0
,
1.0
);
osg
::
ref_ptr
<
osg
::
Group
>
labels
(
new
osg
::
Group
);
...
...
src/modules/eegView/WMEEGView.h
View file @
86eec83b
...
...
@@ -171,6 +171,11 @@ private:
*/
WPropBool
m_butterfly
;
/**
* Size of the region of interest
*/
WPropDouble
m_ROIsize
;
/**
* the width of the label display in pixel as property
*/
...
...
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