Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XRD
darfix
Commits
148e2aa4
Commit
148e2aa4
authored
Jul 20, 2021
by
Julia Garriga Ferrer
Browse files
[core][roi] Fix typo when computing 2D roi
parent
6143d2bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
darfix/core/roi.py
View file @
148e2aa4
...
...
@@ -54,7 +54,8 @@ def apply_2D_ROI(img, origin=None, size=None, center=None):
and
all
(
j
<
img
.
shape
[
i
]
for
i
,
j
in
enumerate
(
origin
)),
"Origin must be a valid pixel"
origin
=
numpy
.
array
(
origin
)
size
=
numpy
.
array
(
size
)
points
=
numpy
.
array
([
origin
,
origin
+
size
])
points
=
numpy
.
ceil
([
origin
,
origin
+
size
]).
astype
(
numpy
.
int
)
points
[
1
]
=
numpy
.
minimum
(
points
[
1
],
img
.
shape
)
elif
center
is
not
None
:
assert
all
(
i
>=
0
for
i
in
center
)
\
and
all
(
j
<
img
.
shape
[
i
]
for
i
,
j
in
enumerate
(
center
)),
"Center must be a valid pixel"
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment