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
82c179f9
Commit
82c179f9
authored
13 years ago
by
Christian Beckmann
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
05fbde20
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
fsl_regfilt.cc
+1
-1
1 addition, 1 deletion
fsl_regfilt.cc
melgmix.cc
+5
-3
5 additions, 3 deletions
melgmix.cc
melgmix.h
+8
-0
8 additions, 0 deletions
melgmix.h
melodic.cc
+19
-10
19 additions, 10 deletions
melodic.cc
with
33 additions
and
14 deletions
fsl_regfilt.cc
+
1
−
1
View file @
82c179f9
...
@@ -65,7 +65,7 @@ using namespace std;
...
@@ -65,7 +65,7 @@ using namespace std;
string
(
" switch on aggressive filtering (full instead of partial regression)"
),
string
(
" switch on aggressive filtering (full instead of partial regression)"
),
false
,
no_argument
);
false
,
no_argument
);
Option
<
bool
>
perfvn
(
string
(
"--vn"
),
FALSE
,
Option
<
bool
>
perfvn
(
string
(
"--vn"
),
FALSE
,
string
(
" perf
r
om variance-normalisation on data"
),
string
(
" perfo
r
m variance-normalisation on data"
),
false
,
no_argument
);
false
,
no_argument
);
Option
<
int
>
help
(
string
(
"-h,--help"
),
0
,
Option
<
int
>
help
(
string
(
"-h,--help"
),
0
,
string
(
"display this help text"
),
string
(
"display this help text"
),
...
...
This diff is collapsed.
Click to expand it.
melgmix.cc
+
5
−
3
View file @
82c179f9
...
@@ -597,10 +597,12 @@ namespace Melodic{
...
@@ -597,10 +597,12 @@ namespace Melodic{
props
=
props
/
sum
(
props
,
2
).
AsScalar
();
props
=
props
/
sum
(
props
,
2
).
AsScalar
();
add_params
(
means
,
vars
,
props
,
logprobY
,
MDL
,
Evi
,
true
);
add_params
(
means
,
vars
,
props
,
logprobY
,
MDL
,
Evi
,
true
);
probmap
<<
SP
(
sum
(
tmp1
.
Rows
(
2
,
tmp1
.
Nrows
()),
1
),
probmap
<<
SP
(
sum
(
tmp1
.
Rows
(
2
,
tmp1
.
Nrows
()),
1
),
pow
(
sum
(
tmp1
,
1
),
-
1
));
pow
(
sum
(
tmp1
,
1
),
-
1
));
dbgmsg
(
" mu: "
<<
means
<<
" sig: "
<<
vars
<<
" prop: "
<<
props
<<
endl
);
if
(
props
(
1
)
<
0.4
){
if
(
props
(
1
)
<
0.4
){
//set up GMM
//set up GMM
message
(
" try Gaussian Mixture Model "
<<
endl
);
message
(
" try Gaussian Mixture Model "
<<
endl
);
...
@@ -618,11 +620,11 @@ namespace Melodic{
...
@@ -618,11 +620,11 @@ namespace Melodic{
IntSize
=
Dmax
/
nummix
;
IntSize
=
Dmax
/
nummix
;
means
(
1
)
=
mean
(
data
,
2
).
AsScalar
();
means
(
1
)
=
mean
(
data
,
2
).
AsScalar
();
for
(
int
ctr
=
2
;
ctr
<=
means
.
Ncols
();
ctr
++
){
for
(
int
ctr
=
2
;
ctr
<=
means
.
Ncols
();
ctr
++
){
means
(
ctr
)
=
Dmax
-
(
ctr
-
1.5
)
*
IntSize
;
means
(
ctr
)
=
Dmax
-
(
ctr
-
1.5
)
*
IntSize
;
}
}
means
(
2
)
=
means
(
1
)
+
sqrt
(
vars
(
1
));
means
(
2
)
=
means
(
1
)
+
sqrt
(
vars
(
1
));
if
(
nummix
>
2
)
if
(
nummix
>
2
)
means
(
3
)
=
means
(
1
)
-
sqrt
(
vars
(
1
));
means
(
3
)
=
means
(
1
)
-
sqrt
(
vars
(
1
));
fit
(
string
(
"GMM"
));
fit
(
string
(
"GMM"
));
}
}
...
...
This diff is collapsed.
Click to expand it.
melgmix.h
+
8
−
0
View file @
82c179f9
...
@@ -145,6 +145,14 @@ namespace Melodic{
...
@@ -145,6 +145,14 @@ namespace Melodic{
probmap
=
tempVol
.
matrix
(
Mask
);
probmap
=
tempVol
.
matrix
(
Mask
);
}
}
inline
Matrix
get_params
(){
Matrix
tmp
=
zeros
(
3
,
means
.
Ncols
());
tmp
.
Row
(
1
)
=
means
;
tmp
.
Row
(
2
)
=
vars
;
tmp
.
Row
(
3
)
=
props
;
return
tmp
;
}
double
datamean
;
double
datamean
;
double
datastdev
;
double
datastdev
;
...
...
This diff is collapsed.
Click to expand it.
melodic.cc
+
19
−
10
View file @
82c179f9
...
@@ -68,7 +68,7 @@ int main(int argc, char *argv[]){
...
@@ -68,7 +68,7 @@ int main(int argc, char *argv[]){
//set up report object
//set up report object
MelodicReport
report
(
melodat
,
opts
,
logger
);
MelodicReport
report
(
melodat
,
opts
,
logger
);
if
(
opts
.
filtermode
||
opts
.
filtermix
.
value
().
length
()
>
0
){
if
(
opts
.
filtermode
||
opts
.
filtermix
.
value
().
length
()
>
0
||
opts
.
ICsfname
.
value
().
length
()
>
0
){
if
(
opts
.
filtermode
){
// just filter out some noise from a previous run
if
(
opts
.
filtermode
){
// just filter out some noise from a previous run
melodat
.
setup
();
melodat
.
setup
();
if
(
opts
.
debug
.
value
())
if
(
opts
.
debug
.
value
())
...
@@ -237,13 +237,18 @@ void mmonly(Log& logger, MelodicOptions& opts,
...
@@ -237,13 +237,18 @@ void mmonly(Log& logger, MelodicOptions& opts,
message
(
" done"
<<
endl
);
message
(
" done"
<<
endl
);
}
}
message
(
"Reading mixing matrix "
<<
opts
.
filtermix
.
value
()
<<
" ... "
);
if
(
opts
.
filtermix
.
value
().
length
()
>
0
){
mixMatrix
=
read_ascii_matrix
(
opts
.
filtermix
.
value
());
message
(
"Reading mixing matrix "
<<
opts
.
filtermix
.
value
()
<<
" ... "
);
if
(
mixMatrix
.
Storage
()
<=
0
)
{
mixMatrix
=
read_ascii_matrix
(
opts
.
filtermix
.
value
());
cerr
<<
" Please specify the mixing matrix correctly"
<<
endl
;
if
(
mixMatrix
.
Storage
()
<=
0
)
{
exit
(
2
);
cerr
<<
" Please specify the mixing matrix correctly"
<<
endl
;
exit
(
2
);
}
message
(
" done"
<<
endl
);
}
else
{
mixMatrix
=
unifrnd
(
ICs
.
Nrows
()
+
1
,
ICs
.
Nrows
());
}
}
message
(
" done"
<<
endl
);
if
(
opts
.
smodename
.
value
().
length
()
>
0
){
if
(
opts
.
smodename
.
value
().
length
()
>
0
){
message
(
"Reading matrix of subject modes: "
<<
opts
.
smodename
.
value
());
message
(
"Reading matrix of subject modes: "
<<
opts
.
smodename
.
value
());
...
@@ -300,7 +305,8 @@ Matrix mmall(Log& logger, MelodicOptions& opts,MelodicData& melodat, MelodicRepo
...
@@ -300,7 +305,8 @@ Matrix mmall(Log& logger, MelodicOptions& opts,MelodicData& melodat, MelodicRepo
message
(
" IC map "
<<
ctr
<<
" ... "
<<
endl
;);
message
(
" IC map "
<<
ctr
<<
" ... "
<<
endl
;);
Matrix
ICmap
;
Matrix
ICmap
;
dbgmsg
(
" stdNoisei max : "
<<
melodat
.
get_stdNoisei
().
Maximum
()
<<
" "
<<
melodat
.
get_stdNoisei
().
Minimum
()
<<
endl
);
if
(
melodat
.
get_stdNoisei
().
Storage
()
>
0
)
dbgmsg
(
" stdNoisei max : "
<<
melodat
.
get_stdNoisei
().
Maximum
()
<<
" "
<<
melodat
.
get_stdNoisei
().
Minimum
()
<<
endl
);
if
(
opts
.
varnorm
.
value
()
&&
melodat
.
get_stdNoisei
().
Storage
()
>
0
){
if
(
opts
.
varnorm
.
value
()
&&
melodat
.
get_stdNoisei
().
Storage
()
>
0
){
ICmap
=
SP
(
melodat
.
get_IC
().
Row
(
ctr
),
diagvals
(
ctr
)
*
melodat
.
get_stdNoisei
());
ICmap
=
SP
(
melodat
.
get_IC
().
Row
(
ctr
),
diagvals
(
ctr
)
*
melodat
.
get_stdNoisei
());
...
@@ -322,9 +328,12 @@ Matrix mmall(Log& logger, MelodicOptions& opts,MelodicData& melodat, MelodicRepo
...
@@ -322,9 +328,12 @@ Matrix mmall(Log& logger, MelodicOptions& opts,MelodicData& melodat, MelodicRepo
mixmod
.
fit
(
"GGM"
);
mixmod
.
fit
(
"GGM"
);
if
(
opts
.
output_MMstats
.
value
()){
if
(
opts
.
output_MMstats
.
value
()){
message
(
" saving probability map:"
);
message
(
" saving probability map:
"
);
melodat
.
save4D
(
mixmod
.
get_probmap
(),
melodat
.
save4D
(
mixmod
.
get_probmap
(),
string
(
"stats/probmap_"
)
+
num2str
(
ctr
));
string
(
"stats/probmap_"
)
+
num2str
(
ctr
));
%%
message
(
" saving mixture model fit:"
);
%%
melodat
.
saveascii
(
mixmod
.
get_params
(),
%%
string
(
"stats/MMstats_"
)
+
num2str
(
ctr
));
}
}
//re-scale spatial maps to mean 0 for nht
//re-scale spatial maps to mean 0 for nht
...
@@ -415,7 +424,7 @@ Matrix mmall(Log& logger, MelodicOptions& opts,MelodicData& melodat, MelodicRepo
...
@@ -415,7 +424,7 @@ Matrix mmall(Log& logger, MelodicOptions& opts,MelodicData& melodat, MelodicRepo
}
}
}
}
if
(
!
opts
.
filtermode
&&
opts
.
filtermix
.
value
().
length
()
==
0
){
if
(
!
opts
.
filtermode
&&
opts
.
ICsfname
.
value
().
length
()
==
0
){
//now safe new data
//now safe new data
// bool what = opts.verbose.value();
// bool what = opts.verbose.value();
//opts.verbose.set_T(false);
//opts.verbose.set_T(false);
...
...
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