Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
Nabu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
67
Issues
67
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tomotools
Nabu
Commits
9237f01b
Commit
9237f01b
authored
Nov 26, 2020
by
Pierre Paleo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
4 changed files
with
15 additions
and
1 deletion
+15
-1
nabu/resources/dataset_analyzer.py
nabu/resources/dataset_analyzer.py
+3
-0
nabu/resources/nabu_config.py
nabu/resources/nabu_config.py
+6
-0
nabu/resources/processconfig.py
nabu/resources/processconfig.py
+1
-1
nabu/resources/validators.py
nabu/resources/validators.py
+5
-0
No files found.
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
Markdown
is supported
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