tomwer 1.4.19__py3-none-any.whl → 1.5.0rc3__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 (124) hide show
  1. orangecontrib/tomwer/tutorials/simple_volume_local_reconstruction.ows +11 -8
  2. orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +12 -9
  3. orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +1 -1
  4. orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +21 -10
  5. tomwer/app/axis.py +1 -1
  6. tomwer/app/reducedarkflat.py +2 -2
  7. tomwer/core/process/control/datalistener/rpcserver.py +2 -8
  8. tomwer/core/process/drac/binning.py +2 -2
  9. tomwer/core/process/drac/output.py +1 -1
  10. tomwer/core/process/edit/imagekeyeditor.py +4 -6
  11. tomwer/core/process/edit/nxtomoeditor.py +58 -20
  12. tomwer/core/process/output.py +6 -5
  13. tomwer/core/process/reconstruction/axis/anglemode.py +2 -2
  14. tomwer/core/process/reconstruction/axis/axis.py +1 -0
  15. tomwer/core/process/reconstruction/axis/mode.py +2 -2
  16. tomwer/core/process/reconstruction/axis/params.py +4 -4
  17. tomwer/core/process/reconstruction/axis/projectiontype.py +1 -1
  18. tomwer/core/process/reconstruction/axis/side.py +1 -1
  19. tomwer/core/process/reconstruction/darkref/darkrefs.py +2 -2
  20. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +1 -1
  21. tomwer/core/process/reconstruction/darkref/params.py +2 -3
  22. tomwer/core/process/reconstruction/nabu/castvolume.py +4 -1
  23. tomwer/core/process/reconstruction/nabu/helical.py +3 -1
  24. tomwer/core/process/reconstruction/nabu/nabucommon.py +2 -2
  25. tomwer/core/process/reconstruction/nabu/nabuscores.py +1 -1
  26. tomwer/core/process/reconstruction/nabu/nabuslices.py +4 -4
  27. tomwer/core/process/reconstruction/nabu/plane.py +2 -2
  28. tomwer/core/process/reconstruction/nabu/target.py +1 -1
  29. tomwer/core/process/reconstruction/nabu/test/test_castvolume.py +2 -0
  30. tomwer/core/process/reconstruction/nabu/test/test_nabu_utils.py +9 -0
  31. tomwer/core/process/reconstruction/nabu/utils.py +18 -14
  32. tomwer/core/process/reconstruction/normalization/normalization.py +1 -1
  33. tomwer/core/process/reconstruction/normalization/params.py +4 -4
  34. tomwer/core/process/reconstruction/output.py +2 -2
  35. tomwer/core/process/reconstruction/saaxis/params.py +3 -3
  36. tomwer/core/process/reconstruction/saaxis/saaxis.py +1 -1
  37. tomwer/core/process/reconstruction/scores/params.py +2 -2
  38. tomwer/core/process/reconstruction/scores/scores.py +3 -3
  39. tomwer/core/process/reconstruction/tests/test_axis.py +1 -1
  40. tomwer/core/process/stitching/metadataholder.py +5 -5
  41. tomwer/core/process/stitching/nabustitcher.py +1 -4
  42. tomwer/core/process/tests/test_normalization.py +2 -1
  43. tomwer/core/scan/edfscan.py +3 -3
  44. tomwer/core/scan/nxtomoscan.py +3 -3
  45. tomwer/core/scan/scanbase.py +3 -3
  46. tomwer/core/scan/scantype.py +1 -1
  47. tomwer/core/settings.py +1 -1
  48. tomwer/core/tomwer_object.py +1 -1
  49. tomwer/core/utils/nxtomoutils.py +2 -2
  50. tomwer/core/utils/spec.py +6 -3
  51. tomwer/gui/cluster/slurm.py +3 -3
  52. tomwer/gui/configuration/level.py +1 -1
  53. tomwer/gui/control/actions.py +1 -1
  54. tomwer/gui/control/datadiscovery.py +1 -1
  55. tomwer/gui/control/datalist.py +1 -1
  56. tomwer/gui/control/reducedarkflatselector.py +4 -4
  57. tomwer/gui/control/series/seriescreator.py +5 -5
  58. tomwer/gui/control/tomoobjdisplaymode.py +1 -1
  59. tomwer/gui/dataportal/gallery.py +6 -6
  60. tomwer/gui/edit/imagekeyeditor.py +7 -9
  61. tomwer/gui/edit/nxtomoeditor.py +420 -112
  62. tomwer/gui/edit/tests/test_nx_editor.py +155 -83
  63. tomwer/gui/reconstruction/axis/CalculationWidget.py +1 -1
  64. tomwer/gui/reconstruction/axis/EstimatedCORWidget.py +12 -8
  65. tomwer/gui/reconstruction/axis/EstimatedCorComboBox.py +2 -2
  66. tomwer/gui/reconstruction/axis/InputWidget.py +3 -3
  67. tomwer/gui/reconstruction/darkref/darkrefwidget.py +2 -2
  68. tomwer/gui/reconstruction/nabu/castvolume.py +16 -1
  69. tomwer/gui/reconstruction/nabu/nabuconfig/base.py +2 -4
  70. tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py +6 -6
  71. tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +1 -1
  72. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +5 -5
  73. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +2 -4
  74. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +78 -52
  75. tomwer/gui/reconstruction/nabu/nabuflow.py +3 -13
  76. tomwer/gui/reconstruction/nabu/slices.py +11 -11
  77. tomwer/gui/reconstruction/nabu/test/test_cast_volume.py +19 -0
  78. tomwer/gui/reconstruction/nabu/volume.py +1 -1
  79. tomwer/gui/reconstruction/normalization/intensity.py +8 -12
  80. tomwer/gui/reconstruction/saaxis/corrangeselector.py +2 -2
  81. tomwer/gui/reconstruction/saaxis/dimensionwidget.py +71 -67
  82. tomwer/gui/reconstruction/sacommon.py +1 -1
  83. tomwer/gui/reconstruction/scores/scoreplot.py +18 -10
  84. tomwer/gui/reconstruction/tests/test_saaxis.py +18 -16
  85. tomwer/gui/stitching/SingleAxisStitchingWidget.py +8 -8
  86. tomwer/gui/stitching/StitchingOptionsWidget.py +1 -1
  87. tomwer/gui/stitching/alignment.py +8 -8
  88. tomwer/gui/stitching/config/axisparams.py +2 -2
  89. tomwer/gui/stitching/config/output.py +1 -1
  90. tomwer/gui/stitching/config/positionoveraxis.py +1 -1
  91. tomwer/gui/stitching/config/stitchingstrategies.py +4 -6
  92. tomwer/gui/stitching/config/tomoobjdetails.py +21 -13
  93. tomwer/gui/stitching/normalization.py +6 -6
  94. tomwer/gui/stitching/tests/test_ZStitchingWindow.py +8 -1
  95. tomwer/gui/stitching/tests/test_preview.py +10 -7
  96. tomwer/gui/stitching/tests/utils.py +27 -18
  97. tomwer/gui/stitching/z_stitching/fineestimation.py +7 -9
  98. tomwer/gui/stitching/z_stitching/tests/test_raw_estimation.py +18 -7
  99. tomwer/gui/stitching/z_stitching/tests/test_stitching_window.py +7 -2
  100. tomwer/gui/utils/buttons.py +53 -35
  101. tomwer/gui/utils/flow.py +2 -2
  102. tomwer/gui/utils/loadingmode.py +1 -1
  103. tomwer/gui/utils/unitsystem.py +44 -33
  104. tomwer/gui/utils/vignettes.py +1 -1
  105. tomwer/gui/visualization/dataviewer.py +7 -7
  106. tomwer/gui/visualization/diffviewer/diffviewer.py +4 -4
  107. tomwer/gui/visualization/diffviewer/shiftwidget.py +4 -6
  108. tomwer/gui/visualization/reconstructionparameters.py +35 -23
  109. tomwer/gui/visualization/scanoverview.py +28 -11
  110. tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +25 -13
  111. tomwer/gui/visualization/test/test_reconstruction_parameters.py +2 -2
  112. tomwer/model/dataset.py +0 -0
  113. tomwer/synctools/utils/scanstages.py +3 -3
  114. tomwer/tasks/reconstruction/cleardarkflat.py +42 -0
  115. tomwer/tests/app/test_stitching.py +1 -1
  116. tomwer/tests/orangecontrib/tomwer/widgets/edit/tests/test_nxtomo_editor.py +32 -20
  117. tomwer/tests/orangecontrib/tomwer/widgets/reconstruction/tests/test_nabu_widget.py +1 -1
  118. tomwer/version.py +4 -4
  119. {tomwer-1.4.19.dist-info → tomwer-1.5.0rc3.dist-info}/METADATA +8 -8
  120. {tomwer-1.4.19.dist-info → tomwer-1.5.0rc3.dist-info}/RECORD +124 -122
  121. {tomwer-1.4.19.dist-info → tomwer-1.5.0rc3.dist-info}/WHEEL +1 -1
  122. {tomwer-1.4.19.dist-info → tomwer-1.5.0rc3.dist-info}/entry_points.txt +0 -0
  123. {tomwer-1.4.19.dist-info → tomwer-1.5.0rc3.dist-info}/licenses/LICENSE +0 -0
  124. {tomwer-1.4.19.dist-info → tomwer-1.5.0rc3.dist-info}/top_level.txt +0 -0
@@ -3,6 +3,7 @@ import pickle
3
3
 
4
4
  import numpy
5
5
  import pytest
6
+ import pint
6
7
  from nxtomomill.nexus.nxtomo import NXtomo
7
8
  from orangecanvas.scheme.readwrite import literal_dumps
8
9
  from silx.gui.utils.testutils import SignalListener
@@ -15,15 +16,21 @@ from tomwer.tests.utils import skip_gui_test
15
16
  from tomwer.gui.utils.qt_utils import QSignalSpy
16
17
  from tomwer.tests.conftest import qtapp # noqa F401
17
18
 
19
+ _ureg = pint.get_application_registry()
20
+
18
21
 
19
22
  def getDefaultConfig() -> dict:
20
23
  """return the configuration of the NXtomo editor. First value is the value of the field, second is: is the associated lock button locked or not"""
21
24
  return {
22
25
  NXtomoEditorKeys.ENERGY: (5.9, False),
26
+ NXtomoEditorKeys.SAMPLE_SOURCE_DISTANCE: (-55.2, False),
27
+ NXtomoEditorKeys.PROPAGATION_DISTANCE: (10.1, True),
23
28
  NXtomoEditorKeys.SAMPLE_DETECTOR_DISTANCE: (2.4, True),
24
29
  NXtomoEditorKeys.FIELD_OF_VIEW: ("Full", False),
25
- NXtomoEditorKeys.X_PIXEL_SIZE: (0.023, True),
26
- NXtomoEditorKeys.Y_PIXEL_SIZE: (0.025, True),
30
+ NXtomoEditorKeys.DETECTOR_X_PIXEL_SIZE: (0.023, True),
31
+ NXtomoEditorKeys.DETECTOR_Y_PIXEL_SIZE: (0.025, True),
32
+ NXtomoEditorKeys.SAMPLE_X_PIXEL_SIZE: (0.24, True),
33
+ NXtomoEditorKeys.SAMPLE_Y_PIXEL_SIZE: (0.26, True),
27
34
  NXtomoEditorKeys.X_FLIPPED: (True, True),
28
35
  NXtomoEditorKeys.Y_FLIPPED: (False, False),
29
36
  NXtomoEditorKeys.X_TRANSLATION: (0.0,),
@@ -49,41 +56,41 @@ def test_NXtomoEditorOW(
49
56
  signal_listener = SignalListener()
50
57
  window.sigScanReady.connect(signal_listener)
51
58
  # set up the widget to define and lock distance, energy and x pixel size
52
- distance_widget = window.widget.mainWidget._distanceMetricEntry
53
- distance_widget.setValue(0.6)
54
- distance_widget.setUnit("mm")
55
- distance_locker = window.widget.mainWidget._distanceLB
59
+ distance_widget = window.widget.mainWidget._sampleDetectorDistanceMetricEntry
60
+ distance_widget.setValue(value_m=0.6)
61
+ distance_widget.setUnit(_ureg.millimeter)
62
+ distance_locker = window.widget.mainWidget._sampleDetectorDistanceLB
56
63
  distance_locker.setLock(True)
57
64
  energy_widget = window.widget.mainWidget._energyEntry
58
65
  energy_widget.setValue(88.058)
59
66
  energy_locker = window.widget.mainWidget._energyLockerLB
60
67
  energy_locker.setLock(True)
61
- x_pixel_widget = window.widget.mainWidget._xPixelSizeMetricEntry
62
- x_pixel_widget.setValue(45)
63
- x_pixel_widget.setUnit("nm")
64
- x_pixel_locker = window.widget.mainWidget._xPixelSizeLB
68
+ x_pixel_widget = window.widget.mainWidget._xDetectorPixelSizeMetricEntry
69
+ x_pixel_widget.setValue(value_m=45)
70
+ x_pixel_widget.setUnit(_ureg.nanometer)
71
+ x_pixel_locker = window.widget.mainWidget._xDetectorPixelSizeLB
65
72
  x_pixel_locker.setLock(True)
66
73
 
67
74
  # 1.0 create nx tomos with raw data
68
75
  nx_tomo = NXtomo()
69
76
  nx_tomo.instrument.detector.x_pixel_size = (
70
- 0.023 # should be overwrite by the configuration / lock buttons
77
+ 0.023 * _ureg.meter # should be overwrite by the configuration / lock buttons
71
78
  )
72
79
  nx_tomo.instrument.detector.y_pixel_size = (
73
- 0.025 # should be overwrite by the configuration / lock buttons
80
+ 0.025 * _ureg.meter # should be overwrite by the configuration / lock buttons
74
81
  )
75
82
  nx_tomo.instrument.detector.field_of_view = "full"
76
83
  nx_tomo.instrument.detector.distance = (
77
- 2.4 # should be overwrite by the configuration / lock buttons
84
+ 2.4 * _ureg.meter # should be overwrite by the configuration / lock buttons
78
85
  )
79
86
  nx_tomo.instrument.detector.x_flipped = (
80
87
  False # should be overwrite by the configuration / lock buttons
81
88
  )
82
89
  nx_tomo.instrument.detector.y_flipped = True
83
- nx_tomo.energy = 5.9
90
+ nx_tomo.energy = 5.9 * _ureg.keV
84
91
  nx_tomo.instrument.detector.image_key_control = [ImageKey.PROJECTION.value] * 12
85
92
  nx_tomo.instrument.detector.data = numpy.empty(shape=(12, 10, 10))
86
- nx_tomo.sample.rotation_angle = numpy.linspace(0, 20, num=12)
93
+ nx_tomo.sample.rotation_angle = numpy.linspace(0, 20, num=12) * _ureg.degree
87
94
 
88
95
  file_path = os.path.join(tmp_path, "nxtomo.nx")
89
96
  entry = "entry0000"
@@ -109,18 +116,20 @@ def test_NXtomoEditorOW(
109
116
  detector_data_as="as_numpy_array",
110
117
  )
111
118
  numpy.testing.assert_almost_equal(
112
- overwrite_nx_tomo.instrument.detector.x_pixel_size.si_value, 45e-9
119
+ overwrite_nx_tomo.instrument.detector.x_pixel_size.to_base_units().magnitude,
120
+ (45e-9 * _ureg.meter).to_base_units().magnitude,
113
121
  )
114
122
  assert (
115
- overwrite_nx_tomo.instrument.detector.y_pixel_size.si_value
116
- == nx_tomo.instrument.detector.y_pixel_size.si_value
123
+ overwrite_nx_tomo.instrument.detector.y_pixel_size
124
+ == nx_tomo.instrument.detector.y_pixel_size
117
125
  )
118
126
  assert (
119
127
  overwrite_nx_tomo.instrument.detector.field_of_view
120
128
  == nx_tomo.instrument.detector.field_of_view
121
129
  )
122
130
  numpy.testing.assert_almost_equal(
123
- overwrite_nx_tomo.instrument.detector.distance.value, 6.0e-4
131
+ overwrite_nx_tomo.instrument.detector.distance.to_base_units().magnitude,
132
+ (6.0e-4 * _ureg.meter).to_base_units().magnitude,
124
133
  )
125
134
  assert (
126
135
  overwrite_nx_tomo.instrument.detector.x_flipped
@@ -131,7 +140,10 @@ def test_NXtomoEditorOW(
131
140
  overwrite_nx_tomo.instrument.detector.y_flipped
132
141
  == True # is not locked and is initially set to False (should load it and ignore overwriting)
133
142
  )
134
- numpy.testing.assert_almost_equal(overwrite_nx_tomo.energy.value, 88.058)
143
+ numpy.testing.assert_almost_equal(
144
+ overwrite_nx_tomo.energy.to_base_units().magnitude,
145
+ (88.058 * _ureg.keV).to_base_units().magnitude,
146
+ )
135
147
  numpy.testing.assert_array_almost_equal(
136
148
  overwrite_nx_tomo.instrument.detector.data,
137
149
  nx_tomo.instrument.detector.data,
@@ -101,7 +101,7 @@ class TestNabuWidget(TestCaseQt):
101
101
  self.wait_processing()
102
102
  self.assertEqual(self.widget.getMode(), _NabuMode.HALF_ACQ)
103
103
  self.patch_fov(value=FOV.FULL.value)
104
- self.scan.clear_caches()
104
+ self.scan.clear_cache()
105
105
  self.widget.process(self.scan)
106
106
  self.wait_processing()
107
107
  self.assertEqual(self.widget.getMode(), _NabuMode.FULL_FIELD)
tomwer/version.py CHANGED
@@ -76,10 +76,10 @@ RELEASE_LEVEL_VALUE = {
76
76
  }
77
77
 
78
78
  MAJOR = 1
79
- MINOR = 4
80
- MICRO = 19
81
- RELEV = "final" # <16
82
- SERIAL = 0 # <16
79
+ MINOR = 5
80
+ MICRO = 0
81
+ RELEV = "rc" # <16
82
+ SERIAL = 3 # <16
83
83
 
84
84
  date = __date__
85
85
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tomwer
3
- Version: 1.4.19
3
+ Version: 1.5.0rc3
4
4
  Summary: "tomography workflow tools"
5
5
  Home-page: https://gitlab.esrf.fr/tomotools/tomwer
6
6
  Author: Henri Payno, Pierre Paleo, Pierre-Olivier Autran, Jérôme Lesaint, Alessandro Mirone
@@ -18,22 +18,22 @@ Classifier: Operating System :: POSIX
18
18
  Classifier: Natural Language :: English
19
19
  Classifier: Topic :: Scientific/Engineering :: Physics
20
20
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
- Requires-Python: >=3.6
21
+ Requires-Python: >=3.9
22
22
  Description-Content-Type: text/x-rst
23
23
  License-File: LICENSE
24
24
  Requires-Dist: numpy
25
25
  Requires-Dist: setuptools
26
26
  Requires-Dist: psutil
27
- Requires-Dist: silx[full]<2.1.1,>=2.0
28
- Requires-Dist: tomoscan>=2.1.0a18
29
- Requires-Dist: nxtomo<2.0,>=1.3.0dev4
30
- Requires-Dist: nxtomomill>=1.1.0a0
27
+ Requires-Dist: silx[full]>=2.1.1
28
+ Requires-Dist: tomoscan>=2.2.0a6
29
+ Requires-Dist: nxtomo>=2.0.0dev2
30
+ Requires-Dist: nxtomomill>=1.2.0dev1
31
31
  Requires-Dist: processview>=1.5.0
32
32
  Requires-Dist: ewoks>=0.1.1
33
33
  Requires-Dist: ewokscore<1.1.0
34
34
  Requires-Dist: sluurp>=0.4.1
35
35
  Requires-Dist: packaging
36
- Requires-Dist: pyunitsystem>=2.0.0a
36
+ Requires-Dist: pint
37
37
  Requires-Dist: tqdm
38
38
  Provides-Extra: full-base
39
39
  Requires-Dist: orange-canvas-core; extra == "full-base"
@@ -227,7 +227,7 @@ Requires-Dist: ewoksnotify[full]; extra == "test"
227
227
  Requires-Dist: pyicat_plus; extra == "test"
228
228
  Requires-Dist: nabu>=2023.3.1dev; extra == "test"
229
229
  Requires-Dist: pytest-asyncio; extra == "test"
230
- Requires-Dist: tomoscan[test]>=2.1.0a18; extra == "test"
230
+ Requires-Dist: tomoscan[test]>=2.2.0a6; extra == "test"
231
231
  Provides-Extra: setup-requires
232
232
  Requires-Dist: setuptools; extra == "setup-requires"
233
233
  Requires-Dist: numpy>=1.12; extra == "setup-requires"