tomwer 1.0.4__py3-none-any.whl → 1.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- orangecontrib/tomwer/tutorials/EBS_tomo_listener.ows +39 -0
- orangecontrib/tomwer/tutorials/cast_volume.ows +34 -0
- orangecontrib/tomwer/tutorials/simple_slice_reconstruction.ows +39 -0
- orangecontrib/tomwer/tutorials/simple_volume_local_reconstruction.ows +49 -0
- orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +59 -0
- orangecontrib/tomwer/tutorials/using_saaxis_to_find_cor.ows +44 -0
- orangecontrib/tomwer/widgets/cluster/FutureSupervisorOW.py +1 -1
- orangecontrib/tomwer/widgets/cluster/SlurmClusterOW.py +14 -4
- orangecontrib/tomwer/widgets/cluster/__init__.py +1 -1
- orangecontrib/tomwer/widgets/control/DataListOW.py +12 -5
- orangecontrib/tomwer/widgets/control/DataListenerOW.py +18 -9
- orangecontrib/tomwer/widgets/control/DataSelectorOW.py +13 -6
- orangecontrib/tomwer/widgets/control/DataTransfertOW.py +4 -5
- orangecontrib/tomwer/widgets/control/DataValidatorOW.py +8 -4
- orangecontrib/tomwer/widgets/control/DataWatcherOW.py +4 -6
- orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +49 -62
- orangecontrib/tomwer/widgets/control/FilterOW.py +2 -4
- orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +93 -0
- orangecontrib/tomwer/widgets/control/NXTomomillOW.py +135 -128
- orangecontrib/tomwer/widgets/control/NotifierOW.py +31 -7
- orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +3 -5
- orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +85 -0
- orangecontrib/tomwer/widgets/control/VolumeSelector.py +12 -4
- orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +11 -7
- orangecontrib/tomwer/widgets/control/icons/notification.svg +4 -4
- orangecontrib/tomwer/widgets/control/icons/nxtomomill.png +0 -0
- orangecontrib/tomwer/widgets/control/icons/nxtomomill.svg +8 -5
- orangecontrib/tomwer/widgets/control/icons/tomoobjserie.png +0 -0
- orangecontrib/tomwer/widgets/control/icons/tomoobjserie.svg +138 -0
- orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +16 -4
- orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +100 -0
- orangecontrib/tomwer/widgets/edit/icons/image_key_editor.png +0 -0
- orangecontrib/tomwer/widgets/edit/icons/image_key_upgrader.png +0 -0
- orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.png +0 -0
- orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.svg +123 -0
- orangecontrib/tomwer/widgets/edit/test/test_dark_flat_patch.py +21 -1
- orangecontrib/tomwer/widgets/edit/test/test_image_key_editor.py +1 -1
- orangecontrib/tomwer/widgets/edit/test/test_image_key_upgrader.py +1 -1
- orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +25 -0
- orangecontrib/tomwer/widgets/other/PythonScriptOW.py +19 -10
- orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +20 -14
- orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +24 -10
- orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py +26 -21
- orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +29 -12
- orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +44 -17
- orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +28 -18
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +24 -17
- orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +6 -6
- orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +4 -2
- orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.png +0 -0
- orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.svg +11 -8
- orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +10 -4
- orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +69 -0
- orangecontrib/tomwer/widgets/visualization/SampleMovedOW.py +2 -4
- orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.png +0 -0
- orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.svg +105 -0
- tomwer/__main__.py +10 -5
- tomwer/app/canvas_launcher/config.py +10 -10
- tomwer/app/canvas_launcher/mainwindow.py +68 -6
- tomwer/app/canvas_launcher/widgetsscheme.py +1 -3
- tomwer/app/darkref.py +16 -12
- tomwer/app/imagekeyeditor.py +2 -2
- tomwer/app/imagekeyupgrader.py +104 -0
- tomwer/app/nxtomoeditor.py +103 -0
- tomwer/app/rsync.py +1 -1
- tomwer/core/cluster/cluster.py +1 -1
- tomwer/core/futureobject.py +1 -0
- tomwer/core/process/control/datalistener/datalistener.py +7 -1
- tomwer/core/process/control/datalistener/rpcserver.py +3 -3
- tomwer/core/process/control/datawatcher/datawatcher.py +18 -18
- tomwer/core/process/control/datawatcher/datawatcherobserver.py +5 -8
- tomwer/core/process/control/datawatcher/datawatcherprocess.py +2 -3
- tomwer/core/process/control/datawatcher/edfdwprocess.py +2 -2
- tomwer/core/process/control/nxtomomill.py +33 -58
- tomwer/core/process/control/scanlist.py +2 -1
- tomwer/core/process/control/scanselector.py +7 -0
- tomwer/core/process/control/scantransfer.py +9 -18
- tomwer/core/process/control/scanvalidator.py +6 -5
- tomwer/core/process/control/singletomoobj.py +2 -1
- tomwer/core/process/control/timer.py +2 -1
- tomwer/core/process/control/tomoobjserie.py +8 -0
- tomwer/core/process/control/volumeselector.py +2 -1
- tomwer/core/process/control/volumesymlink.py +2 -1
- tomwer/core/process/edit/darkflatpatch.py +2 -1
- tomwer/core/process/edit/imagekeyeditor.py +4 -3
- tomwer/core/process/reconstruction/axis/axis.py +29 -32
- tomwer/core/process/reconstruction/axis/mode.py +3 -2
- tomwer/core/process/reconstruction/axis/params.py +35 -16
- tomwer/core/process/reconstruction/darkref/darkrefs.py +90 -707
- tomwer/core/process/reconstruction/darkref/darkrefscopy.py +44 -16
- tomwer/core/process/reconstruction/darkref/params.py +62 -67
- tomwer/core/process/reconstruction/lamino/tofu.py +1 -1
- tomwer/core/process/reconstruction/nabu/castvolume.py +21 -26
- tomwer/core/process/reconstruction/nabu/nabucommon.py +36 -38
- tomwer/core/process/reconstruction/nabu/nabuscores.py +28 -13
- tomwer/core/process/reconstruction/nabu/nabuslices.py +41 -14
- tomwer/core/process/reconstruction/nabu/nabuvolume.py +21 -12
- tomwer/core/process/reconstruction/nabu/utils.py +12 -1
- tomwer/core/process/reconstruction/normalization/normalization.py +9 -8
- tomwer/core/process/reconstruction/saaxis/saaxis.py +46 -20
- tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +38 -12
- tomwer/core/process/reconstruction/test/__init__.py +0 -39
- tomwer/core/process/reconstruction/test/test_axis_params.py +25 -3
- tomwer/core/process/reconstruction/test/test_darkref_copy.py +117 -1
- tomwer/core/process/script/python.py +16 -12
- tomwer/core/process/task.py +3 -7
- tomwer/core/process/test/test_axis.py +1 -1
- tomwer/core/process/test/test_dark_and_flat.py +41 -111
- tomwer/core/process/test/test_data_listener.py +0 -29
- tomwer/core/process/test/test_data_transfer.py +10 -14
- tomwer/core/process/test/test_nabu.py +1 -1
- tomwer/core/process/test/test_normalization.py +1 -1
- tomwer/core/process/visualization/liveslice.py +6 -0
- tomwer/core/scan/blissscan.py +37 -2
- tomwer/core/scan/edfscan.py +14 -4
- tomwer/core/scan/hdf5scan.py +10 -4
- tomwer/core/scan/scanbase.py +35 -29
- tomwer/core/scan/scanfactory.py +3 -17
- tomwer/core/scan/test/test_h5.py +1 -1
- tomwer/core/scan/test/test_process_registration.py +0 -11
- tomwer/core/scan/test/test_scan.py +32 -30
- tomwer/core/settings.py +2 -2
- tomwer/core/test/test_utils.py +1 -1
- tomwer/core/tomwer_object.py +19 -0
- tomwer/core/utils/__init__.py +0 -45
- tomwer/core/utils/char.py +2 -0
- tomwer/core/utils/gpu.py +5 -5
- tomwer/core/utils/nxtomoutils.py +2 -2
- tomwer/core/utils/scanutils.py +50 -0
- tomwer/core/utils/volumeutils.py +13 -0
- tomwer/core/volume/edfvolume.py +4 -0
- tomwer/core/volume/hdf5volume.py +4 -0
- tomwer/core/volume/jp2kvolume.py +4 -0
- tomwer/core/volume/rawvolume.py +4 -0
- tomwer/core/volume/tiffvolume.py +4 -0
- tomwer/core/volume/volumebase.py +19 -12
- tomwer/core/volume/volumefactory.py +20 -1
- tomwer/gui/cluster/slurm.py +1 -1
- tomwer/gui/cluster/test/test_cluster.py +2 -2
- tomwer/gui/control/datalist.py +109 -34
- tomwer/gui/control/datatransfert.py +1 -1
- tomwer/gui/control/datawatcher/datawatcher.py +23 -13
- tomwer/gui/control/datawatcher/datawatcherobserver.py +1 -1
- tomwer/gui/control/observations.py +0 -3
- tomwer/gui/control/selectorwidgetbase.py +42 -11
- tomwer/gui/control/serie/seriecreator.py +967 -0
- tomwer/{web/__init__.py → gui/control/serie/seriewaiter.py} +5 -7
- tomwer/gui/control/singletomoobj.py +15 -3
- tomwer/gui/control/test/test_datalist.py +1 -1
- tomwer/gui/control/test/test_datalistener.py +1 -1
- tomwer/gui/control/test/test_inputwidget.py +1 -1
- tomwer/gui/control/test/test_process_manager.py +1 -13
- tomwer/gui/control/test/test_scanselector.py +1 -1
- tomwer/gui/control/test/test_scanvalidator.py +1 -1
- tomwer/gui/control/test/test_single_tomo_obj.py +1 -1
- tomwer/gui/control/test/test_volume_dialog.py +19 -7
- tomwer/gui/control/test/test_volumeselector.py +4 -4
- tomwer/gui/debugtools/datasetgenerator.py +1 -8
- tomwer/gui/edit/dkrfpatch.py +2 -2
- tomwer/gui/edit/imagekeyeditor.py +12 -9
- tomwer/gui/edit/nxtomoeditor.py +475 -0
- tomwer/gui/edit/test/test_dkrf_patch.py +2 -14
- tomwer/gui/edit/test/test_image_key_editor.py +2 -2
- tomwer/gui/edit/test/test_nx_editor.py +155 -0
- tomwer/gui/qfolderdialog.py +11 -0
- tomwer/gui/reconstruction/axis/CompareImages.py +27 -29
- tomwer/gui/reconstruction/axis/axis.py +2 -0
- tomwer/gui/reconstruction/axis/radioaxis.py +67 -11
- tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +7 -9
- tomwer/gui/reconstruction/darkref/darkrefwidget.py +22 -24
- tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
- tomwer/gui/reconstruction/lamino/tofu/tofu.py +3 -3
- tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +4 -4
- tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +10 -4
- tomwer/gui/reconstruction/nabu/castvolume.py +80 -11
- tomwer/gui/reconstruction/nabu/check.py +1 -1
- tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py +352 -0
- tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +0 -9
- tomwer/gui/reconstruction/nabu/nabuconfig/output.py +1 -1
- tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +18 -19
- tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +30 -7
- tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +26 -13
- tomwer/gui/reconstruction/nabu/slices.py +10 -2
- tomwer/gui/reconstruction/nabu/slurm.py +1 -1
- tomwer/gui/reconstruction/nabu/volume.py +13 -7
- tomwer/gui/reconstruction/normalization/intensity.py +1 -1
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +10 -34
- tomwer/gui/reconstruction/saaxis/saaxis.py +11 -6
- tomwer/gui/reconstruction/saaxis/sliceselector.py +11 -26
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +13 -8
- tomwer/gui/reconstruction/scores/scoreplot.py +67 -61
- tomwer/gui/reconstruction/test/test_axis.py +2 -2
- tomwer/gui/reconstruction/test/test_lamino.py +2 -2
- tomwer/gui/reconstruction/test/test_nabu.py +14 -1
- tomwer/gui/reconstruction/test/test_saaxis.py +8 -17
- tomwer/gui/reconstruction/test/test_sadeltabeta.py +7 -13
- tomwer/gui/stackplot.py +11 -28
- tomwer/gui/test/test_axis_gui.py +4 -4
- tomwer/gui/test/test_qfolder_dialog.py +12 -0
- tomwer/gui/utils/inputwidget.py +42 -21
- tomwer/gui/utils/lineselector/lineselector.py +13 -21
- tomwer/gui/utils/scandescription.py +2 -4
- tomwer/gui/utils/slider.py +1 -102
- tomwer/gui/utils/unitsystem.py +48 -11
- tomwer/gui/visualization/dataviewer.py +24 -17
- tomwer/gui/visualization/diffviewer/diffviewer.py +2 -11
- tomwer/gui/visualization/nxtomometadata.py +21 -0
- tomwer/gui/visualization/scanoverview.py +0 -1
- tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +72 -0
- tomwer/gui/visualization/test/test_stacks.py +1 -1
- tomwer/gui/visualization/tomoobjoverview.py +49 -0
- tomwer/gui/visualization/volumeoverview.py +64 -0
- tomwer/gui/visualization/volumeviewer.py +1 -1
- tomwer/resources/gui/icons/multi-document-save.png +0 -0
- tomwer/resources/gui/icons/multi-document-save.svg +101 -0
- tomwer/resources/gui/illustrations/ctf_z1.png +0 -0
- tomwer/resources/gui/illustrations/ctf_z1.svg +471 -0
- tomwer/synctools/datalistener.py +5 -1
- tomwer/synctools/imageloaderthread.py +2 -2
- tomwer/synctools/stacks/edit/imagekeyeditor.py +1 -1
- tomwer/synctools/stacks/processingstack.py +2 -2
- tomwer/synctools/stacks/reconstruction/castvolume.py +1 -0
- tomwer/synctools/stacks/reconstruction/lamino.py +1 -3
- tomwer/synctools/stacks/reconstruction/sadeltabeta.py +0 -2
- tomwer/synctools/test/test_darkRefs.py +32 -149
- tomwer/synctools/test/test_foldertransfer.py +1 -1
- tomwer/synctools/test/test_scanstages.py +2 -2
- tomwer/tests/__init__.py +0 -0
- tomwer/tests/conftest.py +51 -0
- tomwer/{test → tests}/test_scripts.py +1 -1
- tomwer/tests/test_utils.py +10 -0
- tomwer/{test → tests}/utils/utilstest.py +0 -11
- tomwer/version.py +3 -3
- {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/METADATA +14 -16
- {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/RECORD +245 -217
- {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/WHEEL +1 -1
- {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/entry_points.txt +6 -0
- orangecontrib/tomwer/setup.py +0 -45
- orangecontrib/tomwer/widgets/setup.py +0 -49
- tomwer/app/process.py +0 -153
- tomwer/core/process/reconstruction/nabu/slurm.py +0 -36
- tomwer/core/process/reconstruction/utils/nabu_slice_exec.py +0 -10
- tomwer/core/utils/laminoutils.py +0 -80
- tomwer/gui/utils/lineselector/lineselection.py +0 -76
- tomwer/setup.py +0 -52
- tomwer/web/client.py +0 -43
- tomwer/web/config.py +0 -36
- tomwer/web/test/test_graylog_connection.py +0 -59
- {tomwer/test → orangecontrib/tomwer/tutorials}/__init__.py +0 -0
- /tomwer/{web/test → gui/control/serie}/__init__.py +0 -0
- /tomwer/{test → tests}/utils/__init__.py +0 -0
- /tomwer-1.0.4-py3.8-nspkg.pth → /tomwer-1.1.0-py3.9-nspkg.pth +0 -0
- {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/LICENSE +0 -0
- {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/top_level.txt +0 -0
@@ -93,11 +93,7 @@ class AxisOW(SuperviseOW, WidgetLongProcessing):
|
|
93
93
|
sigScanReady = qt.Signal(TomwerScanBase)
|
94
94
|
"""Signal emitted when a scan is ready"""
|
95
95
|
|
96
|
-
|
97
|
-
"AxisRP store as dict"
|
98
|
-
# this one is keep for backward compatibility. Will be removed on 0.10 I guess
|
99
|
-
|
100
|
-
static_input = Setting({"data": None, "axis_params": None})
|
96
|
+
_ewoks_default_inputs = Setting({"data": None, "axis_params": None, "gui": None})
|
101
97
|
|
102
98
|
class Inputs:
|
103
99
|
data = Input(name="data", type=TomwerScanBase, doc="one scan to be process")
|
@@ -126,17 +122,18 @@ class AxisOW(SuperviseOW, WidgetLongProcessing):
|
|
126
122
|
self._axis_params = axis_params or QAxisRP()
|
127
123
|
|
128
124
|
# handle settings
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
if axis_params_settings != dict():
|
125
|
+
# axis params settings
|
126
|
+
axis_params_settings = self._ewoks_default_inputs.get("axis_params", None)
|
127
|
+
if axis_params_settings not in (None, dict()):
|
133
128
|
try:
|
134
129
|
self._axis_params.load_from_dict(axis_params_settings)
|
135
130
|
except Exception as e:
|
136
|
-
logger.error("fail to load reconstruction settings:
|
137
|
-
|
131
|
+
logger.error(f"fail to load reconstruction settings: {str(e)}")
|
132
|
+
|
133
|
+
# gui settings
|
134
|
+
gui_settings = self._ewoks_default_inputs.get("gui", {})
|
138
135
|
if gui_settings is None:
|
139
|
-
gui_settings =
|
136
|
+
gui_settings = {}
|
140
137
|
|
141
138
|
original_mode = self._axis_params.mode
|
142
139
|
if original_mode is AxisMode.manual:
|
@@ -236,6 +233,16 @@ class AxisOW(SuperviseOW, WidgetLongProcessing):
|
|
236
233
|
relative_cor=original_cor, abs_cor=None
|
237
234
|
)
|
238
235
|
|
236
|
+
def __new__(cls, *args, **kwargs):
|
237
|
+
# ensure backward compatibility with 'static_input'
|
238
|
+
static_input = kwargs.get("stored_settings", {}).get("static_input", None)
|
239
|
+
if static_input not in (None, {}):
|
240
|
+
logger.warning(
|
241
|
+
"static_input has been deprecated. Will be replaced by _ewoks_default_inputs in the workflow file. Please save the workflow to apply modifications"
|
242
|
+
)
|
243
|
+
kwargs["stored_settings"]["_ewoks_default_inputs"] = static_input
|
244
|
+
return super().__new__(cls, *args, **kwargs)
|
245
|
+
|
239
246
|
def _processingStart(self, *args, **kwargs):
|
240
247
|
WidgetLongProcessing._startProcessing(self)
|
241
248
|
|
@@ -362,8 +369,7 @@ class AxisOW(SuperviseOW, WidgetLongProcessing):
|
|
362
369
|
|
363
370
|
def _updateSettingsVals(self):
|
364
371
|
# remove rp setting to the advantage of 'static_input'
|
365
|
-
self.
|
366
|
-
self.static_input = {
|
372
|
+
self._ewoks_default_inputs = {
|
367
373
|
"data": None,
|
368
374
|
"axis_params": self._axis_params.to_dict(),
|
369
375
|
"gui": {
|
@@ -31,7 +31,6 @@ from typing import Optional
|
|
31
31
|
|
32
32
|
from processview.core.manager.manager import DatasetState, ProcessManager
|
33
33
|
from tomwer.core import settings
|
34
|
-
from orangecontrib.tomwer.widgets import utils
|
35
34
|
from tomwer.core.cluster.cluster import SlurmClusterConfiguration
|
36
35
|
from tomwer.core.futureobject import FutureTomwerObject
|
37
36
|
from ...orange.managedprocess import SuperviseOW
|
@@ -45,6 +44,7 @@ from tomwer.synctools.stacks.reconstruction.castvolume import CastVolumeProcessS
|
|
45
44
|
import tomwer.core.process.reconstruction.nabu.castvolume
|
46
45
|
from tomwer.gui.reconstruction.nabu.castvolume import CastVolumeWidget
|
47
46
|
from tomwer.core.volume.volumebase import TomwerVolumeBase
|
47
|
+
from tomwer.core.utils import isLowOnMemory
|
48
48
|
import logging
|
49
49
|
|
50
50
|
_logger = logging.getLogger(__name__)
|
@@ -88,10 +88,7 @@ class CastNabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
88
88
|
compress_signal = False
|
89
89
|
allows_cycle = True
|
90
90
|
|
91
|
-
|
92
|
-
# kept for compatibility
|
93
|
-
|
94
|
-
static_input = Setting({"data": None, "cast_volume_params": {}})
|
91
|
+
_ewoks_default_inputs = Setting({"data": None, "cast_volume_params": {}})
|
95
92
|
|
96
93
|
sigScanReady = qt.Signal(TomwerScanBase)
|
97
94
|
"Signal emitted when a scan is ended"
|
@@ -123,7 +120,10 @@ class CastNabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
123
120
|
|
124
121
|
class Outputs:
|
125
122
|
data = Output(name="data", type=TomwerScanBase, doc="one scan to be process")
|
126
|
-
volume = Output(name="volume", type=TomwerVolumeBase, doc="
|
123
|
+
volume = Output(name="volume", type=TomwerVolumeBase, doc="raw volume")
|
124
|
+
cast_volume = Output(
|
125
|
+
name="cast volume", type=TomwerVolumeBase, doc="cast volume"
|
126
|
+
)
|
127
127
|
future_tomo_obj = Output(
|
128
128
|
name="future_tomo_obj",
|
129
129
|
type=FutureTomwerObject,
|
@@ -144,14 +144,24 @@ class CastNabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
144
144
|
|
145
145
|
self._layout.addWidget(self._window)
|
146
146
|
|
147
|
-
self.
|
147
|
+
cast_volume_params = self._ewoks_default_inputs.get("cast_volume_params", {})
|
148
|
+
self.setConfiguration(cast_volume_params)
|
148
149
|
|
149
150
|
# connect signal / slot
|
150
151
|
self._window.sigConfigChanged.connect(self._updateConfig)
|
151
|
-
# connect signal / slot
|
152
152
|
self._processingStack.sigComputationStarted.connect(self._startProcessing)
|
153
153
|
self._processingStack.sigComputationEnded.connect(self._endProcessing)
|
154
154
|
|
155
|
+
def __new__(cls, *args, **kwargs):
|
156
|
+
# ensure backward compatibility with 'static_input'
|
157
|
+
static_input = kwargs.get("stored_settings", {}).get("static_input", None)
|
158
|
+
if static_input not in (None, {}):
|
159
|
+
_logger.warning(
|
160
|
+
"static_input has been deprecated. Will be replaced by _ewoks_default_inputs in the workflow file. Please save the workflow to apply modifications"
|
161
|
+
)
|
162
|
+
kwargs["stored_settings"]["_ewoks_default_inputs"] = static_input
|
163
|
+
return super().__new__(cls, *args, **kwargs)
|
164
|
+
|
155
165
|
@Inputs.data
|
156
166
|
def process_data(self, scan: Optional[TomwerScanBase]):
|
157
167
|
if scan is None:
|
@@ -162,7 +172,7 @@ class CastNabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
162
172
|
)
|
163
173
|
if (
|
164
174
|
settings.isOnLbsram(scan)
|
165
|
-
and
|
175
|
+
and isLowOnMemory(settings.get_lbsram_path()) is True
|
166
176
|
):
|
167
177
|
ProcessManager().notify_dataset_state(
|
168
178
|
dataset=scan,
|
@@ -203,7 +213,7 @@ class CastNabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
203
213
|
self._window.setConfiguration(configuration)
|
204
214
|
|
205
215
|
def _updateConfig(self):
|
206
|
-
self.
|
216
|
+
self._ewoks_default_inputs = {
|
207
217
|
"data": None,
|
208
218
|
"cast_volume_params": self.getConfiguration(),
|
209
219
|
}
|
@@ -217,3 +227,7 @@ class CastNabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
217
227
|
self.Outputs.data.send(obj)
|
218
228
|
elif isinstance(obj, TomwerVolumeBase):
|
219
229
|
self.Outputs.volume.send(obj)
|
230
|
+
# for now we store a cast_volume to the object but this is not very well design.
|
231
|
+
# I guess this will be removed once we move to ewoks or we need to redesign the stack approach
|
232
|
+
if obj.cast_volume is not None:
|
233
|
+
self.Outputs.cast_volume.send(obj.cast_volume)
|
@@ -38,7 +38,6 @@ from orangewidget.widget import Input, Output
|
|
38
38
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
39
39
|
from tomwer.gui.reconstruction.darkref.darkrefcopywidget import DarkRefAndCopyWidget
|
40
40
|
from tomwer.synctools.darkref import QDKRFRP
|
41
|
-
from tomwer.web.client import OWClient
|
42
41
|
from tomwer.synctools.stacks.reconstruction.dkrefcopy import DarkRefCopyProcessStack
|
43
42
|
from processview.core.manager import DatasetState
|
44
43
|
from processview.core.manager import ProcessManager
|
@@ -50,7 +49,7 @@ import copy
|
|
50
49
|
_logger = logging.getLogger(__name__)
|
51
50
|
|
52
51
|
|
53
|
-
class DarkRefAndCopyOW(SuperviseOW,
|
52
|
+
class DarkRefAndCopyOW(SuperviseOW, WidgetLongProcessing):
|
54
53
|
"""
|
55
54
|
A simple widget managing the copy of an incoming folder to an other one
|
56
55
|
|
@@ -58,9 +57,11 @@ class DarkRefAndCopyOW(SuperviseOW, OWClient, WidgetLongProcessing):
|
|
58
57
|
"""
|
59
58
|
|
60
59
|
# note of this widget should be the one registered on the documentation
|
61
|
-
name = "
|
60
|
+
name = "reduced darks and flats"
|
62
61
|
id = "orange.widgets.tomwer.darkrefs"
|
63
|
-
description =
|
62
|
+
description = (
|
63
|
+
"This widget will generate reduced darks and flats for a received scan "
|
64
|
+
)
|
64
65
|
icon = "icons/darkref.svg"
|
65
66
|
priority = 15
|
66
67
|
keywords = ["tomography", "dark", "darks", "ref", "refs", "flat", "flats"]
|
@@ -69,11 +70,7 @@ class DarkRefAndCopyOW(SuperviseOW, OWClient, WidgetLongProcessing):
|
|
69
70
|
resizing_enabled = True
|
70
71
|
compress_signal = False
|
71
72
|
|
72
|
-
|
73
|
-
"""Setting to load and save DarkRefAndCopyWidget settings"""
|
74
|
-
# this one is keep for backward compatibility. Will be removed on 0.10 I guess
|
75
|
-
|
76
|
-
static_input = Setting({"data": None, "dark_ref_params": None})
|
73
|
+
_ewoks_default_inputs = Setting({"data": None, "dark_ref_params": None})
|
77
74
|
|
78
75
|
sigScanReady = qt.Signal(TomwerScanBase)
|
79
76
|
"""Signal emitted when a scan is ready"""
|
@@ -112,15 +109,12 @@ class DarkRefAndCopyOW(SuperviseOW, OWClient, WidgetLongProcessing):
|
|
112
109
|
:param QKRFRP reconsparams: reconstruction parameters
|
113
110
|
"""
|
114
111
|
SuperviseOW.__init__(self, parent)
|
115
|
-
OWClient.__init__(self)
|
116
112
|
WidgetLongProcessing.__init__(self)
|
117
113
|
recons_params = reconsparams or QDKRFRP()
|
118
114
|
self._processing_stack = DarkRefCopyProcessStack(process_id=self.process_id)
|
119
115
|
|
120
|
-
dark_ref_params = self.
|
121
|
-
if dark_ref_params
|
122
|
-
dark_ref_params = self._rpSetting
|
123
|
-
if dark_ref_params != dict():
|
116
|
+
dark_ref_params = self._ewoks_default_inputs.get("dark_ref_params", None)
|
117
|
+
if dark_ref_params not in ({}, None):
|
124
118
|
try:
|
125
119
|
recons_params.dkrf.load_from_dict(dark_ref_params)
|
126
120
|
except Exception:
|
@@ -153,7 +147,7 @@ class DarkRefAndCopyOW(SuperviseOW, OWClient, WidgetLongProcessing):
|
|
153
147
|
self._processing_stack.sigRefSetted.connect(self.widget.setRefSetBy)
|
154
148
|
|
155
149
|
# load some other copy parameters
|
156
|
-
if dark_ref_params
|
150
|
+
if dark_ref_params not in ({}, None):
|
157
151
|
try:
|
158
152
|
if "activate" in dark_ref_params:
|
159
153
|
self.widget.setCopyActive(dark_ref_params.pop("activate"))
|
@@ -168,6 +162,16 @@ class DarkRefAndCopyOW(SuperviseOW, OWClient, WidgetLongProcessing):
|
|
168
162
|
|
169
163
|
self.setCaption(self.windowTitle())
|
170
164
|
|
165
|
+
def __new__(cls, *args, **kwargs):
|
166
|
+
# ensure backward compatibility with 'static_input'
|
167
|
+
static_input = kwargs.get("stored_settings", {}).get("static_input", None)
|
168
|
+
if static_input not in (None, {}):
|
169
|
+
_logger.warning(
|
170
|
+
"static_input has been deprecated. Will be replaced by _ewoks_default_inputs in the workflow file. Please save the workflow to apply modifications"
|
171
|
+
)
|
172
|
+
kwargs["stored_settings"]["_ewoks_default_inputs"] = static_input
|
173
|
+
return super().__new__(cls, *args, **kwargs)
|
174
|
+
|
171
175
|
@Inputs.data
|
172
176
|
def process(self, scanID):
|
173
177
|
if scanID is None:
|
@@ -204,15 +208,16 @@ class DarkRefAndCopyOW(SuperviseOW, OWClient, WidgetLongProcessing):
|
|
204
208
|
self.sigScanReady.emit(scanID)
|
205
209
|
|
206
210
|
def _updateSettingsVals(self):
|
207
|
-
self.
|
208
|
-
self._rpSetting["auto"] = self.widget.isOnModeAuto()
|
209
|
-
self._rpSetting["activate"] = self.widget.isCopyActive()
|
210
|
-
self.static_input = {
|
211
|
+
self._ewoks_default_inputs = {
|
211
212
|
"data": None,
|
212
213
|
"dark_ref_params": self.widget.recons_params.to_dict(),
|
213
214
|
}
|
214
|
-
self.
|
215
|
-
|
215
|
+
self._ewoks_default_inputs["dark_ref_params"][
|
216
|
+
"auto"
|
217
|
+
] = self.widget.isOnModeAuto()
|
218
|
+
self._ewoks_default_inputs["dark_ref_params"][
|
219
|
+
"activate"
|
220
|
+
] = self.widget.isCopyActive()
|
216
221
|
|
217
222
|
@property
|
218
223
|
def recons_params(self):
|
@@ -30,7 +30,7 @@ __date__ = "14/02/2020"
|
|
30
30
|
|
31
31
|
import logging
|
32
32
|
from typing import Optional
|
33
|
-
|
33
|
+
from tomwer.core.volume.volumefactory import VolumeFactory
|
34
34
|
import tomwer.core.process.reconstruction.nabu.nabuslices
|
35
35
|
from contextlib import AbstractContextManager
|
36
36
|
from silx.gui import qt
|
@@ -71,11 +71,7 @@ class NabuOW(WidgetLongProcessing, SuperviseOW):
|
|
71
71
|
compress_signal = False
|
72
72
|
allows_cycle = True
|
73
73
|
|
74
|
-
|
75
|
-
static_input = Setting({"data": None, "nabu_params": None})
|
76
|
-
|
77
|
-
_rpSetting = Setting(dict())
|
78
|
-
# this one is keep for backward compatibility. Will be removed on 0.10 I guess
|
74
|
+
_ewoks_default_inputs = Setting({"data": None, "nabu_params": None})
|
79
75
|
|
80
76
|
ewokstaskclass = tomwer.core.process.reconstruction.nabu.nabuslices.NabuSlices
|
81
77
|
|
@@ -111,6 +107,8 @@ class NabuOW(WidgetLongProcessing, SuperviseOW):
|
|
111
107
|
doc="data with some remote processing",
|
112
108
|
)
|
113
109
|
|
110
|
+
slice_urls = Output(name="slice urls", type=tuple, doc="tuple of urls created")
|
111
|
+
|
114
112
|
class DialogCM(AbstractContextManager):
|
115
113
|
"""Simple context manager to hide / show button dialogs"""
|
116
114
|
|
@@ -157,10 +155,8 @@ class NabuOW(WidgetLongProcessing, SuperviseOW):
|
|
157
155
|
self._buttons.hide()
|
158
156
|
|
159
157
|
# load settings
|
160
|
-
nabu_params = self.
|
161
|
-
if nabu_params
|
162
|
-
nabu_params = self._rpSetting
|
163
|
-
if nabu_params != dict():
|
158
|
+
nabu_params = self._ewoks_default_inputs.get("nabu_params", None)
|
159
|
+
if nabu_params not in (dict(), None):
|
164
160
|
try:
|
165
161
|
self._nabuWidget.setConfiguration(nabu_params)
|
166
162
|
except Exception:
|
@@ -176,6 +172,16 @@ class NabuOW(WidgetLongProcessing, SuperviseOW):
|
|
176
172
|
self._buttons.button(qt.QDialogButtonBox.Ok).clicked.connect(self.accept)
|
177
173
|
self._nabuWidget.sigConfigChanged.connect(self._updateSettingsVals)
|
178
174
|
|
175
|
+
def __new__(cls, *args, **kwargs):
|
176
|
+
# ensure backward compatibility with 'static_input'
|
177
|
+
static_input = kwargs.get("stored_settings", {}).get("static_input", None)
|
178
|
+
if static_input not in (None, {}):
|
179
|
+
_logger.warning(
|
180
|
+
"static_input has been deprecated. Will be replaced by _ewoks_default_inputs in the workflow file. Please save the workflow to apply modifications"
|
181
|
+
)
|
182
|
+
kwargs["stored_settings"]["_ewoks_default_inputs"] = static_input
|
183
|
+
return super().__new__(cls, *args, **kwargs)
|
184
|
+
|
179
185
|
@Inputs.data
|
180
186
|
def process(self, scan: TomwerScanBase):
|
181
187
|
assert isinstance(scan, (TomwerScanBase, type(None)))
|
@@ -231,9 +237,21 @@ class NabuOW(WidgetLongProcessing, SuperviseOW):
|
|
231
237
|
def _endProcessing(self, scan, future_tomo_obj):
|
232
238
|
WidgetLongProcessing._endProcessing(self, scan)
|
233
239
|
if scan is not None:
|
240
|
+
# send scan
|
234
241
|
self.Outputs.data.send(scan)
|
242
|
+
# send slice urls
|
243
|
+
slice_urls = []
|
244
|
+
for rec_identifier in scan.latest_reconstructions:
|
245
|
+
slice_urls.extend(
|
246
|
+
VolumeFactory.from_identifier_to_vol_urls(rec_identifier)
|
247
|
+
)
|
248
|
+
if len(slice_urls) > 0:
|
249
|
+
slice_urls = tuple(slice_urls)
|
250
|
+
self.Outputs.slice_urls.send(slice_urls)
|
251
|
+
|
235
252
|
self.sigScanReady.emit(scan)
|
236
253
|
if future_tomo_obj is not None:
|
254
|
+
# send future scan
|
237
255
|
self.Outputs.future_out.send(future_tomo_obj)
|
238
256
|
|
239
257
|
def setDryRun(self, dry_run):
|
@@ -249,11 +267,10 @@ class NabuOW(WidgetLongProcessing, SuperviseOW):
|
|
249
267
|
self.__exec_for_ci = True
|
250
268
|
|
251
269
|
def _updateSettingsVals(self):
|
252
|
-
self.
|
270
|
+
self._ewoks_default_inputs = {
|
253
271
|
"data": None,
|
254
272
|
"nabu_params": self.getConfiguration(),
|
255
273
|
}
|
256
|
-
self._rpSetting = self.getConfiguration()
|
257
274
|
|
258
275
|
def getConfiguration(self):
|
259
276
|
config = self._nabuWidget.getConfiguration()
|
@@ -32,12 +32,13 @@ import logging
|
|
32
32
|
from contextlib import AbstractContextManager
|
33
33
|
from silx.gui import qt
|
34
34
|
from tomwer.synctools.stacks.reconstruction.nabu import NabuVolumeProcessStack
|
35
|
-
from tomwer.core.process.reconstruction.nabu.nabuvolume import NabuVolume
|
35
|
+
from tomwer.core.process.reconstruction.nabu.nabuvolume import NabuVolume
|
36
36
|
from tomwer.gui.reconstruction.nabu.volume import NabuVolumeWindow
|
37
37
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
38
38
|
from tomwer.core.cluster import SlurmClusterConfiguration
|
39
39
|
from tomwer.core.futureobject import FutureTomwerObject
|
40
40
|
from orangecontrib.tomwer.widgets.utils import WidgetLongProcessing
|
41
|
+
from tomwer.core.volume.volumefactory import VolumeFactory
|
41
42
|
from orangewidget.settings import Setting
|
42
43
|
from orangewidget import gui
|
43
44
|
from orangewidget.widget import Input, Output
|
@@ -49,6 +50,8 @@ from tomwer.utils import docstring
|
|
49
50
|
from tomwer.core import settings
|
50
51
|
import tomwer.core.process.reconstruction.nabu.nabuvolume
|
51
52
|
from tomwer.core.volume.volumebase import TomwerVolumeBase
|
53
|
+
from tomwer.core.utils.scanutils import format_output_location
|
54
|
+
from tomoscan.identifier import VolumeIdentifier
|
52
55
|
import functools
|
53
56
|
import copy
|
54
57
|
|
@@ -79,10 +82,7 @@ class NabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
79
82
|
compress_signal = False
|
80
83
|
allows_cycle = True
|
81
84
|
|
82
|
-
|
83
|
-
# kept for compatibility
|
84
|
-
|
85
|
-
static_input = Setting(
|
85
|
+
_ewoks_default_inputs = Setting(
|
86
86
|
{"data": None, "nabu_volume_params": None, "nabu_params": None}
|
87
87
|
)
|
88
88
|
|
@@ -119,6 +119,9 @@ class NabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
119
119
|
type=TomwerVolumeBase,
|
120
120
|
doc="volume(s) created",
|
121
121
|
)
|
122
|
+
volume_urls = Output(
|
123
|
+
name="volume urls", type=tuple, doc="url of the volume(s) reconstructed"
|
124
|
+
)
|
122
125
|
|
123
126
|
class DialogCM(AbstractContextManager):
|
124
127
|
"""Simple context manager to hida / show button dialogs"""
|
@@ -132,7 +135,7 @@ class NabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
132
135
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
133
136
|
self._dialogButtonsBox.hide()
|
134
137
|
|
135
|
-
def __init__(self, parent=None):
|
138
|
+
def __init__(self, parent=None, *args, **kwargs):
|
136
139
|
"""
|
137
140
|
Widget which read the .hdf5 generated by octave and modify it.
|
138
141
|
Then run a subprocess to call octave and run ftseries
|
@@ -164,10 +167,9 @@ class NabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
164
167
|
self._buttons.hide()
|
165
168
|
|
166
169
|
# load settings
|
167
|
-
nabu_volume_params = self.
|
168
|
-
|
169
|
-
|
170
|
-
if nabu_volume_params != dict():
|
170
|
+
nabu_volume_params = self._ewoks_default_inputs.get("nabu_volume_params", None)
|
171
|
+
|
172
|
+
if nabu_volume_params not in (dict(), None):
|
171
173
|
try:
|
172
174
|
self._nabuWidget.setConfiguration(nabu_volume_params)
|
173
175
|
except Exception:
|
@@ -179,6 +181,16 @@ class NabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
179
181
|
self._buttons.button(qt.QDialogButtonBox.Ok).clicked.connect(self.accept)
|
180
182
|
self._nabuWidget.sigConfigChanged.connect(self._updateSettingsVals)
|
181
183
|
|
184
|
+
def __new__(cls, *args, **kwargs):
|
185
|
+
# ensure backward compatibility with 'static_input'
|
186
|
+
static_input = kwargs.get("stored_settings", {}).get("static_input", None)
|
187
|
+
if static_input not in (None, {}):
|
188
|
+
_logger.warning(
|
189
|
+
"static_input has been deprecated. Will be replaced by _ewoks_default_inputs in the workflow file. Please save the workflow to apply modifications"
|
190
|
+
)
|
191
|
+
kwargs["stored_settings"]["_ewoks_default_inputs"] = static_input
|
192
|
+
return super().__new__(cls, *args, **kwargs)
|
193
|
+
|
182
194
|
@Inputs.data
|
183
195
|
def process(self, scan: TomwerScanBase):
|
184
196
|
assert isinstance(scan, (TomwerScanBase, type(None)))
|
@@ -207,7 +219,7 @@ class NabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
207
219
|
] = self._nabuWidget._mainWidget.getNabuFileFormat()
|
208
220
|
# update output location if requested
|
209
221
|
if self._nabuWidget._mainWidget.redefineOutputLocation():
|
210
|
-
config.get("output")["location"] =
|
222
|
+
config.get("output")["location"] = format_output_location(
|
211
223
|
location=self._nabuWidget._mainWidget.getNabuOutputLocation(),
|
212
224
|
scan=scan,
|
213
225
|
)
|
@@ -272,7 +284,7 @@ class NabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
272
284
|
db = dialog.getSelectedValue()
|
273
285
|
if db is not None:
|
274
286
|
try:
|
275
|
-
scan.nabu_recons_params["phase"]["delta_beta"] = db
|
287
|
+
scan.nabu_recons_params["phase"]["delta_beta"] = (db,)
|
276
288
|
except Exception as e:
|
277
289
|
logging.error(e)
|
278
290
|
else:
|
@@ -281,10 +293,27 @@ class NabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
281
293
|
def _endProcessing(self, scan, future_tomo_obj):
|
282
294
|
WidgetLongProcessing._endProcessing(self, scan)
|
283
295
|
if scan is not None:
|
296
|
+
# send scan
|
284
297
|
self.Outputs.data.send(scan)
|
285
298
|
self.sigScanReady.emit(scan)
|
286
|
-
|
287
|
-
|
299
|
+
# send volume urls
|
300
|
+
volume_urls = []
|
301
|
+
for volume_id in scan.latest_vol_reconstructions:
|
302
|
+
assert isinstance(volume_id, VolumeIdentifier)
|
303
|
+
volume_urls.extend(VolumeFactory.from_identifier_to_vol_urls(volume_id))
|
304
|
+
if len(volume_urls) > 0:
|
305
|
+
self.Outputs.volume_urls.send(tuple(volume_urls))
|
306
|
+
# send volume identifier(s) # only one expected
|
307
|
+
n_rec_volumes = len(scan.latest_vol_reconstructions)
|
308
|
+
if n_rec_volumes > 0:
|
309
|
+
if n_rec_volumes > 1:
|
310
|
+
_logger.warning(
|
311
|
+
f"{n_rec_volumes} volume reconstructed when at most one expected"
|
312
|
+
)
|
313
|
+
volume = VolumeFactory.create_tomo_object_from_identifier(
|
314
|
+
scan.latest_vol_reconstructions[0]
|
315
|
+
)
|
316
|
+
self.Outputs.volume.send(volume)
|
288
317
|
if future_tomo_obj is not None:
|
289
318
|
self.Outputs.future_out.send(future_tomo_obj)
|
290
319
|
|
@@ -297,9 +326,7 @@ class NabuVolumeOW(WidgetLongProcessing, SuperviseOW):
|
|
297
326
|
self.show()
|
298
327
|
|
299
328
|
def _updateSettingsVals(self):
|
300
|
-
self.
|
301
|
-
# kept for compatibility
|
302
|
-
self.static_input = {
|
329
|
+
self._ewoks_default_inputs = {
|
303
330
|
"data": None,
|
304
331
|
"nabu_volume_params": self.getConfiguration(),
|
305
332
|
"nabu_params": None,
|
@@ -190,7 +190,8 @@ class SAAxisWindow(_SAAxisWindow):
|
|
190
190
|
if scan is None:
|
191
191
|
return
|
192
192
|
assert isinstance(scan, TomwerScanBase)
|
193
|
-
selected_cor_value = self.getCurrentCorValue()
|
193
|
+
selected_cor_value = self.getCurrentCorValue() or scan.saaxis_params.autofocus
|
194
|
+
# if validate is done manually then pick current cor value; else we are in 'auto mode' and get it from the autofocus.
|
194
195
|
details = ProcessManager().get_dataset_details(
|
195
196
|
dataset_id=scan.get_identifier(), process=self._processing_stack
|
196
197
|
)
|
@@ -206,6 +207,12 @@ class SAAxisWindow(_SAAxisWindow):
|
|
206
207
|
)
|
207
208
|
else:
|
208
209
|
scan.axis_params.set_relative_value(selected_cor_value)
|
210
|
+
if scan.nabu_recons_params is not None:
|
211
|
+
if "reconstruction" not in scan.nabu_recons_params:
|
212
|
+
scan.nabu_recons_params["reconstruction"] = {}
|
213
|
+
scan.nabu_recons_params["reconstruction"][
|
214
|
+
"rotation_axis_position"
|
215
|
+
] = scan.axis_params.absolute_cor_value
|
209
216
|
infos = "cor selected for {}: relative: {}, absolute: {}".format(
|
210
217
|
scan,
|
211
218
|
scan.axis_params.relative_cor_value,
|
@@ -286,11 +293,7 @@ class SAAxisOW(SuperviseOW, WidgetLongProcessing):
|
|
286
293
|
sigScanReady = qt.Signal(TomwerScanBase)
|
287
294
|
"""Signal emitted when a scan is ready"""
|
288
295
|
|
289
|
-
|
290
|
-
# kept for compatibility
|
291
|
-
"SAAxisRP store as dict"
|
292
|
-
|
293
|
-
static_input = Setting({"data": None, "sa_axis_params": None})
|
296
|
+
_ewoks_default_inputs = Setting({"data": None, "sa_axis_params": None})
|
294
297
|
|
295
298
|
class Inputs:
|
296
299
|
data = Input(
|
@@ -334,10 +337,8 @@ class SAAxisOW(SuperviseOW, WidgetLongProcessing):
|
|
334
337
|
)
|
335
338
|
self._layout.addWidget(self._widget)
|
336
339
|
|
337
|
-
sa_axis_params = self.
|
338
|
-
|
339
|
-
sa_axis_params = self._rpSetting
|
340
|
-
self.setConfiguration(sa_axis_params)
|
340
|
+
sa_axis_params = self._ewoks_default_inputs.get("sa_axis_params", None)
|
341
|
+
self.setConfiguration(sa_axis_params or {})
|
341
342
|
|
342
343
|
# connect signal / slot
|
343
344
|
self._widget.sigConfigurationChanged.connect(self._updateSettings)
|
@@ -352,6 +353,16 @@ class SAAxisOW(SuperviseOW, WidgetLongProcessing):
|
|
352
353
|
# expose API
|
353
354
|
self.wait_processing = self._widget.wait_processing
|
354
355
|
|
356
|
+
def __new__(cls, *args, **kwargs):
|
357
|
+
# ensure backward compatibility with 'static_input'
|
358
|
+
static_input = kwargs.get("stored_settings", {}).get("static_input", None)
|
359
|
+
if static_input not in (None, {}):
|
360
|
+
_logger.warning(
|
361
|
+
"static_input has been deprecated. Will be replaced by _ewoks_default_inputs in the workflow file. Please save the workflow to apply modifications"
|
362
|
+
)
|
363
|
+
kwargs["stored_settings"]["_ewoks_default_inputs"] = static_input
|
364
|
+
return super().__new__(cls, *args, **kwargs)
|
365
|
+
|
355
366
|
def setConfiguration(self, configuration):
|
356
367
|
if "workflow" in configuration:
|
357
368
|
autofocus_lock = configuration["workflow"].get("autofocus_lock", None)
|
@@ -363,6 +374,9 @@ class SAAxisOW(SuperviseOW, WidgetLongProcessing):
|
|
363
374
|
def getCurrentCorValue(self):
|
364
375
|
return self._widget.getCurrentCorValue()
|
365
376
|
|
377
|
+
def setEstimatedCorPosition(self, value):
|
378
|
+
self._widget.setEstimatedCorPosition(value=value)
|
379
|
+
|
366
380
|
def load_sinogram(self):
|
367
381
|
self._widget.loadSinogram()
|
368
382
|
|
@@ -435,18 +449,14 @@ class SAAxisOW(SuperviseOW, WidgetLongProcessing):
|
|
435
449
|
def _updateSettings(self):
|
436
450
|
config = self._widget.getConfiguration()
|
437
451
|
config.pop("cluster_config", None)
|
438
|
-
self._rpSetting = config
|
439
|
-
self._rpSetting["workflow"] = {
|
440
|
-
"autofocus_lock": self._widget.isAutoFocusLock(),
|
441
|
-
}
|
442
452
|
|
443
|
-
self.
|
453
|
+
self._ewoks_default_inputs = {
|
444
454
|
"data": None,
|
445
455
|
"sa_axis_params": self._widget.getConfiguration(),
|
446
456
|
}
|
447
|
-
self.
|
448
|
-
"autofocus_lock"
|
449
|
-
|
457
|
+
self._ewoks_default_inputs["sa_axis_params"]["workflow"] = {
|
458
|
+
"autofocus_lock": self._widget.isAutoFocusLock(),
|
459
|
+
}
|
450
460
|
|
451
461
|
def _raiseResults(self):
|
452
462
|
if not self.isAutoFocusLock():
|