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
aa39301a
Commit
aa39301a
authored
May 19, 2021
by
Pierre Paleo
Browse files
Merge branch 'fix_tomwer_third_party' into 'release_2021.1.0'
Fix tomwer third party See merge request
!136
parents
ba30dfc5
b7eb49d5
Pipeline
#46981
passed with stage
in 5 minutes and 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nabu/resources/dataset_analyzer.py
View file @
aa39301a
...
...
@@ -287,13 +287,15 @@ class HDF5DatasetAnalyzer(DatasetAnalyzer):
"tomwer_processes.h5"
)
if
tomwer_processes_file
is
None
or
not
(
os
.
path
.
isfile
(
tomwer_processes_file
)):
return
False
self
.
logger
.
info
(
"Loading darks and refs from %s"
%
tomwer_processes_file
)
new_flats
=
get_flats_frm_process_file
(
tomwer_processes_file
,
self
.
dataset_scanner
.
entry
)
new_darks
=
get_darks_frm_process_file
(
tomwer_processes_file
,
self
.
dataset_scanner
.
entry
)
if
not
(
len
(
new_flats
)
>
0
and
len
(
new_darks
)
>
0
):
return
False
self
.
logger
.
info
(
"Loading darks and refs from %s"
%
tomwer_processes_file
)
self
.
flats
=
new_flats
self
.
darks
=
new_darks
return
True
...
...
nabu/thirdparty/tomwer_load_flats_darks.py
View file @
aa39301a
...
...
@@ -89,6 +89,8 @@ def get_darks_frm_process_file(process_file, entry) -> typing.Union[None, dict]:
for
key
,
value
in
dark_nodes
.
items
():
index_to_path
[
key
]
=
key
if
len
(
dark_nodes
)
==
0
:
return
{}
# take the last processed dark ref
last_process_index
=
sorted
(
dark_nodes
.
keys
())[
-
1
]
last_process_dark
=
index_to_path
[
last_process_index
]
...
...
@@ -133,6 +135,8 @@ def get_flats_frm_process_file(process_file, entry) -> typing.Union[None, dict]:
with
HDF5File
(
process_file
,
'r'
,
swmr
=
True
)
as
h5f
:
dkref_nodes
=
get_process_entries
(
root_node
=
h5f
[
entry
],
depth
=
MAX_DEPTH
-
1
)
if
len
(
dkref_nodes
)
==
0
:
return
{}
index_to_path
=
{}
for
key
,
value
in
dkref_nodes
.
items
():
index_to_path
[
key
]
=
key
...
...
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