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
tomotools
Nabu
Commits
b2794cf5
Commit
b2794cf5
authored
Sep 25, 2020
by
myron
Committed by
Pierre Paleo
Oct 08, 2020
Browse files
added documentation for global search
parent
a1ae1f9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
nabu/preproc/alignment.py
View file @
b2794cf5
...
...
@@ -95,13 +95,9 @@ class AlignmentBase(object):
shape_1
=
np
.
squeeze
(
img_1
).
shape
shape_2
=
np
.
squeeze
(
img_2
).
shape
if
not
len
(
shape_1
)
==
2
:
raise
ValueError
(
"Images need to be 2-dimensional. Shape of image #1: %s"
%
(
" "
.
join
((
"%d"
%
x
for
x
in
shape_1
)))
)
raise
ValueError
(
"Images need to be 2-dimensional. Shape of image #1: %s"
%
(
" "
.
join
((
"%d"
%
x
for
x
in
shape_1
))))
if
not
len
(
shape_2
)
==
2
:
raise
ValueError
(
"Images need to be 2-dimensional. Shape of image #2: %s"
%
(
" "
.
join
((
"%d"
%
x
for
x
in
shape_2
)))
)
raise
ValueError
(
"Images need to be 2-dimensional. Shape of image #2: %s"
%
(
" "
.
join
((
"%d"
%
x
for
x
in
shape_2
))))
if
not
np
.
all
(
shape_1
==
shape_2
):
raise
ValueError
(
"Images need to be of the same shape. Shape of image #1: %s, image #2: %s"
...
...
@@ -240,9 +236,7 @@ class AlignmentBase(object):
upper_bound_ok
=
vertex_x
<
vertex_max_x
if
not
np
.
all
(
lower_bound_ok
*
upper_bound_ok
):
if
len
(
f_vals
.
shape
)
==
1
:
message
=
"Fitted position {} is outide the input margins [{}, {}]"
.
format
(
vertex_x
,
vertex_min_x
,
vertex_max_x
)
message
=
"Fitted position {} is outide the input margins [{}, {}]"
.
format
(
vertex_x
,
vertex_min_x
,
vertex_max_x
)
else
:
message
=
"Fitted positions outide the input margins [{}, {}]: %d below and %d above"
.
format
(
vertex_min_x
,
vertex_max_x
,
np
.
sum
(
1
-
lower_bound_ok
),
np
.
sum
(
1
-
upper_bound_ok
),
...
...
@@ -582,6 +576,9 @@ class CenterOfRotation(AlignmentBase):
half_tomo_cor_guess: float or None
The approximate position of the rotation axis from the image center. Optional.
When given a special algorithm is used which can work also in half-tomo conditions
global_search: False, True or a couple of floats
If True a global search is done on on the detector span without assuming centered scan conditions.
If (lim1,lim2) the search is done between lim1 and lim2
Raises
------
...
...
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