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
71842d43
Commit
71842d43
authored
3 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Plain Diff
Merge branch 'mnt/conda' into 'master'
Mnt/conda See merge request
!1
parents
43d2ba75
ab7658ee
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Mnt/conda
Pipeline
#11776
passed
3 years ago
Stage: fsl-ci-build
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+6
-13
6 additions, 13 deletions
Makefile
branchname.log
+0
-1
0 additions, 1 deletion
branchname.log
slicetimer.cc
+27
-27
27 additions, 27 deletions
slicetimer.cc
with
33 additions
and
41 deletions
Makefile
+
6
−
13
View file @
71842d43
include
$(FSLCONFDIR)/default.mk
PROJNAME
=
slicetimer
XFILES
=
slicetimer
LIBS
=
-lfsl-newimage
-lfsl-miscmaths
-lfsl-NewNifti
\
-lfsl-znz
-lfsl-cprob
-lfsl-utils
USRINCFLAGS
=
-I
${
INC_NEWMAT
}
-I
${
INC_PROB
}
-I
${
INC_ZLIB
}
USRLDFLAGS
=
-L
${
LIB_NEWMAT
}
-L
${
LIB_PROB
}
-L
${
LIB_ZLIB
}
OBJS
=
slicetimer.o
LIBS
=
-lnewimage
-lmiscmaths
-lNewNifti
-lznz
-lnewmat
-lprob
-lm
-lutils
-lz
XFILES
=
slicetimer
all
:
${XFILES}
slicetimer
:
${OBJS}
${
CXX
}
${
CXXFLAGS
}
${
LDFLAGS
}
-o
$@
${
OBJS
}
${
LIBS
}
all
:
${XFILES}
slicetimer
:
slicetimer.o
${
CXX
}
${
CXXFLAGS
}
-o
$@
$^
${
LDFLAGS
}
This diff is collapsed.
Click to expand it.
branchname.log
deleted
100644 → 0
+
0
−
1
View file @
43d2ba75
Initial creation of branchname log file
This diff is collapsed.
Click to expand it.
slicetimer.cc
+
27
−
27
View file @
71842d43
/* 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 */
...
...
@@ -17,12 +17,13 @@
#include
<vector>
#include
"miscmaths/optimise.h"
#include
"newmat
ap
.h"
#include
"newmat
io
.h"
#include
"
armawrap/
newmat.h"
#include
"
armawrap/
newmat.h"
#include
"newimage/newimageall.h"
#include
"utils/options.h"
#include
"miscmaths/kernel.h"
using
namespace
std
;
using
namespace
MISCMATHS
;
using
namespace
NEWMAT
;
using
namespace
NEWIMAGE
;
...
...
@@ -34,14 +35,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 +70,7 @@ int do_slice_correction()
{
volume4D
<
float
>
timeseries
;
Matrix
timings
;
int
no_volumes
,
no_slices
;
float
repeat_time
,
offset
=
0
,
slice_spacing
;
...
...
@@ -79,7 +80,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 +109,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 +132,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 +146,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 +161,7 @@ int do_slice_correction()
int
main
(
int
argc
,
char
**
argv
)
{
Tracer
tr
(
"main"
);
OptionParser
options
(
title
,
examples
);
try
{
...
...
@@ -183,30 +184,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