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
tomoscan
Commits
c269f759
Commit
c269f759
authored
Mar 16, 2021
by
payno
Browse files
[TomoScanBase] add x, y and z translation attributs to TomoScanBase and EDFTomoScan.
This is not supported for EDF (but raise an error)
parent
05388877
Changes
3
Hide whitespace changes
Inline
Side-by-side
tomoscan/esrf/edfscan.py
View file @
c269f759
...
...
@@ -170,6 +170,21 @@ class EDFTomoScan(TomoScanBase):
self
.
__dim1
,
self
.
__dim2
=
EDFTomoScan
.
get_dim1_dim2
(
scan
=
self
.
path
)
return
self
.
__dim2
@
property
@
docstring
(
TomoScanBase
.
x_translation
)
def
x_translation
(
self
)
->
Union
[
None
,
tuple
]:
raise
NotImplementedError
(
"Not supported for EDF"
)
@
property
@
docstring
(
TomoScanBase
.
y_translation
)
def
y_translation
(
self
)
->
Union
[
None
,
tuple
]:
raise
NotImplementedError
(
"Not supported for EDF"
)
@
property
@
docstring
(
TomoScanBase
.
z_translation
)
def
z_translation
(
self
)
->
Union
[
None
,
tuple
]:
raise
NotImplementedError
(
"Not supported for EDF"
)
@
property
@
docstring
(
TomoScanBase
.
ff_interval
)
def
ff_interval
(
self
)
->
Union
[
None
,
int
]:
...
...
tomoscan/esrf/hdf5scan.py
View file @
c269f759
...
...
@@ -497,9 +497,7 @@ class HDF5TomoScan(TomoScanBase):
with
HDF5File
(
self
.
master_file
,
"r"
,
swmr
=
True
)
as
h5_file
:
_translations
=
h5_file
[
self
.
_entry
][
self
.
_X_TRANS_PATH
][()]
# cast in float
self
.
_x_translations
=
tuple
(
[
float
(
trans
)
for
trans
in
_translations
]
)
self
.
_x_translations
=
tuple
([
float
(
trans
)
for
trans
in
_translations
])
return
self
.
_x_translations
@
property
...
...
@@ -509,9 +507,7 @@ class HDF5TomoScan(TomoScanBase):
with
HDF5File
(
self
.
master_file
,
"r"
,
swmr
=
True
)
as
h5_file
:
_translations
=
h5_file
[
self
.
_entry
][
self
.
_Y_TRANS_PATH
][()]
# cast in float
self
.
_y_translations
=
tuple
(
[
float
(
trans
)
for
trans
in
_translations
]
)
self
.
_y_translations
=
tuple
([
float
(
trans
)
for
trans
in
_translations
])
return
self
.
_y_translations
@
property
...
...
@@ -521,9 +517,7 @@ class HDF5TomoScan(TomoScanBase):
with
HDF5File
(
self
.
master_file
,
"r"
,
swmr
=
True
)
as
h5_file
:
_translations
=
h5_file
[
self
.
_entry
][
self
.
_Z_TRANS_PATH
][()]
# cast in float
self
.
_z_translations
=
tuple
(
[
float
(
trans
)
for
trans
in
_translations
]
)
self
.
_z_translations
=
tuple
([
float
(
trans
)
for
trans
in
_translations
])
return
self
.
_z_translations
@
property
...
...
@@ -811,8 +805,12 @@ class HDF5TomoScan(TomoScanBase):
last_proj_frame
=
None
return_already_reach
=
False
for
i_frame
,
rot_a
,
img_key
,
x_tr
,
y_tr
,
z_tr
in
zip
(
range
(
len
(
rotation_angles
)),
rotation_angles
,
image_keys
,
x_translation
,
y_translation
,
z_translation
range
(
len
(
rotation_angles
)),
rotation_angles
,
image_keys
,
x_translation
,
y_translation
,
z_translation
,
):
url
=
DataUrl
(
file_path
=
self
.
master_file
,
...
...
@@ -920,7 +918,7 @@ class Frame:
image_key
:
typing
.
Union
[
None
,
ImageKey
,
int
]
=
None
,
rotation_angle
:
typing
.
Union
[
None
,
float
]
=
None
,
is_control_proj
:
bool
=
False
,
x_translation
:
typing
.
Union
[
None
,
float
]
=
None
,
x_translation
:
typing
.
Union
[
None
,
float
]
=
None
,
y_translation
:
typing
.
Union
[
None
,
float
]
=
None
,
z_translation
:
typing
.
Union
[
None
,
float
]
=
None
,
):
...
...
tomoscan/scanbase.py
View file @
c269f759
...
...
@@ -272,6 +272,18 @@ class TomoScanBase:
"""
raise
NotImplementedError
(
"Base class"
)
@
property
def
x_translation
(
self
)
->
typing
.
Union
[
None
,
tuple
]:
raise
NotImplementedError
(
"Base class"
)
@
property
def
y_translation
(
self
)
->
typing
.
Union
[
None
,
tuple
]:
raise
NotImplementedError
(
"Base class"
)
@
property
def
z_translation
(
self
)
->
typing
.
Union
[
None
,
tuple
]:
raise
NotImplementedError
(
"Base class"
)
def
get_distance
(
self
,
unit
=
"m"
)
->
Union
[
None
,
float
]:
"""
...
...
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