Commit 70b779c7 authored by payno's avatar payno Committed by Henri Payno
Browse files

[intensity] add process registration on the tomwer_processes.h5

parent 2a113b32
......@@ -51,6 +51,9 @@ from tomwer.synctools.stacks.reconstruction.normalization import (
)
from processview.core.manager import ProcessManager
from processview.core.manager import DatasetState
from tomwer.core.process.reconstruction.normalization import (
IntensityNormalizationProcess,
)
import functools
_logger = logging.getLogger(__name__)
......@@ -189,6 +192,22 @@ class NormIOW(WidgetLongProcessing, SuperviseOW):
self._window._processScan(scan=scan)
def _validate(self, scan):
if scan is None:
return
# save processing result for the one with interaction. Otherwise
# this will be saved in the processing thread
IntensityNormalizationProcess._register_process(
process_file=scan.process_file,
process=IntensityNormalizationProcess,
entry=scan.entry,
configuration=self.getConfiguration(),
results={
"method": scan.intensity_normalization.method.value,
"extra_infos": scan.intensity_normalization.get_extra_infos(),
},
process_index=scan.pop_process_index(),
)
self.Outputs.data_out.send(scan)
def _skipCurrentScan(self, new_scan):
......
......@@ -62,9 +62,21 @@ class NormIntensityWindow(_NormIntensityWindow):
self._processingThread.finished.connect(self._threadedProcessEnded)
def _validated(self):
raise NotImplementedError("not implemented")
# TODO: should hide / close the window and insure result are saved
# in the .hdf5 file
scan = self.getScan()
if scan is not None:
IntensityNormalizationProcess._register_process(
process_file=scan.process_file,
process=IntensityNormalizationProcess,
entry=scan.entry,
configuration=self.getConfiguration(),
results={
"method": scan.intensity_normalization.method.value,
"extra_infos": scan.intensity_normalization.get_extra_infos(),
},
process_index=scan.pop_process_index(),
)
self.close()
def _launchProcessing(self):
self.clear()
......@@ -178,8 +190,6 @@ def main(argv):
if options.debug:
_logger.setLevel(logging.DEBUG)
scan.normed_darks
scan.normed_flats
window = NormIntensityWindow(parent=None)
window.setWindowTitle("sinogram-norm-intensity")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment