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
1ab127f0
Commit
1ab127f0
authored
19 years ago
by
Christian Beckmann
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
4df535e6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+4
-1
4 additions, 1 deletion
Makefile
fslpspec.cc
+114
-0
114 additions, 0 deletions
fslpspec.cc
with
118 additions
and
1 deletion
Makefile
+
4
−
1
View file @
1ab127f0
...
...
@@ -20,7 +20,7 @@ XFILES = avwcpgeom avwmerge avwnvols avwsplit \
avwinterleave_8UI avwinterleave_8SI avwinterleave_16UI avwinterleave_16SI avwinterleave_32UI avwinterleave_32SI avwinterleave_32R avwinterleave_64R
\
avwroi_8UI avwroi_8SI avwroi_16UI avwroi_16SI avwroi_32UI avwroi_32SI avwroi_32R avwroi_64R
\
avwfill_8UI avwfill_8SI avwfill_16UI avwfill_16SI avwfill_32UI avwfill_32SI avwfill_32R avwfill_64R
\
avwstats avwcomplex avwstats++ avwfft avwmeants avwcheck avwswapdim avwconv avwslice avworient
avwstats avwcomplex avwstats++ avwfft avwmeants avwcheck avwswapdim avwconv avwslice avworient
avwpspec
SCRIPTS
=
avwval avwchpixdim avwanimate sliceanimate avwsize avwinfo avwedithd avwchfiletype
FSCRIPTS
=
fmriborient
...
...
@@ -113,3 +113,6 @@ avworient: avworient.o
avwslice
:
avwslice.cc
${
CXX
}
${
CXXFLAGS
}
${
LDFLAGS
}
-o
avwslice avwslice.cc
${
LIBS
}
avwpspec
:
avwpspec.o
${
CXX
}
${
CXXFLAGS
}
${
LDFLAGS
}
-o
$@
avwpspec.o
${
LIBS
}
This diff is collapsed.
Click to expand it.
fslpspec.cc
0 → 100644
+
114
−
0
View file @
1ab127f0
/* avwswapdim.cc
Christian F. Beckmann, FMRIB Image Analysis Group
Copyright (C) 2003-2004 University of Oxford */
/* CCOPYRIGHT */
#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
)
{
Matrix
res
;
for
(
int
ctr
=
1
;
ctr
<=
Mat
.
Ncols
();
ctr
++
)
{
ColumnVector
tmpCol
;
tmpCol
=
Mat
.
Column
(
ctr
);
ColumnVector
FtmpCol_real
;
ColumnVector
FtmpCol_imag
;
ColumnVector
tmpPow
;
if
(
tmpCol
.
Nrows
()
%
2
!=
0
){
Matrix
empty
(
1
,
1
);
empty
=
0
;
tmpCol
&=
empty
;}
RealFFT
(
tmpCol
,
FtmpCol_real
,
FtmpCol_imag
);
tmpPow
=
pow
(
FtmpCol_real
,
2
)
+
pow
(
FtmpCol_imag
,
2
);
tmpPow
=
tmpPow
.
Rows
(
2
,
tmpPow
.
Nrows
());
//if(opts.logPower.value()) tmpPow = log(tmpPow);
if
(
res
.
Storage
()
==
0
){
res
=
tmpPow
;}
else
{
res
|=
tmpPow
;}
}
res
.
Release
();
return
res
;
}
//Matrix calcFFT()
int
generate_masks
(
volume4D
<
float
>
&
mask
,
volume4D
<
float
>
&
masknz
,
const
volume4D
<
float
>
&
vin
,
float
&
lthr
,
float
&
uthr
)
{
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
));
return
0
;
}
int
fmrib_main_float
(
int
argc
,
char
*
argv
[])
{
string
inname
=
argv
[
1
];
string
maskname
=
""
;
string
outname
=
""
;
cout
<<
argc
<<
endl
;
if
(
argc
>
2
)
outname
=
argv
[
2
];
else
outname
=
inname
;
Matrix
iMat
,
oMat
;
volume4D
<
float
>
vout
;
volume
<
float
>
smask
,
smasknz
;
volumeinfo
volinfo
;
{
volume4D
<
float
>
vin
,
mask
,
masknz
;
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
);
}
oMat
=
calcFFT
(
iMat
);
vout
.
setmatrix
(
oMat
,
smasknz
);
int
retval
=
0
;
retval
=
save_volume4D
(
vout
,
outname
,
volinfo
);
return
retval
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
Tracer
tr
(
"main"
);
string
progname
=
argv
[
0
];
if
(
argc
<
3
)
{
print_usage
(
progname
);
return
1
;
}
return
fmrib_main_float
(
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