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
@@ -34,7 +34,7 @@ import logging
34
34
 
35
35
  from silx.gui import qt
36
36
  from silx.io.url import DataUrl
37
- from tomoscan.io import HDF5File
37
+ from silx.io.utils import open as open_hdf5
38
38
 
39
39
  from tomwer.core.scan.scanbase import TomwerScanBase
40
40
  from tomwer.synctools.imageloaderthread import ImageLoaderThread
@@ -71,7 +71,7 @@ class ImageFromFile(_Image):
71
71
 
72
72
  def get_nabu_entry():
73
73
  try:
74
- with HDF5File(_file, mode="r", swmr=True) as h5s:
74
+ with open_hdf5(_file) as h5s:
75
75
  for node in h5s:
76
76
  if "reconstruction" in h5s[node]:
77
77
  return "/".join(
@@ -78,6 +78,11 @@ class QDataDialog(qt.QFileDialog):
78
78
  os.environ["TOMWER_DEFAULT_INPUT_DIR"]
79
79
  ):
80
80
  self.setDirectory(os.environ["TOMWER_DEFAULT_INPUT_DIR"])
81
+ elif self.directory() != os.getcwd() or str(self.directory()).startswith(
82
+ "/data"
83
+ ):
84
+ # if the directory as already been set by the user. Avoid redefining it
85
+ pass
81
86
  elif os.path.isdir("/data"):
82
87
  self.setDirectory("/data")
83
88
 
@@ -279,6 +284,8 @@ class QVolumeDialog(qt.QDialog):
279
284
 
280
285
  def _selectFileOrFolder(self):
281
286
  dialog = QDataDialog(self, multiSelection=True)
287
+ # AnyFile because for HDF5 a file is expected, for .edf... a folder is expected
288
+ dialog.setFileMode(qt.QFileDialog.AnyFile)
282
289
  dialog.setNameFilters(
283
290
  [
284
291
  "Any files (*)",
@@ -291,7 +298,19 @@ class QVolumeDialog(qt.QDialog):
291
298
  if dialog.exec_() == qt.QDialog.Accepted:
292
299
  selected_files = dialog.selectedFiles()
293
300
  if len(selected_files) > 0:
294
- self.setFilePath(selected_files[0])
301
+ file_or_folder = selected_files[0]
302
+ # in case the user provided a .edf, .tiff... file try to make is life simpler.
303
+ if file_or_folder.endswith(
304
+ (
305
+ f".{EDFVolume.DEFAULT_DATA_EXTENSION}",
306
+ f".{TIFFVolume.DEFAULT_DATA_EXTENSION}",
307
+ f".{JP2KVolume.DEFAULT_DATA_EXTENSION}",
308
+ f".{JP2KVolume.DEFAULT_DATA_EXTENSION}",
309
+ )
310
+ ):
311
+ file_or_folder = os.path.dirname(file_or_folder)
312
+
313
+ self.setFilePath(file_or_folder)
295
314
 
296
315
  def _selectDataPath(self):
297
316
  self._guessDataPathAuto.setChecked(False)
@@ -525,6 +544,10 @@ class QVolumeDialog(qt.QDialog):
525
544
  constructor = TIFFVolume
526
545
  elif file_extension in self._JP2K_EXTENSIONS:
527
546
  constructor = JP2KVolume
547
+ else:
548
+ raise NotImplementedError(
549
+ f"unhandled file extension ({file_extension})"
550
+ )
528
551
  volume = constructor(
529
552
  folder=file_path,
530
553
  volume_basename=None if basename in ("", None) else basename,
@@ -33,75 +33,24 @@ import weakref
33
33
  import numpy
34
34
  from silx.gui import icons as silx_icons
35
35
  from silx.gui import qt
36
- from silx.gui.plot import CompareImages as _CompareImages
36
+ from silx.gui.plot.CompareImages import (
37
+ CompareImages as _CompareImages,
38
+ VisualizationMode,
39
+ )
40
+
41
+ from silx.gui.plot.tools.compare.toolbar import VisualizationModeToolButton
37
42
  from silx.gui.plot import tools
38
43
 
39
- from tomwer.gui import icons as tomwer_icons
40
44
 
41
45
  _logger = logging.getLogger(__name__)
42
46
 
43
47
 
44
- class CompareImagesToolBar(qt.QToolBar):
45
- """ToolBar containing specific tools to custom the configuration of a
46
- :class:`CompareImages` widget
47
-
48
- Use :meth:`setCompareWidget` to connect this toolbar to a specific
49
- :class:`CompareImages` widget.
50
-
51
- :param Union[qt.QWidget,None] parent: Parent of this widget.
52
- """
53
-
54
- def __init__(self, parent=None):
55
- qt.QToolBar.__init__(self, parent)
56
-
57
- self.__compareWidget = None
58
-
59
- menu = qt.QMenu(self)
60
- self.__visualizationAction = qt.QAction(self)
61
- self.__visualizationAction.setMenu(menu)
62
- self.__visualizationAction.setCheckable(False)
63
- self.addAction(self.__visualizationAction)
64
- self.__visualizationGroup = qt.QActionGroup(self)
65
- self.__visualizationGroup.setExclusive(True)
66
- self.__visualizationGroup.triggered.connect(self.__visualizationModeChanged)
67
-
68
- icon = silx_icons.getQIcon("compare-mode-a")
69
- action = qt.QAction(icon, "Display frame 1", self)
70
- action.setIconVisibleInMenu(True)
71
- action.setCheckable(True)
72
- action.setShortcut(qt.QKeySequence(qt.Qt.Key_A))
73
- action.setProperty("mode", CompareImages.VisualizationMode.ONLY_A)
74
- menu.addAction(action)
75
- self.__visualizationGroup.addAction(action)
76
-
77
- icon = silx_icons.getQIcon("compare-mode-b")
78
- action = qt.QAction(icon, "Display frame 2", self)
79
- action.setIconVisibleInMenu(True)
80
- action.setCheckable(True)
81
- action.setShortcut(qt.QKeySequence(qt.Qt.Key_B))
82
- action.setProperty("mode", CompareImages.VisualizationMode.ONLY_B)
83
- menu.addAction(action)
84
- self.__visualizationGroup.addAction(action)
85
-
86
- icon = silx_icons.getQIcon("compare-mode-rbneg-channel")
87
- action = qt.QAction(icon, "Subtract in color mode", self)
88
- action.setIconVisibleInMenu(True)
89
- action.setCheckable(True)
90
- action.setShortcut(qt.QKeySequence(qt.Qt.Key_C))
91
- action.setProperty(
92
- "mode", _CompareImages.VisualizationMode.COMPOSITE_RED_BLUE_GRAY_NEG
93
- )
94
- menu.addAction(action)
95
- self.__visualizationGroup.addAction(action)
48
+ class CompareImages(_CompareImages):
49
+ sigCropImagesChanged = qt.Signal()
50
+ """Emit when cropping of the compared images has changed"""
96
51
 
97
- icon = tomwer_icons.getQIcon("compare_mode_a_minus_b")
98
- action = qt.QAction(icon, "Subtract in BW mode", self)
99
- action.setIconVisibleInMenu(True)
100
- action.setCheckable(True)
101
- action.setShortcut(qt.QKeySequence(qt.Qt.Key_S))
102
- action.setProperty("mode", _CompareImages.VisualizationMode.COMPOSITE_A_MINUS_B)
103
- menu.addAction(action)
104
- self.__visualizationGroup.addAction(action)
52
+ def __init__(self, parent=None, backend=None):
53
+ super().__init__(parent, backend)
105
54
 
106
55
  # create crop images action
107
56
  icon = silx_icons.getQIcon("crop")
@@ -110,126 +59,39 @@ class CompareImagesToolBar(qt.QToolBar):
110
59
  action.setChecked(True)
111
60
  action.triggered.connect(self.__cropComparedImagesChanged)
112
61
  self.__cropComparedImages = action
113
- self.addAction(action)
114
-
115
- def setCompareWidget(self, widget):
116
- """
117
- Connect this tool bar to a specific :class:`CompareImages` widget.
118
-
119
- :param Union[None,CompareImages] widget: The widget to connect with.
120
- """
121
- compareWidget = self.getCompareWidget()
122
- if compareWidget is not None:
123
- compareWidget.sigConfigurationChanged.disconnect(
124
- self.__updateSelectedActions
125
- )
126
- compareWidget = widget
127
- if compareWidget is None:
128
- self.__compareWidget = None
129
- else:
130
- self.__compareWidget = weakref.ref(compareWidget)
131
- if compareWidget is not None:
132
- widget.sigConfigurationChanged.connect(self.__updateSelectedActions)
133
- self.__updateSelectedActions()
134
-
135
- def getCompareWidget(self):
136
- """Returns the connected widget.
137
-
138
- :rtype: CompareImages
139
- """
140
- if self.__compareWidget is None:
141
- return None
142
- else:
143
- return self.__compareWidget()
144
-
145
- def __updateSelectedActions(self):
146
- """
147
- Update the state of this tool bar according to the state of the
148
- connected :class:`CompareImages` widget.
149
- """
150
- widget = self.getCompareWidget()
151
- if widget is None:
152
- return
153
-
154
- mode = widget.getVisualizationMode()
155
- action = None
156
- for a in self.__visualizationGroup.actions():
157
- actionMode = a.property("mode")
158
- if mode == actionMode:
159
- action = a
160
- break
161
- old = self.__visualizationGroup.blockSignals(True)
162
- if action is not None:
163
- # Check this action
164
- action.setChecked(True)
165
- else:
166
- action = self.__visualizationGroup.checkedAction()
167
- if action is not None:
168
- # Uncheck this action
169
- action.setChecked(False)
170
- self.__updateVisualizationMenu()
171
- self.__visualizationGroup.blockSignals(old)
172
-
173
- def __visualizationModeChanged(self, selectedAction):
174
- """Called when user requesting changes of the visualization mode."""
175
- self.__updateVisualizationMenu()
176
- widget = self.getCompareWidget()
177
- if widget is not None:
178
- mode = selectedAction.property("mode")
179
- widget.setVisualizationMode(mode)
62
+ self._compareToolBar.addAction(action)
63
+
64
+ # define visible compare mode
65
+ self._compareToolBar._visualizationToolButton.setVisibleModes(
66
+ [
67
+ VisualizationMode.ONLY_A,
68
+ VisualizationMode.ONLY_B,
69
+ VisualizationMode.COMPOSITE_RED_BLUE_GRAY_NEG,
70
+ VisualizationMode.COMPOSITE_A_MINUS_B,
71
+ ]
72
+ )
180
73
 
181
74
  def __cropComparedImagesChanged(self):
182
- widget = self.getCompareWidget()
183
- if widget is not None:
184
- cropCompositeImage = self.__cropComparedImages.isChecked()
185
- widget.setCropComparedImages(cropCompositeImage)
186
-
187
- def __updateVisualizationMenu(self):
188
- """Update the state of the action containing visualization menu."""
189
- selectedAction = self.__visualizationGroup.checkedAction()
190
- if selectedAction is not None:
191
- self.__visualizationAction.setText(selectedAction.text())
192
- self.__visualizationAction.setIcon(selectedAction.icon())
193
- self.__visualizationAction.setToolTip(selectedAction.toolTip())
194
- else:
195
- self.__visualizationAction.setText("")
196
- self.__visualizationAction.setIcon(qt.QIcon())
197
- self.__visualizationAction.setToolTip("")
198
-
199
-
200
- class CompareImages(_CompareImages.CompareImages):
201
- sigCropImagesChanged = qt.Signal()
202
- """Emit when cropping of the compared images has changed"""
203
-
204
- def __init__(self, parent=None, backend=None):
205
- super().__init__(parent, backend=backend)
206
- self.__cropComparedImages = True
75
+ cropCompositeImage = self.__cropComparedImages.isChecked()
76
+ self.setCropComparedImages(cropCompositeImage)
207
77
 
208
78
  def cropComparedImages(self) -> bool:
209
- return self.__cropComparedImages
79
+ return self.__cropComparedImages.isChecked()
210
80
 
211
81
  def setCropComparedImages(self, crop):
212
- self.__cropComparedImages = crop
82
+ self.__cropComparedImages.setChecked(crop)
213
83
  self.sigCropImagesChanged.emit()
214
84
 
215
85
  def _createToolBars(self, plot):
216
86
  """Create tool bars displayed by the widget"""
217
- self._interactiveModeToolBar = tools.InteractiveModeToolBar(
218
- parent=self, plot=plot
219
- )
220
- self._imageToolBar = tools.ImageToolBar(parent=self, plot=plot)
221
-
87
+ toolBar = tools.InteractiveModeToolBar(parent=self, plot=plot)
88
+ self._interactiveModeToolBar = toolBar
89
+ toolBar = tools.ImageToolBar(parent=self, plot=plot)
90
+ self._imageToolBar = toolBar
222
91
  toolBar = CompareImagesToolBar(self)
223
92
  toolBar.setCompareWidget(self)
224
93
  self._compareToolBar = toolBar
225
94
 
226
- def _createStatusBar(self, plot):
227
- self._statusBar = CompareImagesStatusBar(self)
228
- self._statusBar.setCompareWidget(self)
229
-
230
- def getCompareToolBar(self):
231
- return self._compareToolBar
232
-
233
95
 
234
96
  class CompareImagesStatusBar(qt.QStatusBar):
235
97
  """StatusBar containing specific information contained in a
@@ -407,3 +269,61 @@ class CompareImagesStatusBar(qt.QStatusBar):
407
269
  text2 = self._formatData(data2)
408
270
  self._label1.setText("Frame 1: %s" % text1)
409
271
  self._label2.setText("Frame 2: %s" % text2)
272
+
273
+
274
+ class CompareImagesToolBar(qt.QToolBar):
275
+ def __init__(self, parent=None):
276
+ qt.QToolBar.__init__(self, parent)
277
+
278
+ self.__compareWidget = None
279
+
280
+ self._visualizationToolButton = VisualizationModeToolButton(self)
281
+ self._visualizationToolButton.setPopupMode(qt.QToolButton.InstantPopup)
282
+ self._visualizationToolButton.sigSelected.connect(self.__visualizationChanged)
283
+ self.addWidget(self._visualizationToolButton)
284
+
285
+ def __visualizationChanged(self, mode: VisualizationMode):
286
+ widget = self.getCompareWidget()
287
+ if widget is not None:
288
+ widget.setVisualizationMode(mode)
289
+
290
+ def setCompareWidget(self, widget):
291
+ """
292
+ Connect this tool bar to a specific :class:`CompareImages` widget.
293
+
294
+ :param Union[None,CompareImages] widget: The widget to connect with.
295
+ """
296
+ compareWidget = self.getCompareWidget()
297
+ if compareWidget is not None:
298
+ compareWidget.sigConfigurationChanged.disconnect(
299
+ self.__updateSelectedActions
300
+ )
301
+ compareWidget = widget
302
+ self.setEnabled(compareWidget is not None)
303
+ if compareWidget is None:
304
+ self.__compareWidget = None
305
+ else:
306
+ self.__compareWidget = weakref.ref(compareWidget)
307
+ if compareWidget is not None:
308
+ widget.sigConfigurationChanged.connect(self.__updateSelectedActions)
309
+ self.__updateSelectedActions()
310
+
311
+ def getCompareWidget(self):
312
+ """Returns the connected widget.
313
+
314
+ :rtype: CompareImages
315
+ """
316
+ if self.__compareWidget is None:
317
+ return None
318
+ else:
319
+ return self.__compareWidget()
320
+
321
+ def __updateSelectedActions(self):
322
+ """
323
+ Update the state of this tool bar according to the state of the
324
+ connected :class:`CompareImages` widget.
325
+ """
326
+ widget = self.getCompareWidget()
327
+ if widget is None:
328
+ return
329
+ self._visualizationToolButton.setSelected(widget.getVisualizationMode())