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
d4b72baa
Commit
d4b72baa
authored
17 years ago
by
Matthew Webster
Browse files
Options
Downloads
Patches
Plain Diff
removing marks volume: In progress
parent
e5417702
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
film_gls.cc
+31
-7
31 additions, 7 deletions
film_gls.cc
with
31 additions
and
7 deletions
film_gls.cc
+
31
−
7
View file @
d4b72baa
...
...
@@ -12,6 +12,7 @@
#define WANT_STREAM
#define WANT_MATH
#include
"newimage/newimageall.h"
#include
"newmatap.h"
#include
"newmatio.h"
#include
"miscmaths/volumeseries.h"
...
...
@@ -29,6 +30,7 @@ using namespace NEWMAT;
using
namespace
FILM
;
using
namespace
Utilities
;
using
namespace
MISCMATHS
;
using
namespace
NEWIMAGE
;
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -42,10 +44,32 @@ int main(int argc, char *argv[])
globalopts
.
parse_command_line
(
argc
,
argv
,
logger
);
// load data
VolumeSeries
x
;
x
.
read
(
globalopts
.
inputfname
);
int
sizeTS
=
x
.
getNumVolumes
();
volume4D
<
double
>
input_data
;
read_volume4D
(
input_data
,
globalopts
.
inputfname
);
Matrix
datam
;
VolumeSeries
x
,
y
;
y
.
read
(
globalopts
.
inputfname
);
x
.
setInfo
(
y
.
getInfo
());
x
=
input_data
.
matrix
();
volume
<
double
>
mask
(
input_data
[
0
]);
mask
=
0
;
for
(
int
t
=
0
;
t
<
input_data
.
tsize
();
t
++
)
mask
+=
input_data
[
t
];
mask
/=
input_data
.
tsize
();
for
(
int
z
=
0
;
z
<
input_data
.
zsize
();
z
++
)
for
(
int
y
=
0
;
y
<
input_data
.
ysize
();
y
++
)
for
(
int
x
=
0
;
x
<
input_data
.
xsize
();
x
++
)
if
(
mask
(
x
,
y
,
z
)
>
globalopts
.
thresh
)
for
(
int
t
=
0
;
t
<
input_data
.
tsize
();
t
++
)
input_data
(
x
,
y
,
z
,
t
)
-=
mask
(
x
,
y
,
z
);
mask
.
binarise
(
globalopts
.
thresh
,
mask
.
max
()
+
1
,
exclusive
);
input_data
*=
mask
;
save_volume4D
(
input_data
,
"foo2"
);
datam
=
input_data
.
matrix
(
mask
);
int
sizeTS
=
input_data
.
tsize
();
int
numTS
=
mask
.
sum
();
cerr
<<
datam
.
Nrows
()
<<
" "
<<
datam
.
Ncols
()
<<
endl
;
// if needed for SUSAN spatial smoothing, output the halfway volume for use later
Volume
epivol
;
...
...
@@ -58,6 +82,7 @@ int main(int argc, char *argv[])
// This also removes the mean from each of the time series:
x
.
thresholdSeries
(
globalopts
.
thresh
,
true
);
x
.
writeThresholdedSeriesAsFloat
(
x
.
getInfo
(),
x
.
getPreThresholdPositions
(),
"foo3"
);
// if needed for SUSAN spatial smoothing, also threshold the epi volume
if
(
globalopts
.
smoothACEst
)
...
...
@@ -66,8 +91,6 @@ int main(int argc, char *argv[])
epivol
.
threshold
();
}
int
numTS
=
x
.
getNumSeries
();
// Load paradigm:
Paradigm
parad
;
if
(
!
globalopts
.
ac_only
)
...
...
@@ -108,7 +131,8 @@ int main(int argc, char *argv[])
cout
<<
"Calculating residuals..."
<<
endl
;
for
(
int
i
=
1
;
i
<=
numTS
;
i
++
)
{
glimGls
.
setData
(
x
.
getSeries
(
i
),
parad
.
getDesignMatrix
(),
i
);
//glimGls.setData(x.getSeries(i), parad.getDesignMatrix(), i);
glimGls
.
setData
(
datam
.
Column
(
i
),
parad
.
getDesignMatrix
(),
i
);
residuals
.
setSeries
(
glimGls
.
getResiduals
(),
i
);
}
cout
<<
"Completed"
<<
endl
;
...
...
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