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

fix typo substraction vs subtraction

parent aec34f30
......@@ -81,7 +81,7 @@ normalization_config_test = (
# substract a roi
(
_norm_setting(
method="substraction",
method="subtraction",
source="manual ROI",
extra_infos={
"start_x": 0.0,
......@@ -94,14 +94,14 @@ normalization_config_test = (
},
),
_nabu_norm_field(
sino_normalization="substraction",
sino_normalization="subtraction",
has_sino_normalization_file=True,
),
),
# substract from a dataset
(
_norm_setting(
method="substraction",
method="subtraction",
source="from dataset",
extra_infos={
"dataset_url": DataUrl(
......@@ -115,7 +115,7 @@ normalization_config_test = (
},
),
_nabu_norm_field(
sino_normalization="substraction",
sino_normalization="subtraction",
has_sino_normalization_file=True,
),
),
......
......@@ -71,7 +71,7 @@ class TestNormalization(unittest.TestCase):
).reshape(2, 100, 100)
process_params = normalization.IntensityNormalizationParams()
process_params.method = Method.SUBSTRACTION
process_params.method = Method.SUBTRACTION
process_params.source = params._ValueSource.MANUAL_ROI
expected_results = {
"mean": {
......
......@@ -136,13 +136,13 @@ class NormIntensityWindow(qt.QMainWindow):
method = self.getCurrentMethod()
scan = self.getScan()
methods_using_manual_roi = (Method.DIVISION, Method.SUBSTRACTION)
methods_using_manual_roi = (Method.DIVISION, Method.SUBTRACTION)
self._centralWidget.setManualROIVisible(
source is _ValueSource.MANUAL_ROI and method in methods_using_manual_roi
)
if scan:
methods_requesting_calculation = (Method.DIVISION, Method.SUBSTRACTION)
methods_requesting_calculation = (Method.DIVISION, Method.SUBTRACTION)
if method in methods_requesting_calculation:
# if the normed sinogram can be obtained `directly`
if source in (_ValueSource.MANUAL_SCALAR, _ValueSource.DATASET):
......@@ -226,7 +226,7 @@ class _Viewer(qt.QTabWidget):
display_sino_roi = source is _ValueSource.MANUAL_ROI and method in (
Method.DIVISION,
Method.SUBSTRACTION,
Method.SUBTRACTION,
)
if display_sino_roi:
......@@ -508,7 +508,7 @@ class _NormIntensityOptions(qt.QWidget):
def _sourceChanged(self):
source = self.getCurrentSource()
method = self.getCurrentMethod()
interactive_methods = (Method.DIVISION, Method.SUBSTRACTION)
interactive_methods = (Method.DIVISION, Method.SUBTRACTION)
interactive_sources = (
_ValueSource.MANUAL_ROI,
_ValueSource.AUTO_ROI,
......@@ -557,7 +557,7 @@ class _NormIntensityOptions(qt.QWidget):
self._modeCB.setCurrentIndex(idx)
def getCurrentSource(self):
if self.getCurrentMethod() in (Method.DIVISION, Method.SUBSTRACTION):
if self.getCurrentMethod() in (Method.DIVISION, Method.SUBTRACTION):
return _ValueSource.from_value(self._sourceCB.currentText())
else:
return _ValueSource.NONE
......@@ -569,7 +569,7 @@ class _NormIntensityOptions(qt.QWidget):
def _modeChanged(self, *args, **kwargs):
mode = self.getCurrentMethod()
mode_with_calculations = (Method.DIVISION, Method.SUBSTRACTION)
mode_with_calculations = (Method.DIVISION, Method.SUBTRACTION)
self._intensityCalcOpts.setVisible(mode in mode_with_calculations)
self._sourceCB.setVisible(mode in mode_with_calculations)
self._sourceLabel.setVisible(mode in mode_with_calculations)
......
......@@ -84,12 +84,12 @@ class TestNormIntensityWindow(TestCaseQt):
"source": "none",
}
self._widget.setCurrentMethod(NormalizationMethod.SUBSTRACTION)
self._widget.setCurrentMethod(NormalizationMethod.SUBTRACTION)
self.qapp.processEvents()
self._widget.setCurrentSource(NormalizationSource.MANUAL_ROI)
self.qapp.processEvents()
output_configuration = self._widget.getConfiguration()
assert output_configuration["method"] == "substraction"
assert output_configuration["method"] == "subtraction"
assert output_configuration["source"] == "manual ROI"
assert "start_x" in output_configuration
assert "end_x" in output_configuration
......
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