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
fc02942e
Commit
fc02942e
authored
15 years ago
by
Christian Beckmann
Browse files
Options
Downloads
Patches
Plain Diff
more modifications
parent
04635c65
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl_glm.cc
+25
-19
25 additions, 19 deletions
fsl_glm.cc
with
25 additions
and
19 deletions
fsl_glm.cc
+
25
−
19
View file @
fc02942e
...
...
@@ -26,7 +26,7 @@ using namespace std;
string
(
"
\n
Copyright(c) 2004-2009, University of Oxford (Christian F. Beckmann)
\n
"
)
+
string
(
"
\n
Simple GLM usign ordinary least-squares (OLS) regression on
\n
"
)
+
string
(
" time courses and/or 3D/4D imges against time courses
\n
"
)
+
string
(
" or 3D/4D images
\n\n
"
);
string
(
" or 3D/4D images"
);
string
examples
=
"fsl_glm -i <input> -d <design> -o <output> [options]"
;
//Command line Options {
...
...
@@ -35,10 +35,10 @@ using namespace std;
true
,
requires_argument
);
Option
<
string
>
fnout
(
string
(
"-o,--out"
),
string
(
""
),
string
(
"output file name for GLM parameter estimates (GLM betas)"
),
tru
e
,
requires_argument
);
fals
e
,
requires_argument
);
Option
<
string
>
fndesign
(
string
(
"-d,--design"
),
string
(
""
),
string
(
"file name of the GLM design matrix (time courses or spatial maps)"
),
tru
e
,
requires_argument
);
fals
e
,
requires_argument
);
Option
<
string
>
fnmask
(
string
(
"-m,--mask"
),
string
(
""
),
string
(
"mask image file name if input is image"
),
false
,
requires_argument
);
...
...
@@ -66,6 +66,9 @@ using namespace std;
Option
<
int
>
help
(
string
(
"-h,--help"
),
0
,
string
(
"display this help text"
),
false
,
no_argument
);
Option
<
bool
>
debug
(
string
(
"--debug"
),
FALSE
,
string
(
"display debug information"
),
false
,
no_argument
,
false
);
// Output options
Option
<
string
>
outcope
(
string
(
"--out_cope"
),
string
(
""
),
string
(
"output file name for COPEs (either as text file or image)"
),
...
...
@@ -103,7 +106,7 @@ using namespace std;
/*
}
*/
//Globals
{
//Globals
Melodic
::
basicGLM
glm
;
int
voxels
=
0
;
Matrix
data
;
...
...
@@ -112,9 +115,8 @@ using namespace std;
Matrix
fcontrasts
;
Matrix
meanR
;
RowVector
vnscales
;
volume
<
float
>
mask
;
/*
}
*/
volume
<
float
>
mask
;
////////////////////////////////////////////////////////////////////////////
// Local functions
...
...
@@ -159,22 +161,21 @@ int setup(){
return
1
;
};
}
else
{
mask
=
tmpdata
[
0
]
*
0.0
+
1.0
;
}
mask
=
tmpdata
[
0
]
*
0.0
+
1.0
;
data
=
tmpdata
.
matrix
(
mask
);
Melodic
::
update_mask
(
mask
,
data
);
}
data
=
tmpdata
.
matrix
(
mask
);
voxels
=
data
.
Ncols
();
if
(
perfvn
.
value
()){
data
=
remmean
(
data
,
1
);
vnscales
=
Melodic
::
varnorm
(
data
);
}
}
else
data
=
read_ascii_matrix
(
fnin
.
value
());
if
(
perf_demean
.
value
())
data
=
remmean
(
data
,
1
);
if
(
perfvn
.
value
())
vnscales
=
Melodic
::
varnorm
(
data
);
if
(
normdat
.
value
())
data
=
SP
(
data
,
ones
(
data
.
Nrows
(),
1
)
*
pow
(
stdev
(
data
,
1
),
-
1
));
if
(
fsl_imageexists
(
fndesign
.
value
())){
//read design
volume4D
<
float
>
tmpdata
;
read_volume4D
(
tmpdata
,
fndesign
.
value
());
...
...
@@ -188,11 +189,16 @@ int setup(){
design
=
read_ascii_matrix
(
fndesign
.
value
());
}
if
(
perf_demean
.
value
())
data
=
remmean
(
data
,
1
);
if
(
normdat
.
value
())
data
=
SP
(
data
,
ones
(
data
.
Nrows
(),
1
)
*
pow
(
stdev
(
data
,
1
),
-
1
));
meanR
=
mean
(
data
,
1
);
if
(
perf_demean
.
value
()){
if
(
perf_demean
.
value
())
design
=
remmean
(
design
,
1
);
if
(
normdes
.
value
())
design
=
SP
(
design
,
ones
(
design
.
Nrows
(),
1
)
*
pow
(
stdev
(
design
,
1
),
-
1
));
if
(
fncontrasts
.
value
()
>
""
){
//read contrast
contrasts
=
read_ascii_matrix
(
fncontrasts
.
value
());
if
(
!
(
contrasts
.
Ncols
()
==
design
.
Ncols
())){
...
...
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