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

[core][normalization] save both tomwer code result and result

parent 818140d6
......@@ -226,9 +226,9 @@ class NormIOW(WidgetLongProcessing, SuperviseOW):
process_index=scan.pop_process_index(),
)
if scan.intensity_normalization.tomwer_processing_res is True:
if scan.intensity_normalization.tomwer_processing_res_code is True:
self.notify_succeed(scan=scan)
elif scan.intensity_normalization.tomwer_processing_res is False:
elif scan.intensity_normalization.tomwer_processing_res_code is False:
self.notify_failed(scan=scan)
else:
self.notify_skip(scan=scan)
......
......@@ -168,7 +168,9 @@ class TestProcessing(TestCaseQt):
DatasetState.SUCCEED,
)
# insure a normalization has been registered
self.assertTrue(self.scan_3.intensity_normalization.tomwer_processing_res, True)
self.assertTrue(
self.scan_3.intensity_normalization.tomwer_processing_res_code, True
)
def testTestLbsram(self):
"""Test scan are all validated if 'low memory on lbsram' scenario is
......
......@@ -48,7 +48,9 @@ class IntensityNormalizationThread(qt.QThread):
def run(self) -> None:
process = IntensityNormalizationProcess(process_id=None)
process.set_properties(self._configuration)
self._result = process.process(self.scan)
self._result = process.process(
self.scan
).intensity_normalization.tomwer_processing_res
class NormIntensityWindow(_NormIntensityWindow):
......@@ -75,7 +77,6 @@ class NormIntensityWindow(_NormIntensityWindow):
},
process_index=scan.pop_process_index(),
)
self.close()
def _launchProcessing(self):
......
......@@ -90,7 +90,7 @@ class IntensityNormalizationProcess(SingleProcess, SuperviseProcess):
def process(self, scan: typing.Union[None, TomwerScanBase] = None):
if scan is None:
return None
scan.intensity_normalization.tomwer_processing_res = None
scan.intensity_normalization.tomwer_processing_res_code = None
params = IntensityNormalizationParams.from_dict(self._settings)
try:
if params.method is Method.MANUAL_ROI:
......@@ -109,10 +109,10 @@ class IntensityNormalizationProcess(SingleProcess, SuperviseProcess):
raise ValueError("method {} is not handled".format(params.method))
except Exception as e:
_logger.error(e)
scan.intensity_normalization.tomwer_processing_res = False
scan.intensity_normalization.tomwer_processing_res_code = False
else:
scan.intensity_normalization.tomwer_processing_res = True
scan.intensity_normalization.tomwer_processing_res_code = True
scan.intensity_normalization.tomwer_processing_res = res
if need_conversion_to_tomoscan:
results_to_tomoscan_norm(
scan=scan,
......
......@@ -98,7 +98,7 @@ class TestNormalization(unittest.TestCase):
}
process.set_properties(process_params)
res = process.process(self.scan)
res = process.process(self.scan).intensity_normalization.tomwer_processing_res
if isinstance(res, numpy.ndarray):
numpy.testing.assert_array_equal(
res, expected_results[calc_fct][calc_method]
......
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