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
Nabu
Commits
596e5039
Commit
596e5039
authored
Oct 01, 2020
by
Pierre Paleo
Committed by
Pierre Paleo
Oct 08, 2020
Browse files
Update validator for auto-CoR
parent
7f5957db
Changes
2
Hide whitespace changes
Inline
Side-by-side
nabu/resources/params.py
View file @
596e5039
...
...
@@ -134,3 +134,17 @@ sino_normalizations = {
""
:
None
,
"chebyshev"
:
"chebyshev"
,
}
class
CorMethods
(
Enum
):
AUTO
=
"centered"
CENTERED
=
"centered"
GLOBAL
=
"global"
cor_methods
=
{
"auto"
:
"centered"
,
"centered"
:
"centered"
,
"global"
:
"global"
,
}
nabu/resources/validators.py
View file @
596e5039
...
...
@@ -217,16 +217,18 @@ def optional_float_validator(val):
@
validator
def
cor_validator
(
val
):
if
isinstance
(
val
,
float
):
return
val
elif
len
(
val
.
strip
())
>=
1
:
if
val
.
lower
()
in
[
"auto"
,
"global"
,
"centered"
]:
return
val
.
lower
()
val_float
,
error
=
convert_to_float
(
val
)
assert
error
is
None
,
"Invalid number"
val_float
,
error
=
convert_to_float
(
val
)
if
error
is
None
:
return
val_float
else
:
if
len
(
val
.
strip
())
==
0
:
return
None
val
=
name_range_checker
(
val
.
lower
(),
CorMethods
.
values
(),
"center of rotation estimation method"
,
replacements
=
cor_methods
)
return
val
@
validator
...
...
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