Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tomotools
tomwer
Commits
faf92356
Commit
faf92356
authored
Jul 20, 2021
by
payno
Committed by
Henri Payno
May 03, 2022
Browse files
[core][normalization] clamp manual ROI if / when necessary
parent
b99e8938
Changes
1
Show whitespace changes
Inline
Side-by-side
tomwer/core/process/reconstruction/normalization/normalization.py
View file @
faf92356
...
...
@@ -197,6 +197,11 @@ class IntensityNormalizationProcess(SingleProcess, SuperviseProcess):
start_y
=
int
(
start_y
)
end_x
=
int
(
end_x
)
end_y
=
int
(
end_y
)
# clamp ROI with 0 border
start_x
=
max
(
0
,
start_x
)
start_y
=
max
(
0
,
start_y
)
end_x
=
max
(
0
,
end_x
)
end_y
=
max
(
0
,
end_y
)
scan
=
dataset_identifier
.
recreate_dataset
()
projections
=
scan
.
projections
if
calc_area
is
_CalculationArea
.
VOLUME
:
...
...
@@ -244,6 +249,13 @@ class IntensityNormalizationProcess(SingleProcess, SuperviseProcess):
append_url
(
url
)
data
=
silx
.
io
.
get_data
(
url
)
if
data
.
ndim
<
2
:
raise
ValueError
(
"data is expected to be at least 2D"
)
# clamp ROI with frame size
start_x
=
min
(
data
.
shape
[
-
1
],
start_x
)
start_y
=
min
(
data
.
shape
[
-
2
],
start_y
)
end_x
=
min
(
data
.
shape
[
-
1
],
end_x
)
end_y
=
min
(
data
.
shape
[
-
2
],
end_y
)
def
retrieve_data_proj_indexes
(
url_
):
urls
=
[]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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