Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
slicetimer
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
slicetimer
Commits
28a0f681
Commit
28a0f681
authored
4 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
STY: whitespace
parent
0377be56
No related branches found
No related tags found
1 merge request
!1
Mnt/conda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
slicetimer.cc
+24
-25
24 additions, 25 deletions
slicetimer.cc
with
24 additions
and
25 deletions
slicetimer.cc
+
24
−
25
View file @
28a0f681
/* slicetimer.cc - FMRIB's Slice Timing Utility
Peter Bannister, Stephen Smith and Matthew Webster, FMRIB Image Analysis Group
Copyright (C) 2001-2009 University of Oxford */
/* CCOPYRIGHT */
...
...
@@ -34,14 +34,14 @@ string examples="slicetimer -i <timeseries> [-o <corrected_timeseries>] [options
Option
<
bool
>
help
(
string
(
"-h,--help"
),
false
,
string
(
"display this message"
),
false
,
no_argument
);
Option
<
bool
>
verbose
(
string
(
"-v,--verbose"
),
false
,
string
(
"switch on diagnostic messages"
),
Option
<
bool
>
verbose
(
string
(
"-v,--verbose"
),
false
,
string
(
"switch on diagnostic messages"
),
false
,
no_argument
);
Option
<
bool
>
odd
(
string
(
"--odd"
),
false
,
string
(
"use interleaved acquisition"
),
Option
<
bool
>
odd
(
string
(
"--odd"
),
false
,
string
(
"use interleaved acquisition"
),
false
,
no_argument
);
Option
<
bool
>
down
(
string
(
"--down"
),
false
,
string
(
"reverse slice indexing (default is: slices were acquired bottom-up)"
),
Option
<
bool
>
down
(
string
(
"--down"
),
false
,
string
(
"reverse slice indexing (default is: slices were acquired bottom-up)"
),
false
,
no_argument
);
Option
<
string
>
inputname
(
string
(
"-i,--in"
),
string
(
""
),
string
(
"filename of input timeseries"
),
...
...
@@ -69,7 +69,7 @@ int do_slice_correction()
{
volume4D
<
float
>
timeseries
;
Matrix
timings
;
int
no_volumes
,
no_slices
;
float
repeat_time
,
offset
=
0
,
slice_spacing
;
...
...
@@ -79,7 +79,7 @@ int do_slice_correction()
if
(
!
outputname
.
set
())
outputname
.
set_value
(
inputname
.
value
()
+
"_st"
);
}
else
if
(
outputname
.
set
())
{
cerr
<<
"Must specify an input volume (-i or --in) to generate corrected data."
cerr
<<
"Must specify an input volume (-i or --in) to generate corrected data."
<<
endl
;
return
-
1
;
}
...
...
@@ -108,20 +108,20 @@ int do_slice_correction()
// for(int i=1; i<=1201; i++) cout << i << " " << userkernel(i) << endl;
float
recenter
=
(((
float
)
no_slices
)
/
2
-
0.5
)
/
no_slices
;
// only valid for slice-count-based corrections
for
(
int
slice
=
1
;
slice
<=
no_slices
;
slice
++
)
{
if
(
tglobal
.
set
())
{
offset
=
tglobal
.
value
();
}
else
if
(
tcustom
.
set
())
{
offset
=
timings
(
slice
,
1
);
}
else
if
(
ocustom
.
set
())
{
}
else
if
(
ocustom
.
set
())
{
int
local_count
=
1
;
while
(
local_count
<=
no_slices
)
{
if
(
timings
(
local_count
,
1
)
==
slice
)
{
offset
=
recenter
-
(
local_count
-
1
)
*
(
slice_spacing
/
repeat_time
);
local_count
=
no_slices
+
1
;
}
else
}
else
local_count
++
;
}
}
else
if
(
odd
.
value
())
{
// acquisition order: 1,3,5, ..., 2,4,6 ...
...
...
@@ -131,7 +131,7 @@ int do_slice_correction()
offset
=
recenter
-
((
slice
-
1
)
/
2
)
*
(
slice_spacing
/
repeat_time
);
}
else
if
(
down
.
value
())
{
offset
=
recenter
-
(
no_slices
-
slice
)
*
(
slice_spacing
/
repeat_time
);
}
else
{
}
else
{
offset
=
recenter
-
(
slice
-
1
)
*
(
slice_spacing
/
repeat_time
);
}
...
...
@@ -145,11 +145,11 @@ int do_slice_correction()
}
timeseries
.
setvoxelts
(
interpseries
,
x_pos
,
y_pos
,
slice
-
1
);
}
if
(
verbose
.
value
())
cerr
<<
"Slice "
<<
slice
<<
" offset "
<<
offset
<<
endl
;
}
if
(
direction
.
value
()
==
1
)
timeseries
.
swapdimensions
(
3
,
2
,
1
);
// reverse Flip z and x
if
(
direction
.
value
()
==
2
)
timeseries
.
swapdimensions
(
1
,
3
,
2
);
// reverse Flip z and y
...
...
@@ -160,7 +160,7 @@ int do_slice_correction()
int
main
(
int
argc
,
char
**
argv
)
{
Tracer
tr
(
"main"
);
OptionParser
options
(
title
,
examples
);
try
{
...
...
@@ -183,30 +183,29 @@ int main (int argc,char** argv)
options
.
usage
();
exit
(
EXIT_FAILURE
);
}
if
(
inputname
.
unset
())
if
(
inputname
.
unset
())
{
options
.
usage
();
cerr
<<
endl
<<
"--in or -i MUST be used."
cerr
<<
endl
<<
"--in or -i MUST be used."
<<
endl
;
exit
(
EXIT_FAILURE
);
}
}
catch
(
X_OptionError
&
e
)
{
options
.
usage
();
cerr
<<
endl
<<
e
.
what
()
<<
endl
;
exit
(
EXIT_FAILURE
);
}
catch
(
std
::
exception
&
e
)
{
cerr
<<
e
.
what
()
<<
endl
;
}
}
int
retval
=
do_slice_correction
();
if
(
retval
!=
0
)
{
cerr
<<
endl
<<
endl
<<
"Error detected: try -h for help"
<<
endl
;
}
return
retval
;
}
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