tomwer 1.0.4__py3-none-any.whl → 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. orangecontrib/tomwer/tutorials/EBS_tomo_listener.ows +39 -0
  2. orangecontrib/tomwer/tutorials/cast_volume.ows +34 -0
  3. orangecontrib/tomwer/tutorials/simple_slice_reconstruction.ows +39 -0
  4. orangecontrib/tomwer/tutorials/simple_volume_local_reconstruction.ows +49 -0
  5. orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +59 -0
  6. orangecontrib/tomwer/tutorials/using_saaxis_to_find_cor.ows +44 -0
  7. orangecontrib/tomwer/widgets/cluster/FutureSupervisorOW.py +1 -1
  8. orangecontrib/tomwer/widgets/cluster/SlurmClusterOW.py +14 -4
  9. orangecontrib/tomwer/widgets/cluster/__init__.py +1 -1
  10. orangecontrib/tomwer/widgets/control/DataListOW.py +12 -5
  11. orangecontrib/tomwer/widgets/control/DataListenerOW.py +18 -9
  12. orangecontrib/tomwer/widgets/control/DataSelectorOW.py +13 -6
  13. orangecontrib/tomwer/widgets/control/DataTransfertOW.py +4 -5
  14. orangecontrib/tomwer/widgets/control/DataValidatorOW.py +8 -4
  15. orangecontrib/tomwer/widgets/control/DataWatcherOW.py +4 -6
  16. orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +49 -62
  17. orangecontrib/tomwer/widgets/control/FilterOW.py +2 -4
  18. orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +93 -0
  19. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +135 -128
  20. orangecontrib/tomwer/widgets/control/NotifierOW.py +31 -7
  21. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +3 -5
  22. orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +85 -0
  23. orangecontrib/tomwer/widgets/control/VolumeSelector.py +12 -4
  24. orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +11 -7
  25. orangecontrib/tomwer/widgets/control/icons/notification.svg +4 -4
  26. orangecontrib/tomwer/widgets/control/icons/nxtomomill.png +0 -0
  27. orangecontrib/tomwer/widgets/control/icons/nxtomomill.svg +8 -5
  28. orangecontrib/tomwer/widgets/control/icons/tomoobjserie.png +0 -0
  29. orangecontrib/tomwer/widgets/control/icons/tomoobjserie.svg +138 -0
  30. orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +16 -4
  31. orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +100 -0
  32. orangecontrib/tomwer/widgets/edit/icons/image_key_editor.png +0 -0
  33. orangecontrib/tomwer/widgets/edit/icons/image_key_upgrader.png +0 -0
  34. orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.png +0 -0
  35. orangecontrib/tomwer/widgets/edit/icons/nx_tomo_editor.svg +123 -0
  36. orangecontrib/tomwer/widgets/edit/test/test_dark_flat_patch.py +21 -1
  37. orangecontrib/tomwer/widgets/edit/test/test_image_key_editor.py +1 -1
  38. orangecontrib/tomwer/widgets/edit/test/test_image_key_upgrader.py +1 -1
  39. orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +25 -0
  40. orangecontrib/tomwer/widgets/other/PythonScriptOW.py +19 -10
  41. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +20 -14
  42. orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +24 -10
  43. orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py +26 -21
  44. orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +29 -12
  45. orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +44 -17
  46. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +28 -18
  47. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +24 -17
  48. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +6 -6
  49. orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +4 -2
  50. orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.png +0 -0
  51. orangecontrib/tomwer/widgets/reconstruction/icons/nabu_2d.svg +11 -8
  52. orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +10 -4
  53. orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
  54. orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +69 -0
  55. orangecontrib/tomwer/widgets/visualization/SampleMovedOW.py +2 -4
  56. orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.png +0 -0
  57. orangecontrib/tomwer/widgets/visualization/icons/nx_tomo_metadata_viewer.svg +105 -0
  58. tomwer/__main__.py +10 -5
  59. tomwer/app/canvas_launcher/config.py +10 -10
  60. tomwer/app/canvas_launcher/mainwindow.py +68 -6
  61. tomwer/app/canvas_launcher/widgetsscheme.py +1 -3
  62. tomwer/app/darkref.py +16 -12
  63. tomwer/app/imagekeyeditor.py +2 -2
  64. tomwer/app/imagekeyupgrader.py +104 -0
  65. tomwer/app/nxtomoeditor.py +103 -0
  66. tomwer/app/rsync.py +1 -1
  67. tomwer/core/cluster/cluster.py +1 -1
  68. tomwer/core/futureobject.py +1 -0
  69. tomwer/core/process/control/datalistener/datalistener.py +7 -1
  70. tomwer/core/process/control/datalistener/rpcserver.py +3 -3
  71. tomwer/core/process/control/datawatcher/datawatcher.py +18 -18
  72. tomwer/core/process/control/datawatcher/datawatcherobserver.py +5 -8
  73. tomwer/core/process/control/datawatcher/datawatcherprocess.py +2 -3
  74. tomwer/core/process/control/datawatcher/edfdwprocess.py +2 -2
  75. tomwer/core/process/control/nxtomomill.py +33 -58
  76. tomwer/core/process/control/scanlist.py +2 -1
  77. tomwer/core/process/control/scanselector.py +7 -0
  78. tomwer/core/process/control/scantransfer.py +9 -18
  79. tomwer/core/process/control/scanvalidator.py +6 -5
  80. tomwer/core/process/control/singletomoobj.py +2 -1
  81. tomwer/core/process/control/timer.py +2 -1
  82. tomwer/core/process/control/tomoobjserie.py +8 -0
  83. tomwer/core/process/control/volumeselector.py +2 -1
  84. tomwer/core/process/control/volumesymlink.py +2 -1
  85. tomwer/core/process/edit/darkflatpatch.py +2 -1
  86. tomwer/core/process/edit/imagekeyeditor.py +4 -3
  87. tomwer/core/process/reconstruction/axis/axis.py +29 -32
  88. tomwer/core/process/reconstruction/axis/mode.py +3 -2
  89. tomwer/core/process/reconstruction/axis/params.py +35 -16
  90. tomwer/core/process/reconstruction/darkref/darkrefs.py +90 -707
  91. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +44 -16
  92. tomwer/core/process/reconstruction/darkref/params.py +62 -67
  93. tomwer/core/process/reconstruction/lamino/tofu.py +1 -1
  94. tomwer/core/process/reconstruction/nabu/castvolume.py +21 -26
  95. tomwer/core/process/reconstruction/nabu/nabucommon.py +36 -38
  96. tomwer/core/process/reconstruction/nabu/nabuscores.py +28 -13
  97. tomwer/core/process/reconstruction/nabu/nabuslices.py +41 -14
  98. tomwer/core/process/reconstruction/nabu/nabuvolume.py +21 -12
  99. tomwer/core/process/reconstruction/nabu/utils.py +12 -1
  100. tomwer/core/process/reconstruction/normalization/normalization.py +9 -8
  101. tomwer/core/process/reconstruction/saaxis/saaxis.py +46 -20
  102. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +38 -12
  103. tomwer/core/process/reconstruction/test/__init__.py +0 -39
  104. tomwer/core/process/reconstruction/test/test_axis_params.py +25 -3
  105. tomwer/core/process/reconstruction/test/test_darkref_copy.py +117 -1
  106. tomwer/core/process/script/python.py +16 -12
  107. tomwer/core/process/task.py +3 -7
  108. tomwer/core/process/test/test_axis.py +1 -1
  109. tomwer/core/process/test/test_dark_and_flat.py +41 -111
  110. tomwer/core/process/test/test_data_listener.py +0 -29
  111. tomwer/core/process/test/test_data_transfer.py +10 -14
  112. tomwer/core/process/test/test_nabu.py +1 -1
  113. tomwer/core/process/test/test_normalization.py +1 -1
  114. tomwer/core/process/visualization/liveslice.py +6 -0
  115. tomwer/core/scan/blissscan.py +37 -2
  116. tomwer/core/scan/edfscan.py +14 -4
  117. tomwer/core/scan/hdf5scan.py +10 -4
  118. tomwer/core/scan/scanbase.py +35 -29
  119. tomwer/core/scan/scanfactory.py +3 -17
  120. tomwer/core/scan/test/test_h5.py +1 -1
  121. tomwer/core/scan/test/test_process_registration.py +0 -11
  122. tomwer/core/scan/test/test_scan.py +32 -30
  123. tomwer/core/settings.py +2 -2
  124. tomwer/core/test/test_utils.py +1 -1
  125. tomwer/core/tomwer_object.py +19 -0
  126. tomwer/core/utils/__init__.py +0 -45
  127. tomwer/core/utils/char.py +2 -0
  128. tomwer/core/utils/gpu.py +5 -5
  129. tomwer/core/utils/nxtomoutils.py +2 -2
  130. tomwer/core/utils/scanutils.py +50 -0
  131. tomwer/core/utils/volumeutils.py +13 -0
  132. tomwer/core/volume/edfvolume.py +4 -0
  133. tomwer/core/volume/hdf5volume.py +4 -0
  134. tomwer/core/volume/jp2kvolume.py +4 -0
  135. tomwer/core/volume/rawvolume.py +4 -0
  136. tomwer/core/volume/tiffvolume.py +4 -0
  137. tomwer/core/volume/volumebase.py +19 -12
  138. tomwer/core/volume/volumefactory.py +20 -1
  139. tomwer/gui/cluster/slurm.py +1 -1
  140. tomwer/gui/cluster/test/test_cluster.py +2 -2
  141. tomwer/gui/control/datalist.py +109 -34
  142. tomwer/gui/control/datatransfert.py +1 -1
  143. tomwer/gui/control/datawatcher/datawatcher.py +23 -13
  144. tomwer/gui/control/datawatcher/datawatcherobserver.py +1 -1
  145. tomwer/gui/control/observations.py +0 -3
  146. tomwer/gui/control/selectorwidgetbase.py +42 -11
  147. tomwer/gui/control/serie/seriecreator.py +967 -0
  148. tomwer/{web/__init__.py → gui/control/serie/seriewaiter.py} +5 -7
  149. tomwer/gui/control/singletomoobj.py +15 -3
  150. tomwer/gui/control/test/test_datalist.py +1 -1
  151. tomwer/gui/control/test/test_datalistener.py +1 -1
  152. tomwer/gui/control/test/test_inputwidget.py +1 -1
  153. tomwer/gui/control/test/test_process_manager.py +1 -13
  154. tomwer/gui/control/test/test_scanselector.py +1 -1
  155. tomwer/gui/control/test/test_scanvalidator.py +1 -1
  156. tomwer/gui/control/test/test_single_tomo_obj.py +1 -1
  157. tomwer/gui/control/test/test_volume_dialog.py +19 -7
  158. tomwer/gui/control/test/test_volumeselector.py +4 -4
  159. tomwer/gui/debugtools/datasetgenerator.py +1 -8
  160. tomwer/gui/edit/dkrfpatch.py +2 -2
  161. tomwer/gui/edit/imagekeyeditor.py +12 -9
  162. tomwer/gui/edit/nxtomoeditor.py +475 -0
  163. tomwer/gui/edit/test/test_dkrf_patch.py +2 -14
  164. tomwer/gui/edit/test/test_image_key_editor.py +2 -2
  165. tomwer/gui/edit/test/test_nx_editor.py +155 -0
  166. tomwer/gui/qfolderdialog.py +11 -0
  167. tomwer/gui/reconstruction/axis/CompareImages.py +27 -29
  168. tomwer/gui/reconstruction/axis/axis.py +2 -0
  169. tomwer/gui/reconstruction/axis/radioaxis.py +67 -11
  170. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +7 -9
  171. tomwer/gui/reconstruction/darkref/darkrefwidget.py +22 -24
  172. tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
  173. tomwer/gui/reconstruction/lamino/tofu/tofu.py +3 -3
  174. tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +4 -4
  175. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +10 -4
  176. tomwer/gui/reconstruction/nabu/castvolume.py +80 -11
  177. tomwer/gui/reconstruction/nabu/check.py +1 -1
  178. tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py +352 -0
  179. tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +0 -9
  180. tomwer/gui/reconstruction/nabu/nabuconfig/output.py +1 -1
  181. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +18 -19
  182. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +30 -7
  183. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +26 -13
  184. tomwer/gui/reconstruction/nabu/slices.py +10 -2
  185. tomwer/gui/reconstruction/nabu/slurm.py +1 -1
  186. tomwer/gui/reconstruction/nabu/volume.py +13 -7
  187. tomwer/gui/reconstruction/normalization/intensity.py +1 -1
  188. tomwer/gui/reconstruction/saaxis/corrangeselector.py +10 -34
  189. tomwer/gui/reconstruction/saaxis/saaxis.py +11 -6
  190. tomwer/gui/reconstruction/saaxis/sliceselector.py +11 -26
  191. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +13 -8
  192. tomwer/gui/reconstruction/scores/scoreplot.py +67 -61
  193. tomwer/gui/reconstruction/test/test_axis.py +2 -2
  194. tomwer/gui/reconstruction/test/test_lamino.py +2 -2
  195. tomwer/gui/reconstruction/test/test_nabu.py +14 -1
  196. tomwer/gui/reconstruction/test/test_saaxis.py +8 -17
  197. tomwer/gui/reconstruction/test/test_sadeltabeta.py +7 -13
  198. tomwer/gui/stackplot.py +11 -28
  199. tomwer/gui/test/test_axis_gui.py +4 -4
  200. tomwer/gui/test/test_qfolder_dialog.py +12 -0
  201. tomwer/gui/utils/inputwidget.py +42 -21
  202. tomwer/gui/utils/lineselector/lineselector.py +13 -21
  203. tomwer/gui/utils/scandescription.py +2 -4
  204. tomwer/gui/utils/slider.py +1 -102
  205. tomwer/gui/utils/unitsystem.py +48 -11
  206. tomwer/gui/visualization/dataviewer.py +24 -17
  207. tomwer/gui/visualization/diffviewer/diffviewer.py +2 -11
  208. tomwer/gui/visualization/nxtomometadata.py +21 -0
  209. tomwer/gui/visualization/scanoverview.py +0 -1
  210. tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +72 -0
  211. tomwer/gui/visualization/test/test_stacks.py +1 -1
  212. tomwer/gui/visualization/tomoobjoverview.py +49 -0
  213. tomwer/gui/visualization/volumeoverview.py +64 -0
  214. tomwer/gui/visualization/volumeviewer.py +1 -1
  215. tomwer/resources/gui/icons/multi-document-save.png +0 -0
  216. tomwer/resources/gui/icons/multi-document-save.svg +101 -0
  217. tomwer/resources/gui/illustrations/ctf_z1.png +0 -0
  218. tomwer/resources/gui/illustrations/ctf_z1.svg +471 -0
  219. tomwer/synctools/datalistener.py +5 -1
  220. tomwer/synctools/imageloaderthread.py +2 -2
  221. tomwer/synctools/stacks/edit/imagekeyeditor.py +1 -1
  222. tomwer/synctools/stacks/processingstack.py +2 -2
  223. tomwer/synctools/stacks/reconstruction/castvolume.py +1 -0
  224. tomwer/synctools/stacks/reconstruction/lamino.py +1 -3
  225. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +0 -2
  226. tomwer/synctools/test/test_darkRefs.py +32 -149
  227. tomwer/synctools/test/test_foldertransfer.py +1 -1
  228. tomwer/synctools/test/test_scanstages.py +2 -2
  229. tomwer/tests/__init__.py +0 -0
  230. tomwer/tests/conftest.py +51 -0
  231. tomwer/{test → tests}/test_scripts.py +1 -1
  232. tomwer/tests/test_utils.py +10 -0
  233. tomwer/{test → tests}/utils/utilstest.py +0 -11
  234. tomwer/version.py +3 -3
  235. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/METADATA +14 -16
  236. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/RECORD +245 -217
  237. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/WHEEL +1 -1
  238. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/entry_points.txt +6 -0
  239. orangecontrib/tomwer/setup.py +0 -45
  240. orangecontrib/tomwer/widgets/setup.py +0 -49
  241. tomwer/app/process.py +0 -153
  242. tomwer/core/process/reconstruction/nabu/slurm.py +0 -36
  243. tomwer/core/process/reconstruction/utils/nabu_slice_exec.py +0 -10
  244. tomwer/core/utils/laminoutils.py +0 -80
  245. tomwer/gui/utils/lineselector/lineselection.py +0 -76
  246. tomwer/setup.py +0 -52
  247. tomwer/web/client.py +0 -43
  248. tomwer/web/config.py +0 -36
  249. tomwer/web/test/test_graylog_connection.py +0 -59
  250. {tomwer/test → orangecontrib/tomwer/tutorials}/__init__.py +0 -0
  251. /tomwer/{web/test → gui/control/serie}/__init__.py +0 -0
  252. /tomwer/{test → tests}/utils/__init__.py +0 -0
  253. /tomwer-1.0.4-py3.8-nspkg.pth → /tomwer-1.1.0-py3.9-nspkg.pth +0 -0
  254. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/LICENSE +0 -0
  255. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/namespace_packages.txt +0 -0
  256. {tomwer-1.0.4.dist-info → tomwer-1.1.0.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.36.2)
2
+ Generator: bdist_wheel (0.38.4)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -7,5 +7,11 @@ html-index = orangecontrib.tomwer.widgets:WIDGET_HELP_PATH
7
7
  [orange.widgets]
8
8
  tomwer = orangecontrib.tomwer.widgets
9
9
 
10
+ [orange.widgets.tutorials]
11
+ FLUO = orangecontrib.tomwer.tutorials
12
+
10
13
  [orange3.addon]
11
14
  tomwer-add-on = orangecontrib.tomwer
15
+
16
+ [orangecanvas.examples]
17
+ FLUO = orangecontrib.tomwer.tutorials
@@ -1,45 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2016-2017 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
- __authors__ = ["H. Payno"]
27
- __license__ = "MIT"
28
- __date__ = "05/07/2017"
29
-
30
-
31
- from numpy.distutils.misc_util import Configuration
32
-
33
-
34
- def configuration(parent_package="", top_path=None):
35
- config = Configuration("tomwer", parent_package, top_path)
36
- config.add_subpackage("widgets")
37
- config.add_subpackage("test")
38
-
39
- return config
40
-
41
-
42
- if __name__ == "__main__":
43
- from numpy.distutils.core import setup
44
-
45
- setup(configuration=configuration)
@@ -1,49 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2016-2017 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
- __authors__ = ["H. Payno"]
27
- __license__ = "MIT"
28
- __date__ = "05/07/2017"
29
-
30
-
31
- from numpy.distutils.misc_util import Configuration
32
-
33
-
34
- def configuration(parent_package="", top_path=None):
35
- config = Configuration("widgets", parent_package, top_path)
36
- config.add_subpackage("control")
37
- config.add_subpackage("edit")
38
- config.add_subpackage("other")
39
- config.add_subpackage("reconstruction")
40
- config.add_subpackage("visualization")
41
- config.add_subpackage("test")
42
-
43
- return config
44
-
45
-
46
- if __name__ == "__main__":
47
- from numpy.distutils.core import setup
48
-
49
- setup(configuration=configuration)
tomwer/app/process.py DELETED
@@ -1,153 +0,0 @@
1
- #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
-
4
- import logging
5
- import sys
6
- import argparse
7
- from ewokscore import load_graph
8
- from ewoksorange.bindings import owsconvert
9
- from tomwer.core.scan.scanfactory import ScanFactory
10
- import tempfile
11
- import os
12
- from pprint import pprint
13
-
14
- logging.basicConfig(level=logging.WARNING)
15
- _logger = logging.getLogger(__name__)
16
-
17
-
18
- def exec_scans(name, ewoks_graph, scans=None, darkref_savedir=None):
19
- """
20
-
21
- :param ewoks_graph:
22
- :param scans: list of scan to execute
23
- :param timeout:
24
- :return:
25
- """
26
-
27
- def launch_():
28
- for scan in scans:
29
- exec_scan(name=name, ewoks_graph=ewoks_graph, scan=scan, save_dir=save_dir)
30
-
31
- if darkref_savedir is not None:
32
- if not os.path.exists(darkref_savedir):
33
- os.makedirs(darkref_savedir)
34
- launch_()
35
- else:
36
- with tempfile.TemporaryDirectory() as save_dir:
37
- launch_()
38
-
39
-
40
- def exec_scan(name, ewoks_graph, scan, save_dir):
41
- # set up workflow
42
- if len(ewoks_graph.start_nodes()) == 0:
43
- _logger.warning("no start nodes found. Enable to process")
44
- return None
45
- mess = f"start processing {name} with {str(scan)}"
46
- _logger.info(mess)
47
-
48
- # update scan parameter to start node
49
- for src_node in ewoks_graph.start_nodes():
50
- # provide the dataset to be used and save_dir
51
- # save_dir is used to provide dark ref with a directory to store
52
- # dark and ref to be copy
53
- ewoks_graph.graph.nodes[src_node]["default_inputs"].add(
54
- {({"name": "data", "value": scan})}
55
- )
56
-
57
- # update node with dark ref
58
- import tomwer.core.process.reconstruction.darkref.darkrefscopy
59
-
60
- qual_name = ".".join(
61
- [
62
- tomwer.core.process.reconstruction.darkref.darkrefscopy.__name__,
63
- tomwer.core.process.reconstruction.darkref.darkrefscopy.DarkRefsCopy.__qualname__,
64
- ]
65
- )
66
- for src_node in ewoks_graph.graph.nodes:
67
- # provide save_dir to 'darkref' class
68
- if ewoks_graph.graph.nodes[src_node]["class"] == qual_name:
69
- ewoks_graph.graph.nodes[src_node]["default_inputs"].add(
70
- {({"name": "save_dir", "value": save_dir})}
71
- )
72
- # insure all arguments are provided for each link because the scan object is hidding some
73
- # parameters
74
- for target_node in ewoks_graph.graph.nodes:
75
- if src_node == target_node:
76
- continue
77
- try:
78
- ewoks_graph.graph[src_node][target_node]["all_arguments"] = True
79
- del ewoks_graph.graph[src_node][target_node]["arguments"]
80
- except KeyError:
81
- pass
82
-
83
- print(f" start execution of graph {name} ".center(80, "#"))
84
- taskgraph = load_graph(ewoks_graph)
85
- pprint(taskgraph.dump())
86
- print(f" end execution of graph {name} ".center(80, "#"))
87
- ewoks_graph.execute()
88
-
89
-
90
- def main(argv):
91
- parser = argparse.ArgumentParser(description=__doc__)
92
- parser.add_argument(
93
- "workflow_file",
94
- help="Path to the .ows file defining the workflow to process with the"
95
- "provided scan",
96
- )
97
- parser.add_argument(
98
- "scan_path",
99
- help="Path to data to be processes (master file if come from an hdf5 "
100
- "acquisition or EDF files folder if come from an EDF acquisition)",
101
- )
102
- parser.add_argument(
103
- "--entry", default=None, help="An entry should be specify for hdf5 files"
104
- )
105
- parser.add_argument(
106
- "--timeout", default=None, help="Timeout for the workflow execution"
107
- )
108
- parser.add_argument(
109
- "--dkref-save-dir",
110
- default=None,
111
- dest="savedir",
112
- help="You can provide a save dir folder for the dark-ref copy task to"
113
- "insure persistency between several call of process.",
114
- )
115
- parser.add_argument(
116
- "--debug",
117
- dest="debug",
118
- action="store_true",
119
- default=False,
120
- help="Set logging system in debug mode",
121
- )
122
- options = parser.parse_args(argv[1:])
123
- if options.entry is not None:
124
- scan = ScanFactory.create_scan_object(
125
- options.scan_path, entry=options.entry, accept_bliss_scan=True
126
- )
127
- scans = (scan,)
128
- else:
129
- scans = ScanFactory.create_scan_objects(
130
- options.scan_path, accept_bliss_scan=True
131
- )
132
- if len(scans) > 1:
133
- _logger.info("More than one scan found. Will process every scans")
134
-
135
- # tune the log level
136
- log_level = logging.INFO
137
- if options.debug is True:
138
- log_level = logging.DEBUG
139
-
140
- for log_ in ("tomwer", "ewoks", "ewoksorange", "ewokscore"):
141
- logging.getLogger(log_).setLevel(log_level)
142
-
143
- scheme = owsconvert.ows_to_ewoks(options.workflow_file)
144
- exec_scans(
145
- name=os.path.basename(options.workflow_file),
146
- ewoks_graph=scheme,
147
- scans=scans,
148
- darkref_savedir=options.savedir,
149
- )
150
-
151
-
152
- if __name__ == "__main__":
153
- main(sys.argv)
@@ -1,36 +0,0 @@
1
- import subprocess
2
- import logging
3
-
4
- _logger = logging.getLogger(__name__)
5
-
6
-
7
- def check_n_gpu():
8
- try:
9
- from pycuda import driver
10
-
11
- driver.init()
12
- n_gpus = driver.Device.count()
13
- except Exception as e:
14
- raise e
15
- else:
16
- if n_gpus == 0:
17
- raise RuntimeError("No gpu detected to run nabu reconstruction")
18
- else:
19
- _logger.info(f"{n_gpus} detected by pycuda")
20
-
21
-
22
- def _exec_nabu_on_slurm(conf_file: str, scan_path: str) -> tuple:
23
- check_n_gpu()
24
-
25
- NABU_FULL_FIELD_APP_PATH = "nabu.app.reconstruct"
26
- # need to be executed in his own context
27
- command = " ".join(("python", "-m", NABU_FULL_FIELD_APP_PATH, conf_file))
28
- process = subprocess.Popen(
29
- command,
30
- shell=True,
31
- cwd=scan_path,
32
- stdout=subprocess.PIPE,
33
- stderr=subprocess.PIPE,
34
- )
35
- res = process.communicate()
36
- return res
@@ -1,10 +0,0 @@
1
- from nabu.pipeline.fullfield.chunked_cuda import CudaChunkedPipeline
2
- from nabu.pipeline.fullfield.processconfig import ProcessConfig
3
-
4
-
5
- def launch_reconstruction(config_file, slice_index):
6
- proc = ProcessConfig(config_file)
7
- worker_process = CudaChunkedPipeline(
8
- proc, sub_region=(None, None, slice_index, slice_index + 1)
9
- )
10
- worker_process.process_chunk()
@@ -1,80 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
- __authors__ = ["H. Payno"]
27
- __license__ = "MIT"
28
- __date__ = "22/06/2018"
29
-
30
-
31
- import fabio
32
- import os
33
- import logging
34
-
35
- logger = logging.getLogger(__name__)
36
-
37
-
38
- def getMotorInformationFromEDfFile(_file):
39
- """
40
-
41
- :param _file: file to the edf file containing header with information
42
- :return: dictionary with motor name as key and motor position as value
43
- :rtype: dict
44
- """
45
- assert type(_file) is str
46
- assert _file.endswith(".edf")
47
- if not os.path.isfile(_file):
48
- warn = "%s is not a valid file. Cannot retrieve motor information" % _file
49
- logger.warning(warn)
50
- return None
51
- else:
52
- with fabio.open(_file) as dsc:
53
- header = dsc.header
54
-
55
- if "motor_mne" not in header:
56
- logger.warning(
57
- 'key "motor_mne" not found in the file header.'
58
- "Cannot retrieve motor information"
59
- )
60
- return None
61
-
62
- if "motor_pos" not in header:
63
- logger.warning(
64
- 'key "motor_pos" not found in the file header.'
65
- "Cannot retrieve motor information"
66
- )
67
- return None
68
-
69
- motor_mne_lst = header["motor_mne"].split(" ")
70
- motor_pos_lst = header["motor_pos"].split(" ")
71
- if len(motor_mne_lst) != len(motor_pos_lst):
72
- logger.warning(
73
- "Incoherent number of motor_mne and motor_pos."
74
- "Cannot retrieve motor information"
75
- )
76
- return None
77
- res = {}
78
- for mne, pos in zip(motor_mne_lst, motor_pos_lst):
79
- res[mne] = pos
80
- return res
@@ -1,76 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2016 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
- __authors__ = ["H. Payno"]
27
- __license__ = "MIT"
28
- __date__ = "25/09/2017"
29
-
30
- import re
31
- import numpy
32
-
33
- SELECTION_PATTERN = re.compile(r"\d?[:]?\d?")
34
-
35
-
36
- def selectionIsValid(selection):
37
- """
38
- Return true if the given selection as a string is valid
39
-
40
- :return: bool
41
- """
42
- assert type(selection) is str
43
- _selection = selection.replace(" ", "")
44
- selections = _selection.split(";")
45
- for sel in selections:
46
- if not re.match(SELECTION_PATTERN, sel):
47
- return False
48
- return True
49
-
50
-
51
- def getSelection(projections, selection):
52
- """
53
-
54
- :param str selection:
55
- :return numpy.ndarray:
56
- """
57
-
58
- def evalSelection(projections, sel):
59
- assert type(projections) is numpy.ndarray
60
- return eval("projections[" + sel + "]")
61
-
62
- assert type(selection) is str
63
- if selection == "":
64
- return projections
65
- _selection = selection.replace(" ", "")
66
- selections = _selection.split(";")
67
- if len(selections) == 1:
68
- return evalSelection(projections, selection)
69
- else:
70
- res = None
71
- for iSel, sel in enumerate(range(len(selections))):
72
- if iSel == 0:
73
- res = evalSelection(projections, selections[iSel])
74
- else:
75
- res = numpy.append(res, evalSelection(projections, selections[iSel]))
76
- return res
tomwer/setup.py DELETED
@@ -1,52 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2016-2017 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
- __authors__ = ["H. Payno"]
27
- __license__ = "MIT"
28
- __date__ = "04/01/2018"
29
-
30
-
31
- from numpy.distutils.misc_util import Configuration
32
-
33
-
34
- def configuration(parent_package="", top_path=None):
35
- config = Configuration("tomwer", parent_package, top_path)
36
- config.add_subpackage("app")
37
- config.add_subpackage("core")
38
- config.add_subpackage("gui")
39
- config.add_subpackage("io")
40
- config.add_subpackage("resources")
41
- config.add_subpackage("synctools")
42
- config.add_subpackage("test")
43
- config.add_subpackage("third_party")
44
- config.add_subpackage("web")
45
-
46
- return config
47
-
48
-
49
- if __name__ == "__main__":
50
- from numpy.distutils.core import setup
51
-
52
- setup(configuration=configuration)
tomwer/web/client.py DELETED
@@ -1,43 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- # Copyright (C) 2016 European Synchrotron Radiation Facility
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
22
- #
23
- #############################################################################*/
24
- """module defining functions and class to communicate a status to the
25
- orange-server.
26
- The orange-server is used to display the advancement of the workflow.
27
- """
28
-
29
- __authors__ = ["H.Payno"]
30
- __license__ = "MIT"
31
- __date__ = "28/04/2017"
32
-
33
-
34
- import logging
35
-
36
- _logger = logging.getLogger(__name__)
37
-
38
-
39
- class OWClient(object):
40
- """Orange widget Client can emit information about his advancement"""
41
-
42
- WORKFLOW_INFO = "workflow" # general information about a workflow
43
- SCAN_INFO = "scan" # information focus on a scan
tomwer/web/config.py DELETED
@@ -1,36 +0,0 @@
1
- # coding: utf-8
2
- ###########################################################################
3
- # Copyright (C) 2016 European Synchrotron Radiation Facility
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
22
- #
23
- #############################################################################
24
- """module defining functions and class to communicate a status to the
25
- orange-server.
26
- The orange-server is used to display the advancement of the workflow.
27
- """
28
-
29
- __authors__ = ["H.Payno"]
30
- __license__ = "MIT"
31
- __date__ = "11/05/2017"
32
-
33
- grayport_port = 12204
34
- """Port of connection"""
35
- grayport_host = "graylog-dau"
36
- """host of connection"""
@@ -1,59 +0,0 @@
1
- # # coding: utf-8
2
- # # /*##########################################################################
3
- # #
4
- # # Copyright (c) 2016-2017 European Synchrotron Radiation Facility
5
- # #
6
- # # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # # of this software and associated documentation files (the "Software"), to deal
8
- # # in the Software without restriction, including without limitation the rights
9
- # # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # # copies of the Software, and to permit persons to whom the Software is
11
- # # furnished to do so, subject to the following conditions:
12
- # #
13
- # # The above copyright notice and this permission notice shall be included in
14
- # # all copies or substantial portions of the Software.
15
- # #
16
- # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # # THE SOFTWARE.
23
- # #
24
- # # ###########################################################################*/
25
- # """ Not a unit test but send a simple test message error to gray log"""
26
- #
27
- # __authors__ = ["H. Payno"]
28
- # __license__ = "MIT"
29
- # __date__ = "24/01/2017"
30
- #
31
- # from tomwer.web.client import OWClient
32
- # import logging
33
- #
34
- # logger = logging.getLogger(__name__)
35
- #
36
- #
37
- # class TestGrayLog(OWClient):
38
- # def __init__(self):
39
- # OWClient.__init__(self)
40
- #
41
- # def sendErrorMessage(self):
42
- # logger.error("test error message")
43
- #
44
- # def sendwarningMessage(self):
45
- # logger.warning("test warning message")
46
- #
47
- # def sendInfoMessage(self):
48
- # logger.info("test info message")
49
- #
50
- # def sendProcessEndedMessage(self):
51
- # logger.processEnded("test processEnded message")
52
- #
53
- #
54
- # if __name__ == "__main__":
55
- # c = TestGrayLog()
56
- # c.sendErrorMessage()
57
- # c.sendwarningMessage()
58
- # c.sendInfoMessage()
59
- # c.sendProcessEndedMessage()
File without changes
File without changes