Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
avwutils
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
avwutils
Commits
a6d29838
Commit
a6d29838
authored
19 years ago
by
Christian Beckmann
Browse files
Options
Downloads
Patches
Plain Diff
avwpspec created; transforms 4D files to power spectra
parent
1ab127f0
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
fslpspec.cc
+15
-29
15 additions, 29 deletions
fslpspec.cc
with
15 additions
and
29 deletions
fslpspec.cc
+
15
−
29
View file @
a6d29838
...
...
@@ -10,16 +10,11 @@
#include
"newmatap.h"
#include
"newmatio.h"
#include
"newimage/newimageall.h"
#include
"newimage/fmribmain.h"
using
namespace
NEWIMAGE
;
void
print_usage
(
const
string
&
progname
)
{
cout
<<
"Usage: "
<<
progname
<<
" <input> [options] [output]"
<<
endl
;
cout
<<
endl
;
cout
<<
" "
<<
endl
;
cout
<<
" "
<<
endl
;
cout
<<
" e.g. "
<<
progname
<<
" "
<<
endl
;
}
ReturnMatrix
calcFFT
(
const
Matrix
&
Mat
)
...
...
@@ -45,26 +40,19 @@ ReturnMatrix calcFFT(const Matrix& Mat)
return
res
;
}
//Matrix calcFFT()
int
generate_masks
(
volume
4D
<
float
>
&
mask
,
volume4D
<
float
>
&
masknz
,
const
volume
4D
<
float
>
&
vin
,
float
&
lthr
,
float
&
uthr
)
int
generate_masks
(
volume
<
float
>
&
mask
,
const
volume
<
float
>
&
vin
)
{
mask
=
binarise
(
vin
,
lthr
,
uthr
,
exclusive
);
masknz
=
mask
*
(
1.0
f
-
binarise
(
vin
,
0.0
f
,
0.0
f
));
return
0
;
}
int
generate_masks
(
const
volume4D
<
float
>
&
mask
,
volume4D
<
float
>
&
masknz
,
const
volume4D
<
float
>
&
vin
)
{
masknz
=
mask
*
(
1.0
f
-
binarise
(
vin
,
0.0
f
,
0.0
f
));
mask
=
binarise
(
vin
,
vin
.
min
(),
vin
.
max
());
return
0
;
}
int
fmrib_main
_float
(
int
argc
,
char
*
argv
[])
int
fmrib_main
(
int
argc
,
char
*
argv
[])
{
string
inname
=
argv
[
1
];
string
maskname
=
""
;
string
outname
=
""
;
cout
<<
argc
<<
endl
;
if
(
argc
>
2
)
outname
=
argv
[
2
];
else
...
...
@@ -72,25 +60,23 @@ int fmrib_main_float(int argc, char* argv[])
Matrix
iMat
,
oMat
;
volume4D
<
float
>
vout
;
volume
<
float
>
s
mask
,
smasknz
;
volume
<
float
>
mask
;
volumeinfo
volinfo
;
float
vinTR
;
{
volume4D
<
float
>
vin
,
mask
,
masknz
;
volume4D
<
float
>
vin
;
read_volume4D
(
vin
,
argv
[
1
],
volinfo
);
float
lthr
=
0
,
uthr
=
0
;
generate_masks
(
mask
,
masknz
,
vin
,
lthr
,
uthr
);
smask
=
mask
[
0
];
smasknz
=
masknz
[
0
];
iMat
=
vin
.
matrix
(
smasknz
);
}
generate_masks
(
mask
,
stddevvol
(
vin
));
iMat
=
vin
.
matrix
(
mask
);
vinTR
=
vin
.
TR
();
}
oMat
=
calcFFT
(
iMat
);
vout
.
setmatrix
(
oMat
,
smasknz
);
vout
.
setmatrix
(
oMat
,
mask
);
vout
.
setTR
(
vinTR
);
int
retval
=
0
;
retval
=
save_volume4D
(
vout
,
outname
,
volinfo
);
...
...
@@ -103,12 +89,12 @@ int main(int argc,char *argv[])
Tracer
tr
(
"main"
);
string
progname
=
argv
[
0
];
if
(
argc
<
3
)
{
if
(
argc
<
2
)
{
print_usage
(
progname
);
return
1
;
}
return
fmrib_main
_float
(
argc
,
argv
);
return
fmrib_main
(
argc
,
argv
);
}
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