tomwer 1.4.0__py3-none-any.whl → 1.4.0rc0__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 (53) hide show
  1. orangecontrib/tomwer/tutorials/test_cor.ows +3 -3
  2. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +14 -6
  3. orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +2 -4
  4. tomwer/app/axis.py +3 -0
  5. tomwer/app/multipag.py +3 -11
  6. tomwer/core/process/reconstruction/axis/axis.py +736 -27
  7. tomwer/core/process/reconstruction/axis/mode.py +24 -86
  8. tomwer/core/process/reconstruction/axis/params.py +138 -127
  9. tomwer/core/process/reconstruction/nabu/nabuscores.py +22 -19
  10. tomwer/core/process/reconstruction/nabu/nabuslices.py +1 -5
  11. tomwer/core/process/reconstruction/saaxis/saaxis.py +4 -4
  12. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +4 -4
  13. tomwer/core/process/reconstruction/tests/test_axis.py +1 -1
  14. tomwer/core/process/reconstruction/tests/test_utils.py +4 -4
  15. tomwer/core/process/reconstruction/utils/cor.py +4 -8
  16. tomwer/core/process/tests/test_axis.py +231 -0
  17. tomwer/core/process/tests/test_nabu.py +3 -1
  18. tomwer/core/scan/nxtomoscan.py +0 -2
  19. tomwer/core/scan/scanbase.py +4 -4
  20. tomwer/core/scan/tests/test_process_registration.py +18 -0
  21. tomwer/gui/reconstruction/axis/AxisMainWindow.py +9 -20
  22. tomwer/gui/reconstruction/axis/AxisOptionsWidget.py +79 -239
  23. tomwer/gui/reconstruction/axis/AxisSettingsWidget.py +17 -38
  24. tomwer/gui/reconstruction/axis/AxisWidget.py +8 -16
  25. tomwer/gui/reconstruction/axis/CalculationWidget.py +200 -44
  26. tomwer/gui/reconstruction/axis/ControlWidget.py +2 -10
  27. tomwer/gui/reconstruction/axis/InputWidget.py +155 -11
  28. tomwer/gui/reconstruction/saaxis/corrangeselector.py +10 -19
  29. tomwer/gui/reconstruction/scores/scoreplot.py +2 -5
  30. tomwer/gui/reconstruction/tests/test_nabu.py +0 -8
  31. tomwer/gui/stitching/config/axisparams.py +0 -2
  32. tomwer/gui/stitching/z_stitching/fineestimation.py +1 -1
  33. tomwer/gui/tests/test_axis_gui.py +15 -31
  34. tomwer/synctools/stacks/reconstruction/axis.py +23 -5
  35. tomwer/synctools/stacks/reconstruction/dkrefcopy.py +1 -1
  36. tomwer/synctools/stacks/reconstruction/nabu.py +2 -2
  37. tomwer/synctools/stacks/reconstruction/normalization.py +1 -1
  38. tomwer/synctools/stacks/reconstruction/saaxis.py +1 -1
  39. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +1 -1
  40. tomwer/tests/orangecontrib/tomwer/widgets/reconstruction/tests/test_axis.py +16 -0
  41. tomwer/tests/test_ewoks/test_single_node_execution.py +1 -1
  42. tomwer/tests/test_ewoks/test_workflows.py +1 -1
  43. tomwer/version.py +1 -1
  44. {tomwer-1.4.0.dist-info → tomwer-1.4.0rc0.dist-info}/METADATA +3 -3
  45. {tomwer-1.4.0.dist-info → tomwer-1.4.0rc0.dist-info}/RECORD +49 -52
  46. tomwer/core/process/reconstruction/axis/side.py +0 -8
  47. tomwer/gui/fonts.py +0 -5
  48. tomwer/gui/reconstruction/axis/EstimatedCORWidget.py +0 -394
  49. tomwer/gui/reconstruction/axis/EstimatedCorComboBox.py +0 -118
  50. {tomwer-1.4.0.dist-info → tomwer-1.4.0rc0.dist-info}/LICENSE +0 -0
  51. {tomwer-1.4.0.dist-info → tomwer-1.4.0rc0.dist-info}/WHEEL +0 -0
  52. {tomwer-1.4.0.dist-info → tomwer-1.4.0rc0.dist-info}/entry_points.txt +0 -0
  53. {tomwer-1.4.0.dist-info → tomwer-1.4.0rc0.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,6 @@
1
1
  import logging
2
2
 
3
3
  from silx.utils.enum import Enum as _Enum
4
- from tomwer.core.process.reconstruction.axis.side import Side
5
4
 
6
5
  _logger = logging.getLogger(__name__)
7
6
 
@@ -12,14 +11,6 @@ class AxisModeMetadata:
12
11
 
13
12
  Ease processing and display
14
13
  Maybe this function should be part of nabu ?
15
-
16
- :param lockable: True if this value can be lock and process automatically when a new scan is received
17
- :param tooltip: short description of the mode (to be used by the GUI)
18
- :param computing_constrains: some constrain like need to have a 0-360 acquisition (so no Half acquisition)
19
- :param allows_padding: does the algorithm applies padding (and so can the user provide some mode)
20
- :param valid_inputs: compatible input type (pair of radios or sinogram...)
21
- :param valid_sides: can a side be provided
22
- :param allows_estimated_cor_as_numerical_value: can a numerical value (first guess) be provided to the algorithm
23
14
  """
24
15
 
25
16
  def __init__(
@@ -30,7 +21,6 @@ class AxisModeMetadata:
30
21
  allows_padding=False,
31
22
  valid_inputs=(),
32
23
  valid_sides=(),
33
- allows_estimated_cor_as_numerical_value: bool = True,
34
24
  ) -> None:
35
25
  self._lockable = lockable
36
26
  self._tooltip = tooltip
@@ -38,9 +28,6 @@ class AxisModeMetadata:
38
28
  self._allows_padding = allows_padding
39
29
  self._valid_inputs = valid_inputs
40
30
  self._valid_sides = valid_sides
41
- self._allows_estimated_cor_as_numerical_value = (
42
- allows_estimated_cor_as_numerical_value
43
- )
44
31
 
45
32
  @property
46
33
  def is_lockable(self) -> bool:
@@ -66,10 +53,6 @@ class AxisModeMetadata:
66
53
  def valid_sides(self) -> tuple:
67
54
  return self._valid_sides
68
55
 
69
- @property
70
- def allows_estimated_cor_as_numerical_value(self) -> bool:
71
- return self._allows_estimated_cor_as_numerical_value
72
-
73
56
 
74
57
  class _InputType(_Enum):
75
58
  SINOGRAM = "sinogram"
@@ -86,57 +69,35 @@ class AxisMode(_Enum):
86
69
  global_ = "global"
87
70
  manual = "manual"
88
71
  growing_window_sinogram = "sino-growing-window"
89
- growing_window_radios = "growing-window"
72
+ growing_window_radios = "radios-growing-window"
90
73
  sliding_window_sinogram = "sino-sliding-window"
91
- sliding_window_radios = "sliding-window"
74
+ sliding_window_radios = "radios-sliding-window"
92
75
  sino_coarse_to_fine = "sino-coarse-to-fine"
93
76
  composite_coarse_to_fine = "composite-coarse-to-fine"
94
- fourier_angles = "fourier-angles"
95
- octave_accurate_radios = "octave-accurate"
96
- read = "read 'x_rotation_axis_pixel_position'"
77
+ sino_fourier_angles = "sino-fourier-angles"
78
+ octave_accurate_radios = "radios-octave-accurate"
79
+ read = "read from estimated cor"
97
80
  # alias to composite_coarse_to_fine with near mode
98
81
  near = "near"
99
82
 
100
83
  @classmethod
101
84
  def from_value(cls, value):
102
- # ensure backward compatibility with workflow defined before COR method on sinograms
103
- if value in ("global_", "global"):
104
- value = AxisMode.global_
105
- if value == "radio-growing-window":
85
+ # ensure backward compatiblity with workflow defined before COR method on sinograms
86
+ if value == "growing-window":
106
87
  _logger.warning(
107
- f"Axis mode requested is '{value}'. To insure backward compatibility replace it by '{AxisMode.growing_window_radios.value}'"
88
+ "Axis mode requested is 'growing-window'. To insure backward compatibility replace it by 'growing-window-radios'"
108
89
  )
109
90
  value = AxisMode.growing_window_radios
110
- elif value == "radio-sliding-window":
91
+ elif value == "sliding-window":
111
92
  _logger.warning(
112
- f"Axis mode requested is '{value}'. To insure backward compatibility replace it by '{AxisMode.sliding_window_radios.value}'"
93
+ "Axis mode requested is 'sliding-window'. To insure backward compatibility replace it by 'sliding-window-radios'"
113
94
  )
114
95
  value = AxisMode.sliding_window_radios
115
- elif value in ("radios-octave-accurate", "accurate"):
116
- _logger.warning(
117
- f"Axis mode requested is '{value}'. To insure backward compatibility replace it by '{AxisMode.octave_accurate_radios.value}'"
118
- )
119
- value = AxisMode.octave_accurate_radios
120
- elif value in ("read", "read from estimated cor"):
96
+ elif value == "read":
121
97
  value = AxisMode.read
122
98
 
123
99
  return super().from_value(value=value)
124
100
 
125
- def requires_radio_indices(self) -> bool:
126
- return self in (
127
- AxisMode.growing_window_radios,
128
- AxisMode.sliding_window_radios,
129
- AxisMode.octave_accurate_radios,
130
- )
131
-
132
- def requires_sinogram_index(self) -> bool:
133
- return self in (
134
- AxisMode.growing_window_sinogram,
135
- AxisMode.sliding_window_sinogram,
136
- AxisMode.fourier_angles,
137
- AxisMode.sino_coarse_to_fine,
138
- )
139
-
140
101
 
141
102
  AXIS_MODE_METADATAS = {
142
103
  # manual
@@ -146,7 +107,6 @@ AXIS_MODE_METADATAS = {
146
107
  computing_constrains=(),
147
108
  allows_padding=False,
148
109
  valid_inputs=(_InputType.RADIOS_X2,),
149
- allows_estimated_cor_as_numerical_value=False,
150
110
  ),
151
111
  # read
152
112
  AxisMode.read: AxisModeMetadata(
@@ -155,7 +115,6 @@ AXIS_MODE_METADATAS = {
155
115
  computing_constrains=(),
156
116
  allows_padding=False,
157
117
  valid_inputs=None,
158
- allows_estimated_cor_as_numerical_value=False,
159
118
  ),
160
119
  # radio algorithm
161
120
  AxisMode.centered: AxisModeMetadata(
@@ -164,7 +123,6 @@ AXIS_MODE_METADATAS = {
164
123
  computing_constrains=(),
165
124
  allows_padding=True,
166
125
  valid_inputs=(_InputType.RADIOS_X2,),
167
- valid_sides=(Side.CENTER,),
168
126
  ),
169
127
  AxisMode.global_: AxisModeMetadata(
170
128
  lockable=True,
@@ -172,7 +130,6 @@ AXIS_MODE_METADATAS = {
172
130
  computing_constrains=(),
173
131
  allows_padding=True,
174
132
  valid_inputs=(_InputType.RADIOS_X2,),
175
- allows_estimated_cor_as_numerical_value=False,
176
133
  ),
177
134
  AxisMode.growing_window_radios: AxisModeMetadata(
178
135
  lockable=True,
@@ -180,8 +137,7 @@ AXIS_MODE_METADATAS = {
180
137
  computing_constrains=(),
181
138
  allows_padding=True,
182
139
  valid_inputs=(_InputType.RADIOS_X2,),
183
- valid_sides=(Side.RIGHT, Side.LEFT, Side.CENTER, Side.ALL),
184
- allows_estimated_cor_as_numerical_value=False,
140
+ valid_sides=("left", "right", "center", "all"),
185
141
  ),
186
142
  AxisMode.sliding_window_radios: AxisModeMetadata(
187
143
  lockable=True,
@@ -189,16 +145,15 @@ AXIS_MODE_METADATAS = {
189
145
  computing_constrains=(),
190
146
  allows_padding=True,
191
147
  valid_inputs=(_InputType.RADIOS_X2,),
192
- valid_sides=(Side.RIGHT, Side.LEFT, Side.CENTER),
148
+ valid_sides=("left", "right", "center", "near"),
193
149
  ),
194
150
  AxisMode.octave_accurate_radios: AxisModeMetadata(
195
151
  lockable=True,
196
152
  tooltip="Same method as the 'accurate' octave code",
197
- computing_constrains=(_Constrain.FULL_TURN,),
153
+ computing_constrains=(),
198
154
  allows_padding=True,
199
155
  valid_inputs=(_InputType.RADIOS_X2,),
200
- valid_sides=(Side.CENTER,),
201
- allows_estimated_cor_as_numerical_value=False,
156
+ valid_sides=("center",),
202
157
  ),
203
158
  # sinogram algorithm
204
159
  AxisMode.growing_window_sinogram: AxisModeMetadata(
@@ -207,8 +162,7 @@ AXIS_MODE_METADATAS = {
207
162
  computing_constrains=(),
208
163
  allows_padding=True,
209
164
  valid_inputs=(_InputType.SINOGRAM,),
210
- valid_sides=(Side.RIGHT, Side.LEFT, Side.CENTER, Side.ALL),
211
- allows_estimated_cor_as_numerical_value=False,
165
+ valid_sides=("left", "right", "center", "all"),
212
166
  ),
213
167
  AxisMode.sliding_window_sinogram: AxisModeMetadata(
214
168
  lockable=True,
@@ -216,11 +170,7 @@ AXIS_MODE_METADATAS = {
216
170
  computing_constrains=(),
217
171
  allows_padding=True,
218
172
  valid_inputs=(_InputType.SINOGRAM,),
219
- valid_sides=(
220
- Side.RIGHT,
221
- Side.LEFT,
222
- Side.CENTER,
223
- ),
173
+ valid_sides=("left", "right", "center", "near"),
224
174
  ),
225
175
  AxisMode.sino_coarse_to_fine: AxisModeMetadata(
226
176
  lockable=True,
@@ -228,22 +178,18 @@ AXIS_MODE_METADATAS = {
228
178
  computing_constrains=(_Constrain.FULL_TURN,),
229
179
  allows_padding=True,
230
180
  valid_inputs=(_InputType.SINOGRAM,),
231
- valid_sides=(
232
- Side.RIGHT,
233
- Side.LEFT,
234
- ),
235
- allows_estimated_cor_as_numerical_value=False,
236
181
  ),
237
- AxisMode.fourier_angles: AxisModeMetadata(
182
+ AxisMode.sino_fourier_angles: AxisModeMetadata(
238
183
  lockable=True,
239
184
  tooltip="",
240
185
  computing_constrains=(_Constrain.FULL_TURN,),
241
186
  allows_padding=True,
242
187
  valid_inputs=(_InputType.SINOGRAM,),
243
188
  valid_sides=(
244
- Side.RIGHT,
245
- Side.LEFT,
246
- Side.CENTER,
189
+ "left",
190
+ "right",
191
+ "center",
192
+ "near",
247
193
  ),
248
194
  ),
249
195
  # coarse-to-fine algorithm
@@ -253,11 +199,7 @@ AXIS_MODE_METADATAS = {
253
199
  computing_constrains=(_Constrain.FULL_TURN,),
254
200
  allows_padding=True,
255
201
  valid_inputs=(_InputType.COMPOSITE,),
256
- valid_sides=(
257
- Side.RIGHT,
258
- Side.LEFT,
259
- Side.CENTER,
260
- ),
202
+ valid_sides=("left", "right", "center", "near"),
261
203
  ),
262
204
  AxisMode.near: AxisModeMetadata(
263
205
  lockable=True,
@@ -265,10 +207,6 @@ AXIS_MODE_METADATAS = {
265
207
  computing_constrains=(_Constrain.FULL_TURN,),
266
208
  allows_padding=True,
267
209
  valid_inputs=(_InputType.COMPOSITE,),
268
- valid_sides=(
269
- Side.RIGHT,
270
- Side.LEFT,
271
- Side.CENTER,
272
- ),
210
+ valid_sides=("left", "right", "center", "near"),
273
211
  ),
274
212
  }