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
beb71771
Commit
beb71771
authored
17 years ago
by
Mark Jenkinson
Browse files
Options
Downloads
Patches
Plain Diff
Change -roi code - hopefully fixed a bug
parent
47a3b1d8
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
fslmaths.cc
+19
-13
19 additions, 13 deletions
fslmaths.cc
with
19 additions
and
13 deletions
fslmaths.cc
+
19
−
13
View file @
beb71771
...
@@ -809,29 +809,35 @@ if (!separatenoise)
...
@@ -809,29 +809,35 @@ if (!separatenoise)
/******************************************************/
/******************************************************/
else
if
(
string
(
argv
[
i
])
==
"-roi"
)
else
if
(
string
(
argv
[
i
])
==
"-roi"
)
{
{
// add and subtract 0.5 to ensure the rounding is OK
int
x0
=
atoi
(
argv
[
i
+
1
]);
int
x0
=
atoi
(
argv
[
i
+
1
])
-
0.5
;
int
x1
=
atoi
(
argv
[
i
+
1
])
+
atoi
(
argv
[
i
+
2
]);
int
x1
=
atoi
(
argv
[
i
+
1
])
+
atoi
(
argv
[
i
+
2
])
+
0.5
;
int
y0
=
atoi
(
argv
[
i
+
3
]);
int
y0
=
atoi
(
argv
[
i
+
3
])
-
0.5
;
int
y1
=
atoi
(
argv
[
i
+
3
])
+
atoi
(
argv
[
i
+
4
]);
int
y1
=
atoi
(
argv
[
i
+
3
])
+
atoi
(
argv
[
i
+
4
])
+
0.5
;
int
z0
=
atoi
(
argv
[
i
+
5
]);
int
z0
=
atoi
(
argv
[
i
+
5
])
-
0.5
;
int
z1
=
atoi
(
argv
[
i
+
5
])
+
atoi
(
argv
[
i
+
6
]);
int
z1
=
atoi
(
argv
[
i
+
5
])
+
atoi
(
argv
[
i
+
6
])
+
0.5
;
int
t0
=
atoi
(
argv
[
i
+
7
]);
int
t0
=
atoi
(
argv
[
i
+
7
]);
int
t1
=
atoi
(
argv
[
i
+
7
])
+
atoi
(
argv
[
i
+
8
]);
int
t1
=
atoi
(
argv
[
i
+
7
])
+
atoi
(
argv
[
i
+
8
]);
ColumnVector
v0
,
v1
;
ColumnVector
v0
(
4
)
,
v1
(
4
)
;
v0
<<
x0
<<
y0
<<
z0
<<
1.0
;
v0
<<
x0
<<
y0
<<
z0
<<
1.0
;
v1
<<
x1
<<
y1
<<
z1
<<
1.0
;
v1
<<
x1
<<
y1
<<
z1
<<
1.0
;
// swap back to restore min/max order as necessary
if
(
v0
(
1
)
>
v1
(
1
))
{
v0
(
4
)
=
v0
(
1
);
v0
(
1
)
=
v1
(
1
);
v1
(
1
)
=
v0
(
4
);
}
if
(
v0
(
2
)
>
v1
(
2
))
{
v0
(
4
)
=
v0
(
2
);
v0
(
2
)
=
v1
(
2
);
v1
(
2
)
=
v0
(
4
);
}
if
(
v0
(
3
)
>
v1
(
3
))
{
v0
(
4
)
=
v0
(
3
);
v0
(
3
)
=
v1
(
3
);
v1
(
3
)
=
v0
(
4
);
}
v0
=
input_volume
.
niftivox2newimagevox_mat
()
*
v0
;
v0
=
input_volume
.
niftivox2newimagevox_mat
()
*
v0
;
v1
=
input_volume
.
niftivox2newimagevox_mat
()
*
v1
;
v1
=
input_volume
.
niftivox2newimagevox_mat
()
*
v1
;
x0
=
MISCMATHS
::
round
(
v0
(
1
));
y0
=
MISCMATHS
::
round
(
v0
(
2
));
z0
=
MISCMATHS
::
round
(
v0
(
3
));
x1
=
MISCMATHS
::
round
(
v1
(
1
));
y1
=
MISCMATHS
::
round
(
v1
(
2
));
z1
=
MISCMATHS
::
round
(
v1
(
3
));
// swap back to restore min/max order as necessary
int
tmp
;
if
(
x0
>
x1
)
{
tmp
=
x0
;
x0
=
x1
;
x1
=
tmp
;
}
if
(
y0
>
y1
)
{
tmp
=
y0
;
y0
=
y1
;
y1
=
tmp
;
}
if
(
z0
>
z1
)
{
tmp
=
z0
;
z0
=
z1
;
z1
=
tmp
;
}
for
(
int
t
=
0
;
t
<
input_volume
.
tsize
();
t
++
)
for
(
int
t
=
0
;
t
<
input_volume
.
tsize
();
t
++
)
for
(
int
z
=
0
;
z
<
input_volume
.
zsize
();
z
++
)
for
(
int
z
=
0
;
z
<
input_volume
.
zsize
();
z
++
)
for
(
int
y
=
0
;
y
<
input_volume
.
ysize
();
y
++
)
for
(
int
y
=
0
;
y
<
input_volume
.
ysize
();
y
++
)
for
(
int
x
=
0
;
x
<
input_volume
.
xsize
();
x
++
)
for
(
int
x
=
0
;
x
<
input_volume
.
xsize
();
x
++
)
if
((
x
<
v0
(
1
)
)
||
(
x
>=
v1
(
1
)
)
||
(
y
<
v0
(
2
)
)
||
(
y
>=
v1
(
2
)
)
||
(
z
<
v0
(
3
)
)
||
(
z
>=
v1
(
3
)
)
||
(
t
<
t0
)
||
(
t
>=
t1
)
)
if
((
x
<
x0
)
||
(
x
>=
x1
)
||
(
y
<
y0
)
||
(
y
>=
y1
)
||
(
z
<
z0
)
||
(
z
>=
z1
)
||
(
t
<
t0
)
||
(
t
>=
t1
)
)
input_volume
.
value
(
x
,
y
,
z
,
t
)
=
0
;
input_volume
.
value
(
x
,
y
,
z
,
t
)
=
0
;
i
+=
8
;
i
+=
8
;
}
}
...
...
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