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
9237f01b
Commit
9237f01b
authored
Nov 26, 2020
by
Pierre Paleo
Browse files
Add support for hdf5 entry in nabu config
parent
b9020e41
Pipeline
#37929
passed with stages
in 5 minutes and 48 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nabu/resources/dataset_analyzer.py
View file @
9237f01b
...
...
@@ -62,6 +62,7 @@ class DatasetAnalyzer(object):
"force_flatfield"
:
False
,
"output_dir"
:
None
,
"exclude_projections"
:
None
,
"hdf5_entry"
:
None
,
}
advanced_options
.
update
(
extra_options
)
self
.
extra_options
=
advanced_options
...
...
@@ -82,6 +83,8 @@ class DatasetAnalyzer(object):
}
if
filetype
not
in
scanners
.
keys
():
raise
ValueError
(
"No scanner for file type: %s"
%
filetype
)
if
filetype
==
"hdf5"
and
self
.
extra_options
[
"hdf5_entry"
]
is
not
None
:
kwargs
[
"entry"
]
=
self
.
extra_options
[
"hdf5_entry"
]
scanner
=
scanners
[
filetype
]
self
.
dataset_scanner
=
scanner
(
self
.
location
,
...
...
nabu/resources/nabu_config.py
View file @
9237f01b
...
...
@@ -23,6 +23,12 @@ nabu_config = {
"validator"
:
dataset_location_validator
,
"type"
:
"required"
,
},
"hdf5_entry"
:
{
"default"
:
""
,
"help"
:
"Entry in the HDF5 file, if applicable. Default is the first available entry."
,
"validator"
:
optional_string_validator
,
"type"
:
"advanced"
,
},
"binning"
:
{
"default"
:
"1"
,
"help"
:
"Binning factor in the horizontal dimension when reading the data.
\n
The final slices dimensions will be divided by 'slices_binning'"
,
...
...
nabu/resources/processconfig.py
View file @
9237f01b
...
...
@@ -70,7 +70,7 @@ class ProcessConfig:
"force_flatfield"
:
self
.
nabu_config
[
"preproc"
][
"flatfield_enabled"
]
==
"forced"
,
"exclude_projections"
:
self
.
nabu_config
[
"dataset"
][
"exclude_projections"
],
"output_dir"
:
self
.
nabu_config
[
"output"
][
"location"
],
"hdf5_entry"
:
self
.
nabu_config
[
"dataset"
][
"hdf5_entry"
],
},
logger
=
self
.
logger
)
...
...
nabu/resources/validators.py
View file @
9237f01b
...
...
@@ -92,6 +92,11 @@ def name_range_checker(name, valid_names, descr, replacements=None):
# ---------------------------- Validators --------------------------------------
# ------------------------------------------------------------------------------
@
validator
def
optional_string_validator
(
val
):
if
len
(
val
.
strip
())
==
0
:
return
None
return
val
@
validator
def
file_name_validator
(
name
):
...
...
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