tomwer 1.4.11__py3-none-any.whl → 1.4.12__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.
@@ -16,7 +16,6 @@ from tomwer.core.process.reconstruction.saaxis.params import SAAxisParams
16
16
  from tomwer.core.process.reconstruction.saaxis.saaxis import SAAxisTask
17
17
  from tomwer.gui import icons
18
18
  from tomwer.gui.reconstruction.axis.CalculationWidget import CalculationWidget
19
- from tomwer.gui.reconstruction.nabu.slices import NabuWidget
20
19
  from tomwer.gui.reconstruction.nabu.platform import NabuPlatformSettings
21
20
  from tomwer.gui.reconstruction.saaxis.corrangeselector import SliceAndCorWidget
22
21
  from tomwer.gui.reconstruction.scores.control import ControlWidget
@@ -25,6 +24,8 @@ from tomwer.gui.reconstruction.scores.scoreplot import ScorePlot as _ScorePlot
25
24
  from tomwer.gui.utils.buttons import TabBrowsersButtons
26
25
  from tomwer.gui.utils.scandescription import ScanNameLabelAndShape
27
26
  from tomwer.gui.settings import TAB_LABEL_PLATFORM_SETTINGS
27
+ from tomwer.gui.reconstruction.sacommon import NabuWidgetWithToolbar as NabuWidget
28
+
28
29
  from tomwer.synctools.axis import QAxisRP
29
30
 
30
31
  _logger = logging.getLogger(__file__)
@@ -128,6 +129,7 @@ class _SAAxisTabWidget(qt.QTabWidget):
128
129
  self._nabuSettings.hideSlicesInterface()
129
130
  nabu_icon = icons.getQIcon("nabu")
130
131
  self.addTab(self._nabuSettings, nabu_icon, "reconstruction settings")
132
+
131
133
  # platform settings
132
134
  self._localPlatformSettings = NabuPlatformSettings(self)
133
135
  settings_icons = icons.getQIcon("parameters")
@@ -0,0 +1,151 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ from nabu.pipeline.config import parse_nabu_config_file
5
+ from tomwer.gui.configuration.action import (
6
+ BasicConfigurationAction,
7
+ ExpertConfigurationAction,
8
+ MinimalisticConfigurationAction,
9
+ )
10
+ from silx.gui import qt
11
+ from nabu.pipeline.config import get_default_nabu_config
12
+ from nabu.pipeline.fullfield.nabu_config import (
13
+ nabu_config as nabu_fullfield_default_config,
14
+ )
15
+ from tomwer.gui.reconstruction.nabu.slices import NabuWidget
16
+ from tomwer.gui.configuration.level import ConfigurationLevel
17
+
18
+
19
+ class NabuWidgetWithToolbar(qt.QMainWindow):
20
+ sigConfigChanged = qt.Signal()
21
+
22
+ def __init__(self, *args, **kwargs):
23
+ super().__init__(*args, **kwargs)
24
+ self.setWindowFlags(qt.Qt.Widget)
25
+
26
+ self._nabuSettings = NabuWidget(parent=self)
27
+ self.setCentralWidget(self._nabuSettings)
28
+
29
+ self._createNabuSettingsToolbar()
30
+ # connect signal / slot
31
+ self._nabuSettings.sigConfigChanged.connect(self.sigConfigChanged)
32
+
33
+ def _createNabuSettingsToolbar(self):
34
+ style = qt.QApplication.style()
35
+
36
+ # add toolbar
37
+ toolbar = qt.QToolBar(self)
38
+ toolbar.setMovable(False)
39
+ toolbar.setFloatable(False)
40
+ self.addToolBar(qt.Qt.TopToolBarArea, toolbar)
41
+
42
+ # add configuration mode
43
+ self.__configurationModesAction = qt.QAction(self)
44
+ self.__configurationModesAction.setCheckable(False)
45
+ menu = qt.QMenu(self)
46
+ self.__configurationModesAction.setMenu(menu)
47
+ toolbar.addAction(self.__configurationModesAction)
48
+
49
+ self.__configurationModesGroup = qt.QActionGroup(self)
50
+ self.__configurationModesGroup.setExclusive(True)
51
+ self.__configurationModesGroup.triggered.connect(self._userModeChanged)
52
+
53
+ self._minimalisticAction = MinimalisticConfigurationAction(toolbar)
54
+ menu.addAction(self._minimalisticAction)
55
+ self.__configurationModesGroup.addAction(self._minimalisticAction)
56
+ self._basicConfigAction = BasicConfigurationAction(toolbar)
57
+ menu.addAction(self._basicConfigAction)
58
+ self.__configurationModesGroup.addAction(self._basicConfigAction)
59
+ self._expertConfiguration = ExpertConfigurationAction(toolbar)
60
+ menu.addAction(self._expertConfiguration)
61
+ self.__configurationModesGroup.addAction(self._expertConfiguration)
62
+
63
+ # reset configuration option
64
+ self.__resetAction = qt.QAction(self)
65
+ self.__resetAction.setToolTip("reset nabu configuration")
66
+ reset_icon = style.standardIcon(qt.QStyle.SP_DialogResetButton)
67
+ self.__resetAction.setIcon(reset_icon)
68
+ toolbar.addAction(self.__resetAction)
69
+ self.__resetAction.triggered.connect(self._resetParameters)
70
+
71
+ # toolbar spacer
72
+ self.__tSpacer = qt.QWidget(toolbar)
73
+ self.__tSpacer.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Preferred)
74
+ toolbar.addWidget(self.__tSpacer)
75
+
76
+ # connect signal / slot
77
+ self._nabuSettings.sigConfigChanged.connect(self.sigConfigChanged)
78
+
79
+ # set up
80
+ self._resetParameters()
81
+ self._basicConfigAction.setChecked(True)
82
+ self._userModeChanged()
83
+
84
+ def _resetParameters(self):
85
+ # reset nabu settings
86
+ default_config = get_default_nabu_config(nabu_fullfield_default_config)
87
+ self._nabuSettings._configuration._preProcessingWidget._sinoRingsOpts.resetConfiguration()
88
+ default_config["tomwer_slices"] = "middle"
89
+ default_config["preproc"]["ccd_filter_enabled"] = False
90
+ default_config["preproc"]["double_flatfield_enabled"] = False
91
+ default_config["preproc"]["flatfield"] = True
92
+ default_config["preproc"]["take_logarithm"] = True
93
+ self._nabuSettings.setConfiguration(default_config)
94
+
95
+ def _userModeChanged(self, *args, **kwargs):
96
+ selectedAction = self.__configurationModesGroup.checkedAction()
97
+ self.__configurationModesAction.setIcon(selectedAction.icon())
98
+ self.__configurationModesAction.setToolTip(selectedAction.tooltip())
99
+ self._nabuSettings.setConfigurationLevel(self.getConfigurationLevel())
100
+ self.sigConfigChanged.emit()
101
+
102
+ def _loadParameters(self):
103
+ inputFile = self.askForNabuconfigFile(acceptMode=qt.QFileDialog.AcceptOpen)
104
+
105
+ if inputFile and os.path.exists(inputFile):
106
+ config = parse_nabu_config_file(inputFile)
107
+ self._nabuSettings.setConfiguration(config)
108
+
109
+ def setConfigurationLevel(self, level):
110
+ level = ConfigurationLevel.from_value(level)
111
+ if level == ConfigurationLevel.REQUIRED:
112
+ self._minimalisticAction.setChecked(True)
113
+ elif level == ConfigurationLevel.ADVANCED:
114
+ self._expertConfiguration.setChecked(True)
115
+ elif level == ConfigurationLevel.OPTIONAL:
116
+ self._basicConfigAction.setChecked(True)
117
+ else:
118
+ raise ValueError("Level not recognize")
119
+ self._userModeChanged()
120
+
121
+ def getConfigurationLevel(self):
122
+ if self._basicConfigAction.isChecked():
123
+ return ConfigurationLevel.OPTIONAL
124
+ elif self._expertConfiguration.isChecked():
125
+ return ConfigurationLevel.ADVANCED
126
+ elif self._minimalisticAction.isChecked():
127
+ return ConfigurationLevel.REQUIRED
128
+ else:
129
+ raise ValueError("Level not recognize")
130
+
131
+ # expose API
132
+ def hideSlicesInterface(self):
133
+ return self._nabuSettings.hideSlicesInterface()
134
+
135
+ def hidePaganinInterface(self):
136
+ return self._nabuSettings.hidePaganinInterface()
137
+
138
+ def setConfiguration(self, *args, **kwargs):
139
+ self._nabuSettings.setConfiguration(*args, **kwargs)
140
+
141
+ def getConfiguration(self):
142
+ return self._nabuSettings.getConfiguration()
143
+
144
+ def getMode(self):
145
+ return self._nabuSettings.getMode()
146
+
147
+ def setMode(self, *args, **kwargs):
148
+ self._nabuSettings.setMode(*args, **kwargs)
149
+
150
+ def setScan(self, scan):
151
+ self._nabuSettings.setScan(scan=scan)
@@ -25,7 +25,6 @@ from tomwer.core.process.reconstruction.scores.params import ScoreMethod
25
25
  from tomwer.core.scan.scanbase import TomwerScanBase
26
26
  from tomwer.gui import icons
27
27
  from tomwer.gui.reconstruction.nabu.nabuconfig.phase import _NabuPhaseConfig
28
- from tomwer.gui.reconstruction.nabu.slices import NabuWidget
29
28
  from tomwer.gui.reconstruction.nabu.platform import NabuPlatformSettings
30
29
  from tomwer.gui.reconstruction.saaxis.sliceselector import SliceSelector
31
30
  from tomwer.gui.reconstruction.scores.control import ControlWidget
@@ -35,6 +34,7 @@ from tomwer.gui.utils.buttons import TabBrowsersButtons
35
34
  from tomwer.gui.utils.scandescription import ScanNameLabelAndShape
36
35
  from tomwer.gui.settings import TAB_LABEL_PLATFORM_SETTINGS
37
36
  from tomwer.synctools.sadeltabeta import QSADeltaBetaParams
37
+ from tomwer.gui.reconstruction.sacommon import NabuWidgetWithToolbar as NabuWidget
38
38
 
39
39
  _logger = logging.getLogger(__name__)
40
40
 
tomwer/version.py CHANGED
@@ -77,7 +77,7 @@ RELEASE_LEVEL_VALUE = {
77
77
 
78
78
  MAJOR = 1
79
79
  MINOR = 4
80
- MICRO = 11
80
+ MICRO = 12
81
81
  RELEV = "final" # <16
82
82
  SERIAL = 0 # <16
83
83
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tomwer
3
- Version: 1.4.11
3
+ Version: 1.4.12
4
4
  Summary: "tomography workflow tools"
5
5
  Home-page: https://gitlab.esrf.fr/tomotools/tomwer
6
6
  Author: Henri Payno, Pierre Paleo, Pierre-Olivier Autran, Jérôme Lesaint, Alessandro Mirone
@@ -219,7 +219,7 @@ orangecontrib/tomwer/widgets/visualization/tests/__init__.py,sha256=47DEQpj8HBSa
219
219
  tomwer/__init__.py,sha256=cMIyH-uRxpa9WVnAuWjiBD7k9TK57WO21RzP_S-Mb8I,460
220
220
  tomwer/__main__.py,sha256=7tCADiS4u7k1PCxFhlRAcYSIOpxQTGUTx8sCEQ-hi1E,8707
221
221
  tomwer/utils.py,sha256=7h7dEgKAEUmQ43jkULvC1B9Adl55nkCty-SEKUKCl4U,7008
222
- tomwer/version.py,sha256=n3CqDxj5kf_QPmQ3-LqwLdY1J9aJiQgW9_dN0vfGnJg,4387
222
+ tomwer/version.py,sha256=xsTKVPFvtqACqhXHiD0tTzx8xp1ha3Ub1lds0X_Y-o0,4387
223
223
  tomwer/app/__init__.py,sha256=h1FKED7Tw5f99yikygt7ruXsdrxQhcJxO7kagLGxhJg,84
224
224
  tomwer/app/axis.py,sha256=lB-IZx1o6KTWLIelITvYCIu2flFTB9NhuIfD2MhUZZA,5826
225
225
  tomwer/app/canvas.py,sha256=y8rYOiwmv6ug7JcjgkOzEiGQnNXjKWNNmKofT0n8TFg,1538
@@ -539,6 +539,7 @@ tomwer/gui/edit/tests/test_dkrf_patch.py,sha256=L0fO2nqqK74EOIZTPQKjO03qsAiXbqjj
539
539
  tomwer/gui/edit/tests/test_image_key_editor.py,sha256=6sIGM_DjU_KjspnVKB2UDhWh_BLDhYP8rS6U1fAZXkk,4647
540
540
  tomwer/gui/edit/tests/test_nx_editor.py,sha256=iEm8th1ahclnLhNHVHtdvQQvazX2znteYTJUGeEfXpw,13865
541
541
  tomwer/gui/reconstruction/__init__.py,sha256=Ozf9bYay5hVhe1clExeM_MLhcAuu624i5BP1xonWlB0,95
542
+ tomwer/gui/reconstruction/sacommon.py,sha256=X_xaEiaUDsoebYuIvEPWDM3bWJjd29cdya6s9QAuRsI,6001
542
543
  tomwer/gui/reconstruction/axis/AxisMainWindow.py,sha256=7w2LhdQ1pa8vU9U-XTA3ohGQfYKk5ETZ79s_xl4Zxx8,9641
543
544
  tomwer/gui/reconstruction/axis/AxisOptionsWidget.py,sha256=M47xflZ68KkTDg8tksFt8n7ZFVIr8tJxstlPyG4Odq0,12168
544
545
  tomwer/gui/reconstruction/axis/AxisSettingsWidget.py,sha256=7GpHteE2j9RUo-jUQoJdXJ-GnIi9VnY13Lveq3mvd1M,28120
@@ -582,10 +583,10 @@ tomwer/gui/reconstruction/normalization/test/test_intensity.py,sha256=CP9GxvaR7Q
582
583
  tomwer/gui/reconstruction/saaxis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
583
584
  tomwer/gui/reconstruction/saaxis/corrangeselector.py,sha256=v-3JDRNrvhuq1t_qrOqSj1KkFsvld3Z831IDQeCE888,31797
584
585
  tomwer/gui/reconstruction/saaxis/dimensionwidget.py,sha256=JXokxJxUlMVug5UxZVoXgP8J902V-ahkoDvrq2q_X4Q,7905
585
- tomwer/gui/reconstruction/saaxis/saaxis.py,sha256=dIZ2MTj4CqhipqjR8663DK7Ft70r0U0xSnLC4OPrCkc,20098
586
+ tomwer/gui/reconstruction/saaxis/saaxis.py,sha256=oKHoJ7Z8xZS4BIQ8A6Cn5SijPNH7C7S56Z0zPSEZ2Fo,20122
586
587
  tomwer/gui/reconstruction/saaxis/sliceselector.py,sha256=NMKCVc2x2cMrPxm801M3hl2qCXtxuvIWTjxyUx1mRxE,10883
587
588
  tomwer/gui/reconstruction/sadeltabeta/__init__.py,sha256=74VkZ1KfTqXmfQReLkjJenvuEZFkhHDqK6BZJHhOeS4,57
588
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py,sha256=xSdfITKB8gtOMwhQ5Rpeg-bre9vqt-arRdWt9jsrxbM,19448
589
+ tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py,sha256=r2zDJPnRyiJ8ZX-iO0WbXcsNSlzH3xLp-5S4L3noCRc,19470
589
590
  tomwer/gui/reconstruction/scores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
590
591
  tomwer/gui/reconstruction/scores/control.py,sha256=SVWMruB--sa_LSM1oZhjoFM5ci1oQTe9XqXOyI8iR0U,1496
591
592
  tomwer/gui/reconstruction/scores/scoreplot.py,sha256=TCVG29UDq3w-5oo5QMXJ9IIx2-vMGVCLVJJpE7HAvS8,30917
@@ -903,9 +904,9 @@ tomwer/tests/orangecontrib/tomwer/widgets/visualization/tests/test_volume_viewer
903
904
  tomwer/tests/test_ewoks/test_conversion.py,sha256=a8cEWbErXiFCAkaapi0jeEoRKYxcFQCoa-Jr_u77_OM,3656
904
905
  tomwer/tests/test_ewoks/test_single_node_execution.py,sha256=YBUHfiAnkciv_kjj7biC5fOs7c7ofNImM_azGMn4LZM,2813
905
906
  tomwer/tests/test_ewoks/test_workflows.py,sha256=Eq80eexf5NVL7SzvwctLOaUeuQ8V3vDiFiHgbJA4Yb8,4871
906
- tomwer-1.4.11.dist-info/LICENSE,sha256=62p1wL0n9WMTu8x2YDv0odYgTqeSvTd9mQ0v6Mq7lzE,1876
907
- tomwer-1.4.11.dist-info/METADATA,sha256=M84LcLUCPsi1bQDUkRE6EOZww_25wETf53Gff3lwUhI,13416
908
- tomwer-1.4.11.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
909
- tomwer-1.4.11.dist-info/entry_points.txt,sha256=py3ZUWvGnWGc5c7Yhw_uBTm8Fmew0BDw3aQZnWMBNZI,500
910
- tomwer-1.4.11.dist-info/top_level.txt,sha256=Yz5zKh0FPiImtzHYcPuztG1AO8-6KEpUWgoChGbA0Ys,21
911
- tomwer-1.4.11.dist-info/RECORD,,
907
+ tomwer-1.4.12.dist-info/LICENSE,sha256=62p1wL0n9WMTu8x2YDv0odYgTqeSvTd9mQ0v6Mq7lzE,1876
908
+ tomwer-1.4.12.dist-info/METADATA,sha256=FzYqqbXucsYFj1tqTy66078IJkTfI4VzkEeIpBth6J0,13416
909
+ tomwer-1.4.12.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
910
+ tomwer-1.4.12.dist-info/entry_points.txt,sha256=py3ZUWvGnWGc5c7Yhw_uBTm8Fmew0BDw3aQZnWMBNZI,500
911
+ tomwer-1.4.12.dist-info/top_level.txt,sha256=Yz5zKh0FPiImtzHYcPuztG1AO8-6KEpUWgoChGbA0Ys,21
912
+ tomwer-1.4.12.dist-info/RECORD,,