Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nabu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Vincent
Nabu
Commits
0c36e142
Commit
0c36e142
authored
3 years ago
by
Pierre Paleo
Browse files
Options
Downloads
Patches
Plain Diff
Fix merge_hdf5_reconstructions() order wrong for more than 9999 projections
parent
ecdd45c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nabu/pipeline/fullfield/local_reconstruction.py
+21
-2
21 additions, 2 deletions
nabu/pipeline/fullfield/local_reconstruction.py
with
21 additions
and
2 deletions
nabu/pipeline/fullfield/local_reconstruction.py
+
21
−
2
View file @
0c36e142
...
...
@@ -23,6 +23,10 @@ def get_gpus_ids(resources_cfg):
return
list
(
range
(
resources_cfg
[
"
gpus
"
]))
def
variable_idxlen_sort
(
fname
):
return
int
(
fname
.
split
(
"
_
"
)[
-
1
].
split
(
"
.
"
)[
0
])
class
ChunkedReconstructor
:
"""
A class for doing full-volume reconstructions.
...
...
@@ -369,7 +373,13 @@ class ChunkedReconstructor:
out_cfg
=
self
.
process_config
.
nabu_config
[
"
output
"
]
if
files
is
None
:
files
=
list
(
self
.
results
.
values
())
files
.
sort
()
try
:
files
.
sort
(
key
=
variable_idxlen_sort
)
except
:
self
.
logger
.
error
(
"
Lexical ordering failed, falling back to default sort - it will fail for more than 10k projections
"
)
files
.
sort
()
local_files
=
[
join
(
out_cfg
[
"
file_prefix
"
],
basename
(
fname
))
for
fname
in
files
...
...
@@ -464,7 +474,14 @@ class ChunkedReconstructor:
#
h5_path
=
join
(
masterfile_entry
,
*
[
masterfile_process_name
,
"
results
"
,
"
data
"
])
#
files
=
sorted
(
self
.
_histograms
.
values
())
try
:
files
=
sorted
(
self
.
_histograms
.
values
(),
key
=
variable_idxlen_sort
)
except
:
self
.
logger
.
error
(
"
Lexical ordering of histogram failed, falling back to default sort - it will fail for more than 10k projections
"
)
files
=
sorted
(
self
.
_histograms
.
values
())
data_urls
=
[]
for
fname
in
files
:
url
=
DataUrl
(
...
...
@@ -808,7 +825,9 @@ class GroupedReconstructor(ChunkedReconstructor):
self
.
logger
.
info
(
"
Resuming from sinograms in %s
"
%
projections
)
if
projections
is
None
:
self
.
set_reconstruction_state
(
"
radios
"
)
# TODO this is clumsy - see comment above the class definition
LocalReconstruction
.
reconstruct
(
self
)
#
self
.
_projections
=
self
.
merge_hdf5_reconstructions
(
prefix
=
"
sinogram_
"
,
merge_histograms
=
False
)
self
.
merge_data_dumps
(
axis
=
0
)
self
.
_destroy_pipeline
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment