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
@@ -36,21 +36,22 @@ from nabu.pipeline.fullfield.nabu_config import (
36
36
  from silx.gui import icons as silx_icons
37
37
  from silx.gui import qt
38
38
  from silx.utils.enum import Enum as _Enum
39
- from tomoscan.scanbase import FOV
39
+ from nxtomo.nxobject.nxdetector import FOV
40
40
 
41
- from tomwer.core.process.reconstruction.nabu.utils import ConfigurationLevel, _NabuMode
41
+ from tomwer.core.process.reconstruction.nabu.utils import _NabuMode
42
42
  from tomwer.core.scan.scanbase import TomwerScanBase
43
43
  from tomwer.gui import icons as tomwer_icons
44
44
  from tomwer.gui.reconstruction.nabu.nabuflow import NabuFlowArea
45
45
  from tomwer.gui.utils.buttons import PadlockButton
46
46
 
47
47
  from ...utils.flow import FlowDirection
48
- from .action import (
48
+ from tomwer.gui.configuration.action import (
49
49
  BasicConfigurationAction,
50
50
  ExpertConfigurationAction,
51
51
  FilterAction,
52
52
  MinimalisticConfigurationAction,
53
53
  )
54
+ from tomwer.gui.configuration.level import ConfigurationLevel
54
55
  from .nabuconfig import NabuConfiguration
55
56
 
56
57
  _logger = logging.getLogger(__name__)
@@ -250,7 +251,7 @@ class NabuWindow(qt.QMainWindow):
250
251
 
251
252
  # add load option
252
253
  self.__loadAction = qt.QAction(self)
253
- self.__loadAction.setToolTip("load nabu configuration from a .cfg file")
254
+ self.__loadAction.setToolTip("load nabu configuration from a text file")
254
255
  # load_icon = style.standardIcon(qt.QStyle.SP_)
255
256
  load_icon = silx_icons.getQIcon("document-open")
256
257
  self.__loadAction.setIcon(load_icon)
@@ -259,7 +260,7 @@ class NabuWindow(qt.QMainWindow):
259
260
 
260
261
  # add save option
261
262
  self.__saveAction = qt.QAction(self)
262
- self.__saveAction.setToolTip("save nabu configuration to a .cfg file")
263
+ self.__saveAction.setToolTip("save nabu configuration to a text file")
263
264
  save_icon = silx_icons.getQIcon("document-save")
264
265
  self.__saveAction.setIcon(save_icon)
265
266
  toolbar.addAction(self.__saveAction)
@@ -287,7 +288,7 @@ class NabuWindow(qt.QMainWindow):
287
288
  self.hidePaganinInterface = self._mainWidget.hidePaganinInterface
288
289
 
289
290
  # connect signal / slot
290
- self._mainWidget.sigConfigChanged.connect(self._triggerConfigChanged)
291
+ self._mainWidget.sigConfigChanged.connect(self.sigConfigChanged)
291
292
 
292
293
  # set up
293
294
  self._resetParameters()
@@ -348,6 +349,7 @@ class NabuWindow(qt.QMainWindow):
348
349
 
349
350
  def _resetParameters(self):
350
351
  default_config = get_default_nabu_config(nabu_fullfield_default_config)
352
+ self._mainWidget._configuration._preProcessingWidget._sinoRingsOpts.resetConfiguration()
351
353
  default_config["tomwer_slices"] = "middle"
352
354
  default_config["preproc"]["ccd_filter_enabled"] = False
353
355
  default_config["preproc"]["double_flatfield_enabled"] = False
@@ -386,8 +388,8 @@ class NabuWindow(qt.QMainWindow):
386
388
  filesSelected = dialog.selectedFiles()
387
389
  if filesSelected is not None and len(filesSelected) > 0:
388
390
  output = filesSelected[0]
389
- if not output.endswith(".cfg"):
390
- output = ".".join((output, "cfg"))
391
+ if not output.endswith((".cfg", ".conf", ".config")):
392
+ output = f"{output}.conf"
391
393
  return output
392
394
 
393
395
  def _userModeChanged(self, *args, **kwargs):
@@ -431,9 +433,6 @@ class NabuWindow(qt.QMainWindow):
431
433
  def isModeLocked(self):
432
434
  return self._mainWidget.isModeLocked()
433
435
 
434
- def _triggerConfigChanged(self):
435
- self.sigConfigChanged.emit()
436
-
437
436
 
438
437
  class NabuWidget(qt.QWidget):
439
438
  """
@@ -34,15 +34,15 @@ from asyncio.log import logger
34
34
  from silx.gui import qt
35
35
 
36
36
  from tomwer.core.process.reconstruction.nabu.utils import (
37
- ConfigurationLevel,
38
37
  _NabuStages,
39
38
  )
40
39
  from tomwer.gui import icons
41
- from tomwer.gui.reconstruction.nabu.action import (
40
+ from tomwer.gui.configuration.action import (
42
41
  BasicConfigurationAction,
43
42
  ExpertConfigurationAction,
44
43
  MinimalisticConfigurationAction,
45
44
  )
45
+ from tomwer.gui.configuration.level import ConfigurationLevel
46
46
  from tomwer.gui.reconstruction.nabu.nabuconfig.base import _NabuStageConfigBase
47
47
  from tomwer.gui.reconstruction.nabu.nabuconfig.output import (
48
48
  NabuOutputLocationWidget,
@@ -196,7 +196,7 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
196
196
  )
197
197
  self._redefineNabuOutputLocation.setCheckable(True)
198
198
  self._redefineNabuOutputLocation.setLayout(qt.QVBoxLayout())
199
- self._outputLocationWidget = NabuOutputLocationWidget(self)
199
+ self._outputLocationWidget = NabuOutputLocationWidget(parent=self)
200
200
  self._redefineNabuOutputLocation.layout().addWidget(self._outputLocationWidget)
201
201
  self.layout().addWidget(self._redefineNabuOutputLocation, 5, 0, 1, 2)
202
202
  self.registerWidget(self._redefineNabuOutputLocation, "advanced")
@@ -259,13 +259,15 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
259
259
  self._outputLocationWidget._outputDirQLE.editingFinished.connect(
260
260
  self._triggerSigConfChanged
261
261
  )
262
- self._outputLocationWidget._defaultOutput.toggled.connect(
263
- self._triggerSigConfChanged
264
- )
262
+ self._outputLocationWidget.sigOutputChanged.connect(self._triggerSigConfChanged)
263
+ self._redefineNabuOutputLocation.toggled.connect(self._triggerSigConfChanged)
265
264
 
266
265
  def redefineOutputLocation(self):
267
266
  return self._redefineNabuOutputLocation.isChecked()
268
267
 
268
+ def setRedefineOutputLocation(self, redefine: bool):
269
+ self._redefineNabuOutputLocation.setChecked(redefine)
270
+
269
271
  def getNabuOutputLocation(self):
270
272
  if self.redefineOutputLocation():
271
273
  return self._outputLocationWidget.getOutputDir()
@@ -277,6 +279,7 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
277
279
  self._redefineNabuOutputLocation.setChecked(False)
278
280
  else:
279
281
  self._redefineNabuOutputLocation.setChecked(True)
282
+ self._outputLocationWidget.setOutputDirMode("other")
280
283
  self._outputLocationWidget.setOutputDir(location)
281
284
 
282
285
  def redefineNabuFileFormat(self):
@@ -307,13 +310,13 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
307
310
  return self._spbCPUFract.value() / 100.0
308
311
 
309
312
  def setCPUFract(self, value):
310
- return self._spbCPUFract.setValue(value * 100.0)
313
+ return self._spbCPUFract.setValue(int(value * 100.0))
311
314
 
312
315
  def getGPUFract(self):
313
316
  return self._spbGPUFract.value() / 100.0
314
317
 
315
318
  def setGPUFract(self, value):
316
- return self._spbGPUFract.setValue(value * 100.0)
319
+ return self._spbGPUFract.setValue(int(value * 100.0))
317
320
 
318
321
  def getStartZ(self):
319
322
  return self._fromSlice.value()
@@ -357,6 +360,8 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
357
360
  },
358
361
  "new_output_file_format": self.getNabuFileFormat() or "",
359
362
  "new_output_location": self.getNabuOutputLocation() or "",
363
+ "output_dir_mode": self._outputLocationWidget.getOutputDirMode().value,
364
+ "overwrite_output_location": self.redefineOutputLocation(),
360
365
  }
361
366
 
362
367
  def setConfiguration(self, config):
@@ -382,6 +387,12 @@ class NabuVolumeWidget(_NabuStageConfigBase, qt.QWidget):
382
387
  if new_output_location == "":
383
388
  new_output_location = None
384
389
  self.setNabuOutputLocation(new_output_location)
390
+ output_dir_mode = config.get("output_dir_mode", None)
391
+ if output_dir_mode is not None:
392
+ self._outputLocationWidget.setOutputDirMode(output_dir_mode)
393
+ overwrite_output_location = config.get("overwrite_output_location", None)
394
+ if overwrite_output_location is not None:
395
+ self.setRedefineOutputLocation(overwrite_output_location)
385
396
 
386
397
  def setPostProcConfiguration(self, config):
387
398
  if "output_histogram" in config:
@@ -430,6 +441,7 @@ class NabuVolumeWindow(qt.QMainWindow):
430
441
 
431
442
  self._minimalisticAction = MinimalisticConfigurationAction(toolbar)
432
443
  menu.addAction(self._minimalisticAction)
444
+ self.__configurationModesGroup.addAction(self._minimalisticAction)
433
445
  self._basicConfigAction = BasicConfigurationAction(toolbar)
434
446
  menu.addAction(self._basicConfigAction)
435
447
  self.__configurationModesGroup.addAction(self._basicConfigAction)
@@ -438,8 +450,8 @@ class NabuVolumeWindow(qt.QMainWindow):
438
450
  self.__configurationModesGroup.addAction(self._expertConfiguration)
439
451
 
440
452
  # set up
441
- self._basicConfigAction.setChecked(True)
442
453
  self._userModeChanged(action=self._basicConfigAction)
454
+ self._basicConfigAction.setChecked(True)
443
455
 
444
456
  # connect signal / slot
445
457
  self._mainWidget.sigConfigChanged.connect(self._triggerSigConfigChanged)
@@ -455,7 +467,7 @@ class NabuVolumeWindow(qt.QMainWindow):
455
467
  elif action is self._expertConfiguration:
456
468
  level = ConfigurationLevel.ADVANCED
457
469
  else:
458
- raise ValueError("unknow configuration level")
470
+ level = ConfigurationLevel.REQUIRED
459
471
  self._mainWidget.setConfigurationLevel(level)
460
472
 
461
473
  # expose API
@@ -46,7 +46,7 @@ from tomoscan.normalization import Method
46
46
 
47
47
  from tomwer.core.process.reconstruction.normalization import params as _normParams
48
48
  from tomwer.core.process.reconstruction.normalization.params import _ValueSource
49
- from tomwer.core.scan.hdf5scan import HDF5TomoScan
49
+ from tomwer.core.scan.nxtomoscan import NXtomoScan
50
50
  from tomwer.core.scan.scanbase import TomwerScanBase
51
51
  from tomwer.gui.reconstruction.scores.control import ControlWidget
52
52
  from tomwer.gui.utils.buttons import PadlockButton
@@ -88,7 +88,7 @@ class SinoNormWindow(qt.QMainWindow):
88
88
  # connect signal / slot
89
89
  # self._optsWidget.sigModeChanged.connect(self._modeChanged)
90
90
  self._optsWidget.sigValueUpdated.connect(self.setResult)
91
- self._optsWidget.sigConfigurationChanged.connect(self._configurationChanged)
91
+ self._optsWidget.sigConfigurationChanged.connect(self.sigConfigurationChanged)
92
92
  self._optsWidget.sigSourceChanged.connect(self._sourceChanged)
93
93
  self._crtWidget.sigValidateRequest.connect(self._validated)
94
94
 
@@ -96,14 +96,6 @@ class SinoNormWindow(qt.QMainWindow):
96
96
  self._centralWidget._updateSinogramROI()
97
97
  self._modeChanged()
98
98
 
99
- def close(self):
100
- self._centralWidget.stop()
101
- self._centralWidget = None
102
- super().close()
103
-
104
- def _configurationChanged(self):
105
- self.sigConfigurationChanged.emit()
106
-
107
99
  def _hideLockButton(self):
108
100
  self._optsWidget._hideLockButton()
109
101
 
@@ -168,11 +160,6 @@ class SinoNormWindow(qt.QMainWindow):
168
160
  self._centralWidget.setScan(scan=scan)
169
161
  self._optsWidget.setScan(scan=scan)
170
162
 
171
- def stop(self):
172
- if self._centralWidget is not None:
173
- self._centralWidget.stop()
174
- self._centralWidget = None
175
-
176
163
  def getExtraArgs(self) -> dict:
177
164
  return self._optsWidget.getExtraInfos()
178
165
 
@@ -249,12 +236,6 @@ class _Viewer(qt.QTabWidget):
249
236
  self._projView.setManualROIVisible(visible=visible)
250
237
  self._sinoView.setROIVisible(visible=visible)
251
238
 
252
- def stop(self):
253
- self._projView.stop()
254
- self._projView = None
255
- self._sinoView.stop()
256
- self._sinoView = None
257
-
258
239
  def getROI(self):
259
240
  return self._projView.getROI()
260
241
 
@@ -344,9 +325,6 @@ class _ProjPlotWithROI(DataViewer):
344
325
  super().clear()
345
326
  self.getPlotWidget().removeMarker("sinogram_line")
346
327
 
347
- def stop(self):
348
- self._viewer._plot.stopUpdateThread()
349
-
350
328
 
351
329
  class SinogramViewer(_SinogramViewer):
352
330
  """ "Sinogram viewer but adapated for Intensity normalization"""
@@ -400,14 +378,11 @@ class SinogramViewer(_SinogramViewer):
400
378
  self.getPlotWidget().addItem(item)
401
379
 
402
380
  def getPlotWidget(self):
403
- return self._plot.getPlotWidget()
381
+ return self._plot
404
382
 
405
383
  def _updatePlot(self, sinogram):
406
- self._plot.getPlotWidget().addImage(data=sinogram)
407
- self._plot.getPlotWidget().replot()
408
-
409
- def stop(self):
410
- self._plot.stopUpdateThread()
384
+ self.getPlotWidget().addImage(data=sinogram)
385
+ self.getPlotWidget().replot()
411
386
 
412
387
 
413
388
  class _NormIntensityOptions(qt.QWidget):
@@ -489,21 +464,20 @@ class _NormIntensityOptions(qt.QWidget):
489
464
 
490
465
  # connect signal / slot
491
466
  self._modeCB.currentIndexChanged.connect(self._modeChanged)
492
- self._modeCB.currentIndexChanged.connect(self._configurationChanged)
467
+ self._modeCB.currentIndexChanged.connect(self.sigConfigurationChanged)
493
468
  self._sourceCB.currentIndexChanged.connect(self._sourceChanged)
494
- self._sourceCB.currentIndexChanged.connect(self._configurationChanged)
495
- self._computeButton.released.connect(self._computationRequested)
469
+ self._sourceCB.currentIndexChanged.connect(self.sigConfigurationChanged)
470
+ self._computeButton.released.connect(self.sigProcessingRequested)
496
471
  self._scalarValueWidget.sigValueChanged.connect(self._valueUpdated)
497
- self._scalarValueWidget.sigValueChanged.connect(self._configurationChanged)
498
- self._datasetWidget.sigConfigurationChanged.connect(self._configurationChanged)
472
+ self._scalarValueWidget.sigValueChanged.connect(self.sigConfigurationChanged)
473
+ self._datasetWidget.sigConfigurationChanged.connect(
474
+ self.sigConfigurationChanged
475
+ )
499
476
  self._intensityCalcOpts.sigConfigurationChanged.connect(
500
- self._configurationChanged
477
+ self.sigConfigurationChanged
501
478
  )
502
479
  self._lockButton.toggled.connect(self._lockChanged)
503
- self._lockButton.toggled.connect(self._configurationChanged)
504
-
505
- def _configurationChanged(self):
506
- self.sigConfigurationChanged.emit()
480
+ self._lockButton.toggled.connect(self.sigConfigurationChanged)
507
481
 
508
482
  def _sourceChanged(self):
509
483
  source = self.getCurrentSource()
@@ -644,9 +618,6 @@ class _NormIntensityOptions(qt.QWidget):
644
618
  else:
645
619
  raise ValueError(f"unhandled source: {source} for method {method}")
646
620
 
647
- def _computationRequested(self):
648
- self.sigProcessingRequested.emit()
649
-
650
621
 
651
622
  class _NormIntensityCalcOpts(qt.QWidget):
652
623
  """Options to compute the norm intensity"""
@@ -665,15 +636,14 @@ class _NormIntensityCalcOpts(qt.QWidget):
665
636
  self.layout().addRow(self._calculationModeLabel, self._calculationModeCB)
666
637
 
667
638
  # connect signal / slot
668
- self._calculationModeCB.currentIndexChanged.connect(self._configurationChanged)
639
+ self._calculationModeCB.currentIndexChanged.connect(
640
+ self.sigConfigurationChanged
641
+ )
669
642
 
670
643
  def setCalculationFctVisible(self, visible):
671
644
  self._calculationModeLabel.setVisible(visible)
672
645
  self._calculationModeCB.setVisible(visible)
673
646
 
674
- def _configurationChanged(self):
675
- self.sigConfigurationChanged.emit()
676
-
677
647
  def getCalculationFct(self):
678
648
  return _normParams._ValueCalculationFct.from_value(
679
649
  self._calculationModeCB.currentText()
@@ -885,7 +855,7 @@ class _NormIntensityDatasetWidget(qt.QWidget):
885
855
  if self.getMode() is _normParams._DatasetScope.LOCAL:
886
856
  if self.getScan() is not None:
887
857
  scan = self.getScan()
888
- if not isinstance(scan, HDF5TomoScan):
858
+ if not isinstance(scan, NXtomoScan):
889
859
  mess = qt.QMessageBox(
890
860
  parent=self,
891
861
  icon=qt.QMessageBox.Warning,
@@ -148,7 +148,7 @@ class SinogramViewer(_SinogramViewer):
148
148
  self._estimated_cor = estimated_cor
149
149
  self._other_cors = other_cors if other_cors is not None else tuple()
150
150
 
151
- plot = self._plot.getPlotWidget()
151
+ plot = self._plot
152
152
 
153
153
  if self._corMarker is not None:
154
154
  self._corMarker.sigDragFinished.disconnect(self._middleMarkerMoved)
@@ -259,9 +259,7 @@ class _ReconstructionModeGB(qt.QGroupBox):
259
259
  # connect signal / slot
260
260
  self._verticalRB.toggled.connect(self._reconstructionModeChanged)
261
261
  self._tiltCorrectionRB.toggled.connect(self._reconstructionModeChanged)
262
- self._sliceVerticalQSB.sigSlicesChanged.connect(
263
- self._reconstructionSliceChanged
264
- )
262
+ self._sliceVerticalQSB.sigSlicesChanged.connect(self.reconstructionSliceChanged)
265
263
  self._onRadioButton.released.connect(self._onRadioActivated)
266
264
  self._defaultSlicesCB.currentIndexChanged.connect(self._updateVerticalSelection)
267
265
 
@@ -295,7 +293,7 @@ class _ReconstructionModeGB(qt.QGroupBox):
295
293
  mode_is_middle = current_mode == "middle"
296
294
  self._sliceVerticalQSB.setVisible(not mode_is_middle)
297
295
  self._onRadioButton.setVisible(not mode_is_middle)
298
- self._reconstructionSliceChanged()
296
+ self.reconstructionSliceChanged.emit()
299
297
 
300
298
  def _onRadioActivated(self):
301
299
  lineSelection = QSliceSelectorDialog(parent=self, n_required_slice=1)
@@ -327,11 +325,6 @@ class _ReconstructionModeGB(qt.QGroupBox):
327
325
  def setScan(self, scan):
328
326
  self.__scan = weakref.ref(scan)
329
327
 
330
- def _reconstructionSliceChanged(self):
331
- # for now we only synchronize sliceQSB from vertical with the sinogram
332
- # viewer
333
- self.reconstructionSliceChanged.emit()
334
-
335
328
  def getReconstructionMode(self) -> ReconstructionMode:
336
329
  if self._tiltCorrectionRB.isChecked():
337
330
  return ReconstructionMode.TILT_CORRECTION
@@ -516,10 +509,10 @@ class _EstimatedCorWidget(qt.QGroupBox):
516
509
  self._middlePositionRB.toggled.connect(self._modeChanged)
517
510
  self._manualCORRel.editingFinished.connect(self._relativePositionChanged)
518
511
  self._manualCORAbs.editingFinished.connect(self._absolutePositionChanged)
519
- self._autoCorPB.released.connect(self._autoCorReqested)
520
- self._middlePositionRB.toggled.connect(self._autoCorValueChanged)
521
- self._manualCORRel.editingFinished.connect(self._autoCorValueChanged)
522
- self._manualCORAbs.editingFinished.connect(self._autoCorValueChanged)
512
+ self._autoCorPB.released.connect(self.sigAutoCorRequested)
513
+ self._middlePositionRB.toggled.connect(self.sigAutoCorChanged)
514
+ self._manualCORRel.editingFinished.connect(self.sigAutoCorChanged)
515
+ self._manualCORAbs.editingFinished.connect(self.sigAutoCorChanged)
523
516
  # set up
524
517
  self._middlePositionRB.setChecked(True)
525
518
  self._modeChanged()
@@ -607,12 +600,6 @@ class _EstimatedCorWidget(qt.QGroupBox):
607
600
  self._manualCORAbs.setValue(float(value))
608
601
  self._manualCORAbs.editingFinished.emit()
609
602
 
610
- def _autoCorReqested(self):
611
- self.sigAutoCorRequested.emit()
612
-
613
- def _autoCorValueChanged(self):
614
- self.sigAutoCorChanged.emit()
615
-
616
603
 
617
604
  class SAAxisOptions(qt.QWidget):
618
605
  """
@@ -673,7 +660,7 @@ class SAAxisOptions(qt.QWidget):
673
660
 
674
661
  # connect signal / slot
675
662
  self._reconstructionMode.reconstructionSliceChanged.connect(
676
- self._reconstructionSliceChanged
663
+ self.sigReconstructionSliceChanged
677
664
  )
678
665
  self._nReconsSB.valueChanged.connect(self._reconstructionRangeChanged)
679
666
  self._estimatedCorWidget.sigAutoCorChanged.connect(
@@ -722,9 +709,6 @@ class SAAxisOptions(qt.QWidget):
722
709
  self._reconstructionMode.setSlicesRange(min_index, max_index)
723
710
  self.sigConfigurationChanged.emit()
724
711
 
725
- def _reconstructionSliceChanged(self):
726
- self.sigReconstructionSliceChanged.emit()
727
-
728
712
  def _reconstructionRangeChanged(self):
729
713
  self.sigReconstructionRangeChanged.emit()
730
714
  self.sigConfigurationChanged.emit()
@@ -37,7 +37,7 @@ __date__ = "05/02/2021"
37
37
  from collections.abc import Iterable
38
38
 
39
39
  from silx.gui import qt
40
- from tomoscan.unitsystem import metricsystem
40
+ from pyunitsystem import metricsystem
41
41
 
42
42
 
43
43
  class DimensionWidget(qt.QGroupBox):
@@ -41,7 +41,7 @@ import numpy
41
41
  from silx.gui import qt
42
42
 
43
43
  from tomwer.core.process.reconstruction.axis import mode as axis_mode
44
- from tomwer.core.process.reconstruction.nabu.utils import _NabuMode
44
+ from tomwer.core.process.reconstruction.nabu.utils import _NabuMode, slice_index_to_int
45
45
  from tomwer.core.process.reconstruction.saaxis.params import SAAxisParams
46
46
  from tomwer.core.process.reconstruction.saaxis.saaxis import SAAxisTask
47
47
  from tomwer.gui import icons
@@ -66,14 +66,14 @@ class ScorePlot(_ScorePlot, constructor=CorSelection):
66
66
 
67
67
  def _updateScores(self):
68
68
  scan = self.__scan() if self.__scan else None
69
+ img_width = None
69
70
  if scan is not None:
70
71
  if scan.saaxis_params:
71
72
  scan.saaxis_params.score_method = self.getScoreMethod()
72
73
  img_width = scan.dim_1
73
74
  # update autofocus
74
75
  SAAxisTask.autofocus(scan)
75
- else:
76
- img_width = None
76
+
77
77
  self.setVarScores(
78
78
  scores=self._scores,
79
79
  score_method=self.getScoreMethod(),
@@ -131,13 +131,10 @@ class NabuAutoCorDiag(qt.QDialog):
131
131
  self.layout().addWidget(self._buttons)
132
132
 
133
133
  self._buttons.button(qt.QDialogButtonBox.Ok).clicked.connect(
134
- self._requestAutomaticCor
134
+ self.sigRequestAutoCor
135
135
  )
136
136
  self._buttons.button(qt.QDialogButtonBox.Ok).setText("compute")
137
137
 
138
- def _requestAutomaticCor(self, *args, **kwargs):
139
- self.sigRequestAutoCor.emit()
140
-
141
138
 
142
139
  class _SAAxisTabWidget(qt.QTabWidget):
143
140
  sigConfigurationChanged = qt.Signal()
@@ -258,6 +255,10 @@ class _SAAxisTabWidget(qt.QTabWidget):
258
255
  "mode": self.getReconstructionMode().value,
259
256
  "score_method": self.getScoreMethod().value,
260
257
  "estimated_cor": self.getEstimatedCorPosition(),
258
+ "output_dir": self.getNabuReconsParams()
259
+ .get("output", {})
260
+ .get("location", None)
261
+ or None,
261
262
  }
262
263
 
263
264
  def setConfiguration(self, config):
@@ -302,10 +303,6 @@ class _SAAxisTabWidget(qt.QTabWidget):
302
303
  self._nabuSettings = None
303
304
  super().close()
304
305
 
305
- def _stopAnimationThread(self):
306
- self._resultsViewer._stopAnimationThread()
307
- self._sliceAndCorWidget._sinogramViewer._stopAnimationThread()
308
-
309
306
 
310
307
  class SAAxisWindow(qt.QMainWindow):
311
308
  """
@@ -380,9 +377,6 @@ class SAAxisWindow(qt.QMainWindow):
380
377
  self._saaxisControl.sigComputationRequest.connect(self._launchReconstructions)
381
378
  self._saaxisControl.sigValidateRequest.connect(self._validate)
382
379
 
383
- def stop(self):
384
- self._stopAnimationThread()
385
-
386
380
  def showResults(self):
387
381
  self._tabWidget.showResults()
388
382
 
@@ -450,10 +444,7 @@ class SAAxisWindow(qt.QMainWindow):
450
444
  def _updateSinogramLine(self):
451
445
  r_slice = self.getReconstructionSlices()
452
446
  if r_slice == "middle":
453
- if self._scan is not None and self._scan.dim_2 is not None:
454
- line = self._scan.dim_2 // 2
455
- else:
456
- line = 1024
447
+ line = slice_index_to_int(slice_index="middle", scan=self._scan, axis="XY")
457
448
  else:
458
449
  line = list(r_slice.values())[0]
459
450
  self._tabWidget.getSinogramViewer().setLine(line)
@@ -509,9 +500,6 @@ class SAAxisWindow(qt.QMainWindow):
509
500
  if idx >= 0:
510
501
  self._tabWidget.setCurrentIndex(idx)
511
502
 
512
- def _stopAnimationThread(self):
513
- self._tabWidget._stopAnimationThread()
514
-
515
503
  def close(self):
516
504
  self._tabWidget.close()
517
505
  self._tabWidget = None
@@ -41,10 +41,10 @@ import numpy
41
41
  from silx.gui import qt
42
42
 
43
43
  from tomwer.core.process.reconstruction.nabu.utils import (
44
- ConfigurationLevel,
45
44
  _NabuMode,
46
45
  retrieve_lst_of_value_from_str,
47
46
  )
47
+ from tomwer.gui.configuration.level import ConfigurationLevel
48
48
  from tomwer.core.process.reconstruction.sadeltabeta.sadeltabeta import (
49
49
  SADeltaBetaTask,
50
50
  )
@@ -175,11 +175,22 @@ class _SADeltaBetaTabWidget(qt.QTabWidget):
175
175
  nabu_config = self.getNabuReconsParams()
176
176
  enable_ht = int(self._nabuSettings.getMode() is _NabuMode.HALF_ACQ)
177
177
  nabu_config["reconstruction"]["enable_halftomo"] = enable_ht
178
+ # update phase option
179
+ nabu_config["phase"][
180
+ "padding_type"
181
+ ] = self._deltaBetaSelectionWidget.getPaddingType().value
182
+ nabu_config["phase"][
183
+ "unsharp_coeff"
184
+ ] = self._deltaBetaSelectionWidget.getUnsharpCoeff()
185
+ nabu_config["phase"][
186
+ "unsharp_sigma"
187
+ ] = self._deltaBetaSelectionWidget.getUnsharpSigma()
178
188
  return {
179
189
  "slice_index": self.getReconstructionSlice(),
180
190
  "nabu_params": nabu_config,
181
191
  "score_method": self.getScoreMethod().value,
182
192
  "delta_beta_values": self.getDeltaBetaValues(),
193
+ "output_dir": nabu_config.get("output", {}).get("location", None) or None,
183
194
  }
184
195
 
185
196
  def getReconstructionSlice(self):
@@ -203,7 +214,21 @@ class _SADeltaBetaTabWidget(qt.QTabWidget):
203
214
  if slice_index is not None:
204
215
  self.setReconstructionSlice(slice_index)
205
216
  if "nabu_params" in config:
206
- self.setNabuReconsParams(config["nabu_params"])
217
+ nabu_params = config["nabu_params"]
218
+ self.setNabuReconsParams(nabu_params)
219
+ # special handling of unsharp coeff, sigma and padding type
220
+ padding_type = nabu_params.get("phase", {}).get("padding_type", None)
221
+ if padding_type is not None:
222
+ self._deltaBetaSelectionWidget.setPaddingType(padding_type=padding_type)
223
+
224
+ unsharp_coeff = nabu_params.get("phase", {}).get("unsharp_coeff", None)
225
+ if unsharp_coeff is not None:
226
+ self._deltaBetaSelectionWidget.setUnsharpCoeff(coeff=unsharp_coeff)
227
+
228
+ unsharp_sigma = nabu_params.get("phase", {}).get("unsharp_sigma", None)
229
+ if unsharp_sigma is not None:
230
+ self._deltaBetaSelectionWidget.setUnsharpSigma(sigma=unsharp_sigma)
231
+
207
232
  if "score_method" in config:
208
233
  self.setScoreMethod(config["score_method"])
209
234
 
@@ -214,7 +239,6 @@ class _SADeltaBetaTabWidget(qt.QTabWidget):
214
239
  self._resultsViewer.setScoreMethod(method)
215
240
 
216
241
  def close(self):
217
- self._stopAnimationThread()
218
242
  self._resultsViewer.close()
219
243
  self._resultsViewer = None
220
244
  self._deltaBetaSelectionWidget.close()
@@ -223,9 +247,6 @@ class _SADeltaBetaTabWidget(qt.QTabWidget):
223
247
  self._nabuSettings = None
224
248
  super().close()
225
249
 
226
- def _stopAnimationThread(self):
227
- self._resultsViewer._stopAnimationThread()
228
-
229
250
  def setSliceRange(self, min_, max_):
230
251
  self._deltaBetaSelectionWidget.setSliceRange(min_, max_)
231
252
 
@@ -332,12 +353,6 @@ class SADeltaBetaWindow(qt.QMainWindow):
332
353
  self._tabWidget = None
333
354
  super().close()
334
355
 
335
- def stop(self):
336
- self._stopAnimationThread()
337
-
338
- def _stopAnimationThread(self):
339
- self._tabWidget._stopAnimationThread()
340
-
341
356
  def setDBScores(
342
357
  self,
343
358
  scores: dict,
@@ -498,3 +513,21 @@ class DeltaBetaSelectionWidget(qt.QWidget):
498
513
  from_=values.min(), to_=values.max(), step_=step
499
514
  )
500
515
  )
516
+
517
+ def getPaddingType(self):
518
+ return self._mainWindow.getPaddingType()
519
+
520
+ def setPaddingType(self, padding_type: str):
521
+ self._mainWindow.setPaddingType(padding_type=padding_type)
522
+
523
+ def getUnsharpCoeff(self) -> float:
524
+ return self._mainWindow.getUnsharpCoeff()
525
+
526
+ def setUnsharpCoeff(self, coeff) -> float:
527
+ return self._mainWindow.setUnsharpCoeff(coeff=coeff)
528
+
529
+ def getUnsharpSigma(self) -> float:
530
+ return self._mainWindow.getUnsharpSigma()
531
+
532
+ def setUnsharpSigma(self, sigma):
533
+ self._mainWindow.setUnsharpSigma(sigma=sigma)
@@ -71,12 +71,5 @@ class ControlWidget(qt.QWidget):
71
71
  self.layout().addWidget(self._buttons)
72
72
 
73
73
  # make connection
74
- self._computeBut.pressed.connect(self._needComputation)
75
- self._applyBut.pressed.connect(self._validate)
76
-
77
- def _needComputation(self, *arg, **kwargs):
78
- """callback when the radio line changed"""
79
- self.sigComputationRequest.emit()
80
-
81
- def _validate(self):
82
- self.sigValidateRequest.emit()
74
+ self._computeBut.pressed.connect(self.sigComputationRequest)
75
+ self._applyBut.pressed.connect(self.sigValidateRequest)