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
43d8d90a
Commit
43d8d90a
authored
May 09, 2011
by
reichenbach
Browse files
[CHANGE] adapted MRI viewer to new colo mapping
[FIX] WMData colormapping issue
parent
a03ed39a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
18 deletions
+20
-18
src/kernel/modules/data/WMData.cpp
src/kernel/modules/data/WMData.cpp
+1
-1
src/modules/functionalMRIViewer/WMFunctionalMRIViewer.cpp
src/modules/functionalMRIViewer/WMFunctionalMRIViewer.cpp
+19
-17
No files found.
src/kernel/modules/data/WMData.cpp
View file @
43d8d90a
...
...
@@ -320,7 +320,7 @@ void WMData::moduleMain()
// remove dataset from datahandler
if
(
m_dataSet
->
isTexture
()
)
{
//
m_properties->removeProperty( m_dataSet->getTexture2()->getProperties() );
m_properties
->
removeProperty
(
m_dataSet
->
getTexture2
()
->
getProperties
()
);
m_infoProperties
->
removeProperty
(
m_dataSet
->
getTexture2
()
->
getInformationProperties
()
);
WGEColormapping
::
deregisterTexture
(
m_dataSet
->
getTexture2
()
);
}
...
...
src/modules/functionalMRIViewer/WMFunctionalMRIViewer.cpp
View file @
43d8d90a
...
...
@@ -113,41 +113,43 @@ void WMFunctionalMRIViewer::moduleMain()
// remove old texture
if
(
m_dataSetAtTime
)
{
WDataHandler
::
deregisterDataSet
(
m_dataSetAtTime
);
m_dataSetAtTime
=
boost
::
shared_ptr
<
WDataSetScalar
>
();
m_properties
->
removeProperty
(
m_dataSetAtTime
->
getTexture2
()
->
getProperties
()
);
m_infoProperties
->
removeProperty
(
m_dataSetAtTime
->
getTexture2
()
->
getInformationProperties
()
);
WGEColormapping
::
deregisterTexture
(
m_dataSetAtTime
->
getTexture2
()
);
m_dataSetAtTime
.
reset
();
}
m_dataSet
=
inData
;
m_time
->
setMin
(
m_dataSet
->
getMinTime
()
);
m_time
->
setMax
(
m_dataSet
->
getMaxTime
()
);
m_time
->
ensureValidity
(
m_dataSet
->
getMinTime
()
);
float
time
=
m_time
->
get
(
true
);
if
(
m_dataSetAtTime
)
{
WDataHandler
::
deregisterDataSet
(
m_dataSetAtTime
);
}
std
::
stringstream
s
;
s
<<
m_dataSet
->
getFileName
()
<<
"_time"
<<
time
;
boost
::
shared_ptr
<
WDataSetScalar
const
>
ds
=
m_dataSet
->
calcDataSetAtTime
(
time
,
s
.
str
()
);
// get rid of the const
m_dataSetAtTime
=
boost
::
shared_ptr
<
WDataSetScalar
>
(
new
WDataSetScalar
(
ds
->
getValueSet
(),
ds
->
getGrid
()
)
);
if
(
m_texScaleNormalized
->
get
(
true
)
)
if
(
m_dataSetAtTime
)
{
// { TODO(ebaum): this is deprecated and will be replaced by WGEColormapping
m_dataSetAtTime
->
getTexture
()
->
setMinValue
(
static_cast
<
float
>
(
m_dataSet
->
getMinValue
()
)
);
m_dataSetAtTime
->
getTexture
()
->
setMaxValue
(
static_cast
<
float
>
(
m_dataSet
->
getMaxValue
()
)
);
// }
m_dataSetAtTime
->
getTexture2
()
->
minimum
()
->
set
(
static_cast
<
float
>
(
m_dataSet
->
getMinValue
()
)
);
m_dataSetAtTime
->
getTexture2
()
->
scale
()
->
set
(
static_cast
<
float
>
(
m_dataSet
->
getMaxValue
()
-
m_dataSet
->
getMinValue
()
)
);
WGEColormapping
::
registerTexture
(
m_dataSetAtTime
->
getTexture2
(),
s
.
str
()
);
m_properties
->
addProperty
(
m_dataSetAtTime
->
getTexture2
()
->
getProperties
()
);
m_infoProperties
->
addProperty
(
m_dataSetAtTime
->
getTexture2
()
->
getInformationProperties
()
);
if
(
m_texScaleNormalized
->
get
(
true
)
)
{
m_dataSetAtTime
->
getTexture2
()
->
minimum
()
->
set
(
static_cast
<
float
>
(
m_dataSet
->
getMinValue
()
)
);
m_dataSetAtTime
->
getTexture2
()
->
scale
()
->
set
(
static_cast
<
float
>
(
m_dataSet
->
getMaxValue
()
-
m_dataSet
->
getMinValue
()
)
);
}
}
WDataHandler
::
registerDataSet
(
m_dataSetAtTime
);
m_output
->
updateData
(
m_dataSetAtTime
);
}
}
if
(
m_dataSetAtTime
)
{
WDataHandler
::
deregisterDataSet
(
m_dataSetAtTime
);
m_dataSetAtTime
=
boost
::
shared_ptr
<
WDataSetScalar
>
();
m_properties
->
removeProperty
(
m_dataSetAtTime
->
getTexture2
()
->
getProperties
()
);
m_infoProperties
->
removeProperty
(
m_dataSetAtTime
->
getTexture2
()
->
getInformationProperties
()
);
WGEColormapping
::
deregisterTexture
(
m_dataSetAtTime
->
getTexture2
()
);
m_dataSetAtTime
.
reset
();
}
}
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