tomwer 1.2.8__py3-none-any.whl → 1.3.0a0__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/icat_publication.ows +58 -0
- orangecontrib/tomwer/widgets/__init__.py +1 -0
- orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +2 -2
- orangecontrib/tomwer/widgets/control/DataListOW.py +9 -7
- orangecontrib/tomwer/widgets/control/DataSelectorOW.py +21 -10
- orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +11 -5
- orangecontrib/tomwer/widgets/control/EmailOW.py +4 -4
- orangecontrib/tomwer/widgets/control/NXTomomillOW.py +31 -18
- orangecontrib/tomwer/widgets/control/NXtomoConcatenate.py +14 -7
- orangecontrib/tomwer/widgets/control/NotifierOW.py +1 -0
- orangecontrib/tomwer/widgets/control/VolumeSelector.py +7 -4
- orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +182 -182
- orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +4 -4
- orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +4 -4
- orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +3 -3
- orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +2 -0
- orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +3 -3
- orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +3 -3
- orangecontrib/tomwer/widgets/icat/PublishProcessedDataOW.py +115 -0
- orangecontrib/tomwer/widgets/icat/RawDataScreenshotCreatorOW.py +98 -0
- orangecontrib/tomwer/widgets/icat/SaveToGalleryAndPublishOW.py +129 -0
- orangecontrib/tomwer/widgets/icat/__init__.py +13 -0
- orangecontrib/tomwer/widgets/icat/icons/add_gallery.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/add_gallery.svg +82 -0
- orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.svg +95 -0
- orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.svg +143 -0
- orangecontrib/tomwer/widgets/icons/tomwer_data_portal.png +0 -0
- orangecontrib/tomwer/widgets/icons/tomwer_data_portal.svg +76 -0
- orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +9 -8
- orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +3 -3
- orangecontrib/tomwer/widgets/reconstruction/NabuHelicalPrepareWeightsDoubleOW.py +179 -169
- orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +23 -0
- orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +39 -5
- orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +7 -13
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +7 -17
- orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +3 -4
- orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +3 -3
- orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +3 -29
- tomwer/__main__.py +11 -58
- tomwer/app/canvas.py +8 -0
- tomwer/app/canvas_launcher/config.py +13 -11
- tomwer/app/darkref.py +1 -1
- tomwer/app/darkrefpatch.py +1 -1
- tomwer/app/imagekeyeditor.py +5 -5
- tomwer/app/imagekeyupgrader.py +5 -5
- tomwer/app/intensitynormalization.py +2 -2
- tomwer/app/radiostack.py +2 -2
- tomwer/app/zstitching.py +74 -3
- tomwer/core/cluster/cluster.py +26 -0
- tomwer/core/log/logger.py +7 -5
- tomwer/core/process/conditions/filters.py +1 -1
- tomwer/core/process/control/datalistener/datalistener.py +3 -3
- tomwer/core/process/control/nxtomoconcatenate.py +13 -13
- tomwer/core/process/control/nxtomomill.py +83 -25
- tomwer/core/process/control/scantransfer.py +11 -10
- tomwer/core/process/control/scanvalidator.py +3 -2
- tomwer/core/process/control/test/test_concatenate_nxtomos.py +9 -9
- tomwer/core/process/control/test/test_email.py +4 -4
- tomwer/core/process/control/test/test_h52nx_process.py +59 -7
- tomwer/core/process/control/test/test_volume_link.py +64 -64
- tomwer/core/process/control/timer.py +1 -1
- tomwer/core/process/control/volumesymlink.py +200 -200
- tomwer/core/process/edit/darkflatpatch.py +6 -6
- tomwer/core/process/edit/imagekeyeditor.py +17 -18
- tomwer/core/process/icat/__init__.py +0 -0
- tomwer/core/process/icat/createscreenshots.py +100 -0
- tomwer/core/process/icat/gallery.py +377 -0
- tomwer/core/process/icat/icatbase.py +36 -0
- tomwer/core/process/icat/publish.py +228 -0
- tomwer/core/process/icat/screenshots.py +26 -0
- tomwer/core/process/output.py +52 -0
- tomwer/core/process/reconstruction/axis/axis.py +17 -10
- tomwer/core/process/reconstruction/axis/mode.py +4 -0
- tomwer/core/process/reconstruction/axis/params.py +9 -4
- tomwer/core/process/reconstruction/darkref/darkrefs.py +8 -6
- tomwer/core/process/reconstruction/darkref/darkrefscopy.py +1 -1
- tomwer/core/process/reconstruction/darkref/params.py +1 -1
- tomwer/core/process/reconstruction/lamino/tofu.py +4 -4
- tomwer/core/process/reconstruction/nabu/castvolume.py +1 -1
- tomwer/core/process/reconstruction/nabu/helical.py +9 -5
- tomwer/core/process/reconstruction/nabu/nabucommon.py +32 -62
- tomwer/core/process/reconstruction/nabu/nabuscores.py +387 -61
- tomwer/core/process/reconstruction/nabu/nabuslices.py +33 -21
- tomwer/core/process/reconstruction/nabu/nabuvolume.py +37 -14
- tomwer/core/process/reconstruction/nabu/settings.py +2 -2
- tomwer/core/process/reconstruction/nabu/utils.py +129 -24
- tomwer/core/process/reconstruction/output.py +108 -0
- tomwer/core/process/reconstruction/saaxis/saaxis.py +233 -263
- tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +140 -86
- tomwer/core/process/reconstruction/scores/params.py +4 -1
- tomwer/core/process/reconstruction/scores/scores.py +13 -0
- tomwer/core/process/reconstruction/test/test_axis_params.py +2 -2
- tomwer/core/process/reconstruction/test/test_darkref.py +3 -3
- tomwer/core/process/reconstruction/test/test_darkref_copy.py +3 -3
- tomwer/core/process/reconstruction/test/test_saaxis.py +3 -4
- tomwer/core/process/reconstruction/test/test_sadeltabeta.py +2 -2
- tomwer/core/process/stitching/nabustitcher.py +2 -2
- tomwer/core/process/test/test_axis.py +6 -6
- tomwer/core/process/test/test_dark_and_flat.py +10 -7
- tomwer/core/process/test/test_data_transfer.py +7 -6
- tomwer/core/process/test/test_nabu.py +4 -4
- tomwer/core/process/test/test_normalization.py +2 -2
- tomwer/core/scan/edfscan.py +4 -1
- tomwer/core/scan/hdf5scan.py +19 -500
- tomwer/core/scan/nxtomoscan.py +532 -0
- tomwer/core/scan/scanbase.py +42 -20
- tomwer/core/scan/scanfactory.py +13 -13
- tomwer/core/scan/test/test_future_scan.py +2 -2
- tomwer/core/scan/test/test_h5.py +12 -10
- tomwer/core/scan/test/test_process_registration.py +2 -2
- tomwer/core/scan/test/test_scan.py +4 -3
- tomwer/core/settings.py +20 -0
- tomwer/core/test/test_scanutils.py +8 -7
- tomwer/core/test/test_utils.py +33 -26
- tomwer/core/utils/__init__.py +0 -466
- tomwer/core/utils/deprecation.py +1 -1
- tomwer/core/utils/dictutils.py +14 -0
- tomwer/core/utils/lbsram.py +35 -0
- tomwer/core/utils/nxtomoutils.py +1 -1
- tomwer/core/utils/scanutils.py +6 -6
- tomwer/core/utils/spec.py +263 -0
- tomwer/core/volume/volumefactory.py +2 -2
- tomwer/gui/cluster/slurm.py +260 -60
- tomwer/gui/cluster/test/test_cluster.py +13 -0
- tomwer/gui/cluster/test/test_supervisor.py +2 -2
- tomwer/gui/configuration/__init__.py +0 -0
- tomwer/gui/{reconstruction/nabu → configuration}/action.py +1 -32
- tomwer/gui/configuration/level.py +22 -0
- tomwer/gui/control/actions.py +54 -0
- tomwer/gui/control/datalist.py +78 -16
- tomwer/gui/control/datalistener.py +4 -16
- tomwer/gui/control/{email.py → emailnotifier.py} +9 -18
- tomwer/gui/control/history.py +2 -2
- tomwer/gui/control/observations.py +2 -2
- tomwer/gui/control/reducedarkflatselector.py +1 -1
- tomwer/gui/control/selectorwidgetbase.py +36 -9
- tomwer/gui/control/serie/seriecreator.py +5 -22
- tomwer/gui/control/test/test_email.py +1 -1
- tomwer/gui/control/test/test_scanvalidator.py +6 -5
- tomwer/gui/control/test/test_single_tomo_obj.py +2 -2
- tomwer/gui/control/tomoobjdisplaymode.py +8 -0
- tomwer/gui/debugtools/datasetgenerator.py +3 -3
- tomwer/gui/edit/dkrfpatch.py +16 -22
- tomwer/gui/edit/imagekeyeditor.py +8 -11
- tomwer/gui/edit/nxtomoeditor.py +111 -44
- tomwer/gui/edit/nxtomowarmer.py +4 -4
- tomwer/gui/edit/test/test_dkrf_patch.py +7 -7
- tomwer/gui/edit/test/test_image_key_editor.py +3 -3
- tomwer/gui/edit/test/test_nx_editor.py +40 -16
- tomwer/gui/icat/__init__.py +0 -0
- tomwer/gui/icat/createscreenshots.py +80 -0
- tomwer/gui/icat/gallery.py +214 -0
- tomwer/gui/icat/publish.py +187 -0
- tomwer/gui/reconstruction/axis/axis.py +171 -57
- tomwer/gui/reconstruction/axis/radioaxis.py +80 -95
- tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +3 -2
- tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
- tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +3 -6
- tomwer/gui/reconstruction/nabu/castvolume.py +1 -1
- tomwer/gui/reconstruction/nabu/check.py +9 -9
- tomwer/gui/reconstruction/nabu/helical.py +29 -12
- tomwer/gui/reconstruction/nabu/nabuconfig/base.py +2 -4
- tomwer/gui/reconstruction/nabu/nabuconfig/output.py +110 -33
- tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +9 -12
- tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +219 -29
- tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +3 -6
- tomwer/gui/reconstruction/nabu/nabuflow.py +12 -20
- tomwer/gui/reconstruction/nabu/slices.py +6 -7
- tomwer/gui/reconstruction/nabu/volume.py +22 -10
- tomwer/gui/reconstruction/normalization/intensity.py +15 -23
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +7 -23
- tomwer/gui/reconstruction/saaxis/dimensionwidget.py +1 -1
- tomwer/gui/reconstruction/saaxis/saaxis.py +7 -9
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +2 -1
- tomwer/gui/reconstruction/scores/control.py +2 -9
- tomwer/gui/reconstruction/scores/scoreplot.py +11 -5
- tomwer/gui/reconstruction/test/test_axis.py +23 -12
- tomwer/gui/reconstruction/test/test_lamino.py +8 -3
- tomwer/gui/reconstruction/test/test_nabu.py +28 -9
- tomwer/gui/reconstruction/test/test_saaxis.py +3 -3
- tomwer/gui/reconstruction/test/test_sadeltabeta.py +2 -2
- tomwer/gui/settings.py +5 -28
- tomwer/gui/stackplot.py +2 -5
- tomwer/gui/stitching/action.py +49 -0
- tomwer/gui/stitching/config/axisparams.py +7 -24
- tomwer/gui/stitching/config/output.py +10 -8
- tomwer/gui/stitching/config/positionoveraxis.py +22 -23
- tomwer/gui/stitching/normalization.py +117 -0
- tomwer/gui/stitching/stitchandbackground.py +4 -6
- tomwer/gui/stitching/stitching.py +265 -43
- tomwer/gui/stitching/stitching_preview.py +62 -5
- tomwer/gui/stitching/stitching_raw.py +2 -5
- tomwer/gui/stitching/z_stitching/fineestimation.py +0 -60
- tomwer/gui/utils/buttons.py +112 -29
- tomwer/gui/utils/inputwidget.py +33 -25
- tomwer/gui/utils/scandescription.py +4 -0
- tomwer/gui/utils/step.py +144 -0
- tomwer/gui/utils/unitsystem.py +2 -5
- tomwer/gui/utils/vignettes.py +176 -15
- tomwer/gui/visualization/dataviewer.py +1 -18
- tomwer/gui/visualization/diffviewer/diffviewer.py +7 -16
- tomwer/gui/visualization/diffviewer/shiftwidget.py +2 -5
- tomwer/gui/visualization/scanoverview.py +1 -1
- tomwer/gui/visualization/sinogramviewer.py +1 -10
- tomwer/gui/visualization/test/test_diffviewer.py +3 -3
- tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +4 -4
- tomwer/gui/visualization/test/test_sinogramviewer.py +2 -2
- tomwer/gui/visualization/test/test_stacks.py +3 -3
- tomwer/gui/visualization/test/test_volumeviewer.py +2 -2
- tomwer/io/utils/raw_and_processed_data.py +84 -0
- tomwer/io/utils/tomoobj.py +4 -6
- tomwer/resources/gui/icons/ruler.png +0 -0
- tomwer/resources/gui/icons/ruler.svg +273 -0
- tomwer/resources/gui/icons/short_description.png +0 -0
- tomwer/resources/gui/icons/short_description.svg +58 -0
- tomwer/resources/gui/icons/url.png +0 -0
- tomwer/resources/gui/icons/url.svg +58 -0
- tomwer/synctools/stacks/edit/darkflatpatch.py +2 -2
- tomwer/synctools/stacks/edit/imagekeyeditor.py +2 -2
- tomwer/synctools/stacks/reconstruction/axis.py +4 -4
- tomwer/synctools/stacks/reconstruction/castvolume.py +2 -2
- tomwer/synctools/stacks/reconstruction/dkrefcopy.py +4 -10
- tomwer/synctools/stacks/reconstruction/nabu.py +2 -2
- tomwer/synctools/stacks/reconstruction/normalization.py +2 -2
- tomwer/synctools/stacks/reconstruction/saaxis.py +2 -2
- tomwer/synctools/stacks/reconstruction/sadeltabeta.py +2 -2
- tomwer/synctools/test/test_darkRefs.py +7 -58
- tomwer/synctools/test/test_foldertransfer.py +6 -6
- tomwer/synctools/utils/scanstages.py +6 -6
- tomwer/tests/conftest.py +34 -0
- tomwer/tests/datasets.py +13 -0
- tomwer/tests/test_scripts.py +92 -39
- tomwer/tests/utils.py +5 -0
- tomwer/version.py +3 -3
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/METADATA +39 -44
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/RECORD +248 -209
- tomwer/resources/gui/icons/esrf_1.svg +0 -307
- tomwer/resources/gui/icons/triangle.svg +0 -80
- tomwer/synctools/test/test_scanstages.py +0 -162
- tomwer/tests/utils/__init__.py +0 -247
- tomwer/tests/utils/utilstest.py +0 -220
- /tomwer/app/{saaxis.py → multicor.py} +0 -0
- /tomwer/app/{sadeltabeta.py → multipag.py} +0 -0
- /tomwer/core/process/control/{email.py → emailnotifier.py} +0 -0
- /tomwer-1.2.8-py3.11-nspkg.pth → /tomwer-1.3.0a0-py3.11-nspkg.pth +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/LICENSE +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/WHEEL +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/entry_points.txt +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/top_level.txt +0 -0
@@ -108,23 +108,27 @@ class NabuFlowControl(qt.QWidget):
|
|
108
108
|
self._iniProcessWidgets.sigWidgetActivated.connect(
|
109
109
|
functools.partial(self._updateActiveProcess, _NabuStages.INI)
|
110
110
|
)
|
111
|
-
self._iniProcessWidgets.sigWidgetDeactivated.connect(self.
|
111
|
+
self._iniProcessWidgets.sigWidgetDeactivated.connect(self.sigResetConfiguration)
|
112
112
|
self._preProcessWidgets.sigWidgetActivated.connect(
|
113
113
|
functools.partial(self._updateActiveProcess, _NabuStages.PRE)
|
114
114
|
)
|
115
|
-
self._preProcessWidgets.sigWidgetDeactivated.connect(self.
|
115
|
+
self._preProcessWidgets.sigWidgetDeactivated.connect(self.sigResetConfiguration)
|
116
116
|
self._phaseProcessWidgets.sigWidgetActivated.connect(
|
117
117
|
functools.partial(self._updateActiveProcess, _NabuStages.PHASE)
|
118
118
|
)
|
119
|
-
self._phaseProcessWidgets.sigWidgetDeactivated.connect(
|
119
|
+
self._phaseProcessWidgets.sigWidgetDeactivated.connect(
|
120
|
+
self.sigResetConfiguration
|
121
|
+
)
|
120
122
|
self._processWidgets.sigWidgetActivated.connect(
|
121
123
|
functools.partial(self._updateActiveProcess, _NabuStages.PROC)
|
122
124
|
)
|
123
|
-
self._processWidgets.sigWidgetDeactivated.connect(self.
|
125
|
+
self._processWidgets.sigWidgetDeactivated.connect(self.sigResetConfiguration)
|
124
126
|
self._postProcessWidgets.sigWidgetActivated.connect(
|
125
127
|
functools.partial(self._updateActiveProcess, _NabuStages.POST)
|
126
128
|
)
|
127
|
-
self._postProcessWidgets.sigWidgetDeactivated.connect(
|
129
|
+
self._postProcessWidgets.sigWidgetDeactivated.connect(
|
130
|
+
self.sigResetConfiguration
|
131
|
+
)
|
128
132
|
|
129
133
|
# set up
|
130
134
|
self.setIniprocVisible(False)
|
@@ -133,9 +137,6 @@ class NabuFlowControl(qt.QWidget):
|
|
133
137
|
self.setProcVisible(True)
|
134
138
|
self.setPostVisible(True)
|
135
139
|
|
136
|
-
def _activeProcessUnset(self):
|
137
|
-
self.sigResetConfiguration.emit()
|
138
|
-
|
139
140
|
def _updateActiveProcess(self, stage):
|
140
141
|
stage = _NabuStages.from_value(stage)
|
141
142
|
|
@@ -396,14 +397,8 @@ class NabuFlowArea(qt.QWidget):
|
|
396
397
|
|
397
398
|
# connect signal / slot
|
398
399
|
self._addRmWidget.sigRmProcess.connect(self._control._removeActiveProcess)
|
399
|
-
self._control.sigConfigurationChanged.connect(self.
|
400
|
-
self._control.sigResetConfiguration.connect(self.
|
401
|
-
|
402
|
-
def _repeatConfigSignal(self, *args):
|
403
|
-
self.sigConfigurationChanged.emit(*args)
|
404
|
-
|
405
|
-
def _repeatResetConfigSignal(self):
|
406
|
-
self.sigResetConfiguration.emit()
|
400
|
+
self._control.sigConfigurationChanged.connect(self.sigConfigurationChanged)
|
401
|
+
self._control.sigResetConfiguration.connect(self.sigResetConfiguration)
|
407
402
|
|
408
403
|
@docstring(NabuFlowControl)
|
409
404
|
def setIniProcessing(self, processes, icons):
|
@@ -464,12 +459,9 @@ class _AddRemoveProcessWidget(qt.QWidget):
|
|
464
459
|
|
465
460
|
# connect signal / slot
|
466
461
|
self._addButton.pressed.connect(self._addProcess)
|
467
|
-
self._rmButton.pressed.connect(self.
|
462
|
+
self._rmButton.pressed.connect(self.sigRmProcess)
|
468
463
|
|
469
464
|
def _addProcess(self):
|
470
465
|
# should be able to add a process from ini, post, processing and pre
|
471
466
|
|
472
467
|
raise NotImplementedError(" not implemented, to be defined")
|
473
|
-
|
474
|
-
def _rmProcess(self):
|
475
|
-
self.sigRmProcess.emit()
|
@@ -36,21 +36,22 @@ from nabu.pipeline.fullfield.nabu_config import (
|
|
36
36
|
from silx.gui import icons as silx_icons
|
37
37
|
from silx.gui import qt
|
38
38
|
from silx.utils.enum import Enum as _Enum
|
39
|
-
from
|
39
|
+
from nxtomo.nxobject.nxdetector import FOV
|
40
40
|
|
41
|
-
from tomwer.core.process.reconstruction.nabu.utils import
|
41
|
+
from tomwer.core.process.reconstruction.nabu.utils import _NabuMode
|
42
42
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
43
43
|
from tomwer.gui import icons as tomwer_icons
|
44
44
|
from tomwer.gui.reconstruction.nabu.nabuflow import NabuFlowArea
|
45
45
|
from tomwer.gui.utils.buttons import PadlockButton
|
46
46
|
|
47
47
|
from ...utils.flow import FlowDirection
|
48
|
-
from .action import (
|
48
|
+
from tomwer.gui.configuration.action import (
|
49
49
|
BasicConfigurationAction,
|
50
50
|
ExpertConfigurationAction,
|
51
51
|
FilterAction,
|
52
52
|
MinimalisticConfigurationAction,
|
53
53
|
)
|
54
|
+
from tomwer.gui.configuration.level import ConfigurationLevel
|
54
55
|
from .nabuconfig import NabuConfiguration
|
55
56
|
|
56
57
|
_logger = logging.getLogger(__name__)
|
@@ -287,7 +288,7 @@ class NabuWindow(qt.QMainWindow):
|
|
287
288
|
self.hidePaganinInterface = self._mainWidget.hidePaganinInterface
|
288
289
|
|
289
290
|
# connect signal / slot
|
290
|
-
self._mainWidget.sigConfigChanged.connect(self.
|
291
|
+
self._mainWidget.sigConfigChanged.connect(self.sigConfigChanged)
|
291
292
|
|
292
293
|
# set up
|
293
294
|
self._resetParameters()
|
@@ -348,6 +349,7 @@ class NabuWindow(qt.QMainWindow):
|
|
348
349
|
|
349
350
|
def _resetParameters(self):
|
350
351
|
default_config = get_default_nabu_config(nabu_fullfield_default_config)
|
352
|
+
self._mainWidget._configuration._preProcessingWidget._sinoRingsOpts.resetConfiguration()
|
351
353
|
default_config["tomwer_slices"] = "middle"
|
352
354
|
default_config["preproc"]["ccd_filter_enabled"] = False
|
353
355
|
default_config["preproc"]["double_flatfield_enabled"] = False
|
@@ -431,9 +433,6 @@ class NabuWindow(qt.QMainWindow):
|
|
431
433
|
def isModeLocked(self):
|
432
434
|
return self._mainWidget.isModeLocked()
|
433
435
|
|
434
|
-
def _triggerConfigChanged(self):
|
435
|
-
self.sigConfigChanged.emit()
|
436
|
-
|
437
436
|
|
438
437
|
class NabuWidget(qt.QWidget):
|
439
438
|
"""
|
@@ -34,15 +34,15 @@ from asyncio.log import logger
|
|
34
34
|
from silx.gui import qt
|
35
35
|
|
36
36
|
from tomwer.core.process.reconstruction.nabu.utils import (
|
37
|
-
ConfigurationLevel,
|
38
37
|
_NabuStages,
|
39
38
|
)
|
40
39
|
from tomwer.gui import icons
|
41
|
-
from tomwer.gui.
|
40
|
+
from tomwer.gui.configuration.action import (
|
42
41
|
BasicConfigurationAction,
|
43
42
|
ExpertConfigurationAction,
|
44
43
|
MinimalisticConfigurationAction,
|
45
44
|
)
|
45
|
+
from tomwer.gui.configuration.level import ConfigurationLevel
|
46
46
|
from tomwer.gui.reconstruction.nabu.nabuconfig.base import _NabuStageConfigBase
|
47
47
|
from tomwer.gui.reconstruction.nabu.nabuconfig.output import (
|
48
48
|
NabuOutputLocationWidget,
|
@@ -196,7 +196,7 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
|
|
196
196
|
)
|
197
197
|
self._redefineNabuOutputLocation.setCheckable(True)
|
198
198
|
self._redefineNabuOutputLocation.setLayout(qt.QVBoxLayout())
|
199
|
-
self._outputLocationWidget = NabuOutputLocationWidget(self)
|
199
|
+
self._outputLocationWidget = NabuOutputLocationWidget(parent=self)
|
200
200
|
self._redefineNabuOutputLocation.layout().addWidget(self._outputLocationWidget)
|
201
201
|
self.layout().addWidget(self._redefineNabuOutputLocation, 5, 0, 1, 2)
|
202
202
|
self.registerWidget(self._redefineNabuOutputLocation, "advanced")
|
@@ -259,13 +259,15 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
|
|
259
259
|
self._outputLocationWidget._outputDirQLE.editingFinished.connect(
|
260
260
|
self._triggerSigConfChanged
|
261
261
|
)
|
262
|
-
self._outputLocationWidget.
|
263
|
-
|
264
|
-
)
|
262
|
+
self._outputLocationWidget.sigOutputChanged.connect(self._triggerSigConfChanged)
|
263
|
+
self._redefineNabuOutputLocation.toggled.connect(self._triggerSigConfChanged)
|
265
264
|
|
266
265
|
def redefineOutputLocation(self):
|
267
266
|
return self._redefineNabuOutputLocation.isChecked()
|
268
267
|
|
268
|
+
def setRedefineOutputLocation(self, redefine: bool):
|
269
|
+
self._redefineNabuOutputLocation.setChecked(redefine)
|
270
|
+
|
269
271
|
def getNabuOutputLocation(self):
|
270
272
|
if self.redefineOutputLocation():
|
271
273
|
return self._outputLocationWidget.getOutputDir()
|
@@ -277,6 +279,7 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
|
|
277
279
|
self._redefineNabuOutputLocation.setChecked(False)
|
278
280
|
else:
|
279
281
|
self._redefineNabuOutputLocation.setChecked(True)
|
282
|
+
self._outputLocationWidget.setOutputDirMode("other")
|
280
283
|
self._outputLocationWidget.setOutputDir(location)
|
281
284
|
|
282
285
|
def redefineNabuFileFormat(self):
|
@@ -307,13 +310,13 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
|
|
307
310
|
return self._spbCPUFract.value() / 100.0
|
308
311
|
|
309
312
|
def setCPUFract(self, value):
|
310
|
-
return self._spbCPUFract.setValue(value * 100.0)
|
313
|
+
return self._spbCPUFract.setValue(int(value * 100.0))
|
311
314
|
|
312
315
|
def getGPUFract(self):
|
313
316
|
return self._spbGPUFract.value() / 100.0
|
314
317
|
|
315
318
|
def setGPUFract(self, value):
|
316
|
-
return self._spbGPUFract.setValue(value * 100.0)
|
319
|
+
return self._spbGPUFract.setValue(int(value * 100.0))
|
317
320
|
|
318
321
|
def getStartZ(self):
|
319
322
|
return self._fromSlice.value()
|
@@ -357,6 +360,8 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
|
|
357
360
|
},
|
358
361
|
"new_output_file_format": self.getNabuFileFormat() or "",
|
359
362
|
"new_output_location": self.getNabuOutputLocation() or "",
|
363
|
+
"output_dir_mode": self._outputLocationWidget.getOutputDirMode().value,
|
364
|
+
"overwrite_output_location": self.redefineOutputLocation(),
|
360
365
|
}
|
361
366
|
|
362
367
|
def setConfiguration(self, config):
|
@@ -382,6 +387,12 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
|
|
382
387
|
if new_output_location == "":
|
383
388
|
new_output_location = None
|
384
389
|
self.setNabuOutputLocation(new_output_location)
|
390
|
+
output_dir_mode = config.get("output_dir_mode", None)
|
391
|
+
if output_dir_mode is not None:
|
392
|
+
self._outputLocationWidget.setOutputDirMode(output_dir_mode)
|
393
|
+
overwrite_output_location = config.get("overwrite_output_location", None)
|
394
|
+
if overwrite_output_location is not None:
|
395
|
+
self.setRedefineOutputLocation(overwrite_output_location)
|
385
396
|
|
386
397
|
def setPostProcConfiguration(self, config):
|
387
398
|
if "output_histogram" in config:
|
@@ -430,6 +441,7 @@ class NabuVolumeWindow(qt.QMainWindow):
|
|
430
441
|
|
431
442
|
self._minimalisticAction = MinimalisticConfigurationAction(toolbar)
|
432
443
|
menu.addAction(self._minimalisticAction)
|
444
|
+
self.__configurationModesGroup.addAction(self._minimalisticAction)
|
433
445
|
self._basicConfigAction = BasicConfigurationAction(toolbar)
|
434
446
|
menu.addAction(self._basicConfigAction)
|
435
447
|
self.__configurationModesGroup.addAction(self._basicConfigAction)
|
@@ -438,8 +450,8 @@ class NabuVolumeWindow(qt.QMainWindow):
|
|
438
450
|
self.__configurationModesGroup.addAction(self._expertConfiguration)
|
439
451
|
|
440
452
|
# set up
|
441
|
-
self._basicConfigAction.setChecked(True)
|
442
453
|
self._userModeChanged(action=self._basicConfigAction)
|
454
|
+
self._basicConfigAction.setChecked(True)
|
443
455
|
|
444
456
|
# connect signal / slot
|
445
457
|
self._mainWidget.sigConfigChanged.connect(self._triggerSigConfigChanged)
|
@@ -455,7 +467,7 @@ class NabuVolumeWindow(qt.QMainWindow):
|
|
455
467
|
elif action is self._expertConfiguration:
|
456
468
|
level = ConfigurationLevel.ADVANCED
|
457
469
|
else:
|
458
|
-
|
470
|
+
level = ConfigurationLevel.REQUIRED
|
459
471
|
self._mainWidget.setConfigurationLevel(level)
|
460
472
|
|
461
473
|
# expose API
|
@@ -46,7 +46,7 @@ from tomoscan.normalization import Method
|
|
46
46
|
|
47
47
|
from tomwer.core.process.reconstruction.normalization import params as _normParams
|
48
48
|
from tomwer.core.process.reconstruction.normalization.params import _ValueSource
|
49
|
-
from tomwer.core.scan.
|
49
|
+
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
50
50
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
51
51
|
from tomwer.gui.reconstruction.scores.control import ControlWidget
|
52
52
|
from tomwer.gui.utils.buttons import PadlockButton
|
@@ -88,7 +88,7 @@ class SinoNormWindow(qt.QMainWindow):
|
|
88
88
|
# connect signal / slot
|
89
89
|
# self._optsWidget.sigModeChanged.connect(self._modeChanged)
|
90
90
|
self._optsWidget.sigValueUpdated.connect(self.setResult)
|
91
|
-
self._optsWidget.sigConfigurationChanged.connect(self.
|
91
|
+
self._optsWidget.sigConfigurationChanged.connect(self.sigConfigurationChanged)
|
92
92
|
self._optsWidget.sigSourceChanged.connect(self._sourceChanged)
|
93
93
|
self._crtWidget.sigValidateRequest.connect(self._validated)
|
94
94
|
|
@@ -101,9 +101,6 @@ class SinoNormWindow(qt.QMainWindow):
|
|
101
101
|
self._centralWidget = None
|
102
102
|
super().close()
|
103
103
|
|
104
|
-
def _configurationChanged(self):
|
105
|
-
self.sigConfigurationChanged.emit()
|
106
|
-
|
107
104
|
def _hideLockButton(self):
|
108
105
|
self._optsWidget._hideLockButton()
|
109
106
|
|
@@ -489,21 +486,20 @@ class _NormIntensityOptions(qt.QWidget):
|
|
489
486
|
|
490
487
|
# connect signal / slot
|
491
488
|
self._modeCB.currentIndexChanged.connect(self._modeChanged)
|
492
|
-
self._modeCB.currentIndexChanged.connect(self.
|
489
|
+
self._modeCB.currentIndexChanged.connect(self.sigConfigurationChanged)
|
493
490
|
self._sourceCB.currentIndexChanged.connect(self._sourceChanged)
|
494
|
-
self._sourceCB.currentIndexChanged.connect(self.
|
495
|
-
self._computeButton.released.connect(self.
|
491
|
+
self._sourceCB.currentIndexChanged.connect(self.sigConfigurationChanged)
|
492
|
+
self._computeButton.released.connect(self.sigProcessingRequested)
|
496
493
|
self._scalarValueWidget.sigValueChanged.connect(self._valueUpdated)
|
497
|
-
self._scalarValueWidget.sigValueChanged.connect(self.
|
498
|
-
self._datasetWidget.sigConfigurationChanged.connect(
|
494
|
+
self._scalarValueWidget.sigValueChanged.connect(self.sigConfigurationChanged)
|
495
|
+
self._datasetWidget.sigConfigurationChanged.connect(
|
496
|
+
self.sigConfigurationChanged
|
497
|
+
)
|
499
498
|
self._intensityCalcOpts.sigConfigurationChanged.connect(
|
500
|
-
self.
|
499
|
+
self.sigConfigurationChanged
|
501
500
|
)
|
502
501
|
self._lockButton.toggled.connect(self._lockChanged)
|
503
|
-
self._lockButton.toggled.connect(self.
|
504
|
-
|
505
|
-
def _configurationChanged(self):
|
506
|
-
self.sigConfigurationChanged.emit()
|
502
|
+
self._lockButton.toggled.connect(self.sigConfigurationChanged)
|
507
503
|
|
508
504
|
def _sourceChanged(self):
|
509
505
|
source = self.getCurrentSource()
|
@@ -644,9 +640,6 @@ class _NormIntensityOptions(qt.QWidget):
|
|
644
640
|
else:
|
645
641
|
raise ValueError(f"unhandled source: {source} for method {method}")
|
646
642
|
|
647
|
-
def _computationRequested(self):
|
648
|
-
self.sigProcessingRequested.emit()
|
649
|
-
|
650
643
|
|
651
644
|
class _NormIntensityCalcOpts(qt.QWidget):
|
652
645
|
"""Options to compute the norm intensity"""
|
@@ -665,15 +658,14 @@ class _NormIntensityCalcOpts(qt.QWidget):
|
|
665
658
|
self.layout().addRow(self._calculationModeLabel, self._calculationModeCB)
|
666
659
|
|
667
660
|
# connect signal / slot
|
668
|
-
self._calculationModeCB.currentIndexChanged.connect(
|
661
|
+
self._calculationModeCB.currentIndexChanged.connect(
|
662
|
+
self.sigConfigurationChanged
|
663
|
+
)
|
669
664
|
|
670
665
|
def setCalculationFctVisible(self, visible):
|
671
666
|
self._calculationModeLabel.setVisible(visible)
|
672
667
|
self._calculationModeCB.setVisible(visible)
|
673
668
|
|
674
|
-
def _configurationChanged(self):
|
675
|
-
self.sigConfigurationChanged.emit()
|
676
|
-
|
677
669
|
def getCalculationFct(self):
|
678
670
|
return _normParams._ValueCalculationFct.from_value(
|
679
671
|
self._calculationModeCB.currentText()
|
@@ -885,7 +877,7 @@ class _NormIntensityDatasetWidget(qt.QWidget):
|
|
885
877
|
if self.getMode() is _normParams._DatasetScope.LOCAL:
|
886
878
|
if self.getScan() is not None:
|
887
879
|
scan = self.getScan()
|
888
|
-
if not isinstance(scan,
|
880
|
+
if not isinstance(scan, NXtomoScan):
|
889
881
|
mess = qt.QMessageBox(
|
890
882
|
parent=self,
|
891
883
|
icon=qt.QMessageBox.Warning,
|
@@ -259,9 +259,7 @@ class _ReconstructionModeGB(qt.QGroupBox):
|
|
259
259
|
# connect signal / slot
|
260
260
|
self._verticalRB.toggled.connect(self._reconstructionModeChanged)
|
261
261
|
self._tiltCorrectionRB.toggled.connect(self._reconstructionModeChanged)
|
262
|
-
self._sliceVerticalQSB.sigSlicesChanged.connect(
|
263
|
-
self._reconstructionSliceChanged
|
264
|
-
)
|
262
|
+
self._sliceVerticalQSB.sigSlicesChanged.connect(self.reconstructionSliceChanged)
|
265
263
|
self._onRadioButton.released.connect(self._onRadioActivated)
|
266
264
|
self._defaultSlicesCB.currentIndexChanged.connect(self._updateVerticalSelection)
|
267
265
|
|
@@ -295,7 +293,7 @@ class _ReconstructionModeGB(qt.QGroupBox):
|
|
295
293
|
mode_is_middle = current_mode == "middle"
|
296
294
|
self._sliceVerticalQSB.setVisible(not mode_is_middle)
|
297
295
|
self._onRadioButton.setVisible(not mode_is_middle)
|
298
|
-
self.
|
296
|
+
self.reconstructionSliceChanged.emit()
|
299
297
|
|
300
298
|
def _onRadioActivated(self):
|
301
299
|
lineSelection = QSliceSelectorDialog(parent=self, n_required_slice=1)
|
@@ -327,11 +325,6 @@ class _ReconstructionModeGB(qt.QGroupBox):
|
|
327
325
|
def setScan(self, scan):
|
328
326
|
self.__scan = weakref.ref(scan)
|
329
327
|
|
330
|
-
def _reconstructionSliceChanged(self):
|
331
|
-
# for now we only synchronize sliceQSB from vertical with the sinogram
|
332
|
-
# viewer
|
333
|
-
self.reconstructionSliceChanged.emit()
|
334
|
-
|
335
328
|
def getReconstructionMode(self) -> ReconstructionMode:
|
336
329
|
if self._tiltCorrectionRB.isChecked():
|
337
330
|
return ReconstructionMode.TILT_CORRECTION
|
@@ -516,10 +509,10 @@ class _EstimatedCorWidget(qt.QGroupBox):
|
|
516
509
|
self._middlePositionRB.toggled.connect(self._modeChanged)
|
517
510
|
self._manualCORRel.editingFinished.connect(self._relativePositionChanged)
|
518
511
|
self._manualCORAbs.editingFinished.connect(self._absolutePositionChanged)
|
519
|
-
self._autoCorPB.released.connect(self.
|
520
|
-
self._middlePositionRB.toggled.connect(self.
|
521
|
-
self._manualCORRel.editingFinished.connect(self.
|
522
|
-
self._manualCORAbs.editingFinished.connect(self.
|
512
|
+
self._autoCorPB.released.connect(self.sigAutoCorRequested)
|
513
|
+
self._middlePositionRB.toggled.connect(self.sigAutoCorChanged)
|
514
|
+
self._manualCORRel.editingFinished.connect(self.sigAutoCorChanged)
|
515
|
+
self._manualCORAbs.editingFinished.connect(self.sigAutoCorChanged)
|
523
516
|
# set up
|
524
517
|
self._middlePositionRB.setChecked(True)
|
525
518
|
self._modeChanged()
|
@@ -607,12 +600,6 @@ class _EstimatedCorWidget(qt.QGroupBox):
|
|
607
600
|
self._manualCORAbs.setValue(float(value))
|
608
601
|
self._manualCORAbs.editingFinished.emit()
|
609
602
|
|
610
|
-
def _autoCorReqested(self):
|
611
|
-
self.sigAutoCorRequested.emit()
|
612
|
-
|
613
|
-
def _autoCorValueChanged(self):
|
614
|
-
self.sigAutoCorChanged.emit()
|
615
|
-
|
616
603
|
|
617
604
|
class SAAxisOptions(qt.QWidget):
|
618
605
|
"""
|
@@ -673,7 +660,7 @@ class SAAxisOptions(qt.QWidget):
|
|
673
660
|
|
674
661
|
# connect signal / slot
|
675
662
|
self._reconstructionMode.reconstructionSliceChanged.connect(
|
676
|
-
self.
|
663
|
+
self.sigReconstructionSliceChanged
|
677
664
|
)
|
678
665
|
self._nReconsSB.valueChanged.connect(self._reconstructionRangeChanged)
|
679
666
|
self._estimatedCorWidget.sigAutoCorChanged.connect(
|
@@ -722,9 +709,6 @@ class SAAxisOptions(qt.QWidget):
|
|
722
709
|
self._reconstructionMode.setSlicesRange(min_index, max_index)
|
723
710
|
self.sigConfigurationChanged.emit()
|
724
711
|
|
725
|
-
def _reconstructionSliceChanged(self):
|
726
|
-
self.sigReconstructionSliceChanged.emit()
|
727
|
-
|
728
712
|
def _reconstructionRangeChanged(self):
|
729
713
|
self.sigReconstructionRangeChanged.emit()
|
730
714
|
self.sigConfigurationChanged.emit()
|
@@ -41,7 +41,7 @@ import numpy
|
|
41
41
|
from silx.gui import qt
|
42
42
|
|
43
43
|
from tomwer.core.process.reconstruction.axis import mode as axis_mode
|
44
|
-
from tomwer.core.process.reconstruction.nabu.utils import _NabuMode
|
44
|
+
from tomwer.core.process.reconstruction.nabu.utils import _NabuMode, slice_index_to_int
|
45
45
|
from tomwer.core.process.reconstruction.saaxis.params import SAAxisParams
|
46
46
|
from tomwer.core.process.reconstruction.saaxis.saaxis import SAAxisTask
|
47
47
|
from tomwer.gui import icons
|
@@ -131,13 +131,10 @@ class NabuAutoCorDiag(qt.QDialog):
|
|
131
131
|
self.layout().addWidget(self._buttons)
|
132
132
|
|
133
133
|
self._buttons.button(qt.QDialogButtonBox.Ok).clicked.connect(
|
134
|
-
self.
|
134
|
+
self.sigRequestAutoCor
|
135
135
|
)
|
136
136
|
self._buttons.button(qt.QDialogButtonBox.Ok).setText("compute")
|
137
137
|
|
138
|
-
def _requestAutomaticCor(self, *args, **kwargs):
|
139
|
-
self.sigRequestAutoCor.emit()
|
140
|
-
|
141
138
|
|
142
139
|
class _SAAxisTabWidget(qt.QTabWidget):
|
143
140
|
sigConfigurationChanged = qt.Signal()
|
@@ -258,6 +255,10 @@ class _SAAxisTabWidget(qt.QTabWidget):
|
|
258
255
|
"mode": self.getReconstructionMode().value,
|
259
256
|
"score_method": self.getScoreMethod().value,
|
260
257
|
"estimated_cor": self.getEstimatedCorPosition(),
|
258
|
+
"output_dir": self.getNabuReconsParams()
|
259
|
+
.get("output", {})
|
260
|
+
.get("location", None)
|
261
|
+
or None,
|
261
262
|
}
|
262
263
|
|
263
264
|
def setConfiguration(self, config):
|
@@ -450,10 +451,7 @@ class SAAxisWindow(qt.QMainWindow):
|
|
450
451
|
def _updateSinogramLine(self):
|
451
452
|
r_slice = self.getReconstructionSlices()
|
452
453
|
if r_slice == "middle":
|
453
|
-
|
454
|
-
line = self._scan.dim_2 // 2
|
455
|
-
else:
|
456
|
-
line = 1024
|
454
|
+
line = slice_index_to_int(slice_index="middle", scan=self._scan)
|
457
455
|
else:
|
458
456
|
line = list(r_slice.values())[0]
|
459
457
|
self._tabWidget.getSinogramViewer().setLine(line)
|
@@ -41,10 +41,10 @@ import numpy
|
|
41
41
|
from silx.gui import qt
|
42
42
|
|
43
43
|
from tomwer.core.process.reconstruction.nabu.utils import (
|
44
|
-
ConfigurationLevel,
|
45
44
|
_NabuMode,
|
46
45
|
retrieve_lst_of_value_from_str,
|
47
46
|
)
|
47
|
+
from tomwer.gui.configuration.level import ConfigurationLevel
|
48
48
|
from tomwer.core.process.reconstruction.sadeltabeta.sadeltabeta import (
|
49
49
|
SADeltaBetaTask,
|
50
50
|
)
|
@@ -190,6 +190,7 @@ class _SADeltaBetaTabWidget(qt.QTabWidget):
|
|
190
190
|
"nabu_params": nabu_config,
|
191
191
|
"score_method": self.getScoreMethod().value,
|
192
192
|
"delta_beta_values": self.getDeltaBetaValues(),
|
193
|
+
"output_dir": nabu_config.get("output", {}).get("location", None) or None,
|
193
194
|
}
|
194
195
|
|
195
196
|
def getReconstructionSlice(self):
|
@@ -71,12 +71,5 @@ class ControlWidget(qt.QWidget):
|
|
71
71
|
self.layout().addWidget(self._buttons)
|
72
72
|
|
73
73
|
# make connection
|
74
|
-
self._computeBut.pressed.connect(self.
|
75
|
-
self._applyBut.pressed.connect(self.
|
76
|
-
|
77
|
-
def _needComputation(self, *arg, **kwargs):
|
78
|
-
"""callback when the radio line changed"""
|
79
|
-
self.sigComputationRequest.emit()
|
80
|
-
|
81
|
-
def _validate(self):
|
82
|
-
self.sigValidateRequest.emit()
|
74
|
+
self._computeBut.pressed.connect(self.sigComputationRequest)
|
75
|
+
self._applyBut.pressed.connect(self.sigValidateRequest)
|
@@ -137,6 +137,11 @@ class VariableSelection(qt.QWidget):
|
|
137
137
|
self._scoreMethodCB = qt.QComboBox(self)
|
138
138
|
self.layout().addWidget(self._scoreMethodCB, 0, 1, 1, 1)
|
139
139
|
for method in ScoreMethod:
|
140
|
+
if method is ScoreMethod.TOMO_CONSISTENCY:
|
141
|
+
# for now we avoid this method. Does not provide great results and is very time consuming
|
142
|
+
# I guess when we will add it we will need to first display slices
|
143
|
+
# and then only compute the score. It might be an "on demand" score but not computed by default.
|
144
|
+
continue
|
140
145
|
self._scoreMethodCB.addItem(method.value)
|
141
146
|
# default score method is 1 / tv
|
142
147
|
idx = self._scoreMethodCB.findText(ScoreMethod.TV_INVERSE.value)
|
@@ -193,7 +198,6 @@ class VariableSelection(qt.QWidget):
|
|
193
198
|
self._autofocusRB.toggled.connect(self._selectionModeChanged)
|
194
199
|
self._lockAutofocusButton.toggled.connect(self._lockButtonActive)
|
195
200
|
self._vignetteButton.released.connect(self._openVignetteMode)
|
196
|
-
self._scoreMethodCB.currentIndexChanged.connect(self._scoreMethodChanged)
|
197
201
|
|
198
202
|
# update widget to fit set up
|
199
203
|
self._selectionModeChanged()
|
@@ -571,7 +575,7 @@ class ScorePlot(qt.QWidget):
|
|
571
575
|
self._varSlider.valueChanged.connect(self._plot.setCurrentUrlIndex)
|
572
576
|
self._varSlider.valueChanged.connect(self._sliderReleased)
|
573
577
|
self._varSlider.valueChanged.connect(self._updateVarValue)
|
574
|
-
self._varScore.sigMouseWheelActive.connect(self.
|
578
|
+
self._varScore.sigMouseWheelActive.connect(self._varSlider.wheelEvent)
|
575
579
|
self._varValueWidget.sigAutoFocusLocked.connect(self._autoFocusLockChanged)
|
576
580
|
self._varValueWidget.sigAutoFocusUnLocked.connect(self._autoFocusLockChanged)
|
577
581
|
self._varValueWidget.sigSelectionModeChanged.connect(
|
@@ -588,6 +592,11 @@ class ScorePlot(qt.QWidget):
|
|
588
592
|
self._volumeSizeW.hide()
|
589
593
|
self._voxelSizeW.hide()
|
590
594
|
self._axisLabel.hide()
|
595
|
+
# use mean mean+/-3std for the cor
|
596
|
+
plotWidget = self._plot.getPlotWidget()
|
597
|
+
colormap = plotWidget.getDefaultColormap()
|
598
|
+
colormap.setAutoscaleMode(colormap.STDDEV3)
|
599
|
+
plotWidget.setDefaultColormap(colormap=colormap)
|
591
600
|
|
592
601
|
def __init_subclass__(cls, constructor, **kwargs): # pylint: disable=E0302
|
593
602
|
super().__init_subclass__()
|
@@ -657,9 +666,6 @@ class ScorePlot(qt.QWidget):
|
|
657
666
|
def _varSelectedFromVignettes(self, value):
|
658
667
|
self._varSlider.setVarValue(value)
|
659
668
|
|
660
|
-
def _propagateSPWheelEvent(self, event):
|
661
|
-
self._varSlider.wheelEvent(event)
|
662
|
-
|
663
669
|
def _get_closest_var(self, value):
|
664
670
|
"""return the closest cor value to value or None if no cor value
|
665
671
|
defined"""
|
@@ -38,12 +38,13 @@ from silx.gui import qt
|
|
38
38
|
from silx.gui.utils.testutils import TestCaseQt
|
39
39
|
|
40
40
|
from tomwer.core.process.reconstruction.axis.mode import AxisMode
|
41
|
-
from tomwer.core.scan.
|
42
|
-
from tomwer.core.scan.hdf5scan import HDF5TomoScan
|
41
|
+
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
43
42
|
from tomwer.gui.reconstruction.axis import AxisWindow
|
44
43
|
from tomwer.gui.reconstruction.axis.radioaxis import _ManualFramesSelection
|
45
44
|
from tomwer.synctools.axis import QAxisRP
|
46
|
-
from tomwer.tests.
|
45
|
+
from tomwer.tests.datasets import TomwerCIDatasets
|
46
|
+
from tomwer.tests.utils import skip_gui_test
|
47
|
+
from tomwer.core.utils.scanutils import MockNXtomo
|
47
48
|
|
48
49
|
|
49
50
|
@pytest.mark.skipif(skip_gui_test(), reason="skip gui test")
|
@@ -51,14 +52,22 @@ class TestWindowAxis(TestCaseQt):
|
|
51
52
|
"""Test that the axis widget work correctly"""
|
52
53
|
|
53
54
|
def setUp(self):
|
55
|
+
self.tempdir = tempfile.mkdtemp()
|
54
56
|
self.recons_params = QAxisRP()
|
55
57
|
self._window = AxisWindow(axis_params=self.recons_params)
|
56
|
-
self.
|
57
|
-
|
58
|
+
self.scan = MockNXtomo(
|
59
|
+
scan_path=os.path.join(self.tempdir, "nx_tomo.nx"),
|
60
|
+
n_proj=10,
|
61
|
+
n_ini_proj=10,
|
62
|
+
scan_range=180,
|
63
|
+
dim=20,
|
64
|
+
energy=12.3,
|
65
|
+
).scan
|
58
66
|
self._window.show()
|
59
67
|
self.qWaitForWindowExposed(self._window)
|
60
68
|
|
61
69
|
def tearDown(self):
|
70
|
+
shutil.rmtree(self.tempdir)
|
62
71
|
self._window.setAttribute(qt.Qt.WA_DeleteOnClose)
|
63
72
|
self._window.close()
|
64
73
|
|
@@ -89,7 +98,10 @@ class TestWindowAxis(TestCaseQt):
|
|
89
98
|
self.qapp.processEvents()
|
90
99
|
self.assertTrue(radio_axis.getXShift() == 0)
|
91
100
|
self.assertTrue(radio_axis.getYShift() == 0)
|
92
|
-
self.assertTrue(
|
101
|
+
self.assertTrue(
|
102
|
+
radio_axis.getShiftStep() == 1.0,
|
103
|
+
f"shift is {radio_axis.getShiftStep()} when 1.0 expected",
|
104
|
+
)
|
93
105
|
radio_axis._controlWidget._shiftControl._leftButton.click()
|
94
106
|
self.qapp.processEvents()
|
95
107
|
self.assertTrue(radio_axis.getXShift() == -1)
|
@@ -98,7 +110,7 @@ class TestWindowAxis(TestCaseQt):
|
|
98
110
|
self.qapp.processEvents()
|
99
111
|
self.assertTrue(radio_axis.getXShift() == 0)
|
100
112
|
self.assertTrue(radio_axis.getYShift() == 0)
|
101
|
-
radio_axis._controlWidget._displacementSelector._fineButton.
|
113
|
+
radio_axis._controlWidget._displacementSelector._fineButton.click()
|
102
114
|
self.qapp.processEvents()
|
103
115
|
self.assertTrue(radio_axis.getShiftStep() == 0.1)
|
104
116
|
radio_axis._controlWidget._shiftControl._topButton.click()
|
@@ -131,9 +143,6 @@ class TestWindowAxis(TestCaseQt):
|
|
131
143
|
self.assertEqual(radio_axis.getXShift(), -6.0)
|
132
144
|
self.assertEqual(radio_axis.getYShift(), 0.0)
|
133
145
|
|
134
|
-
def testAxisCalculationSaveLoad(self):
|
135
|
-
pass
|
136
|
-
|
137
146
|
|
138
147
|
@pytest.mark.skipif(skip_gui_test(), reason="skip gui test")
|
139
148
|
class TestWindowsAxisSetScan(TestCaseQt):
|
@@ -148,10 +157,12 @@ class TestWindowsAxisSetScan(TestCaseQt):
|
|
148
157
|
# create dataset
|
149
158
|
self.master_file = os.path.join(self.scan_dir, "frm_edftomomill_twoentries.nx")
|
150
159
|
shutil.copyfile(
|
151
|
-
|
160
|
+
TomwerCIDatasets.get_dataset(
|
161
|
+
"h5_datasets/frm_edftomomill_twoentries.nx",
|
162
|
+
),
|
152
163
|
self.master_file,
|
153
164
|
)
|
154
|
-
self.scan =
|
165
|
+
self.scan = NXtomoScan(scan=self.master_file, entry="entry0000")
|
155
166
|
|
156
167
|
def tearDown(self):
|
157
168
|
self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
|