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
57dc7f9c
Commit
57dc7f9c
authored
22 years ago
by
Stephen Smith
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
e3a647f3
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
slicetimer.cc
+13
-15
13 additions, 15 deletions
slicetimer.cc
with
13 additions
and
15 deletions
slicetimer.cc
+
13
−
15
View file @
57dc7f9c
...
@@ -55,7 +55,7 @@ Option<string> tcustom(string("--tcustom"), string(""),
...
@@ -55,7 +55,7 @@ Option<string> tcustom(string("--tcustom"), string(""),
string
(
"filename of single-column custom interleave timing file"
),
string
(
"filename of single-column custom interleave timing file"
),
false
,
requires_argument
);
false
,
requires_argument
);
Option
<
string
>
ocustom
(
string
(
"--ocustom"
),
string
(
""
),
Option
<
string
>
ocustom
(
string
(
"--ocustom"
),
string
(
""
),
string
(
"filename of single-column custom interleave order file"
),
string
(
"filename of single-column custom interleave order file
(first slice is referred to as 1 not 0)
"
),
false
,
requires_argument
);
false
,
requires_argument
);
Option
<
int
>
direction
(
string
(
"-d,--direction"
),
3
,
Option
<
int
>
direction
(
string
(
"-d,--direction"
),
3
,
string
(
"direction of slice acquisition (x=1,y=2,z=3) - default is z"
),
string
(
"direction of slice acquisition (x=1,y=2,z=3) - default is z"
),
...
@@ -68,11 +68,10 @@ int do_slice_correction()
...
@@ -68,11 +68,10 @@ int do_slice_correction()
{
{
volume4D
<
float
>
timeseries
;
volume4D
<
float
>
timeseries
;
volumeinfo
in_info
;
volumeinfo
in_info
;
ColumnVector
voxeltimeseries
,
interpseries
;
Matrix
timings
;
Matrix
timings
;
int
no_volumes
,
no_slices
;
int
no_volumes
,
no_slices
;
float
repeat_time
,
offset
,
slice_spacing
,
recenter
;
float
repeat_time
,
offset
=
0
,
slice_spacing
;
if
(
inputname
.
set
())
{
if
(
inputname
.
set
())
{
if
(
verbose
.
value
())
{
cout
<<
"Reading input volume"
<<
endl
;
}
if
(
verbose
.
value
())
{
cout
<<
"Reading input volume"
<<
endl
;
}
...
@@ -106,16 +105,13 @@ int do_slice_correction()
...
@@ -106,16 +105,13 @@ int do_slice_correction()
timings
=
read_ascii_matrix
(
ocustom
.
value
(),
timeseries
.
zsize
(),
1
);
timings
=
read_ascii_matrix
(
ocustom
.
value
(),
timeseries
.
zsize
(),
1
);
}
}
offset
=
0.0
;
ColumnVector
userkernel
=
sinckernel1D
(
"hanning"
,
7
,
1201
);
ColumnVector
userkernel
=
sinckernel1D
(
"hanning"
,
7
,
1201
);
// for(int i=1; i<=1201; i++) cout << i << " " << userkernel(i) << endl;
// if (down.value())
// recenter = (((float) no_slices)/2 + 0.5)/ no_slices;
float
recenter
=
(((
float
)
no_slices
)
/
2
-
0.5
)
/
no_slices
;
//else
recenter
=
(((
float
)
no_slices
)
/
2
-
0.5
)
/
no_slices
;
for
(
int
slice
=
1
;
slice
<=
no_slices
;
slice
++
)
{
for
(
int
slice
=
1
;
slice
<=
no_slices
;
slice
++
)
{
if
(
tcustom
.
set
())
{
if
(
tcustom
.
set
())
{
offset
=
-
timings
(
slice
,
1
);
offset
=
-
timings
(
slice
,
1
);
}
else
if
(
ocustom
.
set
())
{
}
else
if
(
ocustom
.
set
())
{
...
@@ -140,15 +136,17 @@ int do_slice_correction()
...
@@ -140,15 +136,17 @@ int do_slice_correction()
for
(
int
x_pos
=
0
;
x_pos
<
timeseries
.
xsize
();
x_pos
++
)
for
(
int
x_pos
=
0
;
x_pos
<
timeseries
.
xsize
();
x_pos
++
)
for
(
int
y_pos
=
0
;
y_pos
<
timeseries
.
ysize
();
y_pos
++
){
for
(
int
y_pos
=
0
;
y_pos
<
timeseries
.
ysize
();
y_pos
++
){
voxeltimeseries
=
timeseries
.
voxelts
(
x_pos
,
y_pos
,
slice
-
1
);
ColumnVector
voxeltimeseries
=
timeseries
.
voxelts
(
x_pos
,
y_pos
,
slice
-
1
);
interpseries
=
voxeltimeseries
;
ColumnVector
interpseries
=
voxeltimeseries
;
for
(
int
time_step
=
1
;
time_step
<=
no_volumes
;
time_step
++
)
for
(
int
time_step
=
1
;
time_step
<=
no_volumes
;
time_step
++
){
interpseries
(
time_step
)
=
interpolate_1d
(
voxeltimeseries
,
time_step
+
offset
+
recenter
);
// interpseries(time_step) = interpolate_1d(voxeltimeseries, time_step + offset + recenter);
interpseries
(
time_step
)
=
kernelinterpolation_1d
(
voxeltimeseries
,
time_step
+
offset
+
recenter
,
userkernel
,
3
);
}
timeseries
.
setvoxelts
(
interpseries
,
x_pos
,
y_pos
,
slice
-
1
);
timeseries
.
setvoxelts
(
interpseries
,
x_pos
,
y_pos
,
slice
-
1
);
}
}
if
(
verbose
.
value
())
if
(
verbose
.
value
())
cerr
<<
"Slice
/ Offset (s)
"
<<
slice
<<
"
/
"
<<
offset
*
repeat_time
*
-
1
<<
endl
;
cerr
<<
"Slice "
<<
slice
<<
"
offset
"
<<
offset
+
recenter
<<
endl
;
}
}
if
(
direction
.
value
()
==
1
)
timeseries
.
swapdimensions
(
3
,
2
,
1
);
// reverse Flip z and x
if
(
direction
.
value
()
==
1
)
timeseries
.
swapdimensions
(
3
,
2
,
1
);
// reverse Flip z and x
...
...
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