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.
Files changed (269) hide show
  1. orangecontrib/tomwer/tutorials/EBS_tomo_listener.ows +39 -0
  2. orangecontrib/tomwer/tutorials/cast_volume.ows +34 -0
  3. orangecontrib/tomwer/tutorials/simple_slice_reconstruction.ows +39 -0
  4. orangecontrib/tomwer/tutorials/simple_volume_local_reconstruction.ows +49 -0
  5. orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +59 -0
  6. orangecontrib/tomwer/tutorials/using_saaxis_to_find_cor.ows +44 -0
  7. orangecontrib/tomwer/widgets/cluster/FutureSupervisorOW.py +1 -1
  8. orangecontrib/tomwer/widgets/cluster/SlurmClusterOW.py +14 -4
  9. orangecontrib/tomwer/widgets/cluster/__init__.py +1 -1
  10. orangecontrib/tomwer/widgets/control/DataListOW.py +12 -5
  11. orangecontrib/tomwer/widgets/control/DataListenerOW.py +18 -9
  12. orangecontrib/tomwer/widgets/control/DataSelectorOW.py +13 -6
  13. orangecontrib/tomwer/widgets/control/DataTransfertOW.py +3 -5
  14. orangecontrib/tomwer/widgets/control/DataValidatorOW.py +8 -4
  15. orangecontrib/tomwer/widgets/control/DataWatcherOW.py +4 -6
  16. orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +49 -62
  17. orangecontrib/tomwer/widgets/control/FilterOW.py +2 -4
  18. orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +93 -0
  19. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +135 -129
  20. orangecontrib/tomwer/widgets/control/NotifierOW.py +34 -9
  21. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +3 -5
  22. orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +19 -13
  23. orangecontrib/tomwer/widgets/control/VolumeSelector.py +12 -4
  24. orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +11 -7
  25. orangecontrib/tomwer/widgets/control/icons/notification.svg +4 -4
  26. orangecontrib/tomwer/widgets/control/icons/nxtomomill.png +0 -0
  27. orangecontrib/tomwer/widgets/control/icons/nxtomomill.svg +8 -5
  28. orangecontrib/tomwer/widgets/control/icons/tomoobjserie.png +0 -0
  29. orangecontrib/tomwer/widgets/control/icons/tomoobjserie.svg +73 -78
  30. orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +16 -4
  31. orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +100 -0
  32. orangecontrib/tomwer/widgets/edit/icons/image_key_editor.png +0 -0
  33. orangecontrib/tomwer/widgets/edit/icons/image_key_upgrader.png +0 -0
  34. orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.png +0 -0
  35. orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.svg +123 -0
  36. orangecontrib/tomwer/widgets/edit/test/test_dark_flat_patch.py +21 -1
  37. orangecontrib/tomwer/widgets/edit/test/test_image_key_editor.py +1 -1
  38. orangecontrib/tomwer/widgets/edit/test/test_image_key_upgrader.py +1 -1
  39. orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +25 -0
  40. orangecontrib/tomwer/widgets/other/PythonScriptOW.py +19 -11
  41. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +20 -14
  42. orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +24 -10
  43. orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py +26 -21
  44. orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +29 -12
  45. orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +44 -17
  46. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +28 -20
  47. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +24 -18
  48. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +6 -6
  49. orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +4 -2
  50. orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.png +0 -0
  51. orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.svg +11 -8
  52. orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +10 -4
  53. orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
  54. orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +69 -0
  55. orangecontrib/tomwer/widgets/visualization/SampleMovedOW.py +2 -4
  56. orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.png +0 -0
  57. orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.svg +105 -0
  58. tomwer/__main__.py +10 -5
  59. tomwer/app/canvas_launcher/config.py +10 -10
  60. tomwer/app/canvas_launcher/mainwindow.py +68 -6
  61. tomwer/app/canvas_launcher/widgetsscheme.py +1 -3
  62. tomwer/app/darkref.py +16 -12
  63. tomwer/app/imagekeyeditor.py +2 -2
  64. tomwer/app/imagekeyupgrader.py +104 -0
  65. tomwer/app/intensitynormalization.py +0 -1
  66. tomwer/app/nxtomoeditor.py +103 -0
  67. tomwer/app/rsync.py +1 -1
  68. tomwer/core/cluster/cluster.py +1 -1
  69. tomwer/core/futureobject.py +1 -0
  70. tomwer/core/process/control/datalistener/datalistener.py +7 -1
  71. tomwer/core/process/control/datalistener/rpcserver.py +3 -4
  72. tomwer/core/process/control/datawatcher/datawatcher.py +18 -18
  73. tomwer/core/process/control/datawatcher/datawatcherobserver.py +5 -8
  74. tomwer/core/process/control/datawatcher/datawatcherprocess.py +2 -3
  75. tomwer/core/process/control/datawatcher/edfdwprocess.py +2 -2
  76. tomwer/core/process/control/nxtomomill.py +33 -58
  77. tomwer/core/process/control/scanlist.py +2 -1
  78. tomwer/core/process/control/scanselector.py +7 -0
  79. tomwer/core/process/control/scantransfer.py +2 -2
  80. tomwer/core/process/control/scanvalidator.py +6 -5
  81. tomwer/core/process/control/singletomoobj.py +2 -1
  82. tomwer/core/process/control/timer.py +2 -1
  83. tomwer/core/process/control/tomoobjserie.py +8 -2
  84. tomwer/core/process/control/volumeselector.py +2 -1
  85. tomwer/core/process/control/volumesymlink.py +2 -1
  86. tomwer/core/process/edit/darkflatpatch.py +2 -1
  87. tomwer/core/process/edit/imagekeyeditor.py +4 -3
  88. tomwer/core/process/reconstruction/axis/axis.py +29 -32
  89. tomwer/core/process/reconstruction/axis/mode.py +3 -2
  90. tomwer/core/process/reconstruction/axis/params.py +35 -16
  91. tomwer/core/process/reconstruction/darkref/darkrefs.py +90 -707
  92. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +44 -16
  93. tomwer/core/process/reconstruction/darkref/params.py +62 -67
  94. tomwer/core/process/reconstruction/lamino/tofu.py +1 -2
  95. tomwer/core/process/reconstruction/nabu/castvolume.py +21 -26
  96. tomwer/core/process/reconstruction/nabu/nabucommon.py +36 -38
  97. tomwer/core/process/reconstruction/nabu/nabuscores.py +28 -13
  98. tomwer/core/process/reconstruction/nabu/nabuslices.py +41 -14
  99. tomwer/core/process/reconstruction/nabu/nabuvolume.py +21 -12
  100. tomwer/core/process/reconstruction/nabu/utils.py +32 -3
  101. tomwer/core/process/reconstruction/normalization/normalization.py +9 -8
  102. tomwer/core/process/reconstruction/saaxis/saaxis.py +46 -20
  103. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +38 -12
  104. tomwer/core/process/reconstruction/test/__init__.py +0 -39
  105. tomwer/core/process/reconstruction/test/test_axis_params.py +25 -3
  106. tomwer/core/process/reconstruction/test/test_darkref_copy.py +117 -1
  107. tomwer/core/process/script/python.py +16 -12
  108. tomwer/core/process/task.py +3 -7
  109. tomwer/core/process/test/test_axis.py +1 -1
  110. tomwer/core/process/test/test_dark_and_flat.py +41 -111
  111. tomwer/core/process/test/test_data_listener.py +0 -29
  112. tomwer/core/process/test/test_data_transfer.py +10 -14
  113. tomwer/core/process/test/test_nabu.py +1 -1
  114. tomwer/core/process/test/test_normalization.py +1 -1
  115. tomwer/core/process/visualization/liveslice.py +6 -0
  116. tomwer/core/scan/blissscan.py +37 -2
  117. tomwer/core/scan/edfscan.py +19 -8
  118. tomwer/core/scan/hdf5scan.py +10 -4
  119. tomwer/core/scan/scanbase.py +35 -29
  120. tomwer/core/scan/scanfactory.py +3 -17
  121. tomwer/core/scan/test/test_h5.py +1 -1
  122. tomwer/core/scan/test/test_process_registration.py +0 -11
  123. tomwer/core/scan/test/test_scan.py +32 -30
  124. tomwer/core/settings.py +2 -2
  125. tomwer/core/test/test_utils.py +1 -1
  126. tomwer/core/tomwer_object.py +19 -0
  127. tomwer/core/utils/__init__.py +0 -45
  128. tomwer/core/utils/char.py +2 -0
  129. tomwer/core/utils/gpu.py +5 -5
  130. tomwer/core/utils/nxtomoutils.py +2 -2
  131. tomwer/core/utils/scanutils.py +50 -0
  132. tomwer/core/utils/volumeutils.py +13 -0
  133. tomwer/core/volume/edfvolume.py +4 -0
  134. tomwer/core/volume/hdf5volume.py +4 -0
  135. tomwer/core/volume/jp2kvolume.py +4 -0
  136. tomwer/core/volume/rawvolume.py +22 -5
  137. tomwer/core/volume/tiffvolume.py +4 -0
  138. tomwer/core/volume/volumebase.py +19 -12
  139. tomwer/core/volume/volumefactory.py +20 -1
  140. tomwer/gui/cluster/slurm.py +1 -1
  141. tomwer/gui/cluster/supervisor.py +0 -2
  142. tomwer/gui/cluster/test/test_cluster.py +2 -2
  143. tomwer/gui/control/datalist.py +109 -36
  144. tomwer/gui/control/datatransfert.py +1 -1
  145. tomwer/gui/control/datawatcher/configuration.py +0 -2
  146. tomwer/gui/control/datawatcher/datawatcher.py +23 -13
  147. tomwer/gui/control/datawatcher/datawatcherobserver.py +1 -1
  148. tomwer/gui/control/observations.py +0 -3
  149. tomwer/gui/control/selectorwidgetbase.py +42 -12
  150. tomwer/gui/control/serie/seriecreator.py +967 -0
  151. tomwer/{web/__init__.py → gui/control/serie/seriewaiter.py} +5 -7
  152. tomwer/gui/control/singletomoobj.py +15 -4
  153. tomwer/gui/control/test/test_datalist.py +1 -1
  154. tomwer/gui/control/test/test_datalistener.py +1 -1
  155. tomwer/gui/control/test/test_inputwidget.py +1 -1
  156. tomwer/gui/control/test/test_process_manager.py +1 -13
  157. tomwer/gui/control/test/test_scanselector.py +1 -1
  158. tomwer/gui/control/test/test_scanvalidator.py +1 -1
  159. tomwer/gui/control/test/test_single_tomo_obj.py +1 -1
  160. tomwer/gui/control/test/test_volume_dialog.py +19 -7
  161. tomwer/gui/control/test/test_volumeselector.py +4 -4
  162. tomwer/gui/debugtools/datasetgenerator.py +1 -9
  163. tomwer/gui/edit/dkrfpatch.py +2 -3
  164. tomwer/gui/edit/imagekeyeditor.py +12 -11
  165. tomwer/gui/edit/nxtomoeditor.py +475 -0
  166. tomwer/gui/edit/test/test_dkrf_patch.py +2 -14
  167. tomwer/gui/edit/test/test_image_key_editor.py +2 -2
  168. tomwer/gui/edit/test/test_nx_editor.py +155 -0
  169. tomwer/gui/icons.py +0 -1
  170. tomwer/gui/qfolderdialog.py +11 -0
  171. tomwer/gui/reconstruction/axis/CompareImages.py +27 -29
  172. tomwer/gui/reconstruction/axis/axis.py +2 -0
  173. tomwer/gui/reconstruction/axis/radioaxis.py +70 -14
  174. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +7 -9
  175. tomwer/gui/reconstruction/darkref/darkrefwidget.py +22 -24
  176. tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
  177. tomwer/gui/reconstruction/lamino/tofu/tofu.py +3 -3
  178. tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +4 -4
  179. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +10 -5
  180. tomwer/gui/reconstruction/nabu/castvolume.py +103 -24
  181. tomwer/gui/reconstruction/nabu/check.py +1 -1
  182. tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py +352 -0
  183. tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +0 -9
  184. tomwer/gui/reconstruction/nabu/nabuconfig/output.py +1 -1
  185. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +18 -19
  186. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +30 -7
  187. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +26 -15
  188. tomwer/gui/reconstruction/nabu/slices.py +10 -4
  189. tomwer/gui/reconstruction/nabu/slurm.py +1 -1
  190. tomwer/gui/reconstruction/nabu/volume.py +13 -7
  191. tomwer/gui/reconstruction/normalization/intensity.py +1 -5
  192. tomwer/gui/reconstruction/saaxis/corrangeselector.py +10 -37
  193. tomwer/gui/reconstruction/saaxis/saaxis.py +11 -7
  194. tomwer/gui/reconstruction/saaxis/sliceselector.py +11 -26
  195. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +13 -8
  196. tomwer/gui/reconstruction/scores/scoreplot.py +67 -62
  197. tomwer/gui/reconstruction/test/test_axis.py +2 -2
  198. tomwer/gui/reconstruction/test/test_lamino.py +2 -2
  199. tomwer/gui/reconstruction/test/test_nabu.py +14 -1
  200. tomwer/gui/reconstruction/test/test_saaxis.py +8 -17
  201. tomwer/gui/reconstruction/test/test_sadeltabeta.py +7 -13
  202. tomwer/gui/stackplot.py +11 -28
  203. tomwer/gui/test/test_axis_gui.py +4 -4
  204. tomwer/gui/test/test_qfolder_dialog.py +12 -0
  205. tomwer/gui/utils/inputwidget.py +42 -22
  206. tomwer/gui/utils/lineselector/lineselector.py +13 -21
  207. tomwer/gui/utils/scandescription.py +2 -4
  208. tomwer/gui/utils/slider.py +1 -102
  209. tomwer/gui/utils/unitsystem.py +48 -11
  210. tomwer/gui/visualization/dataviewer.py +24 -17
  211. tomwer/gui/visualization/diffviewer/diffviewer.py +2 -11
  212. tomwer/gui/visualization/nxtomometadata.py +21 -0
  213. tomwer/gui/visualization/scanoverview.py +0 -1
  214. tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +72 -0
  215. tomwer/gui/visualization/test/test_stacks.py +1 -1
  216. tomwer/gui/visualization/tomoobjoverview.py +49 -0
  217. tomwer/gui/visualization/volumeoverview.py +64 -0
  218. tomwer/gui/visualization/volumeviewer.py +1 -1
  219. tomwer/io/utils/utils.py +2 -2
  220. tomwer/resources/gui/icons/multi-document-save.png +0 -0
  221. tomwer/resources/gui/icons/multi-document-save.svg +101 -0
  222. tomwer/resources/gui/illustrations/ctf_z1.png +0 -0
  223. tomwer/resources/gui/illustrations/ctf_z1.svg +471 -0
  224. tomwer/synctools/axis.py +0 -1
  225. tomwer/synctools/darkref.py +0 -1
  226. tomwer/synctools/datalistener.py +5 -1
  227. tomwer/synctools/imageloaderthread.py +2 -2
  228. tomwer/synctools/saaxis.py +0 -1
  229. tomwer/synctools/sadeltabeta.py +0 -1
  230. tomwer/synctools/stacks/edit/imagekeyeditor.py +1 -1
  231. tomwer/synctools/stacks/processingstack.py +2 -2
  232. tomwer/synctools/stacks/reconstruction/castvolume.py +1 -0
  233. tomwer/synctools/stacks/reconstruction/dkrefcopy.py +1 -1
  234. tomwer/synctools/stacks/reconstruction/lamino.py +1 -3
  235. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +0 -2
  236. tomwer/synctools/test/test_darkRefs.py +32 -149
  237. tomwer/synctools/test/test_foldertransfer.py +1 -1
  238. tomwer/synctools/test/test_scanstages.py +2 -2
  239. tomwer/tests/conftest.py +51 -0
  240. tomwer/{test → tests}/test_scripts.py +1 -1
  241. tomwer/tests/test_utils.py +10 -0
  242. tomwer/{test → tests}/utils/utilstest.py +0 -11
  243. tomwer/version.py +3 -3
  244. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/METADATA +14 -16
  245. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/RECORD +255 -235
  246. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/WHEEL +1 -1
  247. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/entry_points.txt +6 -0
  248. orangecontrib/tomwer/setup.py +0 -45
  249. orangecontrib/tomwer/widgets/setup.py +0 -49
  250. tomwer/app/process.py +0 -153
  251. tomwer/core/process/reconstruction/nabu/slurm.py +0 -36
  252. tomwer/core/process/reconstruction/utils/nabu_slice_exec.py +0 -10
  253. tomwer/core/utils/laminoutils.py +0 -80
  254. tomwer/gui/utils/lineselector/lineselection.py +0 -76
  255. tomwer/setup.py +0 -52
  256. tomwer/slurm/executor.py +0 -36
  257. tomwer/slurm/job.py +0 -349
  258. tomwer/slurm/utils.py +0 -44
  259. tomwer/web/client.py +0 -43
  260. tomwer/web/config.py +0 -36
  261. tomwer/web/test/test_graylog_connection.py +0 -59
  262. {tomwer/slurm → orangecontrib/tomwer/tutorials}/__init__.py +0 -0
  263. /tomwer/{test → gui/control/serie}/__init__.py +0 -0
  264. /tomwer/{web/test → tests}/__init__.py +0 -0
  265. /tomwer/{test → tests}/utils/__init__.py +0 -0
  266. /tomwer-1.0.3-py3.8-nspkg.pth → /tomwer-1.1.0-py3.9-nspkg.pth +0 -0
  267. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/LICENSE +0 -0
  268. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/namespace_packages.txt +0 -0
  269. {tomwer-1.0.3.dist-info → tomwer-1.1.0.dist-info}/top_level.txt +0 -0
@@ -33,6 +33,7 @@ from tomwer.utils import docstring
33
33
  from silx.gui import qt
34
34
  from tomwer.gui.utils.scrollarea import QComboBoxIgnoreWheel as QComboBox
35
35
  from tomwer.gui.reconstruction.nabu.nabuconfig import base
36
+ from tomwer.gui.reconstruction.nabu.nabuconfig.ctf import CTFConfig
36
37
  from tomwer.gui.utils.inputwidget import SelectionLineEdit
37
38
  from tomwer.core.utils.char import BETA_CHAR, DELTA_CHAR
38
39
  from tomwer.core.process.reconstruction.nabu.utils import _NabuStages, _NabuPhaseMethod
@@ -75,11 +76,15 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
75
76
  self._methodCB = QComboBox(parent=self, scrollArea=scrollArea)
76
77
  for method in _NabuPhaseMethod:
77
78
  self._methodCB.addItem(method.value)
79
+ idx_ctf = self._methodCB.findText(_NabuPhaseMethod.CTF.value)
80
+ self._methodCB.setItemData(
81
+ idx_ctf, "Contrast Transfert Function", qt.Qt.ToolTipRole
82
+ )
78
83
  self.layout().addWidget(self._methodCB, 1, 1, 1, 3)
79
84
  self.registerWidget(self._methodLabel, "required")
80
85
  self.registerWidget(self._methodCB, "required")
81
86
 
82
- # paganin options
87
+ # paganin & ctf options
83
88
  self._paganinOpts = NabuPaganinConfig(parent=self, scrollArea=scrollArea)
84
89
  self.layout().addWidget(self._paganinOpts, 2, 0, 3, 3)
85
90
 
@@ -87,6 +92,11 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
87
92
  self._unsharpOpts = NabuUnsharpConfig(parent=self)
88
93
  self.layout().addWidget(self._unsharpOpts, 6, 0, 3, 3)
89
94
 
95
+ # ctf options
96
+ self._ctfOpts = CTFConfig(parent=self)
97
+ self.layout().addWidget(self._ctfOpts, 9, 0, 3, 4)
98
+ self.registerWidget(self._ctfOpts, "advanced")
99
+
90
100
  # spacer for style
91
101
  spacer = qt.QWidget(self)
92
102
  spacer.setSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Expanding)
@@ -101,12 +111,15 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
101
111
  self._methodCB.currentIndexChanged.connect(self._methodChanged)
102
112
  self._paganinOpts.sigConfChanged.connect(self._signalConfChanged)
103
113
  self._unsharpOpts.sigConfChanged.connect(self._signalConfChanged)
114
+ self._ctfOpts.sigConfChanged.connect(self._signalConfChanged)
104
115
 
105
116
  # set up
106
117
  self._paganinOpts.setEnabled(self.getMethod() is not _NabuPhaseMethod.NONE)
118
+ self._ctfOpts.setEnabled(self.getMethod() is _NabuPhaseMethod.CTF)
107
119
 
108
120
  def _methodChanged(self, *args, **kwargs):
109
121
  self._paganinOpts.setEnabled(self.getMethod() is not _NabuPhaseMethod.NONE)
122
+ self._ctfOpts.setEnabled(self.getMethod() is _NabuPhaseMethod.CTF)
110
123
  self._signalConfChanged("method")
111
124
 
112
125
  def _signalConfChanged(self, param):
@@ -129,13 +142,15 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
129
142
  else:
130
143
  _logger.warning("unable to find method {method}")
131
144
  self._unsharpOpts.setConfiguration(config)
145
+ self._ctfOpts.setConfiguration(config)
132
146
 
133
147
  @docstring(base._NabuStageConfigBase)
134
148
  def getConfiguration(self) -> dict:
135
149
  configuration = {"method": self.getMethod().value}
136
- if self.getMethod() is _NabuPhaseMethod.PAGANIN:
150
+ if self.getMethod() in (_NabuPhaseMethod.PAGANIN, _NabuPhaseMethod.CTF):
137
151
  configuration.update(self._paganinOpts.getConfiguration())
138
152
  configuration.update(self._unsharpOpts.getConfiguration())
153
+ configuration.update(self._ctfOpts.getConfiguration())
139
154
  return configuration
140
155
 
141
156
  def setConfigurationLevel(self, level):
@@ -169,22 +184,6 @@ class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
169
184
  self.registerWidget(self._db_label, "required")
170
185
  self.registerWidget(self._deltaBetaQLE, "required")
171
186
 
172
- # paganin lmicron
173
- # we skip this paramter, only used for compatibility
174
-
175
- # paganin margin
176
- # note: hide for now margin as it is not connected at nabu side
177
- # self.layout().addWidget(qt.QLabel("margin"), 1, 0, 1, 1)
178
- # self._margeQSB = qt.QSpinBox(self)
179
- # self._margeQSB.setMinimum(0)
180
- # self._margeQSB.setMaximum(9999)
181
- # self._margeQSB.setToolTip(
182
- # "Marge (in pixels) in the Paganin filtering "
183
- # "to avoid local tomography artefacts"
184
- # )
185
- # self.layout().addWidget(self._margeQSB, 1, 1, 1, 1)
186
- # self.registerWidget(self._margeQSB, "optional")
187
-
188
187
  # paganin padding_type
189
188
  self._paddingLabel = qt.QLabel("padding", self)
190
189
  self.layout().addWidget(self._paddingLabel, 2, 0, 1, 1)
@@ -192,7 +191,7 @@ class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
192
191
  self._paddingTypeCB.setToolTip(
193
192
  "Padding type for the filtering step " "in Paganin/CTR."
194
193
  )
195
- for padding_type in (PaddingMode.ZEROS, PaddingMode.ZEROS.EDGE):
194
+ for padding_type in (PaddingMode.ZEROS, PaddingMode.EDGE):
196
195
  self._paddingTypeCB.addItem(padding_type.value)
197
196
  self.layout().addWidget(self._paddingTypeCB, 2, 1, 1, 3)
198
197
  self.registerWidget(self._paddingLabel, "advanced")
@@ -131,21 +131,29 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
131
131
  self.registerWidget(self._ccdThreshold, "optional"),
132
132
  ]
133
133
 
134
+ # sr current normalization
135
+ self._normalizeCurrent = qt.QCheckBox("normalize with current", self)
136
+ self._normalizeCurrent.setToolTip(
137
+ "Whether to normalize frames with Synchrotron Current. This can correct the effect of a beam refill not taken into account by flats."
138
+ )
139
+ self.layout().addWidget(self._normalizeCurrent, 6, 0, 1, 2)
140
+ self.registerWidget(self._normalizeCurrent, "required")
141
+
134
142
  # take logarithm
135
143
  self._takeLogarithmCB = qt.QCheckBox("take logarithm", self)
136
- self.layout().addWidget(self._takeLogarithmCB, 6, 0, 1, 2)
137
- self.registerWidget(self._takeLogarithmCB, "required")
144
+ self.layout().addWidget(self._takeLogarithmCB, 7, 0, 1, 2)
145
+ self.registerWidget(self._takeLogarithmCB, "advanced")
138
146
 
139
147
  # log min clip value
140
148
  self._clipMinLogValueLabel = qt.QLabel("log min clip value:", self)
141
149
  self._clipMinLogValueLabel.setAlignment(qt.Qt.AlignRight)
142
- self.layout().addWidget(self._clipMinLogValueLabel, 7, 2, 1, 1)
150
+ self.layout().addWidget(self._clipMinLogValueLabel, 8, 2, 1, 1)
143
151
  self._clipMinLogValue = QDoubleSpinBox(self, scrollArea=scrollArea)
144
152
  self._clipMinLogValue.setMinimum(0.0)
145
153
  self._clipMinLogValue.setMaximum(9999999)
146
154
  self._clipMinLogValue.setSingleStep(0.01)
147
155
  self._clipMinLogValue.setDecimals(6)
148
- self.layout().addWidget(self._clipMinLogValue, 7, 3, 1, 1)
156
+ self.layout().addWidget(self._clipMinLogValue, 8, 3, 1, 1)
149
157
  self._takeLogOpt = [
150
158
  self.registerWidget(self._clipMinLogValueLabel, "optional"),
151
159
  self.registerWidget(self._clipMinLogValue, "optional"),
@@ -154,13 +162,13 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
154
162
  # log max clip value
155
163
  self._clipMaxLogValueLabel = qt.QLabel("log max clip value:", self)
156
164
  self._clipMaxLogValueLabel.setAlignment(qt.Qt.AlignRight)
157
- self.layout().addWidget(self._clipMaxLogValueLabel, 8, 2, 1, 1)
165
+ self.layout().addWidget(self._clipMaxLogValueLabel, 9, 2, 1, 1)
158
166
  self._clipMaxLogValue = QDoubleSpinBox(self, scrollArea=scrollArea)
159
167
  self._clipMaxLogValue.setMinimum(0.0)
160
168
  self._clipMaxLogValue.setMaximum(9999999)
161
169
  self._clipMaxLogValue.setSingleStep(0.01)
162
170
  self._clipMaxLogValue.setDecimals(6)
163
- self.layout().addWidget(self._clipMaxLogValue, 8, 3, 1, 1)
171
+ self.layout().addWidget(self._clipMaxLogValue, 9, 3, 1, 1)
164
172
  self._takeLogOpt.extend(
165
173
  [
166
174
  self.registerWidget(self._clipMaxLogValueLabel, "optional"),
@@ -171,7 +179,7 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
171
179
  # tilt correction
172
180
  self._tiltCorrection = TiltCorrection("tilt correction", self)
173
181
  self.registerWidget(self._tiltCorrection, "advanced")
174
- self.layout().addWidget(self._tiltCorrection, 9, 0, 1, 4)
182
+ self.layout().addWidget(self._tiltCorrection, 10, 0, 1, 4)
175
183
 
176
184
  # spacer for style
177
185
  spacer = qt.QWidget(self)
@@ -183,6 +191,7 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
183
191
  self.setDFFOptVisible(False)
184
192
 
185
193
  self._ccdFilterCB.setChecked(False)
194
+ self._normalizeCurrent.setChecked(False)
186
195
  self._ccdThreshold.setValue(0.04)
187
196
 
188
197
  self._clipMinLogValue.setValue(1e-6)
@@ -201,6 +210,7 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
201
210
  self._dffCB.toggled.connect(self.setDFFOptVisible)
202
211
  self._dffSigmaQDSB.valueChanged.connect(self._dffSigmaChanged)
203
212
  self._ccdFilterCB.toggled.connect(self._ccdFilterChanged)
213
+ self._normalizeCurrent.toggled.connect(self._normalizeCurrentChanged)
204
214
  self._ccdThreshold.editingFinished.connect(self._ccdFilterThresholdChanged)
205
215
  self._clipMinLogValue.editingFinished.connect(self._logMinClipChanged)
206
216
  self._clipMaxLogValue.editingFinished.connect(self._logMaxClipChanged)
@@ -226,6 +236,9 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
226
236
  def _ccdFilterChanged(self, *args, **kwargs):
227
237
  self._signalConfChanged("ccd_filter_enabled")
228
238
 
239
+ def _normalizeCurrentChanged(self, *args, **kwargs):
240
+ self._signalConfChanged("normalize_srcurrent")
241
+
229
242
  def _ccdFilterThresholdChanged(self, *args, **kwargs):
230
243
  self._signalConfChanged("ccd_filter_threshold")
231
244
 
@@ -284,6 +297,12 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
284
297
  def getCCDThreshold(self) -> float:
285
298
  return float(self._ccdThreshold.text())
286
299
 
300
+ def getNormalizeCurrent(self) -> bool:
301
+ return self._normalizeCurrent.isChecked()
302
+
303
+ def setNormalizeCurrent(self, normalize: bool) -> None:
304
+ self._normalizeCurrent.setChecked(normalize)
305
+
287
306
  def getLogMinClipValue(self) -> float:
288
307
  return float(self._clipMinLogValue.text())
289
308
 
@@ -329,6 +348,7 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
329
348
  "sino_rings_options": self.getSinoRingcorrectionOptions(),
330
349
  "tilt_correction": tilt_correction,
331
350
  "autotilt_options": autotilt_opts,
351
+ "normalize_srcurrent": int(self.getNormalizeCurrent()),
332
352
  }
333
353
 
334
354
  @docstring(_NabuStageConfigBase)
@@ -359,6 +379,9 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
359
379
  ccd_filter_threshold = conf["ccd_filter_threshold"]
360
380
  if ccd_filter_threshold not in (None, "", "none"):
361
381
  self._ccdThreshold.setValue(float(ccd_filter_threshold))
382
+ normalize_srcurrent = conf.get("normalize_srcurrent", None)
383
+ if normalize_srcurrent is not None:
384
+ self.setNormalizeCurrent(bool(normalize_srcurrent))
362
385
  if "take_logarithm" in conf:
363
386
  take_logarithm = conf["take_logarithm"]
364
387
  if take_logarithm not in (None, "", "none"):
@@ -194,7 +194,7 @@ class TranslationMvtFileWidget(qt.QWidget):
194
194
  else:
195
195
  return dialog.selectedUrl()
196
196
 
197
- def _selectTextFile(self):
197
+ def _selectTextFile(self): # pragma: no cover
198
198
  dialog = qt.QFileDialog(self)
199
199
  dialog.setFileMode(qt.QFileDialog.ExistingFile)
200
200
 
@@ -256,7 +256,7 @@ class AnglesFileWidget(qt.QWidget):
256
256
  def setFile(self, file_path):
257
257
  self._qle.setText(file_path)
258
258
 
259
- def _selectFile(self) -> str:
259
+ def _selectFile(self) -> str: # pragma: no cover
260
260
  dialog = qt.QFileDialog()
261
261
  dialog.setFileMode(qt.QFileDialog.ExistingFile)
262
262
  dialog.setNameFilters(
@@ -401,6 +401,13 @@ class _NabuReconstructionConfig(qt.QWidget, _NabuStageConfigBase):
401
401
  "Whether to set to zero voxels falling outside of the reconstruction region"
402
402
  )
403
403
  self.layout().addWidget(self._clipOuterCircleCB, 11, 0, 1, 2)
404
+ self.registerWidget(self._clipOuterCircleCB, "optional")
405
+
406
+ # centered axis option
407
+ self._centeredAxisCB = qt.QCheckBox("centered axis", self)
408
+ self._centeredAxisCB.setToolTip("")
409
+ self.layout().addWidget(self._centeredAxisCB, 12, 0, 1, 2)
410
+ self.registerWidget(self._centeredAxisCB, "optional")
404
411
 
405
412
  # translation movement file
406
413
  self._transMvtFileLabel = qt.QLabel("translation movement file", self)
@@ -437,6 +444,7 @@ class _NabuReconstructionConfig(qt.QWidget, _NabuStageConfigBase):
437
444
  self._preconditioningFilter.setChecked(True)
438
445
  self._positivityConstraintCB.setChecked(True)
439
446
  self._clipOuterCircleCB.setChecked(False)
447
+ self._centeredAxisCB.setChecked(False)
440
448
 
441
449
  # connect signal / slot
442
450
  self._methodQCB.currentIndexChanged.connect(self._methodChanged)
@@ -454,6 +462,7 @@ class _NabuReconstructionConfig(qt.QWidget, _NabuStageConfigBase):
454
462
  self._binSubSamplingGB.binningChanged.connect(self._binningChanged)
455
463
  self._anglesFileWidget._qle.textChanged.connect(self._anglesFilechanged)
456
464
  self._clipOuterCircleCB.toggled.connect(self._clipOuterCircleChanged)
465
+ self._centeredAxisCB.toggled.connect(self._centeredAxisChanged)
457
466
 
458
467
  def getSlices(self):
459
468
  return self._slicesWidget.getSlices()
@@ -501,6 +510,9 @@ class _NabuReconstructionConfig(qt.QWidget, _NabuStageConfigBase):
501
510
  def _clipOuterCircleChanged(self, *args, **kwargs):
502
511
  self._signalConfChanged("clip_outer_circle")
503
512
 
513
+ def _centeredAxisChanged(self, *args, **kwargs):
514
+ self._signalConfChanged("centered_axis")
515
+
504
516
  def _binningChanged(self, *args, **kwargs):
505
517
  self._signalConfChanged("binning")
506
518
  self._signalConfChanged("binning_z")
@@ -590,7 +602,7 @@ class _NabuReconstructionConfig(qt.QWidget, _NabuStageConfigBase):
590
602
  return self._binSubSamplingGB.getVerticalBinning()
591
603
 
592
604
  def setVerticalBinning(self, binning):
593
- return self._binSubSamplingGB.getVerticalBinning(binning=binning)
605
+ return self._binSubSamplingGB.setVerticalBinning(binning=binning)
594
606
 
595
607
  def getProjSubsampling(self):
596
608
  return self._binSubSamplingGB.getProjSubsampling()
@@ -607,8 +619,14 @@ class _NabuReconstructionConfig(qt.QWidget, _NabuStageConfigBase):
607
619
  def getClipOuterCircle(self) -> bool:
608
620
  return self._clipOuterCircleCB.isChecked()
609
621
 
610
- def setClipOuterCircle(self, checked) -> bool:
611
- return self._clipOuterCircleCB.setChecked(checked)
622
+ def setClipOuterCircle(self, checked: bool) -> None:
623
+ self._clipOuterCircleCB.setChecked(checked)
624
+
625
+ def getCenteredAxis(self) -> bool:
626
+ return self._centeredAxisCB.isChecked()
627
+
628
+ def setCenteredAxis(self, checked: bool):
629
+ self._centeredAxisCB.setChecked(checked)
612
630
 
613
631
  @docstring(_NabuStageConfigBase)
614
632
  def getConfiguration(self) -> dict:
@@ -632,6 +650,7 @@ class _NabuReconstructionConfig(qt.QWidget, _NabuStageConfigBase):
632
650
  "rotation_axis_position": "",
633
651
  "translation_movements_file": self.getTranslationMvtFile() or "",
634
652
  "clip_outer_circle": int(self.getClipOuterCircle()),
653
+ "centered_axis": int(self.getCenteredAxis()),
635
654
  }
636
655
  config.update(self._subRegionSelector.getConfiguration())
637
656
  return config
@@ -668,6 +687,8 @@ class _NabuReconstructionConfig(qt.QWidget, _NabuStageConfigBase):
668
687
  self.setTranslationMvtFile(config["translation_movements_file"])
669
688
  if "clip_outer_circle" in config:
670
689
  self.setClipOuterCircle(bool(config["clip_outer_circle"]))
690
+ if "centered_axis" in config:
691
+ self.setCenteredAxis(bool(config["centered_axis"]))
671
692
  self._subRegionSelector.setConfiguration(config=config)
672
693
 
673
694
  def _signalConfChanged(self, param):
@@ -675,7 +696,6 @@ class _NabuReconstructionConfig(qt.QWidget, _NabuStageConfigBase):
675
696
 
676
697
 
677
698
  class _SubRegionEditor(qt.QObject):
678
-
679
699
  sigConfChanged = qt.Signal(str)
680
700
  """Signal emitted each type a parameter is edited"""
681
701
 
@@ -897,7 +917,6 @@ class _NabuReconstructionSubRegion(qt.QGroupBox, _NabuStageConfigBase):
897
917
 
898
918
 
899
919
  class _BinSubSampling(qt.QGroupBox):
900
-
901
920
  binningChanged = qt.Signal()
902
921
  """signal emitted when binning change"""
903
922
 
@@ -960,11 +979,3 @@ class _BinSubSampling(qt.QGroupBox):
960
979
 
961
980
  def _valueUpdated(self, *args, **kwargs):
962
981
  self.binningChanged.emit()
963
-
964
-
965
- if __name__ == "__main__":
966
- app = qt.QApplication([])
967
- widget = _NabuReconstructionConfig(None, None)
968
- widget.show()
969
- print(widget.getConfiguration())
970
- app.exec_()
@@ -202,7 +202,6 @@ class NabuDialog(qt.QDialog):
202
202
 
203
203
 
204
204
  class NabuWindow(qt.QMainWindow):
205
-
206
205
  sigConfigChanged = qt.Signal()
207
206
  """Signal emitted when the configuration change"""
208
207
 
@@ -317,7 +316,6 @@ class NabuWindow(qt.QMainWindow):
317
316
  self.setConfigurationLevel(level=configuration_level)
318
317
 
319
318
  def _saveParameters(self):
320
-
321
319
  from nabu.pipeline.config import generate_nabu_configfile
322
320
  from tomwer.core.process.reconstruction.nabu.nabuslices import (
323
321
  interpret_tomwer_configuration,
@@ -363,9 +361,17 @@ class NabuWindow(qt.QMainWindow):
363
361
  config = parse_nabu_config_file(inputFile)
364
362
  self.setConfiguration(config)
365
363
 
366
- def askForNabuconfigFile(self, acceptMode=qt.QFileDialog.AcceptSave):
364
+ def askForNabuconfigFile( # pragma: no cover
365
+ self, acceptMode=qt.QFileDialog.AcceptSave
366
+ ):
367
367
  dialog = qt.QFileDialog(self)
368
- dialog.setNameFilters(["*.cfg"])
368
+ dialog.setNameFilters(
369
+ [
370
+ "Configuration files (*.cfg *.conf *.config)",
371
+ "Any files (*)",
372
+ ]
373
+ )
374
+
369
375
  dialog.setAcceptMode(acceptMode)
370
376
  dialog.setFileMode(qt.QFileDialog.AnyFile)
371
377
 
@@ -117,7 +117,7 @@ class SlurmSettingsWidget(qt.QWidget):
117
117
  self._nCores.setValue(SlurmSettings.N_CORES_PER_TASK)
118
118
  self._nWorkers.setValue(SlurmSettings.N_TASKS)
119
119
  self._memory.setValue(SlurmSettings.MEMORY_PER_WORKER)
120
- self._queue.setText(SlurmSettings.PARTIION)
120
+ self._queue.setText(SlurmSettings.PARTITION)
121
121
  self._nGpu.setValue(SlurmSettings.N_GPUS_PER_WORKER)
122
122
 
123
123
  # connect signal / slot
@@ -435,13 +435,6 @@ class NabuVolumeWindow(qt.QMainWindow):
435
435
  menu.addAction(self._expertConfiguration)
436
436
  self.__configurationModesGroup.addAction(self._expertConfiguration)
437
437
 
438
- # expose API
439
- self.getConfiguration = self._mainWidget.getConfiguration
440
- self.setConfiguration = self._mainWidget.setConfiguration
441
- self.setConfigurationLevel = self._mainWidget.setConfigurationLevel
442
- self.getConfigurationLevel = self._mainWidget.getConfigurationLevel
443
- self.setScan = self._mainWidget.setScan
444
-
445
438
  # set up
446
439
  self._basicConfigAction.setChecked(True)
447
440
  self._userModeChanged(action=self._basicConfigAction)
@@ -463,5 +456,18 @@ class NabuVolumeWindow(qt.QMainWindow):
463
456
  raise ValueError("unknow configuration level")
464
457
  self._mainWidget.setConfigurationLevel(level)
465
458
 
459
+ # expose API
466
460
  def getConfigurationLevel(self):
467
461
  self._mainWidget.getConfigurationLevel()
462
+
463
+ def setConfigurationLevel(self, level):
464
+ self._mainWidget.setConfigurationLevel(level=level)
465
+
466
+ def getConfiguration(self):
467
+ return self._mainWidget.getConfiguration()
468
+
469
+ def setConfiguration(self, config):
470
+ return self._mainWidget.setConfiguration(config=config)
471
+
472
+ def setScan(self, scan):
473
+ return self._mainWidget.setScan(scan=scan)
@@ -54,7 +54,6 @@ import typing
54
54
 
55
55
 
56
56
  class SinoNormWindow(qt.QMainWindow):
57
-
58
57
  sigConfigurationChanged = qt.Signal()
59
58
  """signal emit when the configuration change"""
60
59
 
@@ -411,7 +410,6 @@ class SinogramViewer(_SinogramViewer):
411
410
 
412
411
 
413
412
  class _NormIntensityOptions(qt.QWidget):
414
-
415
413
  sigValueCanBeLocked = qt.Signal(bool)
416
414
 
417
415
  sigProcessingRequested = qt.Signal()
@@ -715,7 +713,6 @@ class _NormIntensityControl(ControlWidget):
715
713
 
716
714
 
717
715
  class _NormIntensityScalarValue(qt.QWidget):
718
-
719
716
  sigValueChanged = qt.Signal(float)
720
717
 
721
718
  def __init__(self, parent=None):
@@ -740,7 +737,6 @@ class _NormIntensityScalarValue(qt.QWidget):
740
737
 
741
738
 
742
739
  class _NormIntensityDatasetWidget(qt.QWidget):
743
-
744
740
  _FILE_PATH_LOCAL_VALUE = "scan master file"
745
741
 
746
742
  sigConfigurationChanged = qt.Signal()
@@ -870,7 +866,7 @@ class _NormIntensityDatasetWidget(qt.QWidget):
870
866
  if self._lastGlobalPath is not None:
871
867
  self.setGlobalFilePath(self._lastGlobalPath)
872
868
 
873
- def _selectFile(self):
869
+ def _selectFile(self): # pragma: no cover
874
870
  dialog = qt.QFileDialog(self)
875
871
  dialog.setNameFilters(["HDF5 file *.h5 *.hdf5 *.nx *.nxs *.nexus"])
876
872
 
@@ -150,9 +150,13 @@ class SinogramViewer(_SinogramViewer):
150
150
  if self._corMarker is not None:
151
151
  self._corMarker.sigDragFinished.disconnect(self._middleMarkerMoved)
152
152
  if self._fromMarker is not None:
153
- self._fromMarker.sigDragFinished.disconnect(self._fromCallback)
153
+ self._fromMarker.sigDragFinished.disconnect(
154
+ self._fromCallback # pylint: disable=E0203
155
+ )
154
156
  if self._toMarker is not None:
155
- self._toMarker.sigDragFinished.disconnect(self._toCallback)
157
+ self._toMarker.sigDragFinished.disconnect(
158
+ self._toCallback # pylint: disable=E0203
159
+ )
156
160
 
157
161
  # clear existing markers
158
162
  markers = [
@@ -206,14 +210,13 @@ class SinogramViewer(_SinogramViewer):
206
210
 
207
211
 
208
212
  class _ReconstructionModeGB(qt.QGroupBox):
209
-
210
213
  reconstructionModeChanged = qt.Signal(str)
211
214
 
212
215
  reconstructionSliceChanged = qt.Signal()
213
216
 
214
217
  _DEFAULT_VERTICAL_SLICE_MODE = ("middle", "other")
215
218
 
216
- def __init__(self, parent=None, title="Slice reconstruction mode"):
219
+ def __init__(self, parent=None, title="Slice to be reconstructed"):
217
220
  self.__scan = None
218
221
  qt.QGroupBox.__init__(self, parent)
219
222
  self.setTitle(title)
@@ -263,9 +266,9 @@ class _ReconstructionModeGB(qt.QGroupBox):
263
266
  self.blockSignals(True)
264
267
  self.setCurrentMode("vertical", "middle")
265
268
  self.blockSignals(False)
266
- # for now we don't have the tilt correction mode
267
- # self._sliceTiltCorrQSB.hide()
268
269
  self._tiltCorrectionRB.hide()
270
+ # as for now only the Vertical mode is handled hide it to avoid confusing user
271
+ self._verticalRB.hide()
269
272
 
270
273
  def setCurrentMode(self, mode, slices):
271
274
  valid_modes = ("vertical", "horizontal")
@@ -310,7 +313,7 @@ class _ReconstructionModeGB(qt.QGroupBox):
310
313
  index_radio = list(projections.keys())[len(projections) // 2]
311
314
  data = get_data(projections[index_radio])
312
315
  except Exception as e:
313
- _logger.error("Fail to load radio data:", str(e))
316
+ _logger.error(f"Fail to load radio data: {str(e)}")
314
317
  return
315
318
 
316
319
  lineSelection.setData(data)
@@ -399,7 +402,6 @@ class _ReconstructionModeGB(qt.QGroupBox):
399
402
 
400
403
 
401
404
  class _DetectionAccuracyGB(qt.QGroupBox):
402
-
403
405
  detectionAccuracyChanged = qt.Signal()
404
406
  """signal emitted when the value change"""
405
407
 
@@ -469,7 +471,6 @@ class _DetectionAccuracyGB(qt.QGroupBox):
469
471
 
470
472
 
471
473
  class _EstimatedCorWidget(qt.QGroupBox):
472
-
473
474
  _MIDDLE_COR_TXT = "middle"
474
475
  _OTHER_COR_TXT = "other"
475
476
 
@@ -826,31 +827,3 @@ class SliceAndCorWidget(qt.QMainWindow):
826
827
  self._sinogramViewer.close()
827
828
  self._sinogramViewer = None
828
829
  super().close()
829
-
830
-
831
- if __name__ == "__main__":
832
- import tempfile
833
- import shutil
834
- from tomwer.core.utils.scanutils import MockHDF5
835
-
836
- app = qt.QApplication([])
837
- window = SliceAndCorWidget()
838
-
839
- img_width = 216
840
- slices_folder = tempfile.mkdtemp()
841
-
842
- scan = MockHDF5(
843
- scan_path=slices_folder,
844
- n_proj=60,
845
- n_ini_proj=60,
846
- create_ini_dark=False,
847
- create_ini_ref=False,
848
- dim=img_width,
849
- ).scan
850
-
851
- window.setScan(scan)
852
- window.setWindowTitle("cor and slice selection")
853
- window.show()
854
- app.exec_()
855
-
856
- shutil.rmtree(slices_folder)
@@ -48,6 +48,7 @@ from tomwer.gui.utils.buttons import TabBrowsersButtons
48
48
  from tomwer.gui.reconstruction.scores.control import ControlWidget
49
49
  from tomwer.core.process.reconstruction.saaxis.saaxis import SAAxisProcess
50
50
  from tomwer.core.process.reconstruction.axis import mode as axis_mode
51
+ from tomwer.gui.utils.scandescription import ScanNameLabelAndShape
51
52
  import numpy
52
53
  from typing import Union
53
54
  import logging
@@ -138,7 +139,6 @@ class NabuAutoCorDiag(qt.QDialog):
138
139
 
139
140
 
140
141
  class _SAAxisTabWidget(qt.QTabWidget):
141
-
142
142
  sigConfigurationChanged = qt.Signal()
143
143
  """signal emitted each time the 'input' configuration changed.
144
144
  like slice to reconstruct, number of reconstruction, research width,
@@ -183,7 +183,6 @@ class _SAAxisTabWidget(qt.QTabWidget):
183
183
  self.setVolumeSize = self._resultsViewer.setVolumeSize
184
184
  self.setCurrentCorValue = self._resultsViewer.setCurrentVarValue
185
185
  self.getCurrentCorValue = self._resultsViewer.getCurrentVarValue
186
- self.getScoreMethod = self._resultsViewer.getScoreMethod
187
186
  self.getEstimatedCorPosition = self._sliceAndCorWidget.getEstimatedCorPosition
188
187
  self.setEstimatedCorPosition = self._sliceAndCorWidget.setEstimatedCorPosition
189
188
  self.getNReconstruction = self._sliceAndCorWidget.getNReconstruction
@@ -201,6 +200,7 @@ class _SAAxisTabWidget(qt.QTabWidget):
201
200
  self.getSlicesRange = self._sliceAndCorWidget.getSlicesRange
202
201
  self.setSlicesRange = self._sliceAndCorWidget.setSlicesRange
203
202
  self.loadSinogram = self._sliceAndCorWidget.loadSinogram
203
+ self.saveReconstructedSlicesTo = self._resultsViewer.saveReconstructedSlicesTo
204
204
  # expose signals
205
205
  self.sigStartSinogramLoad = self._sliceAndCorWidget.sigStartSinogramLoad
206
206
  self.sigEndSinogramLoad = self._sliceAndCorWidget.sigEndSinogramLoad
@@ -319,8 +319,14 @@ class SAAxisWindow(qt.QMainWindow):
319
319
  self._qaxis_rp = QAxisRP()
320
320
  self.setWindowFlags(qt.Qt.Widget)
321
321
  # central widget
322
+ self._mainWidget = qt.QWidget(self)
323
+ self._mainWidget.setLayout(qt.QVBoxLayout())
324
+
325
+ self._scanInfo = ScanNameLabelAndShape(self)
326
+ self._mainWidget.layout().addWidget(self._scanInfo)
322
327
  self._tabWidget = _SAAxisTabWidget(self)
323
- self.setCentralWidget(self._tabWidget)
328
+ self._mainWidget.layout().addWidget(self._tabWidget)
329
+ self.setCentralWidget(self._mainWidget)
324
330
  # next and previous buttons for browsing the tab widget
325
331
  self._browserButtons = TabBrowsersButtons(self)
326
332
  self._dockWidgetBrwButtons = qt.QDockWidget(self)
@@ -356,7 +362,7 @@ class SAAxisWindow(qt.QMainWindow):
356
362
  self.getCors = self._tabWidget.getCors
357
363
  self.getMode = self._tabWidget.getReconstructionMode
358
364
  self.loadSinogram = self._tabWidget.loadSinogram
359
- self.isAutoFocusLock = self._tabWidget.isAutoFocusLock
365
+ self.saveReconstructedSlicesTo = self._tabWidget.saveReconstructedSlicesTo
360
366
  # expose signals
361
367
  self.sigValidated = self._saaxisControl.sigValidateRequest
362
368
  self.sigStartSinogramLoad = self._tabWidget.sigStartSinogramLoad
@@ -409,6 +415,7 @@ class SAAxisWindow(qt.QMainWindow):
409
415
  def setScan(self, scan):
410
416
  self._scan = scan
411
417
  self._tabWidget.setScan(scan)
418
+ self._scanInfo.setScan(scan)
412
419
  self._updateSinogramLine()
413
420
  self._loadEstimatedCorFromScan(scan)
414
421
 
@@ -451,9 +458,6 @@ class SAAxisWindow(qt.QMainWindow):
451
458
  line = list(r_slice.values())[0]
452
459
  self._tabWidget.getSinogramViewer().setLine(line)
453
460
 
454
- def setEstimatedCorPosition(self, value):
455
- self.setEstimatedCorPosition(value=value)
456
-
457
461
  def _autoCorRequested(self):
458
462
  window = self.getAutomaticCorWindow()
459
463
  window.activateWindow()