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.
Files changed (253) hide show
  1. orangecontrib/tomwer/tutorials/icat_publication.ows +58 -0
  2. orangecontrib/tomwer/widgets/__init__.py +1 -0
  3. orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +2 -2
  4. orangecontrib/tomwer/widgets/control/DataListOW.py +9 -7
  5. orangecontrib/tomwer/widgets/control/DataSelectorOW.py +21 -10
  6. orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +11 -5
  7. orangecontrib/tomwer/widgets/control/EmailOW.py +4 -4
  8. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +31 -18
  9. orangecontrib/tomwer/widgets/control/NXtomoConcatenate.py +14 -7
  10. orangecontrib/tomwer/widgets/control/NotifierOW.py +1 -0
  11. orangecontrib/tomwer/widgets/control/VolumeSelector.py +7 -4
  12. orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +182 -182
  13. orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +4 -4
  14. orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +4 -4
  15. orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +3 -3
  16. orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +2 -0
  17. orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +3 -3
  18. orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +3 -3
  19. orangecontrib/tomwer/widgets/icat/PublishProcessedDataOW.py +115 -0
  20. orangecontrib/tomwer/widgets/icat/RawDataScreenshotCreatorOW.py +98 -0
  21. orangecontrib/tomwer/widgets/icat/SaveToGalleryAndPublishOW.py +129 -0
  22. orangecontrib/tomwer/widgets/icat/__init__.py +13 -0
  23. orangecontrib/tomwer/widgets/icat/icons/add_gallery.png +0 -0
  24. orangecontrib/tomwer/widgets/icat/icons/add_gallery.svg +82 -0
  25. orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.png +0 -0
  26. orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.svg +95 -0
  27. orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.png +0 -0
  28. orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.svg +143 -0
  29. orangecontrib/tomwer/widgets/icons/tomwer_data_portal.png +0 -0
  30. orangecontrib/tomwer/widgets/icons/tomwer_data_portal.svg +76 -0
  31. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +9 -8
  32. orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +3 -3
  33. orangecontrib/tomwer/widgets/reconstruction/NabuHelicalPrepareWeightsDoubleOW.py +179 -169
  34. orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +23 -0
  35. orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +39 -5
  36. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +7 -13
  37. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +7 -17
  38. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +3 -4
  39. orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +1 -1
  40. orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +3 -3
  41. orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +3 -29
  42. tomwer/__main__.py +11 -58
  43. tomwer/app/canvas.py +8 -0
  44. tomwer/app/canvas_launcher/config.py +13 -11
  45. tomwer/app/darkref.py +1 -1
  46. tomwer/app/darkrefpatch.py +1 -1
  47. tomwer/app/imagekeyeditor.py +5 -5
  48. tomwer/app/imagekeyupgrader.py +5 -5
  49. tomwer/app/intensitynormalization.py +2 -2
  50. tomwer/app/radiostack.py +2 -2
  51. tomwer/app/zstitching.py +74 -3
  52. tomwer/core/cluster/cluster.py +26 -0
  53. tomwer/core/log/logger.py +7 -5
  54. tomwer/core/process/conditions/filters.py +1 -1
  55. tomwer/core/process/control/datalistener/datalistener.py +3 -3
  56. tomwer/core/process/control/nxtomoconcatenate.py +13 -13
  57. tomwer/core/process/control/nxtomomill.py +83 -25
  58. tomwer/core/process/control/scantransfer.py +11 -10
  59. tomwer/core/process/control/scanvalidator.py +3 -2
  60. tomwer/core/process/control/test/test_concatenate_nxtomos.py +9 -9
  61. tomwer/core/process/control/test/test_email.py +4 -4
  62. tomwer/core/process/control/test/test_h52nx_process.py +59 -7
  63. tomwer/core/process/control/test/test_volume_link.py +64 -64
  64. tomwer/core/process/control/timer.py +1 -1
  65. tomwer/core/process/control/volumesymlink.py +200 -200
  66. tomwer/core/process/edit/darkflatpatch.py +6 -6
  67. tomwer/core/process/edit/imagekeyeditor.py +17 -18
  68. tomwer/core/process/icat/__init__.py +0 -0
  69. tomwer/core/process/icat/createscreenshots.py +100 -0
  70. tomwer/core/process/icat/gallery.py +377 -0
  71. tomwer/core/process/icat/icatbase.py +36 -0
  72. tomwer/core/process/icat/publish.py +228 -0
  73. tomwer/core/process/icat/screenshots.py +26 -0
  74. tomwer/core/process/output.py +52 -0
  75. tomwer/core/process/reconstruction/axis/axis.py +17 -10
  76. tomwer/core/process/reconstruction/axis/mode.py +4 -0
  77. tomwer/core/process/reconstruction/axis/params.py +9 -4
  78. tomwer/core/process/reconstruction/darkref/darkrefs.py +8 -6
  79. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +1 -1
  80. tomwer/core/process/reconstruction/darkref/params.py +1 -1
  81. tomwer/core/process/reconstruction/lamino/tofu.py +4 -4
  82. tomwer/core/process/reconstruction/nabu/castvolume.py +1 -1
  83. tomwer/core/process/reconstruction/nabu/helical.py +9 -5
  84. tomwer/core/process/reconstruction/nabu/nabucommon.py +32 -62
  85. tomwer/core/process/reconstruction/nabu/nabuscores.py +387 -61
  86. tomwer/core/process/reconstruction/nabu/nabuslices.py +33 -21
  87. tomwer/core/process/reconstruction/nabu/nabuvolume.py +37 -14
  88. tomwer/core/process/reconstruction/nabu/settings.py +2 -2
  89. tomwer/core/process/reconstruction/nabu/utils.py +129 -24
  90. tomwer/core/process/reconstruction/output.py +108 -0
  91. tomwer/core/process/reconstruction/saaxis/saaxis.py +233 -263
  92. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +140 -86
  93. tomwer/core/process/reconstruction/scores/params.py +4 -1
  94. tomwer/core/process/reconstruction/scores/scores.py +13 -0
  95. tomwer/core/process/reconstruction/test/test_axis_params.py +2 -2
  96. tomwer/core/process/reconstruction/test/test_darkref.py +3 -3
  97. tomwer/core/process/reconstruction/test/test_darkref_copy.py +3 -3
  98. tomwer/core/process/reconstruction/test/test_saaxis.py +3 -4
  99. tomwer/core/process/reconstruction/test/test_sadeltabeta.py +2 -2
  100. tomwer/core/process/stitching/nabustitcher.py +2 -2
  101. tomwer/core/process/test/test_axis.py +6 -6
  102. tomwer/core/process/test/test_dark_and_flat.py +10 -7
  103. tomwer/core/process/test/test_data_transfer.py +7 -6
  104. tomwer/core/process/test/test_nabu.py +4 -4
  105. tomwer/core/process/test/test_normalization.py +2 -2
  106. tomwer/core/scan/edfscan.py +4 -1
  107. tomwer/core/scan/hdf5scan.py +19 -500
  108. tomwer/core/scan/nxtomoscan.py +532 -0
  109. tomwer/core/scan/scanbase.py +42 -20
  110. tomwer/core/scan/scanfactory.py +13 -13
  111. tomwer/core/scan/test/test_future_scan.py +2 -2
  112. tomwer/core/scan/test/test_h5.py +12 -10
  113. tomwer/core/scan/test/test_process_registration.py +2 -2
  114. tomwer/core/scan/test/test_scan.py +4 -3
  115. tomwer/core/settings.py +20 -0
  116. tomwer/core/test/test_scanutils.py +8 -7
  117. tomwer/core/test/test_utils.py +33 -26
  118. tomwer/core/utils/__init__.py +0 -466
  119. tomwer/core/utils/deprecation.py +1 -1
  120. tomwer/core/utils/dictutils.py +14 -0
  121. tomwer/core/utils/lbsram.py +35 -0
  122. tomwer/core/utils/nxtomoutils.py +1 -1
  123. tomwer/core/utils/scanutils.py +6 -6
  124. tomwer/core/utils/spec.py +263 -0
  125. tomwer/core/volume/volumefactory.py +2 -2
  126. tomwer/gui/cluster/slurm.py +260 -60
  127. tomwer/gui/cluster/test/test_cluster.py +13 -0
  128. tomwer/gui/cluster/test/test_supervisor.py +2 -2
  129. tomwer/gui/configuration/__init__.py +0 -0
  130. tomwer/gui/{reconstruction/nabu → configuration}/action.py +1 -32
  131. tomwer/gui/configuration/level.py +22 -0
  132. tomwer/gui/control/actions.py +54 -0
  133. tomwer/gui/control/datalist.py +78 -16
  134. tomwer/gui/control/datalistener.py +4 -16
  135. tomwer/gui/control/{email.py → emailnotifier.py} +9 -18
  136. tomwer/gui/control/history.py +2 -2
  137. tomwer/gui/control/observations.py +2 -2
  138. tomwer/gui/control/reducedarkflatselector.py +1 -1
  139. tomwer/gui/control/selectorwidgetbase.py +36 -9
  140. tomwer/gui/control/serie/seriecreator.py +5 -22
  141. tomwer/gui/control/test/test_email.py +1 -1
  142. tomwer/gui/control/test/test_scanvalidator.py +6 -5
  143. tomwer/gui/control/test/test_single_tomo_obj.py +2 -2
  144. tomwer/gui/control/tomoobjdisplaymode.py +8 -0
  145. tomwer/gui/debugtools/datasetgenerator.py +3 -3
  146. tomwer/gui/edit/dkrfpatch.py +16 -22
  147. tomwer/gui/edit/imagekeyeditor.py +8 -11
  148. tomwer/gui/edit/nxtomoeditor.py +111 -44
  149. tomwer/gui/edit/nxtomowarmer.py +4 -4
  150. tomwer/gui/edit/test/test_dkrf_patch.py +7 -7
  151. tomwer/gui/edit/test/test_image_key_editor.py +3 -3
  152. tomwer/gui/edit/test/test_nx_editor.py +40 -16
  153. tomwer/gui/icat/__init__.py +0 -0
  154. tomwer/gui/icat/createscreenshots.py +80 -0
  155. tomwer/gui/icat/gallery.py +214 -0
  156. tomwer/gui/icat/publish.py +187 -0
  157. tomwer/gui/reconstruction/axis/axis.py +171 -57
  158. tomwer/gui/reconstruction/axis/radioaxis.py +80 -95
  159. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +3 -2
  160. tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
  161. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +3 -6
  162. tomwer/gui/reconstruction/nabu/castvolume.py +1 -1
  163. tomwer/gui/reconstruction/nabu/check.py +9 -9
  164. tomwer/gui/reconstruction/nabu/helical.py +29 -12
  165. tomwer/gui/reconstruction/nabu/nabuconfig/base.py +2 -4
  166. tomwer/gui/reconstruction/nabu/nabuconfig/output.py +110 -33
  167. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +9 -12
  168. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +219 -29
  169. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +3 -6
  170. tomwer/gui/reconstruction/nabu/nabuflow.py +12 -20
  171. tomwer/gui/reconstruction/nabu/slices.py +6 -7
  172. tomwer/gui/reconstruction/nabu/volume.py +22 -10
  173. tomwer/gui/reconstruction/normalization/intensity.py +15 -23
  174. tomwer/gui/reconstruction/saaxis/corrangeselector.py +7 -23
  175. tomwer/gui/reconstruction/saaxis/dimensionwidget.py +1 -1
  176. tomwer/gui/reconstruction/saaxis/saaxis.py +7 -9
  177. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +2 -1
  178. tomwer/gui/reconstruction/scores/control.py +2 -9
  179. tomwer/gui/reconstruction/scores/scoreplot.py +11 -5
  180. tomwer/gui/reconstruction/test/test_axis.py +23 -12
  181. tomwer/gui/reconstruction/test/test_lamino.py +8 -3
  182. tomwer/gui/reconstruction/test/test_nabu.py +28 -9
  183. tomwer/gui/reconstruction/test/test_saaxis.py +3 -3
  184. tomwer/gui/reconstruction/test/test_sadeltabeta.py +2 -2
  185. tomwer/gui/settings.py +5 -28
  186. tomwer/gui/stackplot.py +2 -5
  187. tomwer/gui/stitching/action.py +49 -0
  188. tomwer/gui/stitching/config/axisparams.py +7 -24
  189. tomwer/gui/stitching/config/output.py +10 -8
  190. tomwer/gui/stitching/config/positionoveraxis.py +22 -23
  191. tomwer/gui/stitching/normalization.py +117 -0
  192. tomwer/gui/stitching/stitchandbackground.py +4 -6
  193. tomwer/gui/stitching/stitching.py +265 -43
  194. tomwer/gui/stitching/stitching_preview.py +62 -5
  195. tomwer/gui/stitching/stitching_raw.py +2 -5
  196. tomwer/gui/stitching/z_stitching/fineestimation.py +0 -60
  197. tomwer/gui/utils/buttons.py +112 -29
  198. tomwer/gui/utils/inputwidget.py +33 -25
  199. tomwer/gui/utils/scandescription.py +4 -0
  200. tomwer/gui/utils/step.py +144 -0
  201. tomwer/gui/utils/unitsystem.py +2 -5
  202. tomwer/gui/utils/vignettes.py +176 -15
  203. tomwer/gui/visualization/dataviewer.py +1 -18
  204. tomwer/gui/visualization/diffviewer/diffviewer.py +7 -16
  205. tomwer/gui/visualization/diffviewer/shiftwidget.py +2 -5
  206. tomwer/gui/visualization/scanoverview.py +1 -1
  207. tomwer/gui/visualization/sinogramviewer.py +1 -10
  208. tomwer/gui/visualization/test/test_diffviewer.py +3 -3
  209. tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +4 -4
  210. tomwer/gui/visualization/test/test_sinogramviewer.py +2 -2
  211. tomwer/gui/visualization/test/test_stacks.py +3 -3
  212. tomwer/gui/visualization/test/test_volumeviewer.py +2 -2
  213. tomwer/io/utils/raw_and_processed_data.py +84 -0
  214. tomwer/io/utils/tomoobj.py +4 -6
  215. tomwer/resources/gui/icons/ruler.png +0 -0
  216. tomwer/resources/gui/icons/ruler.svg +273 -0
  217. tomwer/resources/gui/icons/short_description.png +0 -0
  218. tomwer/resources/gui/icons/short_description.svg +58 -0
  219. tomwer/resources/gui/icons/url.png +0 -0
  220. tomwer/resources/gui/icons/url.svg +58 -0
  221. tomwer/synctools/stacks/edit/darkflatpatch.py +2 -2
  222. tomwer/synctools/stacks/edit/imagekeyeditor.py +2 -2
  223. tomwer/synctools/stacks/reconstruction/axis.py +4 -4
  224. tomwer/synctools/stacks/reconstruction/castvolume.py +2 -2
  225. tomwer/synctools/stacks/reconstruction/dkrefcopy.py +4 -10
  226. tomwer/synctools/stacks/reconstruction/nabu.py +2 -2
  227. tomwer/synctools/stacks/reconstruction/normalization.py +2 -2
  228. tomwer/synctools/stacks/reconstruction/saaxis.py +2 -2
  229. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +2 -2
  230. tomwer/synctools/test/test_darkRefs.py +7 -58
  231. tomwer/synctools/test/test_foldertransfer.py +6 -6
  232. tomwer/synctools/utils/scanstages.py +6 -6
  233. tomwer/tests/conftest.py +34 -0
  234. tomwer/tests/datasets.py +13 -0
  235. tomwer/tests/test_scripts.py +92 -39
  236. tomwer/tests/utils.py +5 -0
  237. tomwer/version.py +3 -3
  238. {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/METADATA +39 -44
  239. {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/RECORD +248 -209
  240. tomwer/resources/gui/icons/esrf_1.svg +0 -307
  241. tomwer/resources/gui/icons/triangle.svg +0 -80
  242. tomwer/synctools/test/test_scanstages.py +0 -162
  243. tomwer/tests/utils/__init__.py +0 -247
  244. tomwer/tests/utils/utilstest.py +0 -220
  245. /tomwer/app/{saaxis.py → multicor.py} +0 -0
  246. /tomwer/app/{sadeltabeta.py → multipag.py} +0 -0
  247. /tomwer/core/process/control/{email.py → emailnotifier.py} +0 -0
  248. /tomwer-1.2.8-py3.11-nspkg.pth → /tomwer-1.3.0a0-py3.11-nspkg.pth +0 -0
  249. {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/LICENSE +0 -0
  250. {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/WHEEL +0 -0
  251. {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/entry_points.txt +0 -0
  252. {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/namespace_packages.txt +0 -0
  253. {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/top_level.txt +0 -0
@@ -34,8 +34,9 @@ import typing
34
34
 
35
35
  from silx.gui import qt
36
36
 
37
- from tomwer.core.process.reconstruction.nabu.nabucommon import NabuOutputFileFormat
37
+ from tomwer.core.process.reconstruction.output import NabuOutputFileFormat
38
38
  from tomwer.core.process.reconstruction.nabu.utils import _NabuStages
39
+ from tomwer.core.process.reconstruction.output import ProcessDataOutputDirMode
39
40
  from tomwer.gui.qlefilesystem import QLFileSystem
40
41
  from tomwer.gui.reconstruction.nabu.nabuconfig.base import _NabuStageConfigBase
41
42
  from tomwer.io.utils import get_default_directory
@@ -79,51 +80,110 @@ class QNabuFileFormatComboBoxIgnoreWheel(QNabuFileFormatComboBox):
79
80
  pass
80
81
 
81
82
 
82
- class NabuOutputLocationWidget(qt.QWidget):
83
+ class NabuOutputLocationWidget(qt.QGroupBox):
84
+ sigOutputChanged = qt.Signal()
85
+ """Emit when location changed"""
86
+
83
87
  def __init__(self, *args, **kwargs) -> None:
84
- super().__init__(*args, **kwargs)
85
- self.setLayout(qt.QHBoxLayout())
88
+ super().__init__(title="output folder", *args, **kwargs)
89
+ self.setLayout(qt.QGridLayout())
86
90
 
87
- self._outputLabel = qt.QLabel("output:", self)
88
91
  self.layout().setContentsMargins(0, 0, 0, 0)
89
92
  self.layout().setSpacing(0)
90
- self.layout().addWidget(self._outputLabel)
91
93
 
92
- self._defaultOutput = qt.QCheckBox("raw data root level", self)
93
- self._defaultOutput.setToolTip(
94
- "set reconstruction at the the same " "level as raw data"
94
+ # in scan folder
95
+ self._inScanFolderRB = qt.QRadioButton(
96
+ ProcessDataOutputDirMode.IN_SCAN_FOLDER.value, self
97
+ )
98
+ self._inScanFolderRB.setToolTip(
99
+ "Reconstruction will be saved at the same level as the acquisition folder. (near the NXtomo file (.nx) or under the spec acquisition folder)"
100
+ )
101
+ self.layout().addWidget(self._inScanFolderRB, 1, 0, 1, 1)
102
+ # in processed data dir
103
+ self._processedDataDirRB = qt.QRadioButton(
104
+ ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER.value, self
105
+ )
106
+ self._inScanFolderRB.setToolTip(
107
+ "Reconstruction will be saved under the PROCESSED_DATA/dataset folder. if exists else under the scan folder."
95
108
  )
96
- self.layout().addWidget(self._defaultOutput)
109
+ self.layout().addWidget(self._processedDataDirRB, 2, 0, 1, 1)
110
+ # raw data dir
111
+ self._rawDataDirRB = qt.QRadioButton(
112
+ ProcessDataOutputDirMode.RAW_DATA_FOLDER.value, self
113
+ )
114
+ self._rawDataDirRB.setToolTip(
115
+ "Reconstruction will be saved under the RAW_DATA/dataset folder. if exists else under the scan folder."
116
+ )
117
+ self.layout().addWidget(self._rawDataDirRB, 3, 0, 1, 1)
118
+ # other dir
119
+ self._otherDirRB = qt.QRadioButton(ProcessDataOutputDirMode.OTHER.value, self)
120
+ self._otherDirRB.setToolTip(
121
+ "Reconstruction will be saved under user provided folder."
122
+ )
123
+ self.layout().addWidget(self._otherDirRB, 4, 0, 1, 1)
97
124
  self._outputDirQLE = QLFileSystem(
98
125
  "", self, filters=qt.QDir.NoDotAndDotDot | qt.QDir.Dirs
99
126
  )
100
- self.layout().addWidget(self._outputDirQLE)
127
+ self.layout().addWidget(self._outputDirQLE, 4, 1, 1, 1)
101
128
  style = qt.QApplication.style()
102
129
  icon_opendir = style.standardIcon(qt.QStyle.SP_DirOpenIcon)
103
130
  self._selectOutputPB = qt.QPushButton(icon_opendir, "", self)
104
131
  self._selectOutputPB.setIcon(icon_opendir)
105
- general_tooltip = "You can enter a string with some keywords like {my_keyword}. Those will be interpreted during runtime according to scan metadata. Possible keywords are:"
106
- "\n - 'scan_dir_name': returns name of the directory containing the acquisition (! not a path !)"
107
- "\n - 'scan_basename': returns basename of the directory containing the acquisition"
108
- "\n - 'scan_parent_dir_basename': returns basename of the PARENT directory containing the acquisition"
132
+ general_tooltip = (
133
+ "You can enter a string with some keywords like {my_keyword}. Those will be interpreted during runtime according to scan metadata. Possible keywords are:"
134
+ + "\n - 'scan_dir_name': returns name of the directory containing the acquisition (! not a path !)"
135
+ + "\n - 'scan_basename': returns basename of the directory containing the acquisition"
136
+ + "\n - 'scan_parent_dir_basename': returns basename of the PARENT directory containing the acquisition"
137
+ )
109
138
 
110
139
  self._selectOutputPB.setToolTip(general_tooltip)
111
140
  self._outputDirQLE.setToolTip(general_tooltip)
112
- self.layout().addWidget(self._selectOutputPB)
141
+ self.layout().addWidget(self._selectOutputPB, 4, 2, 1, 1)
142
+
143
+ # set up:
144
+ self._inScanFolderRB.setChecked(True)
113
145
 
114
146
  # connect signal / slot
115
- self._defaultOutput.toggled.connect(self._hideOutput)
147
+ self._inScanFolderRB.toggled.connect(self._outputModeChanged)
148
+ self._processedDataDirRB.toggled.connect(self._outputModeChanged)
149
+ self._rawDataDirRB.toggled.connect(self._outputModeChanged)
150
+ self._otherDirRB.toggled.connect(self._outputModeChanged)
116
151
  self._selectOutputPB.released.connect(self._selectOutput)
117
- self._defaultOutput.setChecked(True)
118
- self._hideOutput(True)
119
-
120
- def _hideOutput(self, hide):
121
- self._outputDirQLE.setVisible(not hide)
122
- self._selectOutputPB.setVisible(not hide)
152
+ self._inScanFolderRB.setChecked(True)
153
+ self._outputModeChanged()
154
+
155
+ def getOutputDirMode(self) -> ProcessDataOutputDirMode:
156
+ if self._inScanFolderRB.isChecked():
157
+ return ProcessDataOutputDirMode.IN_SCAN_FOLDER
158
+ elif self._processedDataDirRB.isChecked():
159
+ return ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER
160
+ elif self._rawDataDirRB.isChecked():
161
+ return ProcessDataOutputDirMode.RAW_DATA_FOLDER
162
+ elif self._otherDirRB.isChecked():
163
+ return ProcessDataOutputDirMode.OTHER
164
+
165
+ def setOutputDirMode(
166
+ self, mode: typing.Union[ProcessDataOutputDirMode, str]
167
+ ) -> None:
168
+ mode = ProcessDataOutputDirMode.from_value(mode)
169
+ if mode is ProcessDataOutputDirMode.IN_SCAN_FOLDER:
170
+ self._inScanFolderRB.setChecked(True)
171
+ elif mode is ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER:
172
+ self._processedDataDirRB.setChecked(True)
173
+ elif mode is ProcessDataOutputDirMode.RAW_DATA_FOLDER:
174
+ self._rawDataDirRB.setChecked(True)
175
+ elif mode is ProcessDataOutputDirMode.OTHER:
176
+ self._otherDirRB.setChecked(True)
177
+
178
+ def _outputModeChanged(self, *args, **kwargs):
179
+ outputMode = self.getOutputDirMode()
180
+ self._outputDirQLE.setVisible(outputMode is ProcessDataOutputDirMode.OTHER)
181
+ self._selectOutputPB.setVisible(outputMode is ProcessDataOutputDirMode.OTHER)
182
+ self.sigOutputChanged.emit()
123
183
 
124
184
  def _selectOutput(self): # pragma: no cover
125
185
  defaultDirectory = self._outputDirQLE.text()
126
- if os.path.isdir(defaultDirectory):
186
+ if not os.path.isdir(defaultDirectory):
127
187
  defaultDirectory = get_default_directory()
128
188
 
129
189
  dialog = qt.QFileDialog(self, directory=defaultDirectory)
@@ -141,16 +201,15 @@ class NabuOutputLocationWidget(qt.QWidget):
141
201
  :return: None if the default output directory is selected else
142
202
  return path to the directory
143
203
  """
144
- if self._defaultOutput.isChecked():
145
- return None
146
- else:
204
+ if self._otherDirRB.isChecked():
147
205
  return self._outputDirQLE.text()
206
+ else:
207
+ return None
148
208
 
149
209
  def setOutputDir(self, output_dir):
150
210
  if output_dir in (None, ""):
151
- self._defaultOutput.setChecked(True)
211
+ pass
152
212
  else:
153
- self._defaultOutput.setChecked(False)
154
213
  self._outputDirQLE.setText(output_dir)
155
214
 
156
215
 
@@ -170,7 +229,7 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
170
229
  self.setLayout(qt.QGridLayout())
171
230
 
172
231
  # output dir
173
- self._output_dir_widget = NabuOutputLocationWidget(self)
232
+ self._output_dir_widget = NabuOutputLocationWidget(parent=self)
174
233
  self.layout().addWidget(self._output_dir_widget, 0, 0, 1, 4)
175
234
  self.registerWidget(self._output_dir_widget, "advanced")
176
235
 
@@ -207,7 +266,7 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
207
266
  self._output_dir_widget._outputDirQLE.editingFinished.connect(
208
267
  self._outputDirChanged
209
268
  )
210
- self._output_dir_widget._defaultOutput.toggled.connect(self._outputDirChanged)
269
+ self._output_dir_widget.sigOutputChanged.connect(self._outputDirChanged)
211
270
  self._fileFormatCB.currentTextChanged.connect(self._fileFormatChanged)
212
271
  self._framePerGroup.valueChanged.connect(self._framePerGroupChanged)
213
272
 
@@ -226,6 +285,12 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
226
285
  def setOutputDir(self, dir):
227
286
  return self._output_dir_widget.setOutputDir(dir)
228
287
 
288
+ def getOutputdirMode(self):
289
+ return self._output_dir_widget.getOutputDirMode()
290
+
291
+ def setOutputdirMode(self, mode):
292
+ return self._output_dir_widget.setOutputDirMode(mode=mode)
293
+
229
294
  def getFileFormat(self) -> NabuOutputFileFormat:
230
295
  return NabuOutputFileFormat.from_value(self._fileFormatCB.currentText())
231
296
 
@@ -244,13 +309,25 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
244
309
  return {
245
310
  "file_format": self.getFileFormat().value,
246
311
  "location": self.getOutputDir() or "",
312
+ "output_dir_mode": self.getOutputdirMode().value,
247
313
  # 'frames_per_group': self.getFramePerGroup(),
248
314
  }
249
315
 
250
316
  def setConfiguration(self, config):
251
317
  if "file_format" in config:
252
318
  self.setFileformat(config["file_format"])
253
- if "location" in config:
254
- self.setOutputDir(config["location"])
319
+ location = config.get("location", None)
320
+ if location == "":
321
+ location = None
322
+ if location is not None:
323
+ self.setOutputDir(location)
255
324
  if "frames_per_group" in config:
256
325
  self.setFramePerGroup(int(config["frames_per_group"]))
326
+
327
+ # definition of default_output_dir_mode ensure backward compatibility
328
+ default_output_dir_mode = (
329
+ None if location is None else ProcessDataOutputDirMode.OTHER
330
+ )
331
+ output_dir_mode = config.get("output_dir_mode", default_output_dir_mode)
332
+ if output_dir_mode is not None:
333
+ self.setOutputdirMode(output_dir_mode)
@@ -107,9 +107,9 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
107
107
 
108
108
  # connect signal / slot
109
109
  self._methodCB.currentIndexChanged.connect(self._methodChanged)
110
- self._paganinOpts.sigConfChanged.connect(self._signalConfChanged)
111
- self._unsharpOpts.sigConfChanged.connect(self._signalConfChanged)
112
- self._ctfOpts.sigConfChanged.connect(self._signalConfChanged)
110
+ self._paganinOpts.sigConfChanged.connect(self.sigConfChanged)
111
+ self._unsharpOpts.sigConfChanged.connect(self.sigConfChanged)
112
+ self._ctfOpts.sigConfChanged.connect(self.sigConfChanged)
113
113
 
114
114
  # set up
115
115
  self._paganinOpts.setEnabled(self.getMethod() is not _NabuPhaseMethod.NONE)
@@ -118,7 +118,7 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
118
118
  def _methodChanged(self, *args, **kwargs):
119
119
  self._paganinOpts.setEnabled(self.getMethod() is not _NabuPhaseMethod.NONE)
120
120
  self._ctfOpts.setEnabled(self.getMethod() is _NabuPhaseMethod.CTF)
121
- self._signalConfChanged("method")
121
+ self.sigConfChanged.emit("method")
122
122
 
123
123
  def _signalConfChanged(self, param):
124
124
  self.sigConfChanged.emit(param)
@@ -224,13 +224,13 @@ class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
224
224
  self._paddingTypeCB.currentIndexChanged.connect(self._paganinPaddingTypeChanged)
225
225
 
226
226
  def _paganinDBChanged(self, *args, **kwargs):
227
- self._signalConfChanged("delta_beta")
227
+ self.sigConfChanged.emit("delta_beta")
228
228
 
229
229
  def _paganinMargeChanged(self, *args, **kwargs):
230
- self._signalConfChanged("marge")
230
+ self.sigConfChanged.emit("marge")
231
231
 
232
232
  def _paganinPaddingTypeChanged(self, *args, **kwargs):
233
- self._signalConfChanged("padding_type")
233
+ self.sigConfChanged.emit("padding_type")
234
234
 
235
235
  def getPaddingType(self) -> PaddingMode:
236
236
  current_text = self._paddingTypeCB.currentText()
@@ -263,9 +263,6 @@ class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
263
263
  if padding_type is not None:
264
264
  self.setPaddingType(padding_type)
265
265
 
266
- def _signalConfChanged(self, param):
267
- self.sigConfChanged.emit(param)
268
-
269
266
 
270
267
  class NabuUnsharpConfig(qt.QWidget, base._NabuStageConfigBase):
271
268
  """Configuration widget dedicated to the unsharp options for nabu"""
@@ -331,10 +328,10 @@ class NabuUnsharpConfig(qt.QWidget, base._NabuStageConfigBase):
331
328
  self._unsharpSigmaQLE.editingFinished.connect(self._unsharpSigmaChanged)
332
329
 
333
330
  def _unsharpCoeffChanged(self, *args, **kwargs):
334
- self._signalConfChanged("unsharp_coeff")
331
+ self.sigConfChanged.emit("unsharp_coeff")
335
332
 
336
333
  def _unsharpSigmaChanged(self, *args, **kwargs):
337
- self._signalConfChanged("unsharp_sigma")
334
+ self.sigConfChanged.emit("unsharp_sigma")
338
335
 
339
336
  def isUnsharpCoeffActive(self):
340
337
  return self._unsharpCoeffCB.isChecked()
@@ -29,13 +29,13 @@ __date__ = "06/12/2021"
29
29
 
30
30
 
31
31
  import logging
32
- from typing import Optional
32
+ from typing import Optional, Union
33
33
 
34
34
  from silx.gui import qt
35
35
 
36
36
  from tomwer.core.process.reconstruction.nabu.utils import (
37
37
  _NabuStages,
38
- _RingCorrectionMethod,
38
+ RingCorrectionMethod,
39
39
  )
40
40
  from tomwer.gui.reconstruction.nabu.nabuconfig.base import _NabuStageConfigBase
41
41
  from tomwer.gui.utils.scrollarea import QComboBoxIgnoreWheel as QComboBox
@@ -78,6 +78,9 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
78
78
  self._dffSigmaQDSB.setMinimum(0.0)
79
79
  self._dffSigmaQDSB.setDecimals(2)
80
80
  self._dffSigmaQDSB.setSingleStep(0.1)
81
+ self._dffSigmaQDSB.setToolTip(
82
+ "Sigma value to give to the double flat field unsharp mask"
83
+ )
81
84
  self.layout().addWidget(self._dffSigmaQDSB, 1, 3, 1, 1)
82
85
  self.registerWidget(self._flatFieldCB, "required")
83
86
  self._dffOptWidgets = [
@@ -92,10 +95,10 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
92
95
  self.registerWidget(self._sinoRingCorrectionCB, "required")
93
96
 
94
97
  self._sinoRingCorrectionMthd = QComboBox(parent=self, scrollArea=scrollArea)
95
- for method in _RingCorrectionMethod:
98
+ for method in RingCorrectionMethod:
96
99
  self._sinoRingCorrectionMthd.addItem(method.value)
97
100
  ## force method to be None by default
98
- idx = self._sinoRingCorrectionMthd.findText(_RingCorrectionMethod.NONE.value)
101
+ idx = self._sinoRingCorrectionMthd.findText(RingCorrectionMethod.NONE.value)
99
102
  self._sinoRingCorrectionMthd.setCurrentIndex(idx)
100
103
 
101
104
  self.layout().addWidget(self._sinoRingCorrectionMthd, 2, 2, 1, 1)
@@ -232,8 +235,8 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
232
235
  self._sinoRingCorrectionMthd.currentIndexChanged.connect(
233
236
  self._sinoRingCorrectionChanged
234
237
  )
235
- self._sinoRingsOpts._levels.valueChanged.connect(self._sinoRingOptsChanged)
236
- self._sinoRingsOpts._sigma.valueChanged.connect(self._sinoRingOptsChanged)
238
+ self._sinoRingsOpts._levelsMunch.valueChanged.connect(self._sinoRingOptsChanged)
239
+ self._sinoRingsOpts._sigmaMunch.valueChanged.connect(self._sinoRingOptsChanged)
237
240
 
238
241
  self._tiltCorrection.toggled.connect(self._tiltCorrectionChanged)
239
242
  self._tiltCorrection.sigChanged.connect(self._tiltCorrectionChanged)
@@ -266,9 +269,13 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
266
269
  self._signalConfChanged("take_logarithm")
267
270
 
268
271
  def _sinoRingCorrectionChanged(self, *args, **kwargs):
269
- self._sinoRingsOpts.setVisible(
270
- self.getSinoRingcorrectionMethod() in (_RingCorrectionMethod.MUNCH.value,)
271
- )
272
+ method = self.getSinoRingcorrectionMethod()
273
+ if method is not RingCorrectionMethod.NONE.value:
274
+ self._sinoRingsOpts.setVisible(True)
275
+ self._sinoRingsOpts.setMethod(method)
276
+ else:
277
+ self._sinoRingsOpts.setVisible(False)
278
+
272
279
  self._signalConfChanged("sino_rings_correction")
273
280
 
274
281
  def _sinoRingOptsChanged(self, *args, **kwargs):
@@ -341,8 +348,11 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
341
348
  opt_as_dict = {}
342
349
  for opt in options.split(";"):
343
350
  opt = opt.replace(" ", "")
344
- key, value = opt.split("=")
345
- opt_as_dict[key] = value
351
+ if len(opt.split("=")) == 2:
352
+ key, value = opt.split("=")
353
+ opt_as_dict[key] = value
354
+ else:
355
+ _logger.info(f"ignore option {opt}. Invalid synthax")
346
356
 
347
357
  self._sinoRingsOpts.setOptions(opt_as_dict)
348
358
 
@@ -412,8 +422,8 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
412
422
  sino_rings_correction = conf.get("sino_rings_correction", None)
413
423
  if sino_rings_correction is not None:
414
424
  if sino_rings_correction == "":
415
- sino_rings_correction = _RingCorrectionMethod.NONE
416
- sino_rings_correction = _RingCorrectionMethod.from_value(
425
+ sino_rings_correction = RingCorrectionMethod.NONE
426
+ sino_rings_correction = RingCorrectionMethod.from_value(
417
427
  sino_rings_correction
418
428
  ).value
419
429
  idx = self._sinoRingCorrectionMthd.findText(sino_rings_correction)
@@ -431,32 +441,212 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
431
441
 
432
442
 
433
443
  class SinoRingsOptions(qt.QWidget):
444
+ _VO_DIMS = ("horizontaly", "horizontaly and vertically")
445
+
434
446
  def __init__(self, parent=None, *args, **kwargs):
435
447
  super().__init__(parent, *args, **kwargs)
448
+ self._method = None
436
449
  self.setLayout(qt.QFormLayout())
437
- self._sigma = qt.QDoubleSpinBox(self)
438
- self._sigma.setRange(0.0, 2147483647)
439
- self.layout().addRow("sigma", self._sigma)
440
-
441
- self._levels = qt.QSpinBox(self)
442
- self._levels.setRange(0, 2147483647)
443
- self.layout().addRow("levels", self._levels)
444
-
450
+ self.layout().setContentsMargins(0, 0, 0, 0)
451
+ self.layout().setSpacing(0)
452
+ # munch parameters
453
+ self._sigmaMunchLabel = qt.QLabel("sigma", self)
454
+ self._sigmaMunch = qt.QDoubleSpinBox(self)
455
+ self._sigmaMunch.setRange(0.0, 2147483647)
456
+ self.layout().addRow(self._sigmaMunchLabel, self._sigmaMunch)
457
+
458
+ self._levelsMunchLabel = qt.QLabel("levels", self)
459
+ self._levelsMunch = qt.QSpinBox(self)
460
+ self._levelsMunch.setRange(0, 2147483647)
461
+ self.layout().addRow(self._levelsMunchLabel, self._levelsMunch)
462
+
463
+ self._paddingMunch = qt.QCheckBox("padding", self)
464
+ self.layout().addWidget(self._paddingMunch)
465
+
466
+ # vo parameters
467
+ self._snrVOLabel = qt.QLabel("snr", self)
468
+ self._snrVO = qt.QDoubleSpinBox(self)
469
+ self._snrVO.setMinimum(0.0)
470
+ tooltip = "Ratio used to locate large stripes. Greater is less sensitive."
471
+ self._snrVO.setToolTip(tooltip)
472
+ self._snrVOLabel.setToolTip(tooltip)
473
+ self.layout().addRow(self._snrVOLabel, self._snrVO)
474
+
475
+ self._laSizeVOLabel = qt.QLabel("la_size", self)
476
+ self._laSizeVO = qt.QSpinBox(self)
477
+ self._laSizeVO.setMinimum(0)
478
+ tooltip = "Window size of the median filter to remove large stripes."
479
+ self._laSizeVO.setToolTip(tooltip)
480
+ self._laSizeVOLabel.setToolTip(tooltip)
481
+ self.layout().addRow(self._laSizeVOLabel, self._laSizeVO)
482
+
483
+ self._smSizeVOLabel = qt.QLabel("sm_size", self)
484
+ self._smSizeVO = qt.QSpinBox(self)
485
+ self._smSizeVO.setMinimum(0)
486
+ tooltip = "Window size of the median filter to remove small-to-medium stripes."
487
+ self._laSizeVO.setToolTip(tooltip)
488
+ self._smSizeVOLabel.setToolTip(tooltip)
489
+ self.layout().addRow(self._smSizeVOLabel, self._smSizeVO)
490
+
491
+ self._dimVOLabel = qt.QLabel("dimension", self)
492
+ self._dimVO = qt.QComboBox(self)
493
+ self._dimVO.addItems(self._VO_DIMS)
494
+ self.layout().addRow(self._dimVOLabel, self._dimVO)
495
+
496
+ # sino mean deringer
497
+ self._sigmaLowLabel = qt.QLabel("signal low", self)
498
+ self._sigmaLow = qt.QDoubleSpinBox(self)
499
+ self._sigmaLow.setMinimum(0.0)
500
+ self._sigmaHighLabel = qt.QLabel("signal high", self)
501
+ self.layout().addRow(self._sigmaLowLabel, self._sigmaLow)
502
+
503
+ self._sigmaHigh = qt.QDoubleSpinBox(self)
504
+ self._sigmaHigh.setMinimum(0.0)
505
+ tooltip = (
506
+ "sigma low and sigma high values are defining the standard deviation of "
507
+ "gaussian(sigma_low) * (1 - gaussian(sigma_high)). \n"
508
+ "High values of sigma mean stronger effect of associated filters."
509
+ )
510
+ self._sigmaHigh.setToolTip(tooltip)
511
+ self._sigmaLow.setToolTip(tooltip)
512
+ self.layout().addRow(self._sigmaHighLabel, self._sigmaHigh)
445
513
  # set up
446
- self._sigma.setValue(1.0)
447
- self._levels.setValue(10)
514
+ self.resetConfiguration()
515
+
516
+ def resetConfiguration(self):
517
+ self.setMethod(method=RingCorrectionMethod.MUNCH)
518
+ self._levelsMunch.setValue(10)
519
+ self._sigmaMunch.setValue(1.0)
520
+ self._paddingMunch.setChecked(False)
521
+
522
+ self._sigmaHigh.setValue(30.0)
523
+ self._sigmaLow.setValue(0.0)
524
+
525
+ self._snrVO.setValue(3.0)
526
+ self._laSizeVO.setValue(51)
527
+ self._smSizeVO.setValue(21)
528
+
529
+ def getVoDim(self):
530
+ if self._dimVO.currentText() == self._VO_DIMS[0]:
531
+ return 1
532
+ elif self._dimVO.currentText() == self._VO_DIMS[1]:
533
+ return 2
534
+ else:
535
+ raise NotImplementedError
536
+
537
+ def setVoDim(self, dim: Union[int, str]):
538
+ if dim in ("1", 1, self._VO_DIMS[0]):
539
+ self._dimVO.setCurrentText(self._VO_DIMS[0])
540
+ elif dim in ("2", 2, self._VO_DIMS[1]):
541
+ self._dimVO.setCurrentText(self._VO_DIMS[1])
542
+ else:
543
+ raise NotImplementedError(f"dim {dim} not handled")
448
544
 
449
545
  def getOptions(self) -> dict:
450
- return {
451
- "sigma": self._sigma.value(),
452
- "levels": self._levels.value(),
453
- }
546
+ if self.getMethod() is RingCorrectionMethod.NONE:
547
+ return {}
548
+ elif self.getMethod() is RingCorrectionMethod.MUNCH:
549
+ return {
550
+ "sigma": self._sigmaMunch.value(),
551
+ "levels": self._levelsMunch.value(),
552
+ "padding": self._paddingMunch.isChecked(),
553
+ }
554
+ elif self.getMethod() is RingCorrectionMethod.VO:
555
+ return {
556
+ "snr": self._snrVO.value(),
557
+ "la_size": self._laSizeVO.value(),
558
+ "sm_size": self._smSizeVO.value(),
559
+ "dim": self.getVoDim(),
560
+ }
561
+ elif self.getMethod() in (
562
+ RingCorrectionMethod.MEAN_DIVISION,
563
+ RingCorrectionMethod.MEAN_SUBTRACTION,
564
+ ):
565
+ return {
566
+ "filter_cutoff": (self._sigmaLow.value(), self._sigmaHigh.value()),
567
+ }
568
+ else:
569
+ raise NotImplementedError
454
570
 
455
571
  def setOptions(self, options: dict) -> None:
572
+ # handle munch propertoies
456
573
  if "sigma" in options:
457
- self._sigma.setValue(float(options["sigma"]))
574
+ self._sigmaMunch.setValue(float(options["sigma"]))
458
575
  if "levels" in options:
459
- self._levels.setValue(int(options["levels"]))
576
+ self._levelsMunch.setValue(int(options["levels"]))
577
+ padding = options.get("padding")
578
+ if padding is not None:
579
+ self._paddingMunch.setChecked(padding in (True, 1, "1", "True"))
580
+ # handle VO properties
581
+ snr = options.get("snr")
582
+ if snr is not None:
583
+ self._snrVO.setValue(float(snr))
584
+ la_size = options.get("la_size")
585
+ if la_size is not None:
586
+ self._laSizeVO.setValue(int(la_size))
587
+ sm_size = options.get("sm_size")
588
+ if sm_size is not None:
589
+ self._smSizeVO.setValue(int(sm_size))
590
+ dim = options.get("dim")
591
+ if dim is not None:
592
+ self.setVoDim(dim)
593
+ # handle mean subtraction or division options
594
+ filter_cutoff = options.get("filter_cutoff")
595
+ if filter_cutoff is not None:
596
+ low_pass, high_pass = filter_cutoff
597
+ self._sigmaLow.setValue(float(low_pass))
598
+ self._sigmaHigh.setValue(float(high_pass))
599
+
600
+ def setMethod(self, method: RingCorrectionMethod):
601
+ method = RingCorrectionMethod.from_value(method)
602
+ self._method = method
603
+ # handle munch options
604
+ self._sigmaMunch.setVisible(method is RingCorrectionMethod.MUNCH)
605
+ self._sigmaMunchLabel.setVisible(method is RingCorrectionMethod.MUNCH)
606
+ self._levelsMunch.setVisible(method is RingCorrectionMethod.MUNCH)
607
+ self._levelsMunchLabel.setVisible(method is RingCorrectionMethod.MUNCH)
608
+ self._paddingMunch.setVisible(method is RingCorrectionMethod.MUNCH)
609
+ # handle VO options
610
+ self._snrVO.setVisible(method is RingCorrectionMethod.VO)
611
+ self._snrVOLabel.setVisible(method is RingCorrectionMethod.VO)
612
+ self._laSizeVO.setVisible(method is RingCorrectionMethod.VO)
613
+ self._laSizeVOLabel.setVisible(method is RingCorrectionMethod.VO)
614
+ self._smSizeVO.setVisible(method is RingCorrectionMethod.VO)
615
+ self._smSizeVOLabel.setVisible(method is RingCorrectionMethod.VO)
616
+ self._dimVO.setVisible(method is RingCorrectionMethod.VO)
617
+ self._dimVOLabel.setVisible(method is RingCorrectionMethod.VO)
618
+ # mean subtractions / division deringer
619
+ self._sigmaLow.setVisible(
620
+ method
621
+ in (
622
+ RingCorrectionMethod.MEAN_DIVISION,
623
+ RingCorrectionMethod.MEAN_SUBTRACTION,
624
+ )
625
+ )
626
+ self._sigmaLowLabel.setVisible(
627
+ method
628
+ in (
629
+ RingCorrectionMethod.MEAN_DIVISION,
630
+ RingCorrectionMethod.MEAN_SUBTRACTION,
631
+ )
632
+ )
633
+ self._sigmaHigh.setVisible(
634
+ method
635
+ in (
636
+ RingCorrectionMethod.MEAN_DIVISION,
637
+ RingCorrectionMethod.MEAN_SUBTRACTION,
638
+ )
639
+ )
640
+ self._sigmaHighLabel.setVisible(
641
+ method
642
+ in (
643
+ RingCorrectionMethod.MEAN_DIVISION,
644
+ RingCorrectionMethod.MEAN_SUBTRACTION,
645
+ )
646
+ )
647
+
648
+ def getMethod(self) -> RingCorrectionMethod:
649
+ return self._method
460
650
 
461
651
 
462
652
  class TiltCorrection(qt.QGroupBox):
@@ -85,16 +85,13 @@ class SliceGroupBox(qt.QGroupBox):
85
85
 
86
86
  # connect signal / slot
87
87
  self._modeCB.currentIndexChanged.connect(self._updateSliceQLEVisibilty)
88
- self._modeCB.currentIndexChanged.connect(self._triggerSlicesChanged)
89
- self._sliceQLE.editingFinished.connect(self._triggerSlicesChanged)
90
- self.toggled.connect(self._triggerSlicesChanged)
88
+ self._modeCB.currentIndexChanged.connect(self.sigSlicesChanged)
89
+ self._sliceQLE.editingFinished.connect(self.sigSlicesChanged)
90
+ self.toggled.connect(self.sigSlicesChanged)
91
91
 
92
92
  def _updateSliceQLEVisibilty(self, *args, **kwargs):
93
93
  self._sliceQLE.setVisible(self.getMode() == NabuSliceMode.OTHER)
94
94
 
95
- def _triggerSlicesChanged(self):
96
- self.sigSlicesChanged.emit()
97
-
98
95
  def setMode(self, mode: NabuSliceMode):
99
96
  mode = NabuSliceMode.from_value(mode)
100
97
  item_index = self._modeCB.findText(mode.value)