tomwer 1.0.3__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 +3 -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 -129
- orangecontrib/tomwer/widgets/control/NotifierOW.py +34 -9
- orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +3 -5
- orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +19 -13
- 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 +73 -78
- 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 -11
- 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 -20
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +24 -18
- 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/intensitynormalization.py +0 -1
- 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 -4
- 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 +2 -2
- 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 -2
- 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 -2
- 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 +32 -3
- 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 +19 -8
- 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 +22 -5
- 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/supervisor.py +0 -2
- tomwer/gui/cluster/test/test_cluster.py +2 -2
- tomwer/gui/control/datalist.py +109 -36
- tomwer/gui/control/datatransfert.py +1 -1
- tomwer/gui/control/datawatcher/configuration.py +0 -2
- 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 -12
- 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 -4
- 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 -9
- tomwer/gui/edit/dkrfpatch.py +2 -3
- tomwer/gui/edit/imagekeyeditor.py +12 -11
- 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/icons.py +0 -1
- 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 +70 -14
- 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 -5
- tomwer/gui/reconstruction/nabu/castvolume.py +103 -24
- 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 -15
- tomwer/gui/reconstruction/nabu/slices.py +10 -4
- tomwer/gui/reconstruction/nabu/slurm.py +1 -1
- tomwer/gui/reconstruction/nabu/volume.py +13 -7
- tomwer/gui/reconstruction/normalization/intensity.py +1 -5
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +10 -37
- tomwer/gui/reconstruction/saaxis/saaxis.py +11 -7
- tomwer/gui/reconstruction/saaxis/sliceselector.py +11 -26
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +13 -8
- tomwer/gui/reconstruction/scores/scoreplot.py +67 -62
- 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 -22
- 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/io/utils/utils.py +2 -2
- 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/axis.py +0 -1
- tomwer/synctools/darkref.py +0 -1
- tomwer/synctools/datalistener.py +5 -1
- tomwer/synctools/imageloaderthread.py +2 -2
- tomwer/synctools/saaxis.py +0 -1
- tomwer/synctools/sadeltabeta.py +0 -1
- 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/dkrefcopy.py +1 -1
- 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/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.3.dist-info → tomwer-1.1.0.dist-info}/METADATA +14 -16
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/RECORD +255 -235
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/WHEEL +1 -1
- {tomwer-1.0.3.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/slurm/executor.py +0 -36
- tomwer/slurm/job.py +0 -349
- tomwer/slurm/utils.py +0 -44
- tomwer/web/client.py +0 -43
- tomwer/web/config.py +0 -36
- tomwer/web/test/test_graylog_connection.py +0 -59
- {tomwer/slurm → orangecontrib/tomwer/tutorials}/__init__.py +0 -0
- /tomwer/{test → gui/control/serie}/__init__.py +0 -0
- /tomwer/{web/test → tests}/__init__.py +0 -0
- /tomwer/{test → tests}/utils/__init__.py +0 -0
- /tomwer-1.0.3-py3.8-nspkg.pth → /tomwer-1.1.0-py3.9-nspkg.pth +0 -0
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/LICENSE +0 -0
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/top_level.txt +0 -0
@@ -35,16 +35,13 @@ from orangewidget.settings import Setting
|
|
35
35
|
from orangewidget.widget import Output
|
36
36
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
37
37
|
from tomwer.gui.control.datawatcher import DataWatcherWidget
|
38
|
-
from tomwer.web.client import OWClient
|
39
38
|
import functools
|
40
39
|
import logging
|
41
40
|
|
42
41
|
logger = logging.getLogger(__name__)
|
43
42
|
|
44
43
|
|
45
|
-
class DataWatcherOW(
|
46
|
-
widget.OWBaseWidget, OWClient, WidgetLongProcessing, openclass=True
|
47
|
-
):
|
44
|
+
class DataWatcherOW(widget.OWBaseWidget, WidgetLongProcessing, openclass=True):
|
48
45
|
"""
|
49
46
|
This widget is used to observe a selected folder and his sub-folders to
|
50
47
|
detect if they are containing valid-finished acquisitions.
|
@@ -78,7 +75,9 @@ class DataWatcherOW(
|
|
78
75
|
|
79
76
|
DEFAULT_DIRECTORY = "/lbsram/data/visitor"
|
80
77
|
|
81
|
-
ewokstaskclass =
|
78
|
+
ewokstaskclass = (
|
79
|
+
tomwer.core.process.control.datawatcher.datawatcher.DataWatcherEwoksTask
|
80
|
+
)
|
82
81
|
|
83
82
|
class Outputs:
|
84
83
|
data = Output(name="data", type=TomwerScanBase)
|
@@ -93,7 +92,6 @@ class DataWatcherOW(
|
|
93
92
|
:param parent: the parent widget
|
94
93
|
"""
|
95
94
|
widget.OWBaseWidget.__init__(self, parent)
|
96
|
-
OWClient.__init__(self)
|
97
95
|
WidgetLongProcessing.__init__(self)
|
98
96
|
self._widget = DataWatcherWidget(parent=self)
|
99
97
|
self._widget.setFolderObserved(self.folderObserved)
|
@@ -28,7 +28,6 @@ __license__ = "MIT"
|
|
28
28
|
__date__ = "11/03/2020"
|
29
29
|
|
30
30
|
from copy import copy
|
31
|
-
import os
|
32
31
|
from orangewidget import gui
|
33
32
|
from tomwer.core.scan.edfscan import EDFTomoScan
|
34
33
|
from orangecontrib.tomwer.orange.managedprocess import TomwerWithStackStack
|
@@ -37,8 +36,7 @@ from tomwer.gui.control.datalist import (
|
|
37
36
|
EDFDataListMainWindow,
|
38
37
|
)
|
39
38
|
from nxtomomill.io.config import TomoEDFConfig as EDFConfig
|
40
|
-
from .
|
41
|
-
from tomwer.gui.control.nxtomomill import NXTomomillInput
|
39
|
+
from orangecontrib.tomwer.widgets.control.NXTomomillMixIn import NXTomomillMixIn
|
42
40
|
from tomwer.core.process.control.nxtomomill import EDFToNxProcess
|
43
41
|
from silx.gui import qt
|
44
42
|
import logging
|
@@ -46,7 +44,11 @@ import logging
|
|
46
44
|
logger = logging.getLogger(__name__)
|
47
45
|
|
48
46
|
|
49
|
-
class EDF2NXOW(
|
47
|
+
class EDF2NXOW(
|
48
|
+
TomwerWithStackStack,
|
49
|
+
NXTomomillMixIn,
|
50
|
+
ewokstaskclass=EDFToNxProcess,
|
51
|
+
):
|
50
52
|
"""
|
51
53
|
Widget to allow user to pick some bliss files and that will convert them
|
52
54
|
to HDF5scan.
|
@@ -74,12 +76,16 @@ class EDF2NXOW(TomwerWithStackStack, _NXTomoMixIn, ewokstaskclass=EDFToNxProcess
|
|
74
76
|
resizing_enabled = True
|
75
77
|
compress_signal = False
|
76
78
|
|
79
|
+
CONFIG_CLS = EDFConfig
|
80
|
+
|
81
|
+
LOGGER = logger
|
82
|
+
|
77
83
|
def __init__(self, parent=None):
|
78
84
|
self.__configuration_cache = None
|
79
85
|
# cache updated for each folder in order to match `_execute_ewoks_task` design
|
80
86
|
|
81
87
|
TomwerWithStackStack.__init__(self, parent=parent)
|
82
|
-
|
88
|
+
NXTomomillMixIn.__init__(self)
|
83
89
|
_layout = gui.vBox(self.mainArea, self.name).layout()
|
84
90
|
self.widget = EDFDataListMainWindow(parent=self)
|
85
91
|
_layout.addWidget(self.widget)
|
@@ -109,8 +115,7 @@ class EDF2NXOW(TomwerWithStackStack, _NXTomoMixIn, ewokstaskclass=EDFToNxProcess
|
|
109
115
|
self._loadSettings()
|
110
116
|
|
111
117
|
def _updateSettings(self):
|
112
|
-
|
113
|
-
self._static_input[
|
118
|
+
self._ewoks_default_inputs[ # pylint: disable=E1137
|
114
119
|
"convert_auto_edfscan_channel"
|
115
120
|
] = self.convertAutoEDFScanReceivedFromChannel()
|
116
121
|
|
@@ -120,59 +125,26 @@ class EDF2NXOW(TomwerWithStackStack, _NXTomoMixIn, ewokstaskclass=EDFToNxProcess
|
|
120
125
|
def setConvertAutoEDFScanReceivedFromChannel(self, checked: bool):
|
121
126
|
self._convertAutoCB.setChecked(checked)
|
122
127
|
|
123
|
-
def add(self, folder):
|
124
|
-
self.widget.add(folder)
|
125
|
-
|
126
|
-
def _saveNXTomoCfgFile(self, cfg_file):
|
127
|
-
"""save the nxtomofile to the setttings"""
|
128
|
-
self._nxtomo_cfg_file = cfg_file
|
129
|
-
self._static_input["nxtomomill_cfg_file"] = cfg_file
|
130
|
-
|
131
|
-
if os.path.exists(cfg_file):
|
132
|
-
try:
|
133
|
-
configuration = EDFConfig.from_cfg_file(cfg_file)
|
134
|
-
except Exception as e:
|
135
|
-
logger.error(
|
136
|
-
"Fail to use configuration file {}."
|
137
|
-
"Error is {}. No conversion will be done."
|
138
|
-
"".format(cfg_file, e)
|
139
|
-
)
|
140
|
-
else:
|
141
|
-
self.update_default_inputs(
|
142
|
-
edf_to_nx_configuration=configuration.to_dict()
|
143
|
-
)
|
144
|
-
else:
|
145
|
-
self.update_default_inputs(edf_to_nx_configuration=EDFConfig().to_dict())
|
146
|
-
|
147
|
-
def _sendSelected(self):
|
148
|
-
self._inputGUI = NXTomomillInput()
|
149
|
-
# reset the GUI for input (reset all the cache for answers)
|
150
|
-
self._canOverwriteOutputs = False
|
151
|
-
for scan_id in self.widget.datalist._myitems:
|
152
|
-
tomo_obj = self.widget.datalist.getEDFTomoScan(scan_id, None)
|
153
|
-
if tomo_obj:
|
154
|
-
self._convertAndSend(tomo_obj)
|
155
|
-
|
156
|
-
def _sendAll(self):
|
157
|
-
self._inputGUI = NXTomomillInput()
|
158
|
-
# reset the GUI for input (reset all the cache for answers)
|
159
|
-
self._canOverwriteOutputs = False
|
160
|
-
for scan_id in self.widget.datalist._myitems:
|
161
|
-
tomo_obj = self.widget.datalist.getEDFTomoScan(scan_id, None)
|
162
|
-
if tomo_obj:
|
163
|
-
self._convertAndSend(tomo_obj)
|
164
|
-
|
165
128
|
def _loadSettings(self):
|
166
|
-
for scan in self._scans:
|
129
|
+
for scan in self._scans: # pylint: disable=E1133
|
167
130
|
self.widget.add(scan)
|
168
|
-
if "nxtomomill_cfg_file" in self.
|
169
|
-
self._nxtomo_cfg_file = self.
|
131
|
+
if "nxtomomill_cfg_file" in self._ewoks_default_inputs: # pylint: disable=E1135
|
132
|
+
self._nxtomo_cfg_file = self._ewoks_default_inputs[ # pylint: disable=E1136
|
133
|
+
"nxtomomill_cfg_file"
|
134
|
+
]
|
170
135
|
self.widget.setCFGFilePath(self._nxtomo_cfg_file)
|
171
|
-
if "output_dir" in self.
|
172
|
-
self.widget.setOutputFolder(
|
173
|
-
|
136
|
+
if "output_dir" in self._ewoks_default_inputs: # pylint: disable=E1135
|
137
|
+
self.widget.setOutputFolder(
|
138
|
+
self._ewoks_default_inputs["output_dir"] # pylint: disable=E1136
|
139
|
+
)
|
140
|
+
if (
|
141
|
+
"convert_auto_edfscan_channel"
|
142
|
+
in self._ewoks_default_inputs # pylint: disable=E1135
|
143
|
+
):
|
174
144
|
self.setConvertAutoEDFScanReceivedFromChannel(
|
175
|
-
self.
|
145
|
+
self._ewoks_default_inputs[ # pylint: disable=E1136
|
146
|
+
"convert_auto_edfscan_channel"
|
147
|
+
]
|
176
148
|
)
|
177
149
|
|
178
150
|
def _convertAndSend(self, edf_scan: EDFTomoScan):
|
@@ -192,7 +164,9 @@ class EDF2NXOW(TomwerWithStackStack, _NXTomoMixIn, ewokstaskclass=EDFToNxProcess
|
|
192
164
|
self.__configuration_cache.dataset_basename = edf_scan.dataset_basename
|
193
165
|
|
194
166
|
output_file = EDFToNxProcess.deduce_output_file_path(
|
195
|
-
folder_path=edf_scan.path,
|
167
|
+
folder_path=edf_scan.path,
|
168
|
+
output_dir=self.widget.getOutputFolder(),
|
169
|
+
scan=edf_scan,
|
196
170
|
)
|
197
171
|
output_entry = "entry"
|
198
172
|
self.__configuration_cache.output_file = output_file
|
@@ -240,8 +214,21 @@ class EDF2NXOW(TomwerWithStackStack, _NXTomoMixIn, ewokstaskclass=EDFToNxProcess
|
|
240
214
|
except Exception as e:
|
241
215
|
logger.error(f"failed to handle task finished callback. Raiseon is {e}")
|
242
216
|
|
243
|
-
def
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
217
|
+
def _saveNXTomoCfgFile(self, cfg_file):
|
218
|
+
super()._saveNXTomoCfgFile(cfg_file, keyword="edf_to_nx_configuration")
|
219
|
+
|
220
|
+
def _sendSelected(self):
|
221
|
+
"""send all selected items to be converted"""
|
222
|
+
self._canOverwriteOutputs = False
|
223
|
+
for scan_id in self.widget.datalist._myitems:
|
224
|
+
tomo_obj = self.widget.datalist.getEDFTomoScan(scan_id, None)
|
225
|
+
if tomo_obj:
|
226
|
+
self._convertAndSend(tomo_obj)
|
227
|
+
|
228
|
+
def _sendAll(self):
|
229
|
+
"""send all items to be converted"""
|
230
|
+
self._canOverwriteOutputs = False
|
231
|
+
for scan_id in self.widget.datalist._myitems:
|
232
|
+
tomo_obj = self.widget.datalist.getEDFTomoScan(scan_id, None)
|
233
|
+
if tomo_obj:
|
234
|
+
self._convertAndSend(tomo_obj)
|
@@ -33,7 +33,6 @@ from orangewidget import gui
|
|
33
33
|
import tomwer.core.process.conditions.filters
|
34
34
|
from orangecontrib.tomwer.orange.managedprocess import SuperviseOW
|
35
35
|
from orangewidget.widget import Input, Output
|
36
|
-
from tomwer.web.client import OWClient
|
37
36
|
from tomwer.gui.conditions.filter import FileNameFilterWidget
|
38
37
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
39
38
|
from processview.core.manager import DatasetState
|
@@ -44,7 +43,7 @@ import logging
|
|
44
43
|
logger = logging.getLogger(__name__)
|
45
44
|
|
46
45
|
|
47
|
-
class NameFilterOW(SuperviseOW
|
46
|
+
class NameFilterOW(SuperviseOW):
|
48
47
|
name = "scan filter"
|
49
48
|
id = "orange.widgets.tomwer.filterow"
|
50
49
|
description = (
|
@@ -69,8 +68,7 @@ class NameFilterOW(SuperviseOW, OWClient):
|
|
69
68
|
|
70
69
|
def __init__(self, parent=None):
|
71
70
|
""" """
|
72
|
-
|
73
|
-
OWClient.__init__(self)
|
71
|
+
super().__init__(parent)
|
74
72
|
|
75
73
|
self.widget = FileNameFilterWidget(parent=self)
|
76
74
|
self.widget.setContentsMargins(0, 0, 0, 0)
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import os
|
2
|
+
import logging
|
3
|
+
from orangewidget.settings import Setting
|
4
|
+
|
5
|
+
_logger = logging.getLogger(__name__)
|
6
|
+
|
7
|
+
|
8
|
+
class NXTomomillMixIn:
|
9
|
+
"""
|
10
|
+
MixIn class for nxtomomill + ewoks
|
11
|
+
"""
|
12
|
+
|
13
|
+
_scans = Setting(list())
|
14
|
+
|
15
|
+
_ewoks_default_inputs = Setting(dict())
|
16
|
+
|
17
|
+
CONFIG_CLS = None
|
18
|
+
# logger to be used. Expected to be redefine by child class
|
19
|
+
|
20
|
+
LOGGER = None
|
21
|
+
# logger to be used. Expected to be redefine by child class
|
22
|
+
|
23
|
+
def __init__(self, *args, **kwargs) -> None:
|
24
|
+
self.__configuration_cache = None
|
25
|
+
# cache updated for each folder in order to match `_execute_ewoks_task` design
|
26
|
+
|
27
|
+
def add(self, *args, **kwargs):
|
28
|
+
self.widget.add(*args, **kwargs)
|
29
|
+
|
30
|
+
def _updateSettings(self):
|
31
|
+
raise NotImplementedError("Base class")
|
32
|
+
|
33
|
+
def _saveNXTomoCfgFile(self, cfg_file, keyword: str):
|
34
|
+
"""save the nxtomofile to the setttings"""
|
35
|
+
assert (
|
36
|
+
self.CONFIG_CLS is not None
|
37
|
+
), "inheriting classes are expected to redefine CONFIG_CLS"
|
38
|
+
self._ewoks_default_inputs[
|
39
|
+
"nxtomomill_cfg_file"
|
40
|
+
] = cfg_file # pylint: disable=E1137
|
41
|
+
|
42
|
+
if os.path.exists(cfg_file):
|
43
|
+
try:
|
44
|
+
configuration = self.CONFIG_CLS.from_cfg_file(
|
45
|
+
cfg_file
|
46
|
+
) # pylint: disable=E1102
|
47
|
+
except Exception as e:
|
48
|
+
self._logger.error(
|
49
|
+
"Fail to use configuration file {}."
|
50
|
+
"Error is {}. No conversion will be done."
|
51
|
+
"".format(cfg_file, e)
|
52
|
+
)
|
53
|
+
else:
|
54
|
+
default_inputs = {
|
55
|
+
keyword: configuration.to_dict(),
|
56
|
+
}
|
57
|
+
else:
|
58
|
+
default_inputs = {
|
59
|
+
keyword: self.CONFIG_CLS().to_dict(), # pylint: disable=E1102
|
60
|
+
}
|
61
|
+
|
62
|
+
# hack: try to upgrade x_pixel_keys and y_pixels keys to list.
|
63
|
+
# otherwise has they have the same values and are tuples they have the same id and orange raises an
|
64
|
+
# dump_literals raise a ValueError - check_relaxed - is a recursive structure
|
65
|
+
try:
|
66
|
+
default_inputs[keyword]["KEYS_SECTION"]["x_pixel_keys"] = list(
|
67
|
+
default_inputs[keyword]["KEYS_SECTION"]["x_pixel_keys"]
|
68
|
+
)
|
69
|
+
default_inputs[keyword]["KEYS_SECTION"]["y_pixel_keys"] = list(
|
70
|
+
default_inputs[keyword]["KEYS_SECTION"]["y_pixel_keys"]
|
71
|
+
)
|
72
|
+
except KeyError:
|
73
|
+
pass
|
74
|
+
|
75
|
+
self.update_default_inputs(
|
76
|
+
**default_inputs,
|
77
|
+
)
|
78
|
+
|
79
|
+
def _get_task_arguments(self):
|
80
|
+
adict = super()._get_task_arguments()
|
81
|
+
# pop progress as does not fully exists on the orange-widget-base
|
82
|
+
adict.pop("progress", None)
|
83
|
+
return adict
|
84
|
+
|
85
|
+
def __new__(cls, *args, **kwargs):
|
86
|
+
# ensure backward compatibility with 'static_input'
|
87
|
+
static_input = kwargs.get("stored_settings", {}).get("static_input", None)
|
88
|
+
if static_input not in (None, {}):
|
89
|
+
_logger.warning(
|
90
|
+
"static_input has been deprecated. Will be replaced by _ewoks_default_inputs in the workflow file. Please save the workflow to apply modifications"
|
91
|
+
)
|
92
|
+
kwargs["stored_settings"]["_ewoks_default_inputs"] = static_input
|
93
|
+
return super().__new__(cls, *args, **kwargs)
|