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
3470f4fd
Commit
3470f4fd
authored
Oct 01, 2020
by
myron
Committed by
Pierre Paleo
Oct 08, 2020
Browse files
break
parent
67a91dd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
nabu/preproc/alignment.py
View file @
3470f4fd
...
...
@@ -604,7 +604,7 @@ class CenterOfRotation(AlignmentBase):
class
CenterOfRotationAdaptiveSearch
(
CenterOfRotation
):
""" This adaptive method works by applying a gaussian which highlights, by apodisation, a region
which can possibly contain the good center of rotation.
The whole image is spanned during several applications of the apodisation
, a
t each application
The whole image is spanned during several applications of the apodisation
. A
t each application
the apodisation function, which is a gaussian, is moved to a new guess position.
The lenght of the step, by which the gaussian is moved, and its sigma are
obtained by multiplying the shortest distance to the left or right border with
...
...
@@ -738,12 +738,12 @@ class CenterOfRotationAdaptiveSearch(CenterOfRotation):
Xcor
=
lim1
while
Xcor
<
lim2
:
tmpsigma
=
min
(
tmp
_
sigma
=
min
(
(
img_1
.
shape
[
1
]
-
Xcor
)
,
(
Xcor
)
,
)
*
self
.
sigma_fraction
tmpx
=
(
np
.
arange
(
img_1
.
shape
[
1
])
-
Xcor
)
/
tmpsigma
tmpx
=
(
np
.
arange
(
img_1
.
shape
[
1
])
-
Xcor
)
/
tmp
_
sigma
apodis
=
np
.
exp
(
-
tmpx
*
tmpx
/
2.0
)
Xcor_rel
=
Xcor
-
(
img_1
.
shape
[
1
]
//
2
)
...
...
@@ -771,13 +771,13 @@ class CenterOfRotationAdaptiveSearch(CenterOfRotation):
cor_position
=
p2
/
2
cor_in_img
=
img_1
.
shape
[
1
]
//
2
+
cor_position
tmpsigma
=
min
(
tmp
_
sigma
=
min
(
(
img_1
.
shape
[
1
]
-
cor_in_img
)
,
(
cor_in_img
)
,
)
*
self
.
sigma_fraction
M1
=
int
(
round
(
cor_position
+
img_1
.
shape
[
1
]
//
2
))
-
int
(
round
(
tmpsigma
))
M2
=
int
(
round
(
cor_position
+
img_1
.
shape
[
1
]
//
2
))
+
int
(
round
(
tmpsigma
))
M1
=
int
(
round
(
cor_position
+
img_1
.
shape
[
1
]
//
2
))
-
int
(
round
(
tmp
_
sigma
))
M2
=
int
(
round
(
cor_position
+
img_1
.
shape
[
1
]
//
2
))
+
int
(
round
(
tmp
_
sigma
))
piece1
=
img_1
[:,
M1
:
M2
]
piece2
=
img_2
[:,
img_1
.
shape
[
1
]
-
M2
:
img_1
.
shape
[
1
]
-
M1
]
...
...
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