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
tomwer
Commits
a765355c
Commit
a765355c
authored
Dec 10, 2021
by
Henri Payno
Committed by
Henri Payno
May 03, 2022
Browse files
[core][normalization] readapt the normalization to fit latest ewoks
parent
268b99c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
tomwer/core/process/reconstruction/normalization/normalization.py
View file @
a765355c
...
...
@@ -34,6 +34,7 @@ __license__ = "MIT"
__date__
=
"25/06/2021"
from
tomwer.core.process.task
import
Task
from
.params
import
(
IntensityNormalizationParams
,
Method
,
...
...
@@ -41,9 +42,7 @@ from .params import (
_ValueCalculationMethod
,
_ValueCalculationFct
,
)
from
tomwer.core.process.baseprocess
import
SingleProcess
,
_input_desc
,
_output_desc
from
processview.core.superviseprocess
import
SuperviseProcess
from
tomwer.core.scan.scanbase
import
TomwerScanBase
from
silx.io.url
import
DataUrl
from
silx.io.utils
import
get_data
from
processview.core.dataset
import
DatasetIdentifier
...
...
@@ -60,21 +59,15 @@ from tomoscan.normalization import Method as TomoScanMethod
_logger
=
logging
.
getLogger
(
__name__
)
class
IntensityNormalizationProcess
(
SingleProcess
,
SuperviseProcess
):
class
IntensityNormalizationProcess
(
Task
,
SuperviseProcess
,
input_names
=
(
"data"
,),
output_names
=
(
"data"
,)
):
"""
Main process to launch several reconstruction of a single slice with
several Center Of Rotation (cor) values
Task to define the normalization to apply to a sinogram
"""
inputs
=
[
_input_desc
(
name
=
"data"
,
type
=
TomwerScanBase
,
handler
=
"pathReceived"
,
doc
=
"scan path"
),
]
outputs
=
[
_output_desc
(
name
=
"data"
,
type
=
TomwerScanBase
,
doc
=
"scan path"
)]
def
__init__
(
self
,
process_id
=
None
,
dump_process
=
True
):
SingleProcess
.
__init__
(
self
)
def
__init__
(
self
,
process_id
=
None
,
varinfo
=
None
,
inputs
=
None
,
label
=
None
):
Task
.
__init__
(
self
,
varinfo
=
varinfo
,
inputs
=
inputs
,
label
=
label
)
SuperviseProcess
.
__init__
(
self
,
process_id
=
process_id
)
self
.
_dry_run
=
False
...
...
@@ -87,9 +80,10 @@ class IntensityNormalizationProcess(SingleProcess, SuperviseProcess):
def
set_configuration
(
self
,
configuration
:
dict
)
->
None
:
self
.
set_properties
(
configuration
)
def
process
(
self
,
scan
:
typing
.
Union
[
None
,
TomwerScanBase
]
=
None
):
def
run
(
self
):
scan
=
self
.
inputs
.
data
if
scan
is
None
:
return
None
return
scan
.
intensity_normalization
.
tomwer_processing_res_code
=
None
params
=
IntensityNormalizationParams
.
from_dict
(
self
.
_settings
)
try
:
...
...
@@ -125,7 +119,7 @@ class IntensityNormalizationProcess(SingleProcess, SuperviseProcess):
extra_infos
=
params
.
extra_infos
,
)
return
scan
self
.
outputs
.
data
=
scan
def
_compute_from_manual_roi
(
self
,
scan
):
params
=
IntensityNormalizationParams
.
from_dict
(
self
.
get_configuration
())
...
...
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