Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
film
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
film
Commits
68bb6176
Commit
68bb6176
authored
17 years ago
by
Matthew Webster
Browse files
Options
Downloads
Patches
Plain Diff
in progress newimage conversion: DO NOT TAG STABLE
parent
c92f1d66
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ftoz.cc
+1
-2
1 addition, 2 deletions
ftoz.cc
glim.cc
+16
-22
16 additions, 22 deletions
glim.cc
glim.h
+10
-11
10 additions, 11 deletions
glim.h
with
27 additions
and
35 deletions
ftoz.cc
+
1
−
2
View file @
68bb6176
...
...
@@ -138,11 +138,10 @@ int main(int argc,char *argv[])
ColumnVector
zs
(
numTS
);
F2z
::
ComputeFStats
(
fs
,
dof1
,
dof2
,
zs
);
input
.
set_intent
(
NIFTI_INTENT_ZSCORE
,
0
,
0
,
0
);
input
.
setmatrix
(
zs
.
AsRow
());
FslSetCalMinMax
(
&
vinfo
,
input
.
min
(),
input
.
max
());
input
.
set_intent
(
NIFTI_INTENT_ZSCORE
,
0
,
0
,
0
);
save_volume4D
(
input
,
globalopts
.
zscoresfname
,
vinfo
);
}
catch
(
Exception
p_excp
)
...
...
This diff is collapsed.
Click to expand it.
glim.cc
+
16
−
22
View file @
68bb6176
...
...
@@ -9,24 +9,24 @@
#include
<sstream>
#include
"glim.h"
#include
"miscmaths/miscmaths.h"
#include
"utils/log.h"
#include
"
miscmaths/volume
.h"
#include
"
newimage/newimageall
.h"
#ifndef NO_NAMESPACE
using
namespace
MISCMATHS
;
using
namespace
Utilities
;
using
namespace
NEWIMAGE
;
namespace
FILM
{
#endif
Glim
::
Glim
(
VolumeSeries
&
p_y
,
const
Matrix
&
p_x
)
:
Glim
::
Glim
(
Matrix
&
p_y
,
const
Matrix
&
p_x
)
:
y
(
p_y
),
x
(
p_x
),
numTS
(
p_y
.
Ncols
()),
sizeTS
(
p_y
.
Nrows
()),
numParams
(
p_x
.
Ncols
()),
r
(
sizeTS
,
numTS
,
p_y
.
getInfo
(),
p_y
.
getPreThresholdPositions
()
),
r
(
sizeTS
,
numTS
),
pinv_x
(
p_x
.
Ncols
(),
sizeTS
),
V
(
sizeTS
,
sizeTS
),
RV
(
sizeTS
,
sizeTS
),
...
...
@@ -39,32 +39,26 @@ namespace FILM {
{
}
void
Glim
::
Save
()
void
Glim
::
Save
(
const
volume
<
float
>&
mask
,
volumeinfo
vinfo
)
{
// Need to save b, sigmaSquareds, corrections and dof
Log
&
logger
=
LogSingleton
::
getInstance
();
// b:
Volume
peVol
;
volume4D
<
float
>
output
;
for
(
int
i
=
1
;
i
<=
numParams
;
i
++
)
{
peVol
=
b
.
Row
(
i
).
AsColumn
();
peVol
.
setInfo
(
y
.
getInfo
());
peVol
.
setPreThresholdPositions
(
y
.
getPreThresholdPositions
());
peVol
.
unthreshold
();
// Add param number to "pe" to create filename:
ostringstream
osc
;
osc
<<
i
;
peVol
.
writeAsFloat
(
logger
.
getDir
()
+
"/pe"
+
osc
.
str
().
c_str
());
output
.
setmatrix
(
b
.
Row
(
i
),
mask
);
FslSetCalMinMax
(
&
vinfo
,
output
.
min
(),
output
.
max
());
save_volume4D
(
output
,
logger
.
getDir
()
+
"/pe"
+
osc
.
str
().
c_str
(),
vinfo
);
}
// sigmaSquareds:
sigmaSquareds
.
setInfo
(
y
.
getInfo
());
sigmaSquareds
.
setPreThresholdPositions
(
y
.
getPreThresholdPositions
());
sigmaSquareds
.
unthreshold
();
sigmaSquareds
.
writeAsFloat
(
logger
.
getDir
()
+
"/sigmasquareds"
);
output
.
setmatrix
(
sigmaSquareds
.
AsRow
(),
mask
);
FslSetCalMinMax
(
&
vinfo
,
output
.
min
(),
output
.
max
());
save_volume4D
(
output
,
logger
.
getDir
()
+
"/sigmasquareds"
,
vinfo
);
// dof:
ColumnVector
dofVec
(
1
);
...
...
@@ -76,7 +70,7 @@ namespace FILM {
}
// Called on entire data set:
VolumeSeries
&
Glim
::
ComputeResids
()
Matrix
&
Glim
::
ComputeResids
()
{
Tracer
ts
(
"ComputeResids"
);
...
...
This diff is collapsed.
Click to expand it.
glim.h
+
10
−
11
View file @
68bb6176
...
...
@@ -11,13 +11,12 @@
#define WANT_STREAM
#define WANT_MATH
#include
"newmatap.h"
#include
"newmatio.h"
#include
"miscmaths/volumeseries.h"
#include
"miscmaths/volume.h"
#include
"miscmaths/miscmaths.h"
#include
"newimage/newimageall.h"
using
namespace
NEWMAT
;
using
namespace
MISCMATHS
;
using
namespace
NEWIMAGE
;
namespace
FILM
{
#if !defined(__glim_h)
...
...
@@ -28,11 +27,11 @@ namespace FILM{
class
Glim
{
public:
Glim
(
VolumeSeries
&
p_y
,
const
Matrix
&
p_x
);
Glim
(
Matrix
&
p_y
,
const
Matrix
&
p_x
);
void
Save
();
void
Save
(
const
volume
<
float
>&
mask
,
volumeinfo
vinfo
);
VolumeSeries
&
ComputeResids
();
Matrix
&
ComputeResids
();
void
ComputePes
();
void
SetVrow
(
const
ColumnVector
&
p_vrow
,
const
int
ind
);
void
SetGlobalVrow
(
const
ColumnVector
&
p_vrow
);
...
...
@@ -46,17 +45,17 @@ namespace FILM{
void
SetCorrection
(
const
Matrix
&
corr
,
const
int
ind
);
void
ConstructV
(
const
ColumnVector
&
p_vrow
);
void
setData
(
VolumeSeries
&
p_y
)
{
y
=
p_y
;
}
void
setData
(
Matrix
&
p_y
)
{
y
=
p_y
;
}
// y = bx + r
VolumeSeries
&
y
;
Matrix
&
y
;
const
Matrix
&
x
;
int
numTS
;
int
sizeTS
;
int
numParams
;
VolumeSeries
r
;
Matrix
r
;
Matrix
pinv_x
;
Matrix
V
;
Matrix
RV
;
...
...
@@ -67,7 +66,7 @@ namespace FILM{
// Data to be saved:
Matrix
corrections
;
Matrix
b
;
V
olum
e
sigmaSquareds
;
C
olum
nVector
sigmaSquareds
;
float
dof
;
};
...
...
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