Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
melodic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
melodic
Commits
ed7b47a5
Commit
ed7b47a5
authored
18 years ago
by
Christian Beckmann
Browse files
Options
Downloads
Patches
Plain Diff
GLM cleanup
parent
11af553f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
meldata.cc
+27
-11
27 additions, 11 deletions
meldata.cc
meloptions.h
+5
-0
5 additions, 0 deletions
meloptions.h
with
32 additions
and
11 deletions
meldata.cc
+
27
−
11
View file @
ed7b47a5
...
@@ -652,19 +652,35 @@ namespace Melodic{
...
@@ -652,19 +652,35 @@ namespace Melodic{
// Read in thresholded maps
// Read in thresholded maps
Matrix
threshmaps
;
Matrix
threshmaps
;
int
ic_ctr
=
2
;
int
ic_ctr
=
1
;
message
(
" Reading in thresholded IC maps ..."
);
message
(
" Reading in thresholded IC maps ..."
);
read_volume4D
(
tmpvol
,
logger
.
appendDir
(
"stats/thresh_zstat1"
));
//
read_volume4D(tmpvol,logger.appendDir("stats/thresh_zstat1"));
threshmaps
=
tmpvol
.
matrix
(
Mask
);
//
threshmaps = tmpvol.matrix(Mask);
while
(
fsl_imageexists
(
logger
.
appendDir
(
"stats/thresh_zstat"
+
num2str
(
ic_ctr
))))
while
(
fsl_imageexists
(
logger
.
appendDir
(
"stats/thresh_zstat"
+
num2str
(
ic_ctr
))))
{
{
read_volume4D
(
tmpvol
,
logger
.
appendDir
(
"stats/thresh_zstat"
+
num2str
(
ic_ctr
)));
read_volume4D
(
tmpvol
,
logger
.
appendDir
(
"stats/thresh_zstat"
+
num2str
(
ic_ctr
)));
threshmaps
=
threshmaps
&
tmpvol
.
matrix
(
Mask
);
Matrix
newmap
;
newmap
=
tmpvol
.
matrix
(
Mask
);
Matrix
corrcf
;
corrcf
=
pemaps
.
t
()
|
newmap
.
t
();
corrcf
=
corrcoef
(
corrcf
);
corrcf
=
corrcf
.
SubMatrix
(
corrcf
.
Nrows
(),
corrcf
.
Nrows
(),
1
,
pemaps
.
Nrows
());
message
(
"IC map "
<<
ic_ctr
<<
": "
<<
corrcf
);
if
(
opts
.
glmPEreg
.
value
()
==
0.0
||
opts
.
glmPEreg
.
value
()
>
max
(
abs
(
corrcf
)).
AsScalar
()){
message
(
" removing IC map "
<<
endl
);
if
(
threshmaps
.
Storage
()
==
0
)
threshmaps
=
newmap
;
else
threshmaps
=
threshmaps
&
newmap
;
}
else
message
(
" not removing IC map "
<<
endl
);
ic_ctr
++
;
ic_ctr
++
;
}
}
message
(
" ... done "
<<
endl
);
message
(
" ... done "
<<
endl
);
outMsize
(
" threshmaps "
,
threshmaps
);
//
outMsize(" threshmaps ",threshmaps);
outMsize
(
" pemaps "
,
pemaps
);
//
outMsize(" pemaps ",pemaps);
//read in data
//read in data
message
(
" Reading in "
<<
opts
.
inputfname
.
value
()
<<
" ... "
);
message
(
" Reading in "
<<
opts
.
inputfname
.
value
()
<<
" ... "
);
...
@@ -681,21 +697,21 @@ namespace Melodic{
...
@@ -681,21 +697,21 @@ namespace Melodic{
allmaps
=
pemaps
&
threshmaps
;
allmaps
=
pemaps
&
threshmaps
;
outMsize
(
" allmaps "
,
allmaps
);
outMsize
(
" allmaps "
,
allmaps
);
outMsize
(
" orig_data "
,
orig_data
);
//
outMsize(" orig_data ",orig_data);
allmaps
=
pemaps
&
threshmaps
;
allmaps
=
pemaps
&
threshmaps
;
alltcs
=
(
orig_data
*
allmaps
.
t
()
)
*
pinv
(
allmaps
*
allmaps
.
t
()
);
alltcs
=
(
orig_data
*
allmaps
.
t
()
)
*
pinv
(
allmaps
*
allmaps
.
t
()
);
outMsize
(
" alltcs"
,
alltcs
);
//
outMsize(" alltcs",alltcs);
resi
=
orig_data
-
alltcs
*
allmaps
;
resi
=
orig_data
-
alltcs
*
allmaps
;
pemaps
=
pemaps
-
pemaps
*
threshmaps
.
t
()
*
pinv
(
threshmaps
*
threshmaps
.
t
()
)
*
threshmaps
;
pemaps
=
pemaps
-
pemaps
*
threshmaps
.
t
()
*
pinv
(
threshmaps
*
threshmaps
.
t
()
)
*
threshmaps
;
outMsize
(
" ... new PEs :"
,
pemaps
);
//
outMsize(" ... new PEs :",pemaps);
Matrix
R
;
Matrix
R
;
R
=
Identity
(
orig_data
.
Nrows
())
-
alltcs
*
pinv
(
alltcs
.
t
()
*
alltcs
)
*
alltcs
.
t
();
R
=
Identity
(
orig_data
.
Nrows
())
-
alltcs
*
pinv
(
alltcs
.
t
()
*
alltcs
)
*
alltcs
.
t
();
Matrix
sigsq
;
Matrix
sigsq
;
sigsq
=
sum
(
SP
(
resi
,
resi
))
/
R
.
Trace
();
sigsq
=
sum
(
SP
(
resi
,
resi
))
/
R
.
Trace
();
outMsize
(
" ... new sigmasquareds :"
,
sigsq
);
//
outMsize(" ... new sigmasquareds :",sigsq);
Matrix
new_dof
;
Matrix
new_dof
;
new_dof
=
old_dof
.
matrix
(
Mask
);
new_dof
=
old_dof
.
matrix
(
Mask
);
...
@@ -703,7 +719,7 @@ namespace Melodic{
...
@@ -703,7 +719,7 @@ namespace Melodic{
for
(
int
i_ctr
=
1
;
i_ctr
<=
threshmaps
.
Nrows
();
i_ctr
++
)
for
(
int
i_ctr
=
1
;
i_ctr
<=
threshmaps
.
Nrows
();
i_ctr
++
)
if
(
abs
(
threshmaps
(
i_ctr
,
j_ctr
))
>
0
)
if
(
abs
(
threshmaps
(
i_ctr
,
j_ctr
))
>
0
)
new_dof
(
1
,
j_ctr
)
--
;
new_dof
(
1
,
j_ctr
)
--
;
outMsize
(
" ... new DOFs :"
,
new_dof
);
//
outMsize(" ... new DOFs :", new_dof);
message
(
" ... done "
<<
endl
);
message
(
" ... done "
<<
endl
);
//save out new GLM results
//save out new GLM results
...
...
This diff is collapsed.
Click to expand it.
meloptions.h
+
5
−
0
View file @
ed7b47a5
...
@@ -70,6 +70,7 @@ class MelodicOptions {
...
@@ -70,6 +70,7 @@ class MelodicOptions {
Option
<
string
>
filtermix
;
Option
<
string
>
filtermix
;
Option
<
string
>
filter
;
Option
<
string
>
filter
;
Option
<
string
>
glmcleanup
;
Option
<
string
>
glmcleanup
;
Option
<
float
>
glmPEreg
;
Option
<
bool
>
genreport
;
Option
<
bool
>
genreport
;
Option
<
float
>
tr
;
Option
<
float
>
tr
;
...
@@ -204,6 +205,9 @@ class MelodicOptions {
...
@@ -204,6 +205,9 @@ class MelodicOptions {
glmcleanup
(
string
(
"--cleanup"
),
string
(
""
),
glmcleanup
(
string
(
"--cleanup"
),
string
(
""
),
string
(
"<feat dir>
\n
"
),
string
(
"<feat dir>
\n
"
),
false
,
requires_argument
),
false
,
requires_argument
),
glmPEreg
(
string
(
"--PEreg"
),
0.0
,
string
(
"spatial correlation threshold between ICA and PE maps"
),
false
,
requires_argument
),
genreport
(
string
(
"--report"
),
false
,
genreport
(
string
(
"--report"
),
false
,
string
(
"generate Melodic web report"
),
string
(
"generate Melodic web report"
),
false
,
no_argument
),
false
,
no_argument
),
...
@@ -320,6 +324,7 @@ class MelodicOptions {
...
@@ -320,6 +324,7 @@ class MelodicOptions {
options
.
add
(
filtermix
);
options
.
add
(
filtermix
);
options
.
add
(
filter
);
options
.
add
(
filter
);
options
.
add
(
glmcleanup
);
options
.
add
(
glmcleanup
);
options
.
add
(
glmPEreg
);
options
.
add
(
genreport
);
options
.
add
(
genreport
);
options
.
add
(
tr
);
options
.
add
(
tr
);
options
.
add
(
logPower
);
options
.
add
(
logPower
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment