tomwer 1.2.1__py3-none-any.whl → 1.3.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.
Files changed (334) hide show
  1. orangecontrib/tomwer/tutorials/icat_publication.ows +58 -0
  2. orangecontrib/tomwer/widgets/__init__.py +11 -11
  3. orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +2 -2
  4. orangecontrib/tomwer/widgets/control/DataListOW.py +9 -7
  5. orangecontrib/tomwer/widgets/control/DataListenerOW.py +6 -6
  6. orangecontrib/tomwer/widgets/control/DataSelectorOW.py +21 -10
  7. orangecontrib/tomwer/widgets/control/DataValidatorOW.py +6 -6
  8. orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +24 -7
  9. orangecontrib/tomwer/widgets/control/EmailOW.py +4 -4
  10. orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +3 -3
  11. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +64 -23
  12. orangecontrib/tomwer/widgets/control/NXtomoConcatenate.py +20 -8
  13. orangecontrib/tomwer/widgets/control/NotifierOW.py +1 -0
  14. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +6 -6
  15. orangecontrib/tomwer/widgets/control/VolumeSelector.py +7 -4
  16. orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +182 -182
  17. orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +5 -5
  18. orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +4 -4
  19. orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +3 -3
  20. orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +8 -1
  21. orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +3 -3
  22. orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +3 -3
  23. orangecontrib/tomwer/widgets/icat/PublishProcessedDataOW.py +115 -0
  24. orangecontrib/tomwer/widgets/icat/RawDataScreenshotCreatorOW.py +98 -0
  25. orangecontrib/tomwer/widgets/icat/SaveToGalleryAndPublishOW.py +129 -0
  26. orangecontrib/tomwer/widgets/icat/__init__.py +13 -0
  27. orangecontrib/tomwer/widgets/icat/icons/add_gallery.png +0 -0
  28. orangecontrib/tomwer/widgets/icat/icons/add_gallery.svg +82 -0
  29. orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.png +0 -0
  30. orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.svg +95 -0
  31. orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.png +0 -0
  32. orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.svg +143 -0
  33. orangecontrib/tomwer/widgets/icons/tomwer_data_portal.png +0 -0
  34. orangecontrib/tomwer/widgets/icons/tomwer_data_portal.svg +76 -0
  35. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +22 -20
  36. orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +19 -3
  37. orangecontrib/tomwer/widgets/reconstruction/NabuHelicalPrepareWeightsDoubleOW.py +184 -169
  38. orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +23 -0
  39. orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +39 -5
  40. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +18 -22
  41. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +18 -26
  42. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +15 -19
  43. orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +9 -9
  44. orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
  45. orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +1 -1
  46. orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +3 -3
  47. orangecontrib/tomwer/widgets/visualization/SinogramViewerOW.py +0 -1
  48. orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +3 -29
  49. tomwer/__main__.py +7 -64
  50. tomwer/app/axis.py +3 -3
  51. tomwer/app/canvas.py +8 -0
  52. tomwer/app/canvas_launcher/config.py +16 -14
  53. tomwer/app/canvas_launcher/environ.py +1 -0
  54. tomwer/app/canvas_launcher/mainwindow.py +4 -1
  55. tomwer/app/darkref.py +1 -1
  56. tomwer/app/darkrefpatch.py +1 -1
  57. tomwer/app/diffframe.py +3 -3
  58. tomwer/app/imagekeyeditor.py +5 -5
  59. tomwer/app/imagekeyupgrader.py +5 -5
  60. tomwer/app/intensitynormalization.py +14 -13
  61. tomwer/app/{saaxis.py → multicor.py} +3 -3
  62. tomwer/app/{sadeltabeta.py → multipag.py} +3 -3
  63. tomwer/app/nabuapp.py +0 -11
  64. tomwer/app/radiostack.py +6 -4
  65. tomwer/app/samplemoved.py +3 -2
  66. tomwer/app/scanviewer.py +4 -2
  67. tomwer/app/sinogramviewer.py +3 -2
  68. tomwer/app/slicestack.py +3 -2
  69. tomwer/app/zstitching.py +88 -6
  70. tomwer/core/cluster/cluster.py +26 -0
  71. tomwer/core/log/logger.py +7 -5
  72. tomwer/core/process/conditions/filters.py +1 -1
  73. tomwer/core/process/control/datalistener/datalistener.py +19 -14
  74. tomwer/core/process/control/datawatcher/edfdwprocess.py +0 -9
  75. tomwer/core/process/control/nxtomoconcatenate.py +13 -13
  76. tomwer/core/process/control/nxtomomill.py +92 -34
  77. tomwer/core/process/control/scantransfer.py +20 -43
  78. tomwer/core/process/control/scanvalidator.py +3 -2
  79. tomwer/core/process/control/test/test_concatenate_nxtomos.py +9 -9
  80. tomwer/core/process/control/test/test_email.py +4 -4
  81. tomwer/core/process/control/test/test_h52nx_process.py +59 -7
  82. tomwer/core/process/control/test/test_volume_link.py +64 -64
  83. tomwer/core/process/control/timer.py +1 -1
  84. tomwer/core/process/control/volumesymlink.py +200 -200
  85. tomwer/core/process/edit/darkflatpatch.py +14 -15
  86. tomwer/core/process/edit/imagekeyeditor.py +41 -39
  87. tomwer/core/process/icat/__init__.py +0 -0
  88. tomwer/core/process/icat/createscreenshots.py +100 -0
  89. tomwer/core/process/icat/gallery.py +377 -0
  90. tomwer/core/process/icat/icatbase.py +36 -0
  91. tomwer/core/process/icat/publish.py +228 -0
  92. tomwer/core/process/icat/screenshots.py +27 -0
  93. tomwer/core/process/output.py +52 -0
  94. tomwer/core/process/reconstruction/axis/axis.py +280 -69
  95. tomwer/core/process/reconstruction/axis/mode.py +163 -48
  96. tomwer/core/process/reconstruction/axis/params.py +29 -21
  97. tomwer/core/process/reconstruction/darkref/darkrefs.py +41 -127
  98. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +4 -3
  99. tomwer/core/process/reconstruction/darkref/params.py +1 -1
  100. tomwer/core/process/reconstruction/nabu/castvolume.py +4 -4
  101. tomwer/core/process/reconstruction/nabu/helical.py +9 -5
  102. tomwer/core/process/reconstruction/nabu/nabucommon.py +71 -78
  103. tomwer/core/process/reconstruction/nabu/nabuscores.py +425 -53
  104. tomwer/core/process/reconstruction/nabu/nabuslices.py +114 -93
  105. tomwer/core/process/reconstruction/nabu/nabuvolume.py +54 -27
  106. tomwer/core/process/reconstruction/nabu/plane.py +9 -0
  107. tomwer/core/process/reconstruction/nabu/settings.py +2 -2
  108. tomwer/core/process/reconstruction/nabu/utils.py +164 -26
  109. tomwer/core/process/reconstruction/output.py +108 -0
  110. tomwer/core/process/reconstruction/saaxis/saaxis.py +238 -264
  111. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +151 -87
  112. tomwer/core/process/reconstruction/scores/params.py +7 -4
  113. tomwer/core/process/reconstruction/scores/scores.py +13 -0
  114. tomwer/core/process/reconstruction/test/test_axis_params.py +2 -2
  115. tomwer/core/process/reconstruction/test/test_darkref.py +3 -3
  116. tomwer/core/process/reconstruction/test/test_darkref_copy.py +7 -7
  117. tomwer/core/process/reconstruction/test/test_saaxis.py +3 -4
  118. tomwer/core/process/reconstruction/test/test_sadeltabeta.py +2 -2
  119. tomwer/core/process/stitching/nabustitcher.py +13 -12
  120. tomwer/core/process/task.py +34 -26
  121. tomwer/core/process/test/test_axis.py +13 -12
  122. tomwer/core/process/test/test_dark_and_flat.py +10 -7
  123. tomwer/core/process/test/test_data_transfer.py +10 -8
  124. tomwer/core/process/test/test_nabu.py +14 -6
  125. tomwer/core/process/test/test_normalization.py +4 -4
  126. tomwer/core/scan/blissscan.py +3 -3
  127. tomwer/core/scan/edfscan.py +13 -10
  128. tomwer/core/scan/hdf5scan.py +19 -530
  129. tomwer/core/scan/nxtomoscan.py +534 -0
  130. tomwer/core/scan/scanbase.py +72 -44
  131. tomwer/core/scan/scanfactory.py +13 -13
  132. tomwer/core/scan/test/test_edf.py +2 -2
  133. tomwer/core/scan/test/test_future_scan.py +3 -3
  134. tomwer/core/scan/test/test_h5.py +18 -16
  135. tomwer/core/scan/test/test_process_registration.py +4 -40
  136. tomwer/core/scan/test/test_scan.py +5 -78
  137. tomwer/core/settings.py +22 -2
  138. tomwer/core/test/test_scanutils.py +8 -7
  139. tomwer/core/test/test_utils.py +35 -28
  140. tomwer/core/tomwer_object.py +1 -1
  141. tomwer/core/utils/__init__.py +0 -466
  142. tomwer/core/utils/deprecation.py +1 -1
  143. tomwer/core/utils/dictutils.py +14 -0
  144. tomwer/core/utils/lbsram.py +35 -0
  145. tomwer/core/utils/nxtomoutils.py +1 -1
  146. tomwer/core/utils/scanutils.py +6 -6
  147. tomwer/core/utils/spec.py +263 -0
  148. tomwer/core/volume/edfvolume.py +6 -6
  149. tomwer/core/volume/hdf5volume.py +6 -6
  150. tomwer/core/volume/jp2kvolume.py +6 -6
  151. tomwer/core/volume/rawvolume.py +6 -6
  152. tomwer/core/volume/tiffvolume.py +12 -12
  153. tomwer/core/volume/volumefactory.py +2 -2
  154. tomwer/gui/cluster/slurm.py +274 -65
  155. tomwer/gui/cluster/supervisor.py +12 -0
  156. tomwer/gui/cluster/test/test_cluster.py +14 -2
  157. tomwer/gui/cluster/test/test_supervisor.py +3 -3
  158. tomwer/gui/configuration/__init__.py +0 -0
  159. tomwer/gui/{reconstruction/nabu → configuration}/action.py +1 -32
  160. tomwer/gui/configuration/level.py +22 -0
  161. tomwer/gui/control/actions.py +54 -0
  162. tomwer/gui/control/datalist.py +83 -16
  163. tomwer/gui/control/datalistener.py +4 -16
  164. tomwer/gui/control/datawatcher/controlwidget.py +2 -4
  165. tomwer/gui/control/datawatcher/datawatcher.py +1 -24
  166. tomwer/gui/control/{email.py → emailnotifier.py} +9 -18
  167. tomwer/gui/control/history.py +2 -2
  168. tomwer/gui/control/observations.py +2 -2
  169. tomwer/gui/control/reducedarkflatselector.py +9 -9
  170. tomwer/gui/control/selectorwidgetbase.py +36 -9
  171. tomwer/gui/control/serie/seriecreator.py +5 -22
  172. tomwer/gui/control/test/test_email.py +1 -1
  173. tomwer/gui/control/test/test_scanvalidator.py +6 -5
  174. tomwer/gui/control/test/test_single_tomo_obj.py +3 -3
  175. tomwer/gui/control/tomoobjdisplaymode.py +8 -0
  176. tomwer/gui/debugtools/datasetgenerator.py +3 -3
  177. tomwer/gui/edit/dkrfpatch.py +20 -26
  178. tomwer/gui/edit/imagekeyeditor.py +11 -12
  179. tomwer/gui/edit/nxtomoeditor.py +111 -44
  180. tomwer/gui/edit/nxtomowarmer.py +7 -6
  181. tomwer/gui/edit/test/test_dkrf_patch.py +13 -13
  182. tomwer/gui/edit/test/test_image_key_editor.py +3 -3
  183. tomwer/gui/edit/test/test_nx_editor.py +40 -16
  184. tomwer/gui/icat/__init__.py +0 -0
  185. tomwer/gui/icat/createscreenshots.py +80 -0
  186. tomwer/gui/icat/gallery.py +214 -0
  187. tomwer/gui/icat/publish.py +187 -0
  188. tomwer/gui/imagefromfile.py +2 -2
  189. tomwer/gui/qfolderdialog.py +24 -1
  190. tomwer/gui/reconstruction/axis/CompareImages.py +88 -168
  191. tomwer/gui/reconstruction/axis/axis.py +171 -57
  192. tomwer/gui/reconstruction/axis/radioaxis.py +122 -257
  193. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +3 -2
  194. tomwer/gui/reconstruction/darkref/darkrefwidget.py +2 -1
  195. tomwer/gui/reconstruction/nabu/castvolume.py +14 -3
  196. tomwer/gui/reconstruction/nabu/check.py +9 -9
  197. tomwer/gui/reconstruction/nabu/helical.py +29 -12
  198. tomwer/gui/reconstruction/nabu/nabuconfig/base.py +2 -4
  199. tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +2 -1
  200. tomwer/gui/reconstruction/nabu/nabuconfig/output.py +126 -35
  201. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +39 -32
  202. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +222 -31
  203. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +57 -27
  204. tomwer/gui/reconstruction/nabu/nabuflow.py +12 -20
  205. tomwer/gui/reconstruction/nabu/slices.py +10 -11
  206. tomwer/gui/reconstruction/nabu/volume.py +22 -10
  207. tomwer/gui/reconstruction/normalization/intensity.py +18 -48
  208. tomwer/gui/reconstruction/saaxis/corrangeselector.py +8 -24
  209. tomwer/gui/reconstruction/saaxis/dimensionwidget.py +1 -1
  210. tomwer/gui/reconstruction/saaxis/saaxis.py +9 -21
  211. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +45 -12
  212. tomwer/gui/reconstruction/scores/control.py +2 -9
  213. tomwer/gui/reconstruction/scores/scoreplot.py +13 -11
  214. tomwer/gui/reconstruction/test/test_axis.py +41 -16
  215. tomwer/gui/reconstruction/test/test_nabu.py +31 -9
  216. tomwer/gui/reconstruction/test/test_saaxis.py +3 -3
  217. tomwer/gui/reconstruction/test/test_sadeltabeta.py +12 -2
  218. tomwer/gui/settings.py +5 -28
  219. tomwer/gui/stackplot.py +2 -5
  220. tomwer/gui/stitching/action.py +49 -0
  221. tomwer/gui/stitching/config/axisparams.py +7 -24
  222. tomwer/gui/stitching/config/output.py +10 -8
  223. tomwer/gui/stitching/config/positionoveraxis.py +22 -23
  224. tomwer/gui/stitching/normalization.py +117 -0
  225. tomwer/gui/stitching/stitchandbackground.py +4 -6
  226. tomwer/gui/stitching/stitching.py +267 -45
  227. tomwer/gui/stitching/stitching_preview.py +62 -55
  228. tomwer/gui/stitching/stitching_raw.py +13 -12
  229. tomwer/gui/stitching/z_stitching/fineestimation.py +0 -60
  230. tomwer/gui/utils/buttons.py +112 -29
  231. tomwer/gui/utils/inputwidget.py +43 -25
  232. tomwer/gui/utils/lineselector/lineselector.py +1 -1
  233. tomwer/gui/utils/scandescription.py +4 -0
  234. tomwer/gui/utils/step.py +144 -0
  235. tomwer/gui/utils/unitsystem.py +2 -5
  236. tomwer/gui/utils/vignettes.py +176 -15
  237. tomwer/gui/visualization/dataviewer.py +48 -35
  238. tomwer/gui/visualization/diffviewer/diffviewer.py +7 -16
  239. tomwer/gui/visualization/diffviewer/shiftwidget.py +2 -5
  240. tomwer/gui/visualization/scanoverview.py +1 -1
  241. tomwer/gui/visualization/sinogramviewer.py +20 -36
  242. tomwer/gui/visualization/test/test_diffviewer.py +3 -3
  243. tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +4 -4
  244. tomwer/gui/visualization/test/test_sinogramviewer.py +2 -2
  245. tomwer/gui/visualization/test/test_stacks.py +3 -3
  246. tomwer/gui/visualization/test/test_volumeviewer.py +65 -67
  247. tomwer/gui/visualization/volumeviewer.py +114 -113
  248. tomwer/io/utils/h5pyutils.py +3 -3
  249. tomwer/io/utils/raw_and_processed_data.py +84 -0
  250. tomwer/io/utils/tomoobj.py +4 -6
  251. tomwer/io/utils/utils.py +7 -7
  252. tomwer/resources/gui/icons/parameters.svg +1 -1
  253. tomwer/resources/gui/icons/ruler.png +0 -0
  254. tomwer/resources/gui/icons/ruler.svg +273 -0
  255. tomwer/resources/gui/icons/short_description.png +0 -0
  256. tomwer/resources/gui/icons/short_description.svg +58 -0
  257. tomwer/resources/gui/icons/url.png +0 -0
  258. tomwer/resources/gui/icons/url.svg +58 -0
  259. tomwer/resources/gui/illustrations/no_rot.svg +1 -1
  260. tomwer/synctools/stacks/edit/darkflatpatch.py +19 -14
  261. tomwer/synctools/stacks/edit/imagekeyeditor.py +2 -2
  262. tomwer/synctools/stacks/reconstruction/axis.py +4 -4
  263. tomwer/synctools/stacks/reconstruction/castvolume.py +22 -7
  264. tomwer/synctools/stacks/reconstruction/dkrefcopy.py +25 -20
  265. tomwer/synctools/stacks/reconstruction/nabu.py +2 -2
  266. tomwer/synctools/stacks/reconstruction/normalization.py +2 -2
  267. tomwer/synctools/stacks/reconstruction/saaxis.py +2 -2
  268. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +2 -2
  269. tomwer/synctools/test/test_darkRefs.py +7 -58
  270. tomwer/synctools/test/test_foldertransfer.py +6 -6
  271. tomwer/synctools/utils/scanstages.py +6 -6
  272. tomwer/tests/conftest.py +34 -0
  273. tomwer/tests/datasets.py +13 -0
  274. tomwer/tests/test_scripts.py +91 -41
  275. tomwer/tests/utils.py +5 -0
  276. tomwer/third_part/WaitingOverlay.py +110 -0
  277. tomwer/third_part/__init__.py +0 -0
  278. tomwer/version.py +2 -2
  279. tomwer-1.3.12-py3.11-nspkg.pth +1 -0
  280. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/METADATA +73 -58
  281. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/RECORD +287 -286
  282. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/WHEEL +1 -1
  283. orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +0 -197
  284. orangecontrib/tomwer/widgets/reconstruction/icons/XY_lamino.svg +0 -168
  285. orangecontrib/tomwer/widgets/reconstruction/icons/XZ_lamino.svg +0 -275
  286. orangecontrib/tomwer/widgets/reconstruction/icons/YZ_lamino.svg +0 -182
  287. tomwer/app/lamino.py +0 -143
  288. tomwer/core/process/reconstruction/lamino/__init__.py +0 -1
  289. tomwer/core/process/reconstruction/lamino/tofu.py +0 -1000
  290. tomwer/core/process/test/test_lamino.py +0 -76
  291. tomwer/core/test/test_lamino.py +0 -92
  292. tomwer/gui/reconstruction/lamino/__init__.py +0 -31
  293. tomwer/gui/reconstruction/lamino/tofu/TofuOptionLoader.py +0 -107
  294. tomwer/gui/reconstruction/lamino/tofu/__init__.py +0 -1
  295. tomwer/gui/reconstruction/lamino/tofu/misc.py +0 -148
  296. tomwer/gui/reconstruction/lamino/tofu/projections.py +0 -896
  297. tomwer/gui/reconstruction/lamino/tofu/settings.py +0 -75
  298. tomwer/gui/reconstruction/lamino/tofu/tofu.py +0 -432
  299. tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +0 -567
  300. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +0 -760
  301. tomwer/gui/reconstruction/test/test_lamino.py +0 -189
  302. tomwer/resources/gui/icons/esrf_1.svg +0 -307
  303. tomwer/resources/gui/icons/lamino_parameters.svg +0 -70
  304. tomwer/resources/gui/icons/triangle.svg +0 -80
  305. tomwer/resources/gui/illustrations/lamino_angle.png +0 -0
  306. tomwer/resources/gui/illustrations/lamino_angle.svg +0 -509
  307. tomwer/resources/gui/illustrations/lamino_beta_angle.png +0 -0
  308. tomwer/resources/gui/illustrations/lamino_beta_angle.svg +0 -97
  309. tomwer/resources/gui/illustrations/lamino_theta_angle.png +0 -0
  310. tomwer/resources/gui/illustrations/lamino_theta_angle.svg +0 -368
  311. tomwer/resources/gui/illustrations/manual_slice.png +0 -0
  312. tomwer/resources/gui/illustrations/manual_slice.svg +0 -221
  313. tomwer/resources/gui/illustrations/psi_angle.png +0 -0
  314. tomwer/resources/gui/illustrations/psi_angle.svg +0 -479
  315. tomwer/resources/gui/illustrations/rotation_center.png +0 -0
  316. tomwer/resources/gui/illustrations/rotation_center.svg +0 -276
  317. tomwer/resources/gui/illustrations/slice_stack.png +0 -0
  318. tomwer/resources/gui/illustrations/slice_stack.svg +0 -266
  319. tomwer/resources/gui/illustrations/xy_slice.png +0 -0
  320. tomwer/resources/gui/illustrations/xy_slice.svg +0 -269
  321. tomwer/resources/gui/illustrations/xz_slice.png +0 -0
  322. tomwer/resources/gui/illustrations/xz_slice.svg +0 -270
  323. tomwer/resources/gui/illustrations/yz_slice.png +0 -0
  324. tomwer/resources/gui/illustrations/yz_slice.svg +0 -270
  325. tomwer/synctools/stacks/reconstruction/lamino.py +0 -233
  326. tomwer/synctools/test/test_scanstages.py +0 -162
  327. tomwer/tests/utils/__init__.py +0 -247
  328. tomwer/tests/utils/utilstest.py +0 -220
  329. tomwer-1.2.1-py3.11-nspkg.pth +0 -1
  330. /tomwer/core/process/control/{email.py → emailnotifier.py} +0 -0
  331. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/LICENSE +0 -0
  332. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/entry_points.txt +0 -0
  333. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/namespace_packages.txt +0 -0
  334. {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/top_level.txt +0 -0
@@ -29,13 +29,13 @@ __date__ = "02/12/2021"
29
29
 
30
30
 
31
31
  from silx.gui import qt
32
- from tomoscan.esrf.scan.hdf5scan import ImageKey
32
+ from nxtomo.nxobject.nxdetector import ImageKey
33
33
 
34
- from tomwer.core.scan.hdf5scan import HDF5TomoScan
34
+ from tomwer.core.scan.nxtomoscan import NXtomoScan
35
35
  from tomwer.core.utils.nxtomoutils import get_n_series
36
36
 
37
37
 
38
- def check_dark_series(scan: HDF5TomoScan, logger=None, user_input: bool = True) -> bool:
38
+ def check_dark_series(scan: NXtomoScan, logger=None, user_input: bool = True) -> bool:
39
39
  """
40
40
  check:
41
41
  - if scan has computed_dark attached. If there is more than one then ask confirmation to the user to process the dataset
@@ -43,15 +43,15 @@ def check_dark_series(scan: HDF5TomoScan, logger=None, user_input: bool = True)
43
43
 
44
44
  ask confirmation for processing is done by a pop up dialog.
45
45
 
46
- :param HDF5TomoScan scan: scan to check
46
+ :param NXtomoScan scan: scan to check
47
47
  :param bool user_input: if True and if n series of flat is invalid then ask the user to confirm the processing. Else print a warning and refuse processing
48
48
 
49
49
  :return: True if processing can be done else False
50
50
  :note: user can 'force' the processing to be done
51
51
  """
52
- if not isinstance(scan, HDF5TomoScan):
52
+ if not isinstance(scan, NXtomoScan):
53
53
  raise TypeError(
54
- f"scan is expected to be an instance of {HDF5TomoScan} not a {type(scan)}"
54
+ f"scan is expected to be an instance of {NXtomoScan} not a {type(scan)}"
55
55
  )
56
56
  try:
57
57
  image_keys = scan.image_keys
@@ -82,13 +82,13 @@ def check_dark_series(scan: HDF5TomoScan, logger=None, user_input: bool = True)
82
82
  return True
83
83
 
84
84
 
85
- def check_flat_series(scan: HDF5TomoScan, logger, user_input: bool = True) -> bool:
85
+ def check_flat_series(scan: NXtomoScan, logger, user_input: bool = True) -> bool:
86
86
  """
87
87
  Insure the scan contains at least one serie of flat. Otherwise warn the user nabu will not be able to process
88
88
  """
89
- if not isinstance(scan, HDF5TomoScan):
89
+ if not isinstance(scan, NXtomoScan):
90
90
  raise TypeError(
91
- f"scan is expected to be an instance of {HDF5TomoScan} not a {type(scan)}"
91
+ f"scan is expected to be an instance of {NXtomoScan} not a {type(scan)}"
92
92
  )
93
93
  try:
94
94
  image_keys = scan.image_keys
@@ -22,17 +22,28 @@ class HelicalPrepareWeightsDouble(qt.QWidget):
22
22
  )
23
23
  self.layout().addWidget(self._outputFilePathQLE, 0, 2, 1, 1)
24
24
 
25
- # transition_width
26
- self._transitionWidthQDSP = qt.QLabel("transition width", self)
27
- self.layout().addWidget(self._transitionWidthQDSP, 1, 0, 1, 1)
28
- self._transitionWidthQDSP = qt.QDoubleSpinBox(self)
29
- self._transitionWidthQDSP.setRange(0.0, 99999999)
30
- self._transitionWidthQDSP.setValue(50.0)
31
- self._transitionWidthQDSP.setToolTip(
25
+ # transition_width_vertical
26
+ self._verticalTransitionWidthQDSP = qt.QLabel("transition width", self)
27
+ self.layout().addWidget(self._verticalTransitionWidthQDSP, 1, 0, 1, 1)
28
+ self._verticalTransitionWidthQDSP = qt.QDoubleSpinBox(self)
29
+ self._verticalTransitionWidthQDSP.setRange(0.0, 99999999)
30
+ self._verticalTransitionWidthQDSP.setValue(50.0)
31
+ self._verticalTransitionWidthQDSP.setToolTip(
32
32
  "the transition width is used to determine how the weights are apodised near the upper and lower border"
33
33
  )
34
34
  # TODO: improve tooltip of this
35
- self.layout().addWidget(self._transitionWidthQDSP, 1, 1, 1, 2)
35
+ self.layout().addWidget(self._verticalTransitionWidthQDSP, 1, 1, 1, 2)
36
+
37
+ # transition_width_vertical
38
+ self._horizontalTransitionWidthQDSP = qt.QLabel("transition width", self)
39
+ self.layout().addWidget(self._horizontalTransitionWidthQDSP, 1, 0, 1, 1)
40
+ self._horizontalTransitionWidthQDSP = qt.QDoubleSpinBox(self)
41
+ self._horizontalTransitionWidthQDSP.setRange(0.0, 99999999)
42
+ self._horizontalTransitionWidthQDSP.setValue(50.0)
43
+ self._horizontalTransitionWidthQDSP.setToolTip(
44
+ "the transition width is used to determine how the weights are apodised near the upper and lower border"
45
+ )
46
+ self.layout().addWidget(self._horizontalTransitionWidthQDSP, 1, 1, 1, 2)
36
47
 
37
48
  spacer = qt.QWidget(parent=self)
38
49
  spacer.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding)
@@ -40,7 +51,8 @@ class HelicalPrepareWeightsDouble(qt.QWidget):
40
51
 
41
52
  # connect signal / slot
42
53
  self._outputFilePathQLE.editingFinished.connect(self._changed)
43
- self._transitionWidthQDSP.valueChanged.connect(self._changed)
54
+ self._verticalTransitionWidthQDSP.valueChanged.connect(self._changed)
55
+ self._horizontalTransitionWidthQDSP.valueChanged.connect(self._changed)
44
56
 
45
57
  def _changed(self, *args, **kwargs):
46
58
  self.sigConfigChanged.emit()
@@ -48,7 +60,8 @@ class HelicalPrepareWeightsDouble(qt.QWidget):
48
60
  def getConfiguration(self) -> dict:
49
61
  return {
50
62
  "processes_file": self._outputFilePathQLE.text(),
51
- "transition_width": self._transitionWidthQDSP.value(),
63
+ "transition_width_vertical": self._verticalTransitionWidthQDSP.value(),
64
+ "transition_width_horizontal": self._horizontalTransitionWidthQDSP.value(),
52
65
  }
53
66
 
54
67
  def setConfiguration(self, config: dict):
@@ -56,6 +69,10 @@ class HelicalPrepareWeightsDouble(qt.QWidget):
56
69
  if processes_file is not None:
57
70
  self._outputFilePathQLE.setText(processes_file)
58
71
 
59
- transition_width = config.get("transition_width", None)
72
+ transition_width = config.get("transition_width_vertical", None)
73
+ if transition_width is not None:
74
+ self._verticalTransitionWidthQDSP.setValue(float(transition_width))
75
+
76
+ transition_width = config.get("transition_width_horizontal", None)
60
77
  if transition_width is not None:
61
- self._transitionWidthQDSP.setValue(float(transition_width))
78
+ self._horizontalTransitionWidthQDSP.setValue(float(transition_width))
@@ -30,10 +30,8 @@ __date__ = "11/02/2020"
30
30
 
31
31
  from typing import Union
32
32
 
33
- from tomwer.core.process.reconstruction.nabu.utils import (
34
- ConfigurationLevel,
35
- _NabuStages,
36
- )
33
+ from tomwer.core.process.reconstruction.nabu.utils import _NabuStages
34
+ from tomwer.gui.configuration.level import ConfigurationLevel
37
35
 
38
36
 
39
37
  class _FilteringObject:
@@ -156,7 +156,8 @@ class NabuConfiguration(qt.QWidget):
156
156
  self._preProcessingWidget.setConfiguration(config["preproc"])
157
157
  if "phase" in config:
158
158
  self._phaseWidget.setConfiguration(config["phase"])
159
- if config["phase"]["method"] == "":
159
+ paganin = config["phase"].get("method", "")
160
+ if paganin == "":
160
161
  self._phaseGB.setChecked(False)
161
162
  else:
162
163
  self._phaseGB.setChecked(True)
@@ -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
@@ -51,10 +52,25 @@ _logger = logging.getLogger(__name__)
51
52
 
52
53
 
53
54
  class QNabuFileFormatComboBox(qt.QComboBox):
54
- def __init__(self, parent: typing.Optional[qt.QWidget] = ...) -> None:
55
+ def __init__(
56
+ self, parent: typing.Optional[qt.QWidget] = ..., filter_formats=tuple()
57
+ ) -> None:
58
+ """
59
+ :param filter_format: if provided the given file format won't have an item on the ComboBox
60
+ """
55
61
  super().__init__(parent=parent)
62
+ if not isinstance(filter_formats, tuple):
63
+ raise TypeError(
64
+ f"filter_format should be a tuple. Get {type(filter_formats)} instead"
65
+ )
66
+ filter_formats = [
67
+ NabuOutputFileFormat.from_value(file_format)
68
+ for file_format in filter_formats
69
+ ]
56
70
 
57
71
  for ff in NabuOutputFileFormat:
72
+ if ff in filter_formats:
73
+ continue
58
74
  if ff is NabuOutputFileFormat.JP2K:
59
75
  if not has_glymur:
60
76
  _logger.warning(
@@ -79,51 +95,110 @@ class QNabuFileFormatComboBoxIgnoreWheel(QNabuFileFormatComboBox):
79
95
  pass
80
96
 
81
97
 
82
- class NabuOutputLocationWidget(qt.QWidget):
98
+ class NabuOutputLocationWidget(qt.QGroupBox):
99
+ sigOutputChanged = qt.Signal()
100
+ """Emit when location changed"""
101
+
83
102
  def __init__(self, *args, **kwargs) -> None:
84
- super().__init__(*args, **kwargs)
85
- self.setLayout(qt.QHBoxLayout())
103
+ super().__init__(title="output folder", *args, **kwargs)
104
+ self.setLayout(qt.QGridLayout())
86
105
 
87
- self._outputLabel = qt.QLabel("output:", self)
88
106
  self.layout().setContentsMargins(0, 0, 0, 0)
89
107
  self.layout().setSpacing(0)
90
- self.layout().addWidget(self._outputLabel)
91
108
 
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"
109
+ # in scan folder
110
+ self._inScanFolderRB = qt.QRadioButton(
111
+ ProcessDataOutputDirMode.IN_SCAN_FOLDER.value, self
112
+ )
113
+ self._inScanFolderRB.setToolTip(
114
+ "Reconstruction will be saved at the same level as the acquisition folder. (near the NXtomo file (.nx) or under the spec acquisition folder)"
115
+ )
116
+ self.layout().addWidget(self._inScanFolderRB, 1, 0, 1, 1)
117
+ # in processed data dir
118
+ self._processedDataDirRB = qt.QRadioButton(
119
+ ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER.value, self
95
120
  )
96
- self.layout().addWidget(self._defaultOutput)
121
+ self._inScanFolderRB.setToolTip(
122
+ "Reconstruction will be saved under the PROCESSED_DATA/dataset folder. if exists else under the scan folder."
123
+ )
124
+ self.layout().addWidget(self._processedDataDirRB, 2, 0, 1, 1)
125
+ # raw data dir
126
+ self._rawDataDirRB = qt.QRadioButton(
127
+ ProcessDataOutputDirMode.RAW_DATA_FOLDER.value, self
128
+ )
129
+ self._rawDataDirRB.setToolTip(
130
+ "Reconstruction will be saved under the RAW_DATA/dataset folder. if exists else under the scan folder."
131
+ )
132
+ self.layout().addWidget(self._rawDataDirRB, 3, 0, 1, 1)
133
+ # other dir
134
+ self._otherDirRB = qt.QRadioButton(ProcessDataOutputDirMode.OTHER.value, self)
135
+ self._otherDirRB.setToolTip(
136
+ "Reconstruction will be saved under user provided folder."
137
+ )
138
+ self.layout().addWidget(self._otherDirRB, 4, 0, 1, 1)
97
139
  self._outputDirQLE = QLFileSystem(
98
140
  "", self, filters=qt.QDir.NoDotAndDotDot | qt.QDir.Dirs
99
141
  )
100
- self.layout().addWidget(self._outputDirQLE)
142
+ self.layout().addWidget(self._outputDirQLE, 4, 1, 1, 1)
101
143
  style = qt.QApplication.style()
102
144
  icon_opendir = style.standardIcon(qt.QStyle.SP_DirOpenIcon)
103
145
  self._selectOutputPB = qt.QPushButton(icon_opendir, "", self)
104
146
  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"
147
+ general_tooltip = (
148
+ "You can enter a string with some keywords like {my_keyword}. Those will be interpreted during runtime according to scan metadata. Possible keywords are:"
149
+ + "\n - 'scan_dir_name': returns name of the directory containing the acquisition (! not a path !)"
150
+ + "\n - 'scan_basename': returns basename of the directory containing the acquisition"
151
+ + "\n - 'scan_parent_dir_basename': returns basename of the PARENT directory containing the acquisition"
152
+ )
109
153
 
110
154
  self._selectOutputPB.setToolTip(general_tooltip)
111
155
  self._outputDirQLE.setToolTip(general_tooltip)
112
- self.layout().addWidget(self._selectOutputPB)
156
+ self.layout().addWidget(self._selectOutputPB, 4, 2, 1, 1)
157
+
158
+ # set up:
159
+ self._inScanFolderRB.setChecked(True)
113
160
 
114
161
  # connect signal / slot
115
- self._defaultOutput.toggled.connect(self._hideOutput)
162
+ self._inScanFolderRB.toggled.connect(self._outputModeChanged)
163
+ self._processedDataDirRB.toggled.connect(self._outputModeChanged)
164
+ self._rawDataDirRB.toggled.connect(self._outputModeChanged)
165
+ self._otherDirRB.toggled.connect(self._outputModeChanged)
116
166
  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)
167
+ self._inScanFolderRB.setChecked(True)
168
+ self._outputModeChanged()
169
+
170
+ def getOutputDirMode(self) -> ProcessDataOutputDirMode:
171
+ if self._inScanFolderRB.isChecked():
172
+ return ProcessDataOutputDirMode.IN_SCAN_FOLDER
173
+ elif self._processedDataDirRB.isChecked():
174
+ return ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER
175
+ elif self._rawDataDirRB.isChecked():
176
+ return ProcessDataOutputDirMode.RAW_DATA_FOLDER
177
+ elif self._otherDirRB.isChecked():
178
+ return ProcessDataOutputDirMode.OTHER
179
+
180
+ def setOutputDirMode(
181
+ self, mode: typing.Union[ProcessDataOutputDirMode, str]
182
+ ) -> None:
183
+ mode = ProcessDataOutputDirMode.from_value(mode)
184
+ if mode is ProcessDataOutputDirMode.IN_SCAN_FOLDER:
185
+ self._inScanFolderRB.setChecked(True)
186
+ elif mode is ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER:
187
+ self._processedDataDirRB.setChecked(True)
188
+ elif mode is ProcessDataOutputDirMode.RAW_DATA_FOLDER:
189
+ self._rawDataDirRB.setChecked(True)
190
+ elif mode is ProcessDataOutputDirMode.OTHER:
191
+ self._otherDirRB.setChecked(True)
192
+
193
+ def _outputModeChanged(self, *args, **kwargs):
194
+ outputMode = self.getOutputDirMode()
195
+ self._outputDirQLE.setVisible(outputMode is ProcessDataOutputDirMode.OTHER)
196
+ self._selectOutputPB.setVisible(outputMode is ProcessDataOutputDirMode.OTHER)
197
+ self.sigOutputChanged.emit()
123
198
 
124
199
  def _selectOutput(self): # pragma: no cover
125
200
  defaultDirectory = self._outputDirQLE.text()
126
- if os.path.isdir(defaultDirectory):
201
+ if not os.path.isdir(defaultDirectory):
127
202
  defaultDirectory = get_default_directory()
128
203
 
129
204
  dialog = qt.QFileDialog(self, directory=defaultDirectory)
@@ -134,7 +209,6 @@ class NabuOutputLocationWidget(qt.QWidget):
134
209
  return
135
210
 
136
211
  self._outputDirQLE.setText(dialog.selectedFiles()[0])
137
- self._outputDirChanged()
138
212
 
139
213
  def getOutputDir(self):
140
214
  """
@@ -142,16 +216,15 @@ class NabuOutputLocationWidget(qt.QWidget):
142
216
  :return: None if the default output directory is selected else
143
217
  return path to the directory
144
218
  """
145
- if self._defaultOutput.isChecked():
146
- return None
147
- else:
219
+ if self._otherDirRB.isChecked():
148
220
  return self._outputDirQLE.text()
221
+ else:
222
+ return None
149
223
 
150
224
  def setOutputDir(self, output_dir):
151
225
  if output_dir in (None, ""):
152
- self._defaultOutput.setChecked(True)
226
+ pass
153
227
  else:
154
- self._defaultOutput.setChecked(False)
155
228
  self._outputDirQLE.setText(output_dir)
156
229
 
157
230
 
@@ -171,7 +244,7 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
171
244
  self.setLayout(qt.QGridLayout())
172
245
 
173
246
  # output dir
174
- self._output_dir_widget = NabuOutputLocationWidget(self)
247
+ self._output_dir_widget = NabuOutputLocationWidget(parent=self)
175
248
  self.layout().addWidget(self._output_dir_widget, 0, 0, 1, 4)
176
249
  self.registerWidget(self._output_dir_widget, "advanced")
177
250
 
@@ -208,7 +281,7 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
208
281
  self._output_dir_widget._outputDirQLE.editingFinished.connect(
209
282
  self._outputDirChanged
210
283
  )
211
- self._output_dir_widget._defaultOutput.toggled.connect(self._outputDirChanged)
284
+ self._output_dir_widget.sigOutputChanged.connect(self._outputDirChanged)
212
285
  self._fileFormatCB.currentTextChanged.connect(self._fileFormatChanged)
213
286
  self._framePerGroup.valueChanged.connect(self._framePerGroupChanged)
214
287
 
@@ -227,6 +300,12 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
227
300
  def setOutputDir(self, dir):
228
301
  return self._output_dir_widget.setOutputDir(dir)
229
302
 
303
+ def getOutputdirMode(self):
304
+ return self._output_dir_widget.getOutputDirMode()
305
+
306
+ def setOutputdirMode(self, mode):
307
+ return self._output_dir_widget.setOutputDirMode(mode=mode)
308
+
230
309
  def getFileFormat(self) -> NabuOutputFileFormat:
231
310
  return NabuOutputFileFormat.from_value(self._fileFormatCB.currentText())
232
311
 
@@ -245,13 +324,25 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
245
324
  return {
246
325
  "file_format": self.getFileFormat().value,
247
326
  "location": self.getOutputDir() or "",
327
+ "output_dir_mode": self.getOutputdirMode().value,
248
328
  # 'frames_per_group': self.getFramePerGroup(),
249
329
  }
250
330
 
251
331
  def setConfiguration(self, config):
252
332
  if "file_format" in config:
253
333
  self.setFileformat(config["file_format"])
254
- if "location" in config:
255
- self.setOutputDir(config["location"])
334
+ location = config.get("location", None)
335
+ if location == "":
336
+ location = None
337
+ if location is not None:
338
+ self.setOutputDir(location)
256
339
  if "frames_per_group" in config:
257
340
  self.setFramePerGroup(int(config["frames_per_group"]))
341
+
342
+ # definition of default_output_dir_mode ensure backward compatibility
343
+ default_output_dir_mode = (
344
+ None if location is None else ProcessDataOutputDirMode.OTHER
345
+ )
346
+ output_dir_mode = config.get("output_dir_mode", default_output_dir_mode)
347
+ if output_dir_mode is not None:
348
+ self.setOutputdirMode(output_dir_mode)
@@ -53,10 +53,6 @@ class PaddingMode(_Enum):
53
53
  REFLECT = "reflect"
54
54
 
55
55
 
56
- # assert set(PaddingMode.values()) == set(PaganinPhaseRetrieval.available_padding_modes)
57
- #
58
-
59
-
60
56
  class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
61
57
  """
62
58
  Widget to define the configuration of the nabu preprocessing
@@ -111,9 +107,9 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
111
107
 
112
108
  # connect signal / slot
113
109
  self._methodCB.currentIndexChanged.connect(self._methodChanged)
114
- self._paganinOpts.sigConfChanged.connect(self._signalConfChanged)
115
- self._unsharpOpts.sigConfChanged.connect(self._signalConfChanged)
116
- 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)
117
113
 
118
114
  # set up
119
115
  self._paganinOpts.setEnabled(self.getMethod() is not _NabuPhaseMethod.NONE)
@@ -122,7 +118,7 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
122
118
  def _methodChanged(self, *args, **kwargs):
123
119
  self._paganinOpts.setEnabled(self.getMethod() is not _NabuPhaseMethod.NONE)
124
120
  self._ctfOpts.setEnabled(self.getMethod() is _NabuPhaseMethod.CTF)
125
- self._signalConfChanged("method")
121
+ self.sigConfChanged.emit("method")
126
122
 
127
123
  def _signalConfChanged(self, param):
128
124
  self.sigConfChanged.emit(param)
@@ -163,6 +159,24 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
163
159
  def setDeltaBetaValue(self, value):
164
160
  self._paganinOpts.setDeltaBetaValue(value)
165
161
 
162
+ def getUnsharpCoeff(self) -> float:
163
+ return self._unsharpOpts.getUnsharpCoeff()
164
+
165
+ def setUnsharpCoeff(self, coeff: float):
166
+ self._unsharpOpts.setUnsharpCoeff(coeff)
167
+
168
+ def getUnsharpSigma(self) -> float:
169
+ return self._unsharpOpts.getUnsharpSigma()
170
+
171
+ def setUnsharpSigma(self, sigma: float):
172
+ self._unsharpOpts.setUnsharpSigma(sigma)
173
+
174
+ def getPaddingType(self):
175
+ return self._paganinOpts.getPaddingType()
176
+
177
+ def setPaddingType(self, padding_type):
178
+ return self._paganinOpts.setPaddingType(padding_type)
179
+
166
180
 
167
181
  class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
168
182
  """Configuration widget dedicated to the paganin options for nabu"""
@@ -202,33 +216,30 @@ class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
202
216
  self.registerWidget(self._paddingTypeCB, "advanced")
203
217
 
204
218
  # set up
205
- # note: hide for now margin as it is not connected at nabu side
206
- # self._margeQSB.setValue(50)
207
219
  item_index = self._paddingTypeCB.findText(PaddingMode.EDGE.value)
208
220
  self._paddingTypeCB.setCurrentIndex(item_index)
209
221
 
210
222
  # connect signal - slot
211
223
  self._deltaBetaQLE.editingFinished.connect(self._paganinDBChanged)
212
- # note: hide for now margin as it is not connected at nabu side
213
- # self._margeQSB.editingFinished.connect(self._paganinMargeChanged)
214
224
  self._paddingTypeCB.currentIndexChanged.connect(self._paganinPaddingTypeChanged)
215
225
 
216
226
  def _paganinDBChanged(self, *args, **kwargs):
217
- self._signalConfChanged("delta_beta")
227
+ self.sigConfChanged.emit("delta_beta")
218
228
 
219
229
  def _paganinMargeChanged(self, *args, **kwargs):
220
- self._signalConfChanged("marge")
230
+ self.sigConfChanged.emit("marge")
221
231
 
222
232
  def _paganinPaddingTypeChanged(self, *args, **kwargs):
223
- self._signalConfChanged("padding_type")
233
+ self.sigConfChanged.emit("padding_type")
224
234
 
225
235
  def getPaddingType(self) -> PaddingMode:
226
236
  current_text = self._paddingTypeCB.currentText()
227
237
  return PaddingMode.from_value(current_text)
228
238
 
229
- # note: hide for now margin as it is not connected at nabu side
230
- # def getMarge(self) -> int:
231
- # return int(self._margeQSB.text())
239
+ def setPaddingType(self, padding_type):
240
+ padding_type = PaddingMode.from_value(padding_type)
241
+ item_index = self._paddingTypeCB.findText(padding_type.value)
242
+ self._paddingTypeCB.setCurrentIndex(item_index)
232
243
 
233
244
  def getDeltaBeta(self) -> str:
234
245
  return self._deltaBetaQLE.text()
@@ -239,22 +250,18 @@ class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
239
250
  def getConfiguration(self):
240
251
  return {
241
252
  "delta_beta": self.getDeltaBeta(), # this one is not cast because can contain several values
242
- # "margin": self.getMarge(),
243
253
  "padding_type": self.getPaddingType().value,
244
254
  }
245
255
 
246
256
  def setConfiguration(self, conf):
247
- if "delta_beta" in conf:
248
- self._deltaBetaQLE.setText(str(conf["delta_beta"]))
249
- # if "margin" in conf:
250
- # self._margeQSB.setValue(int(conf["margin"]))
251
- if "padding_type" in conf:
252
- padding_type = PaddingMode.from_value(conf["padding_type"])
253
- item_index = self._paddingTypeCB.findText(padding_type.value)
254
- self._paddingTypeCB.setCurrentIndex(item_index)
255
-
256
- def _signalConfChanged(self, param):
257
- self.sigConfChanged.emit(param)
257
+ # delta_beta
258
+ delta_beta = conf.get("delta_beta", None)
259
+ if delta_beta is not None:
260
+ self._deltaBetaQLE.setText(str(delta_beta))
261
+ # padding_type
262
+ padding_type = conf.get("padding_type", None)
263
+ if padding_type is not None:
264
+ self.setPaddingType(padding_type)
258
265
 
259
266
 
260
267
  class NabuUnsharpConfig(qt.QWidget, base._NabuStageConfigBase):
@@ -321,10 +328,10 @@ class NabuUnsharpConfig(qt.QWidget, base._NabuStageConfigBase):
321
328
  self._unsharpSigmaQLE.editingFinished.connect(self._unsharpSigmaChanged)
322
329
 
323
330
  def _unsharpCoeffChanged(self, *args, **kwargs):
324
- self._signalConfChanged("unsharp_coeff")
331
+ self.sigConfChanged.emit("unsharp_coeff")
325
332
 
326
333
  def _unsharpSigmaChanged(self, *args, **kwargs):
327
- self._signalConfChanged("unsharp_sigma")
334
+ self.sigConfChanged.emit("unsharp_sigma")
328
335
 
329
336
  def isUnsharpCoeffActive(self):
330
337
  return self._unsharpCoeffCB.isChecked()