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
ba391d49
Commit
ba391d49
authored
Mar 19, 2013
by
Stefan Philips
Browse files
[ADD] Threshold parameters for CSA reconstruction as module propoerties
parent
441da628
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
10 deletions
+43
-10
src/modules/HARDIToSphericalHarmonics/WMHARDIToSphericalHarmonics.cpp
...HARDIToSphericalHarmonics/WMHARDIToSphericalHarmonics.cpp
+20
-0
src/modules/HARDIToSphericalHarmonics/WMHARDIToSphericalHarmonics.h
...s/HARDIToSphericalHarmonics/WMHARDIToSphericalHarmonics.h
+3
-0
src/modules/HARDIToSphericalHarmonics/WSphericalHarmonicsCoefficientsThread.h
...phericalHarmonics/WSphericalHarmonicsCoefficientsThread.h
+20
-10
No files found.
src/modules/HARDIToSphericalHarmonics/WMHARDIToSphericalHarmonics.cpp
View file @
ba391d49
...
...
@@ -120,6 +120,8 @@ void WMHARDIToSphericalHarmonics::moduleMain()
m_doErrorCalculation
->
setHidden
(
false
);
m_doResidualCalculation
->
setHidden
(
false
);
m_doNormalisation
->
setHidden
(
false
);
m_CSADelta1
->
setHidden
();
m_CSADelta2
->
setHidden
();
reconstructionType
=
DEFAULT
;
break
;
case
1
:
...
...
@@ -127,6 +129,8 @@ void WMHARDIToSphericalHarmonics::moduleMain()
m_doErrorCalculation
->
setHidden
();
m_doResidualCalculation
->
setHidden
();
m_doNormalisation
->
setHidden
();
m_CSADelta1
->
setHidden
(
false
);
m_CSADelta2
->
setHidden
(
false
);
reconstructionType
=
CSA
;
break
;
}
...
...
@@ -215,6 +219,8 @@ void WMHARDIToSphericalHarmonics::moduleMain()
parameter
.
m_doErrorCalculation
=
false
;
parameter
.
m_normalize
=
false
;
parameter
.
m_doFunkRadonTransformation
=
false
;
parameter
.
m_CSADelta1
=
m_CSADelta1
->
get
(
true
);
parameter
.
m_CSADelta2
=
m_CSADelta2
->
get
(
true
);
transformMatrix
=
WSymmetricSphericalHarmonic
::
getSHFittingMatrixForConstantSolidAngle
(
gradients
,
order
,
m_regularisationFactorLambda
->
get
(
true
)
);
...
...
@@ -320,6 +326,20 @@ void WMHARDIToSphericalHarmonics::properties()
false
,
m_propCondition
);
m_CSADelta1
=
m_properties
->
addProperty
(
"delta 1"
,
"delta1 threshold"
,
0.01
,
m_propCondition
);
m_CSADelta1
->
setMin
(
0.0
);
m_CSADelta1
->
setMax
(
1.0
);
m_CSADelta2
=
m_properties
->
addProperty
(
"delta 2"
,
"delta2 threshold"
,
0.01
,
m_propCondition
);
m_CSADelta2
->
setMin
(
0.0
);
m_CSADelta2
->
setMax
(
1.0
);
// vista-daten
// order Gesamtfehler
// 0 8,7%
...
...
src/modules/HARDIToSphericalHarmonics/WMHARDIToSphericalHarmonics.h
View file @
ba391d49
...
...
@@ -141,6 +141,9 @@ private:
*/
WPropBool
m_doNormalisation
;
WPropDouble
m_CSADelta1
;
//!< Delta1 value for the constant solid angle reconstruction.
WPropDouble
m_CSADelta2
;
//!< Delta2 value for the constant solid angle reconstruction.
/**
* This is a pointer to the dataset the module is currently working on.
*/
...
...
src/modules/HARDIToSphericalHarmonics/WSphericalHarmonicsCoefficientsThread.h
View file @
ba391d49
...
...
@@ -68,7 +68,9 @@ public:
* \param flag A reference to a shutdown flag that we should listen to.
*/
ThreadParameter
(
WBoolFlag
const
&
flag
)
// NOLINT no explicit
:
m_shutdownFlag
(
flag
)
:
m_CSADelta1
(
0.01
),
m_CSADelta2
(
0.01
),
m_shutdownFlag
(
flag
)
{
}
...
...
@@ -149,6 +151,16 @@ public:
*/
bool
m_csa
;
/**
* Delta1 value for the constant solid angle reconstruction.
*/
double
m_CSADelta1
;
/**
* Delta2 value for the constant solid angle reconstruction.
*/
double
m_CSADelta2
;
/**
* A shutdownFlag that may tell the thread to stop.
*/
...
...
@@ -244,28 +256,26 @@ void WSphericalHarmonicsCoefficientsThread< T >::threadMain()
// double minVal = 1e99;
// double maxVal = -1e99;
double
thresholdDelta1
=
0.01
;
double
thresholdDelta2
=
0.01
;
for
(
std
::
vector
<
size_t
>::
const_iterator
it
=
m_parameter
.
m_validIndices
.
begin
();
it
!=
m_parameter
.
m_validIndices
.
end
();
it
++
,
idx
++
)
{
if
(
m_parameter
.
m_csa
)
{
double
val
=
static_cast
<
double
>
(
allMeasures
[
*
it
]
)
/
S0avg
;
if
(
val
<
0.0
)
if
(
val
<
0.0
)
{
val
=
threshold
Delta1
/
2.0
;
val
=
m_parameter
.
m_CSA
Delta1
/
2.0
;
}
else
if
(
val
<
threshold
Delta1
)
else
if
(
val
<
m_parameter
.
m_CSA
Delta1
)
{
val
=
threshold
Delta1
/
2.0
+
val
*
val
/
(
2.0
*
threshold
Delta1
);
val
=
m_parameter
.
m_CSA
Delta1
/
2.0
+
val
*
val
/
(
2.0
*
m_parameter
.
m_CSA
Delta1
);
}
else
if
(
val
>
1.0
-
threshold
Delta2
&&
val
<
1.0
)
else
if
(
val
>
1.0
-
m_parameter
.
m_CSA
Delta2
&&
val
<
1.0
)
{
val
=
1.0
-
threshold
Delta2
/
2.0
-
std
::
pow
(
1.0
-
val
,
2
)
/
(
2.0
*
threshold
Delta2
);
val
=
1.0
-
m_parameter
.
m_CSA
Delta2
/
2.0
-
std
::
pow
(
1.0
-
val
,
2
)
/
(
2.0
*
m_parameter
.
m_CSA
Delta2
);
}
else
if
(
val
>=
1.0
)
{
val
=
1.0
-
threshold
Delta2
/
2.0
;
val
=
1.0
-
m_parameter
.
m_CSA
Delta2
/
2.0
;
}
measures
[
idx
]
=
std
::
log
(
-
std
::
log
(
val
)
);
}
...
...
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