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
744e6dbf
Commit
744e6dbf
authored
Mar 02, 2020
by
Pierre Paleo
Browse files
HDF5TomoScan: swap dim_1 and dim_2
parent
9525bd3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
tomoscan/esrf/hdf5scan.py
View file @
744e6dbf
...
...
@@ -435,18 +435,14 @@ class HDF5TomoScan(TomoScanBase):
@
property
def
dim_1
(
self
)
->
typing
.
Union
[
None
,
int
]:
if
self
.
_dim_1
is
None
and
self
.
master_file
and
os
.
path
.
exists
(
self
.
master_file
):
if
self
.
projections
is
not
None
:
if
len
(
self
.
projections
)
>
0
:
self
.
_dim_1
,
self
.
_dim_2
=
get_data
(
list
(
self
.
projections
.
values
())[
0
]).
shape
if
self
.
_dim_1
is
None
:
self
.
_get_dim1_dim2
()
return
self
.
_dim_1
@
property
def
dim_2
(
self
)
->
typing
.
Union
[
None
,
int
]:
if
self
.
_dim_2
is
None
and
self
.
master_file
and
os
.
path
.
exists
(
self
.
master_file
):
if
self
.
projections
is
not
None
:
if
len
(
self
.
projections
)
>
0
:
self
.
_dim_1
,
self
.
_dim_2
=
get_data
(
list
(
self
.
projections
.
values
())[
0
]).
shape
if
self
.
_dim_2
is
None
:
self
.
_get_dim1_dim2
()
return
self
.
_dim_2
@
property
...
...
@@ -470,6 +466,12 @@ class HDF5TomoScan(TomoScanBase):
_y_pixel_size
=
self
.
_get_value
(
y_pixel_dataset
,
default_unit
=
'mm'
)
return
_x_pixel_size
,
_y_pixel_size
def
_get_dim1_dim2
(
self
):
if
self
.
master_file
and
os
.
path
.
exists
(
self
.
master_file
):
if
self
.
projections
is
not
None
:
if
len
(
self
.
projections
)
>
0
:
self
.
_dim_2
,
self
.
_dim_1
=
get_data
(
list
(
self
.
projections
.
values
())[
0
]).
shape
@
property
def
y_pixel_size
(
self
)
->
typing
.
Union
[
None
,
float
]:
if
(
self
.
_y_pixel_size
is
None
and
self
.
master_file
and
...
...
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