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
7cb0117f
Commit
7cb0117f
authored
Apr 27, 2021
by
Pierre Paleo
Browse files
Add _convert_halftomo_right
parent
00bd9262
Changes
1
Hide whitespace changes
Inline
Side-by-side
nabu/preproc/sinogram.py
View file @
7cb0117f
...
...
@@ -171,7 +171,11 @@ def convert_halftomo(sino, rotation_axis_position):
"""
assert
sino
.
ndim
==
2
assert
(
sino
.
shape
[
0
]
%
2
)
==
0
na
,
nx
=
sino
.
shape
if
rotation_axis_position
>=
nx
:
return
_convert_halftomo_right
(
sino
,
rotation_axis_position
)
na2
=
na
//
2
r
=
rotation_axis_position
d
=
nx
-
r
...
...
@@ -189,6 +193,32 @@ def convert_halftomo(sino, rotation_axis_position):
return
res
def
_convert_halftomo_right
(
sino
,
rotation_axis_position
):
"""
Converts a sinogram into a sinogram with extended FOV with the "half tomography"
setting, with a CoR outside the image support.
"""
assert
sino
.
ndim
==
2
assert
(
sino
.
shape
[
0
]
%
2
)
==
0
assert
rotation_axis_position
>
sino
.
shape
[
1
]
na
,
nx
=
sino
.
shape
na2
=
na
//
2
r
=
rotation_axis_position
d
=
r
-
nx
res
=
np
.
zeros
((
na2
,
2
*
r
),
dtype
=
"f"
)
sino1
=
sino
[:
na2
,
:]
sino2
=
sino
[
na2
:,
::
-
1
]
w
=
np
.
linspace
(
0
,
1
,
d
,
endpoint
=
True
)
# has to be adapted when the sample actually goes beyond this point
res
[:,
:
nx
]
=
sino1
[:,
:]
res
[:,
nx
:
nx
+
d
]
=
sino1
[:,
-
d
:][:,
::
-
1
]
*
(
1
-
w
)
res
[:,
nx
+
d
:
nx
+
2
*
d
]
=
sino2
[:,
:
d
][:,
::
-
1
]
*
w
res
[:,
nx
+
2
*
d
:]
=
sino2
[:,
:]
return
res
class
SinoNormalization
(
SinoProcessing
):
"""
...
...
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