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
6895d272
Commit
6895d272
authored
May 25, 2020
by
Nicola Vigano
Browse files
CoR: refactored module and class names
Signed-off-by:
Nicola VIGANÒ
<
nicola.vigano@esrf.fr
>
parent
91d431d4
Pipeline
#26223
passed with stages
in 3 minutes and 43 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
doc/apidoc/nabu.preproc.
cor
.rst
→
doc/apidoc/nabu.preproc.
alignment
.rst
View file @
6895d272
nabu.preproc.
cor
module
nabu.preproc.
alignment
module
=======================
.. automodule:: nabu.preproc.
cor
.. automodule:: nabu.preproc.
alignment
:members:
:undoc-members:
:show-inheritance:
doc/apidoc/nabu.preproc.rst
View file @
6895d272
...
...
@@ -9,7 +9,7 @@ Submodules
nabu.preproc.ccd
nabu.preproc.ccd_cuda
nabu.preproc.
cor
nabu.preproc.
alignment
nabu.preproc.double_flat_field
nabu.preproc.phase
nabu.preproc.phase_cuda
...
...
nabu/preproc/
cor
.py
→
nabu/preproc/
alignment
.py
View file @
6895d272
...
...
@@ -7,7 +7,7 @@ from silx.math import medianfilter
from
nabu.utils
import
previouspow2
class
C
ORCalcul
ation
(
object
):
class
C
enterOfRot
ation
(
object
):
def
__init__
(
self
,
...
...
@@ -187,7 +187,7 @@ class CORCalculation(object):
>>> radio1 = data[0, :, :]
... radio2 = np.fliplr(data[1, :, :])
... CoR_calc = C
ORCalcul
ation(poly_deg=2)
... CoR_calc = C
enterOfRot
ation(poly_deg=2)
... cor_position = CoR_calc.find_shift(radio1, radio2)
Or for noisy images:
...
...
nabu/preproc/tests/test_cor.py
View file @
6895d272
...
...
@@ -3,7 +3,7 @@ import numpy as np
import
os
import
h5py
from
nabu.preproc.
cor
import
CORCalcul
ation
from
nabu.preproc.
alignment
import
CenterOfRot
ation
from
nabu.testutils
import
utilstest
...
...
@@ -36,7 +36,7 @@ class TestCor:
radio1
=
self
.
data
[
0
,
:,
:]
radio2
=
np
.
fliplr
(
self
.
data
[
1
,
:,
:])
CoR_calc
=
C
ORCalcul
ation
(
poly_deg
=
2
)
CoR_calc
=
C
enterOfRot
ation
(
poly_deg
=
2
)
cor_position
=
CoR_calc
.
find_shift
(
radio1
,
radio2
)
message
=
"Computed CoR %f "
%
cor_position
+
" and real CoR %f do not coincide"
%
self
.
px
...
...
@@ -49,14 +49,14 @@ class TestCor:
radio1
=
np
.
random
.
poisson
(
radio1
*
400
)
radio2
=
np
.
random
.
poisson
(
np
.
fliplr
(
radio2
)
*
400
)
CoR_calc
=
C
ORCalcul
ation
(
poly_deg
=
2
)
CoR_calc
=
C
enterOfRot
ation
(
poly_deg
=
2
)
cor_position
=
CoR_calc
.
find_shift
(
radio1
,
radio2
,
median_filt_shape
=
(
3
,
3
))
message
=
"Computed CoR %f "
%
cor_position
+
" and real CoR %f do not coincide"
%
self
.
px
assert
np
.
abs
(
self
.
px
-
cor_position
)
<
self
.
cor_tol
,
message
def
test_error_checking_001
(
self
):
CoR_calc
=
C
ORCalcul
ation
(
poly_deg
=
2
)
CoR_calc
=
C
enterOfRot
ation
(
poly_deg
=
2
)
radio1
=
self
.
data
[
0
,
:,
:
1
:]
radio2
=
self
.
data
[
1
,
:,
:]
...
...
@@ -68,7 +68,7 @@ class TestCor:
assert
'Images need to be 2-dimensional. Shape of image #1'
in
str
(
ex
.
value
),
message
def
test_error_checking_002
(
self
):
CoR_calc
=
C
ORCalcul
ation
(
poly_deg
=
2
)
CoR_calc
=
C
enterOfRot
ation
(
poly_deg
=
2
)
radio1
=
self
.
data
[
0
,
:,
:]
radio2
=
self
.
data
...
...
@@ -80,7 +80,7 @@ class TestCor:
assert
'Images need to be 2-dimensional. Shape of image #2'
in
str
(
ex
.
value
),
message
def
test_error_checking_003
(
self
):
CoR_calc
=
C
ORCalcul
ation
(
poly_deg
=
2
)
CoR_calc
=
C
enterOfRot
ation
(
poly_deg
=
2
)
radio1
=
self
.
data
[
0
,
:,
:]
radio2
=
self
.
data
[
1
,
:,
0
:
10
]
...
...
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