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
1d87353c
Commit
1d87353c
authored
16 years ago
by
Mark Jenkinson
Browse files
Options
Downloads
Patches
Plain Diff
Added some error checking - :O
parent
0e4957b1
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
fslroi.cc
+24
-12
24 additions, 12 deletions
fslroi.cc
with
24 additions
and
12 deletions
fslroi.cc
+
24
−
12
View file @
1d87353c
// fslroi.cc extract cuboid ROI and/or timeseries from image
// fslroi.cc extract cuboid ROI and/or timeseries from image
// Stephen Smith
and
Matthew Webster, FMRIB Image Analysis Group
// Stephen Smith
,
Matthew Webster
and Mark Jenkinson
, FMRIB Image Analysis Group
// Copyright (C) 1999-200
5
University of Oxford
// Copyright (C) 1999-200
8
University of Oxford
// COPYRIGHT
// COPYRIGHT
#include
"newimage/newimageall.h"
#include
"newimage/newimageall.h"
...
@@ -13,7 +13,7 @@ void print_usage(const string& progname) {
...
@@ -13,7 +13,7 @@ void print_usage(const string& progname) {
cout
<<
"Usage: fslroi <input> <output> <xmin> <xsize> <ymin> <ysize> <zmin> <zsize>"
<<
endl
;
cout
<<
"Usage: fslroi <input> <output> <xmin> <xsize> <ymin> <ysize> <zmin> <zsize>"
<<
endl
;
cout
<<
" fslroi <input> <output> <tmin> <tsize>
\n
"
<<
endl
;
cout
<<
" fslroi <input> <output> <tmin> <tsize>
\n
"
<<
endl
;
cout
<<
" fslroi <input> <output> <xmin> <xsize> <ymin> <ysize> <zmin> <zsize> <tmin> <tsize>"
<<
endl
;
cout
<<
" fslroi <input> <output> <xmin> <xsize> <ymin> <ysize> <zmin> <zsize> <tmin> <tsize>"
<<
endl
;
cout
<<
"Note:
count
ing (in both time and space) starts with 0 not 1!"
<<
endl
;
cout
<<
"Note:
index
ing (in both time and space) starts with 0 not 1!"
<<
endl
;
}
}
...
@@ -70,6 +70,12 @@ int fmrib_main(int argc, char *argv[])
...
@@ -70,6 +70,12 @@ int fmrib_main(int argc, char *argv[])
maxz
+=
minz
-
1
;
maxz
+=
minz
-
1
;
maxt
+=
mint
-
1
;
maxt
+=
mint
-
1
;
}
}
// sanity check
if
((
maxx
<
minx
)
||
(
maxy
<
miny
)
||
(
maxz
<
minz
)
||
(
maxt
<
mint
))
{
imthrow
(
"Invalid ROI dimensions"
,
21
);
}
// now transform these coordinates to newimage conventions
// now transform these coordinates to newimage conventions
ColumnVector
v
(
4
);
ColumnVector
v
(
4
);
v
<<
minx
<<
miny
<<
minz
<<
1.0
;
v
<<
minx
<<
miny
<<
minz
<<
1.0
;
...
@@ -99,15 +105,21 @@ int main(int argc,char *argv[])
...
@@ -99,15 +105,21 @@ int main(int argc,char *argv[])
Tracer
tr
(
"main"
);
Tracer
tr
(
"main"
);
string
progname
=
argv
[
0
];
try
{
if
(
argc
!=
5
&&
argc
!=
9
&&
argc
!=
11
)
string
progname
=
argv
[
0
];
{
if
(
argc
!=
5
&&
argc
!=
9
&&
argc
!=
11
)
print_usage
(
progname
);
{
return
1
;
print_usage
(
progname
);
}
return
1
;
}
string
iname
=
string
(
argv
[
1
]);
return
call_fmrib_main
(
dtype
(
iname
),
argc
,
argv
);
string
iname
=
string
(
argv
[
1
]);
return
call_fmrib_main
(
dtype
(
iname
),
argc
,
argv
);
}
catch
(
std
::
exception
&
e
)
{
cerr
<<
e
.
what
()
<<
endl
;
}
catch
(
Exception
&
e
)
{
exit
(
EXIT_FAILURE
);
}
}
}
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