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
5a3942dd
Commit
5a3942dd
authored
18 years ago
by
Matthew Webster
Browse files
Options
Downloads
Patches
Plain Diff
Multi-dimensional splitting
parent
d3c2534e
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
avwmerge++.cc
+1
-1
1 addition, 1 deletion
avwmerge++.cc
fslsplit.cc
+26
-11
26 additions, 11 deletions
fslsplit.cc
with
27 additions
and
12 deletions
avwmerge++.cc
+
1
−
1
View file @
5a3942dd
...
@@ -11,7 +11,7 @@ using namespace NEWIMAGE;
...
@@ -11,7 +11,7 @@ using namespace NEWIMAGE;
void
print_usage
(
const
string
&
progname
)
void
print_usage
(
const
string
&
progname
)
{
{
cout
<<
endl
;
cout
<<
endl
;
cout
<<
"Usage: avwmerge <-x/y/z/t> <output> <file1 file2 .......>"
<<
endl
;
cout
<<
"Usage: avwmerge <-x/y/z/t
/a
> <output> <file1 file2 .......>"
<<
endl
;
cout
<<
" -t : concatenate images in time"
<<
endl
;
cout
<<
" -t : concatenate images in time"
<<
endl
;
cout
<<
" -x : concatenate images in the x direction"
<<
endl
;
cout
<<
" -x : concatenate images in the x direction"
<<
endl
;
cout
<<
" -y : concatenate images in the y direction"
<<
endl
;
cout
<<
" -y : concatenate images in the y direction"
<<
endl
;
...
...
This diff is collapsed.
Click to expand it.
fslsplit.cc
+
26
−
11
View file @
5a3942dd
...
@@ -13,26 +13,41 @@ using namespace MISCMATHS;
...
@@ -13,26 +13,41 @@ using namespace MISCMATHS;
void
print_usage
(
const
string
&
progname
)
void
print_usage
(
const
string
&
progname
)
{
{
cout
<<
endl
;
cout
<<
endl
;
cout
<<
"Usage: avwsplit <inputfile.hdr>"
<<
endl
;
cout
<<
"Usage: avwsplit++ <inputfile.hdr>"
<<
endl
;
cout
<<
" avwsplit <inputfile.hdr> [basename]"
<<
endl
;
cout
<<
" avwsplit++ <inputfile.hdr> [basename] [-t/x/y/z]"
<<
endl
;
cout
<<
" -t : concatenate images in time (default behaviour)"
<<
endl
;
cout
<<
" -x : concatenate images in the x direction"
<<
endl
;
cout
<<
" -y : concatenate images in the y direction"
<<
endl
;
cout
<<
" -z : concatenate images in the z direction"
<<
endl
;
}
}
template
<
class
T
>
template
<
class
T
>
int
fmrib_main
(
int
argc
,
char
*
argv
[])
int
fmrib_main
(
int
argc
,
char
*
argv
[])
{
{
volume4D
<
T
>
input_vol
ume
;
volume4D
<
T
>
input_vol
;
volumeinfo
vinfo
;
volumeinfo
vinfo
;
volume
<
T
>
output_vol
ume
;
volume
4D
<
T
>
output_vol
;
string
input_name
=
string
(
argv
[
1
]);
string
input_name
=
string
(
argv
[
1
]);
string
output_name
=
"vol"
;
string
output_name
=
"vol"
;
read_volume4D
(
input_volume
,
input_name
,
vinfo
);
int
xoff
=
1
,
yoff
=
1
,
zoff
=
1
,
toff
=
1
,
nsize
;
int
t
;
read_volume4D
(
input_vol
,
input_name
,
vinfo
);
if
(
argc
==
3
)
output_name
=
string
(
argv
[
2
]);
if
((
argc
>
2
)
&&
(
argv
[
2
][
0
]
!=
'-'
))
output_name
=
string
(
argv
[
2
]);
for
(
t
=
0
;
t
<=
input_volume
.
maxt
();
t
++
)
if
(
argv
[
argc
-
1
][
0
]
==
'-'
)
{
if
(
argv
[
argc
-
1
][
1
]
==
't'
)
toff
=
input_vol
.
tsize
();
if
(
argv
[
argc
-
1
][
1
]
==
'z'
)
zoff
=
input_vol
.
zsize
();
if
(
argv
[
argc
-
1
][
1
]
==
'y'
)
yoff
=
input_vol
.
ysize
();
if
(
argv
[
argc
-
1
][
1
]
==
'x'
)
xoff
=
input_vol
.
xsize
();
}
else
toff
=
input_vol
.
tsize
();
nsize
=
xoff
*
yoff
*
zoff
*
toff
;
for
(
int
j
=
0
;
j
<
nsize
;
j
++
)
{
{
output_volume
=
input_volume
[
t
];
input_vol
.
setROIlimits
(
0
+
j
*
(
xoff
!=
1
),
0
+
j
*
(
yoff
!=
1
),
0
+
j
*
(
zoff
!=
1
),
0
+
j
*
(
toff
!=
1
),
input_vol
.
xsize
()
-
1
-
(
nsize
-
j
-
1
)
*
(
xoff
!=
1
),
input_vol
.
ysize
()
-
1
-
(
nsize
-
j
-
1
)
*
(
yoff
!=
1
),
input_vol
.
zsize
()
-
1
-
(
nsize
-
j
-
1
)
*
(
zoff
!=
1
),
input_vol
.
tsize
()
-
1
-
(
nsize
-
j
-
1
)
*
(
toff
!=
1
));
save_volume
(
output_volume
,(
output_name
+
num2str
(
t
,
4
)),
vinfo
);
input_vol
.
activateROI
();
output_vol
=
input_vol
.
ROI
();
save_volume4D
(
output_vol
,(
output_name
+
num2str
(
j
,
4
)),
vinfo
);
}
}
return
0
;
return
0
;
}
}
...
@@ -44,7 +59,7 @@ int main(int argc,char *argv[])
...
@@ -44,7 +59,7 @@ int main(int argc,char *argv[])
Tracer
tr
(
"main"
);
Tracer
tr
(
"main"
);
string
progname
=
argv
[
0
];
string
progname
=
argv
[
0
];
if
(
argc
!
=
3
&&
argc
!
=
2
)
if
(
argc
<
=
1
&&
argc
>
=
5
)
{
{
print_usage
(
progname
);
print_usage
(
progname
);
return
1
;
return
1
;
...
...
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