tomwer 1.3.0.dev2__py3-none-any.whl → 1.3.0rc10__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 (156) hide show
  1. orangecontrib/tomwer/widgets/__init__.py +11 -12
  2. orangecontrib/tomwer/widgets/control/DataListenerOW.py +6 -6
  3. orangecontrib/tomwer/widgets/control/DataValidatorOW.py +6 -6
  4. orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +3 -3
  5. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +10 -8
  6. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +6 -6
  7. orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +1 -1
  8. orangecontrib/tomwer/widgets/icat/RawDataScreenshotCreatorOW.py +98 -98
  9. orangecontrib/tomwer/widgets/icat/SaveToGalleryAndPublishOW.py +129 -129
  10. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +13 -12
  11. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +11 -9
  12. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +11 -9
  13. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +12 -15
  14. orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +9 -9
  15. orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
  16. orangecontrib/tomwer/widgets/visualization/SinogramViewerOW.py +0 -1
  17. tomwer/__main__.py +0 -10
  18. tomwer/app/canvas_launcher/config.py +3 -3
  19. tomwer/app/canvas_launcher/environ.py +1 -0
  20. tomwer/app/intensitynormalization.py +12 -11
  21. tomwer/app/nabuapp.py +0 -11
  22. tomwer/app/zstitching.py +11 -1
  23. tomwer/core/process/control/datalistener/datalistener.py +15 -10
  24. tomwer/core/process/control/nxtomomill.py +1 -1
  25. tomwer/core/process/control/scantransfer.py +8 -32
  26. tomwer/core/process/edit/darkflatpatch.py +8 -9
  27. tomwer/core/process/edit/imagekeyeditor.py +20 -22
  28. tomwer/core/process/icat/screenshots.py +1 -0
  29. tomwer/core/process/reconstruction/axis/axis.py +263 -59
  30. tomwer/core/process/reconstruction/axis/mode.py +161 -50
  31. tomwer/core/process/reconstruction/axis/params.py +23 -20
  32. tomwer/core/process/reconstruction/darkref/darkrefs.py +12 -13
  33. tomwer/core/process/reconstruction/nabu/castvolume.py +3 -3
  34. tomwer/core/process/reconstruction/nabu/nabucommon.py +43 -19
  35. tomwer/core/process/reconstruction/nabu/nabuscores.py +34 -7
  36. tomwer/core/process/reconstruction/nabu/nabuslices.py +81 -26
  37. tomwer/core/process/reconstruction/nabu/nabuvolume.py +31 -26
  38. tomwer/core/process/reconstruction/nabu/plane.py +9 -0
  39. tomwer/core/process/reconstruction/nabu/utils.py +32 -9
  40. tomwer/core/process/reconstruction/saaxis/saaxis.py +4 -1
  41. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +9 -1
  42. tomwer/core/process/reconstruction/scores/params.py +3 -3
  43. tomwer/core/process/reconstruction/test/test_darkref_copy.py +4 -4
  44. tomwer/core/process/stitching/nabustitcher.py +11 -10
  45. tomwer/core/process/task.py +33 -27
  46. tomwer/core/process/test/test_axis.py +7 -6
  47. tomwer/core/process/test/test_data_transfer.py +3 -3
  48. tomwer/core/process/test/test_nabu.py +10 -2
  49. tomwer/core/process/test/test_normalization.py +2 -2
  50. tomwer/core/scan/blissscan.py +3 -3
  51. tomwer/core/scan/edfscan.py +9 -9
  52. tomwer/core/scan/nxtomoscan.py +11 -11
  53. tomwer/core/scan/scanbase.py +31 -24
  54. tomwer/core/scan/test/test_future_scan.py +1 -1
  55. tomwer/core/scan/test/test_h5.py +4 -4
  56. tomwer/core/scan/test/test_process_registration.py +2 -2
  57. tomwer/core/scan/test/test_scan.py +1 -75
  58. tomwer/core/settings.py +3 -3
  59. tomwer/core/test/test_utils.py +2 -2
  60. tomwer/core/volume/edfvolume.py +6 -6
  61. tomwer/core/volume/hdf5volume.py +6 -6
  62. tomwer/core/volume/jp2kvolume.py +6 -6
  63. tomwer/core/volume/rawvolume.py +6 -6
  64. tomwer/core/volume/tiffvolume.py +12 -12
  65. tomwer/gui/cluster/slurm.py +14 -9
  66. tomwer/gui/cluster/supervisor.py +12 -0
  67. tomwer/gui/cluster/test/test_cluster.py +1 -2
  68. tomwer/gui/cluster/test/test_supervisor.py +1 -1
  69. tomwer/gui/control/datalist.py +5 -0
  70. tomwer/gui/control/datawatcher/controlwidget.py +2 -4
  71. tomwer/gui/control/reducedarkflatselector.py +8 -8
  72. tomwer/gui/control/test/test_single_tomo_obj.py +1 -1
  73. tomwer/gui/edit/dkrfpatch.py +4 -4
  74. tomwer/gui/edit/nxtomowarmer.py +2 -2
  75. tomwer/gui/edit/test/test_dkrf_patch.py +6 -6
  76. tomwer/gui/imagefromfile.py +2 -2
  77. tomwer/gui/qfolderdialog.py +5 -0
  78. tomwer/gui/reconstruction/axis/CompareImages.py +94 -168
  79. tomwer/gui/reconstruction/axis/radioaxis.py +58 -182
  80. tomwer/gui/reconstruction/darkref/darkrefwidget.py +2 -1
  81. tomwer/gui/reconstruction/nabu/castvolume.py +8 -1
  82. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +54 -21
  83. tomwer/gui/reconstruction/normalization/intensity.py +3 -25
  84. tomwer/gui/reconstruction/saaxis/corrangeselector.py +1 -1
  85. tomwer/gui/reconstruction/saaxis/saaxis.py +1 -11
  86. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +0 -10
  87. tomwer/gui/reconstruction/scores/scoreplot.py +1 -6
  88. tomwer/gui/reconstruction/test/test_axis.py +18 -4
  89. tomwer/gui/reconstruction/test/test_nabu.py +3 -0
  90. tomwer/gui/stitching/stitching.py +2 -2
  91. tomwer/gui/stitching/stitching_preview.py +7 -53
  92. tomwer/gui/stitching/stitching_raw.py +3 -3
  93. tomwer/gui/utils/inputwidget.py +12 -2
  94. tomwer/gui/utils/lineselector/lineselector.py +1 -1
  95. tomwer/gui/visualization/dataviewer.py +47 -17
  96. tomwer/gui/visualization/sinogramviewer.py +19 -26
  97. tomwer/gui/visualization/test/test_volumeviewer.py +64 -66
  98. tomwer/gui/visualization/volumeviewer.py +105 -105
  99. tomwer/io/utils/h5pyutils.py +7 -3
  100. tomwer/io/utils/utils.py +3 -3
  101. tomwer/resources/gui/icons/parameters.svg +1 -1
  102. tomwer/resources/gui/illustrations/no_rot.svg +1 -1
  103. tomwer/synctools/stacks/edit/darkflatpatch.py +17 -12
  104. tomwer/tests/test_scripts.py +0 -3
  105. tomwer/third_part/WaitingOverlay.py +110 -0
  106. tomwer/third_part/__init__.py +0 -0
  107. tomwer/version.py +2 -2
  108. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/METADATA +32 -31
  109. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/RECORD +115 -153
  110. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/WHEEL +1 -1
  111. orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +0 -197
  112. orangecontrib/tomwer/widgets/reconstruction/icons/XY_lamino.svg +0 -168
  113. orangecontrib/tomwer/widgets/reconstruction/icons/XZ_lamino.svg +0 -275
  114. orangecontrib/tomwer/widgets/reconstruction/icons/YZ_lamino.svg +0 -182
  115. tomwer/app/lamino.py +0 -143
  116. tomwer/core/process/reconstruction/lamino/__init__.py +0 -1
  117. tomwer/core/process/reconstruction/lamino/tofu.py +0 -1000
  118. tomwer/core/process/test/test_lamino.py +0 -76
  119. tomwer/core/test/test_lamino.py +0 -92
  120. tomwer/gui/reconstruction/lamino/__init__.py +0 -31
  121. tomwer/gui/reconstruction/lamino/tofu/TofuOptionLoader.py +0 -107
  122. tomwer/gui/reconstruction/lamino/tofu/__init__.py +0 -1
  123. tomwer/gui/reconstruction/lamino/tofu/misc.py +0 -148
  124. tomwer/gui/reconstruction/lamino/tofu/projections.py +0 -896
  125. tomwer/gui/reconstruction/lamino/tofu/settings.py +0 -75
  126. tomwer/gui/reconstruction/lamino/tofu/tofu.py +0 -432
  127. tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +0 -567
  128. tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +0 -757
  129. tomwer/gui/reconstruction/test/test_lamino.py +0 -194
  130. tomwer/resources/gui/icons/lamino_parameters.svg +0 -70
  131. tomwer/resources/gui/illustrations/lamino_angle.png +0 -0
  132. tomwer/resources/gui/illustrations/lamino_angle.svg +0 -509
  133. tomwer/resources/gui/illustrations/lamino_beta_angle.png +0 -0
  134. tomwer/resources/gui/illustrations/lamino_beta_angle.svg +0 -97
  135. tomwer/resources/gui/illustrations/lamino_theta_angle.png +0 -0
  136. tomwer/resources/gui/illustrations/lamino_theta_angle.svg +0 -368
  137. tomwer/resources/gui/illustrations/manual_slice.png +0 -0
  138. tomwer/resources/gui/illustrations/manual_slice.svg +0 -221
  139. tomwer/resources/gui/illustrations/psi_angle.png +0 -0
  140. tomwer/resources/gui/illustrations/psi_angle.svg +0 -479
  141. tomwer/resources/gui/illustrations/rotation_center.png +0 -0
  142. tomwer/resources/gui/illustrations/rotation_center.svg +0 -276
  143. tomwer/resources/gui/illustrations/slice_stack.png +0 -0
  144. tomwer/resources/gui/illustrations/slice_stack.svg +0 -266
  145. tomwer/resources/gui/illustrations/xy_slice.png +0 -0
  146. tomwer/resources/gui/illustrations/xy_slice.svg +0 -269
  147. tomwer/resources/gui/illustrations/xz_slice.png +0 -0
  148. tomwer/resources/gui/illustrations/xz_slice.svg +0 -270
  149. tomwer/resources/gui/illustrations/yz_slice.png +0 -0
  150. tomwer/resources/gui/illustrations/yz_slice.svg +0 -270
  151. tomwer/synctools/stacks/reconstruction/lamino.py +0 -233
  152. /tomwer-1.3.0.dev2-py3.11-nspkg.pth → /tomwer-1.3.0rc10-py3.11-nspkg.pth +0 -0
  153. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/LICENSE +0 -0
  154. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/entry_points.txt +0 -0
  155. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/namespace_packages.txt +0 -0
  156. {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/top_level.txt +0 -0
@@ -495,18 +495,19 @@ class AxisOW(SuperviseOW, WidgetLongProcessing):
495
495
  cor = self._axis_params.relative_cor_value
496
496
  scan.axis_params.set_relative_value(cor)
497
497
  scan._axis_params.mode = "manual"
498
- try:
499
- AxisTask._register_process(
500
- process_file=scan.process_file,
501
- entry=entry,
502
- process=AxisTask,
503
- results={"center_of_rotation": cor if cor is not None else "-"},
504
- configuration=self._axis_params.to_dict(),
505
- process_index=scan.pop_process_index(),
506
- overwrite=True,
507
- )
508
- except Exception as e:
509
- logger.warning(f"Fail to register Axis process. Error is {e}")
498
+ with scan.acquire_process_file_lock():
499
+ try:
500
+ AxisTask._register_process(
501
+ process_file=scan.process_file,
502
+ entry=entry,
503
+ process=AxisTask,
504
+ results={"center_of_rotation": cor if cor is not None else "-"},
505
+ configuration=self._axis_params.to_dict(),
506
+ process_index=scan.pop_process_index(),
507
+ overwrite=True,
508
+ )
509
+ except Exception as e:
510
+ logger.warning(f"Fail to register Axis process. Error is {e}")
510
511
  ProcessManager().notify_dataset_state(
511
512
  dataset=scan,
512
513
  process=AxisTask(
@@ -343,7 +343,6 @@ class SAAxisOW(SuperviseOW, WidgetLongProcessing):
343
343
 
344
344
  # connect signal / slot
345
345
  self._widget.sigConfigurationChanged.connect(self._updateSettings)
346
- self.destroyed.connect(self._widget.stop)
347
346
  self._widget._processing_stack.sigComputationStarted.connect(
348
347
  self._startProcessing
349
348
  )
@@ -354,6 +353,17 @@ class SAAxisOW(SuperviseOW, WidgetLongProcessing):
354
353
  # expose API
355
354
  self.wait_processing = self._widget.wait_processing
356
355
 
356
+ def getWaitingOverlay(self):
357
+ return self._widget._tabWidget._resultsViewer._plot.getWaiterOverlay()
358
+
359
+ def _startProcessing(self, *args, **kwargs):
360
+ self.getWaitingOverlay().show()
361
+ super()._startProcessing()
362
+
363
+ def _endProcessing(self, *args, **kwargs):
364
+ self.getWaitingOverlay().hide()
365
+ super()._endProcessing()
366
+
357
367
  def __new__(cls, *args, **kwargs):
358
368
  # ensure backward compatibility with 'static_input'
359
369
  static_input = kwargs.get("stored_settings", {}).get("static_input", None)
@@ -478,13 +488,5 @@ class SAAxisOW(SuperviseOW, WidgetLongProcessing):
478
488
  self.show()
479
489
  self._widget.showResults()
480
490
 
481
- def stop(self):
482
- self._widget.stop()
483
-
484
- def close(self):
485
- self.stop()
486
- self._widget = None
487
- super().close()
488
-
489
491
  def getConfiguration(self):
490
492
  return self._widget.getConfiguration()
@@ -277,7 +277,6 @@ class SADeltaBetaOW(SuperviseOW, WidgetLongProcessing):
277
277
 
278
278
  # connect signal / slot
279
279
  self._widget.sigConfigurationChanged.connect(self._updateSettings)
280
- self.destroyed.connect(self._widget.stop)
281
280
  self._widget._processing_stack.sigComputationStarted.connect(
282
281
  self._startProcessing
283
282
  )
@@ -383,14 +382,6 @@ class SADeltaBetaOW(SuperviseOW, WidgetLongProcessing):
383
382
  "autofocus_lock": self._widget.isAutoFocusLock(),
384
383
  }
385
384
 
386
- def close(self):
387
- self.stop()
388
- self._widget = None
389
- super().close()
390
-
391
- def stop(self):
392
- self._widget.stop()
393
-
394
385
  def getConfiguration(self):
395
386
  return self._widget.getConfiguration()
396
387
 
@@ -408,3 +399,14 @@ class SADeltaBetaOW(SuperviseOW, WidgetLongProcessing):
408
399
  # if possible process next
409
400
  if self._widget._processing_stack.can_process_next():
410
401
  self._widget._processing_stack._process_next()
402
+
403
+ def getWaitingOverlay(self):
404
+ return self._widget._tabWidget._resultsViewer._plot.getWaiterOverlay()
405
+
406
+ def _startProcessing(self, *args, **kwargs):
407
+ self.getWaitingOverlay().show()
408
+ super()._startProcessing()
409
+
410
+ def _endProcessing(self, *args, **kwargs):
411
+ self.getWaitingOverlay().hide()
412
+ super()._endProcessing()
@@ -164,7 +164,6 @@ class SinoNormOW(WidgetLongProcessing, SuperviseOW):
164
164
 
165
165
  # connect signal / slot
166
166
  self._window.sigConfigurationChanged.connect(self._updateSettings)
167
- self.destroyed.connect(self._window.stop)
168
167
  self._window._processing_stack.sigComputationStarted.connect(
169
168
  self._startProcessing
170
169
  )
@@ -218,17 +217,18 @@ class SinoNormOW(WidgetLongProcessing, SuperviseOW):
218
217
  tomwer_processing_res_code = extra_infos.pop(
219
218
  "tomwer_processing_res_code", "unprocessed"
220
219
  )
221
- SinoNormalizationTask._register_process(
222
- process_file=scan.process_file,
223
- process=SinoNormalizationTask,
224
- entry=scan.entry,
225
- configuration=self.getConfiguration(),
226
- results={
227
- "method": scan.intensity_normalization.method.value,
228
- "extra_infos": extra_infos,
229
- },
230
- process_index=scan.pop_process_index(),
231
- )
220
+ with scan.acquire_process_file_lock():
221
+ SinoNormalizationTask._register_process(
222
+ process_file=scan.process_file,
223
+ process=SinoNormalizationTask,
224
+ entry=scan.entry,
225
+ configuration=self.getConfiguration(),
226
+ results={
227
+ "method": scan.intensity_normalization.method.value,
228
+ "extra_infos": extra_infos,
229
+ },
230
+ process_index=scan.pop_process_index(),
231
+ )
232
232
  if tomwer_processing_res_code is True:
233
233
  # if defined by manual scalar we need to set the value
234
234
  if extra_infos.get("source", None) == _ValueSource.MANUAL_SCALAR.value:
@@ -292,9 +292,6 @@ class SinoNormOW(WidgetLongProcessing, SuperviseOW):
292
292
  def getConfiguration(self):
293
293
  return self._window.getConfiguration()
294
294
 
295
- def stop(self):
296
- self._window.stop()
297
-
298
295
  def _updateSettings(self):
299
296
  self._ewoks_default_inputs = self._window.getConfiguration()
300
297
  self._ewoks_default_inputs["__lock__"] = self.isLocked()
@@ -120,15 +120,15 @@ class DataViewerOW(widget.OWBaseWidget, openclass=True):
120
120
  return qt.QSize(400, 500)
121
121
 
122
122
  def _updateSettings(self):
123
- self._viewer_config[ # pylint: disable=E1137
124
- "mode"
125
- ] = self.viewer.getDisplayMode().value
126
- self._viewer_config[ # pylint: disable=E1137
127
- "slice_opt"
128
- ] = self.viewer.getSliceOption().value
129
- self._viewer_config[ # pylint: disable=E1137
130
- "radio_opt"
131
- ] = self.viewer.getRadioOption().value
123
+ self._viewer_config["mode"] = ( # pylint: disable=E1137
124
+ self.viewer.getDisplayMode().value
125
+ )
126
+ self._viewer_config["slice_opt"] = ( # pylint: disable=E1137
127
+ self.viewer.getSliceOption().value
128
+ )
129
+ self._viewer_config["radio_opt"] = ( # pylint: disable=E1137
130
+ self.viewer.getRadioOption().value
131
+ )
132
132
 
133
133
  def _setSettings(self, settings):
134
134
  old_state = self.viewer.blockSignals(True)
@@ -47,7 +47,7 @@ class DiffViewerOW(widget.OWBaseWidget, openclass=True):
47
47
  Allows to compare two random frame.
48
48
  """
49
49
 
50
- name = "diff viewer"
50
+ name = "diff frame viewer"
51
51
  id = "orangecontrib.tomwer.widgets.visualization.diffviewerow"
52
52
  description = "Allows comparison between two random frame from a scan"
53
53
  icon = "icons/diff.png"
@@ -79,7 +79,6 @@ class SinogramViewerOW(WidgetLongProcessing, widget.OWBaseWidget, openclass=True
79
79
  # connect signal / slot
80
80
  self._viewer.sigSinoLoadStarted.connect(self._startProcessing)
81
81
  self._viewer.sigSinoLoadEnded.connect(self._endProcessing)
82
- self.destroyed.connect(self._viewer._stopAnimationThread)
83
82
 
84
83
  @Inputs.data
85
84
  def addLeafScan(self, scanID):
tomwer/__main__.py CHANGED
@@ -168,16 +168,6 @@ def main():
168
168
  module_name="tomwer.app.intensitynormalization",
169
169
  description="Tool to compute intensity normalization.",
170
170
  )
171
- launcher.add_command(
172
- "lamino",
173
- module_name="tomwer.app.lamino",
174
- description="Run laminography reconstruction using tofu",
175
- )
176
- launcher.add_command(
177
- "liveslice",
178
- module_name="tomwer.app.liveslice",
179
- description="Run liveslice application",
180
- )
181
171
  launcher.add_command(
182
172
  "multi-cor",
183
173
  module_name="tomwer.app.multicor",
@@ -112,9 +112,9 @@ class TomwerConfig(config.Config):
112
112
 
113
113
  all_eps = sorted(
114
114
  all_eps,
115
- key=lambda ep: 0
116
- if ep.dist.project_name.lower() in ("orange3", "tomwer")
117
- else 1,
115
+ key=lambda ep: (
116
+ 0 if ep.dist.project_name.lower() in ("orange3", "tomwer") else 1
117
+ ),
118
118
  )
119
119
  return iter(all_eps)
120
120
 
@@ -40,6 +40,7 @@ orangerc.cfg
40
40
  canvas_settings_dir = %(prefix)s/config/%(name)s/canvas
41
41
 
42
42
  """
43
+
43
44
  import configparser
44
45
  import os
45
46
  import sys
@@ -72,17 +72,18 @@ class NormIntensityWindow(_SinoNormWindow):
72
72
  def _validated(self):
73
73
  scan = self.getScan()
74
74
  if scan is not None:
75
- SinoNormalizationTask._register_process(
76
- process_file=scan.process_file,
77
- process=SinoNormalizationTask,
78
- entry=scan.entry,
79
- configuration=self.getConfiguration(),
80
- results={
81
- "method": scan.intensity_normalization.method.value,
82
- "extra_infos": scan.intensity_normalization.get_extra_infos(),
83
- },
84
- process_index=scan.pop_process_index(),
85
- )
75
+ with scan.acquire_process_file_lock():
76
+ SinoNormalizationTask._register_process(
77
+ process_file=scan.process_file,
78
+ process=SinoNormalizationTask,
79
+ entry=scan.entry,
80
+ configuration=self.getConfiguration(),
81
+ results={
82
+ "method": scan.intensity_normalization.method.value,
83
+ "extra_infos": scan.intensity_normalization.get_extra_infos(),
84
+ },
85
+ process_index=scan.pop_process_index(),
86
+ )
86
87
  self.close()
87
88
 
88
89
  def _launchProcessing(self):
tomwer/app/nabuapp.py CHANGED
@@ -44,12 +44,6 @@ class DataViewer(_DataViewer):
44
44
  if event.key() is qt.Qt.Key_F5:
45
45
  self._updateDisplay()
46
46
 
47
- def event(self, event) -> bool:
48
- if event.type() == qt.QEvent.DeferredDelete:
49
- self.cleanBeforeQuit()
50
- self.closed.emit()
51
- return super().event(event)
52
-
53
47
 
54
48
  class NabuProcessingThread(qt.QThread):
55
49
  def init(self, data, config, dry_run=False):
@@ -185,10 +179,6 @@ class NabuWindow(NabuDialog):
185
179
  self._dataViewer.close()
186
180
  self._dataViewer = None
187
181
 
188
- def _aboutToQuit(self):
189
- if self._dataViewer is not None:
190
- self._dataViewer.cleanBeforeQuit()
191
-
192
182
 
193
183
  def main(argv):
194
184
  import os
@@ -248,7 +238,6 @@ def main(argv):
248
238
  widget.setWindowIcon(icons.getQIcon("tomwer"))
249
239
  splash.finish(widget)
250
240
  widget.show()
251
- qt.QApplication.instance().aboutToQuit.connect(widget._aboutToQuit)
252
241
 
253
242
  app.exec_()
254
243
 
tomwer/app/zstitching.py CHANGED
@@ -21,6 +21,7 @@ from tomwer.gui.utils.splashscreen import getMainSplashScreen
21
21
  from tomwer.gui.stitching.stitching import ZStitchingWindow as _ZStitchingWindow
22
22
  from tomwer.gui.stitching import action as stitching_action
23
23
  from tomwer.gui.cluster.slurm import SlurmSettingsWidget
24
+ from tomwer.core.scan.scanbase import TomwerScanBase
24
25
 
25
26
  logging.basicConfig(level=logging.WARNING)
26
27
 
@@ -296,7 +297,12 @@ def main(argv):
296
297
  action="store_true",
297
298
  default=False,
298
299
  )
299
-
300
+ parser.add_argument(
301
+ "--check-scans",
302
+ help="If True will check scans before adding them. This check scan validity (virtual dataset contains data...)",
303
+ action="store_true",
304
+ default=False,
305
+ )
300
306
  options = parser.parse_args(argv[1:])
301
307
 
302
308
  if options.use_opengl_plot:
@@ -342,6 +348,10 @@ def main(argv):
342
348
 
343
349
  tomo_objs, (has_scans, has_vols) = get_tomo_objs_instances(options.tomo_objs)
344
350
  for tomo_obj in tomo_objs:
351
+ if isinstance(tomo_obj, TomwerScanBase):
352
+ tomo_obj.set_check_behavior(
353
+ run_check=options.check_scans
354
+ ) # speed up processing
345
355
  window.addTomoObj(tomo_obj=tomo_obj)
346
356
  if has_scans and has_vols:
347
357
  _logger.warning(
@@ -102,6 +102,11 @@ class DataListener(BaseProcessInfo):
102
102
  TIMOUT_READ_FILE = 30
103
103
  "When the event 'scan_ended' is received all data might not have been write" " yet"
104
104
 
105
+ SWMR_MODE = None
106
+ """The bliss writer is not using the swmr mode. This class has independant behavior regarding the tomoscan / nxotmo get_swmr_mode which is
107
+ dedicated to the internal tomotools behavior
108
+ """
109
+
105
110
  def __init__(self):
106
111
  super().__init__()
107
112
  self._host = settings.JSON_RPC_HOST
@@ -224,7 +229,7 @@ class DataListener(BaseProcessInfo):
224
229
  """Return the list of scans dir for this bliss_file / entry"""
225
230
 
226
231
  def get_scan_indexes():
227
- with HDF5File(bliss_file, "r", swmr=True) as h5f:
232
+ with HDF5File(bliss_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
228
233
  entry_node = h5f[entry]
229
234
  if _SCAN_NUMBER_PATH in entry_node:
230
235
  return h5py_read_dataset(entry_node[_SCAN_NUMBER_PATH])
@@ -249,7 +254,7 @@ class DataListener(BaseProcessInfo):
249
254
  """Return the proposal file of the experimentation if registred by the
250
255
  data listener"""
251
256
  if entry is None:
252
- with HDF5File(process_file, "r", swmr=True) as h5f:
257
+ with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
253
258
  entries = BaseProcessInfo._get_process_nodes(
254
259
  root_node=h5f, process=DataListener
255
260
  )
@@ -264,7 +269,7 @@ class DataListener(BaseProcessInfo):
264
269
  entry = list(entries.keys())[0]
265
270
  _logger.info("take %s as default entry" % entry)
266
271
 
267
- with HDF5File(process_file, "r", swmr=True) as h5f:
272
+ with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
268
273
  dl_nodes = BaseProcessInfo._get_process_nodes(
269
274
  root_node=h5f[entry], process=DataListener
270
275
  )
@@ -306,7 +311,7 @@ class DataListener(BaseProcessInfo):
306
311
  """Return the proposal file of the experimentation if registred by the
307
312
  data listener"""
308
313
  if entry is None:
309
- with HDF5File(process_file, "r", swmr=True) as h5f:
314
+ with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
310
315
  entries = BaseProcessInfo._get_process_nodes(
311
316
  root_node=h5f, process=DataListener
312
317
  )
@@ -321,7 +326,7 @@ class DataListener(BaseProcessInfo):
321
326
  entry = list(entries.keys())[0]
322
327
  _logger.info("take %s as default entry" % entry)
323
328
 
324
- with HDF5File(process_file, "r", swmr=True) as h5f:
329
+ with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
325
330
  dl_nodes = BaseProcessInfo._get_process_nodes(
326
331
  root_node=h5f[entry], process=DataListener
327
332
  )
@@ -355,7 +360,7 @@ class DataListener(BaseProcessInfo):
355
360
  """Return the proposal file of the experimentation if registred by the
356
361
  data listener"""
357
362
  if entry is None:
358
- with HDF5File(process_file, "r", swmr=True) as h5f:
363
+ with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
359
364
  entries = BaseProcessInfo._get_process_nodes(
360
365
  root_node=h5f, process=DataListener
361
366
  )
@@ -370,7 +375,7 @@ class DataListener(BaseProcessInfo):
370
375
  entry = list(entries.keys())[0]
371
376
  _logger.info("take %s as default entry" % entry)
372
377
 
373
- with HDF5File(process_file, "r", swmr=True) as h5f:
378
+ with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
374
379
  dl_nodes = BaseProcessInfo._get_process_nodes(
375
380
  root_node=h5f[entry], process=DataListener
376
381
  )
@@ -405,7 +410,7 @@ class DataListener(BaseProcessInfo):
405
410
  specific sequence data
406
411
  """
407
412
  if entry is None:
408
- with HDF5File(process_file, "r", swmr=True) as h5f:
413
+ with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
409
414
  entries = BaseProcessInfo._get_process_nodes(
410
415
  root_node=h5f, process=DataListener
411
416
  )
@@ -420,7 +425,7 @@ class DataListener(BaseProcessInfo):
420
425
  entry = list(entries.keys())[0]
421
426
  _logger.info("take %s as default entry" % entry)
422
427
 
423
- with HDF5File(process_file, "r", swmr=True) as h5f:
428
+ with HDF5File(process_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
424
429
  dl_nodes = BaseProcessInfo._get_process_nodes(
425
430
  root_node=h5f[entry], process=DataListener
426
431
  )
@@ -498,7 +503,7 @@ class DataListener(BaseProcessInfo):
498
503
  # write
499
504
  def sequence_is_finished():
500
505
  try:
501
- with HDF5File(bliss_file, "r", swmr=True) as h5f:
506
+ with HDF5File(bliss_file, "r", swmr=DataListener.SWMR_MODE) as h5f:
502
507
  end_scan_path = "/".join((entry, "end_time"))
503
508
  return end_scan_path in h5f
504
509
  except Exception:
@@ -57,7 +57,7 @@ class H5ToNxProcess(
57
57
  input_names=("h5_to_nx_configuration",),
58
58
  optional_input_names=(
59
59
  "progress",
60
- "hdf5_scan",
60
+ "bliss_scan",
61
61
  "serialize_output_data",
62
62
  ),
63
63
  output_names=("data", "serie"),
@@ -1,33 +1,3 @@
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
1
  import fnmatch
32
2
  import logging
33
3
  import os
@@ -48,6 +18,12 @@ from tomwer.core.utils import logconfig
48
18
  from tomwer.core.utils.spec import rebaseParFile
49
19
  from tomwer.core.utils.scanutils import data_identifier_to_scan
50
20
  from tomwer.io.utils import get_linked_files_with_entry
21
+ from tomwer.core.process.reconstruction.saaxis.saaxis import (
22
+ DEFAULT_RECONS_FOLDER as MULTI_COR_DEFAULT_FOLDER,
23
+ )
24
+ from tomwer.core.process.reconstruction.sadeltabeta.sadeltabeta import (
25
+ DEFAULT_RECONS_FOLDER as MULTI_DB_DEFAULT_FOLDER,
26
+ )
51
27
 
52
28
  logger = logging.getLogger(__name__)
53
29
 
@@ -398,8 +374,8 @@ class ScanTransferTask(
398
374
  patterns = [
399
375
  NABU_CFG_FILE_FOLDER,
400
376
  "*slice*",
401
- "saaxis_results",
402
- "sadeltabeta_results",
377
+ MULTI_COR_DEFAULT_FOLDER,
378
+ MULTI_DB_DEFAULT_FOLDER,
403
379
  "steps_file_basename_nabu_sinogram_save_step",
404
380
  ]
405
381
  for folder_ in os.listdir(dir_name):
@@ -95,15 +95,14 @@ class DarkFlatPatchTask(
95
95
  if isinstance(value, DataUrl):
96
96
  config[key] = value.path()
97
97
 
98
- with scan.acquire_process_file_lock():
99
- self.register_process(
100
- process_file=scan.process_file,
101
- entry=scan.entry,
102
- configuration=config,
103
- results={},
104
- process_index=scan.pop_process_index(),
105
- overwrite=True,
106
- )
98
+ self.register_process(
99
+ process_file=scan.process_file,
100
+ entry=scan.entry,
101
+ configuration=config,
102
+ results={},
103
+ process_index=scan.pop_process_index(),
104
+ overwrite=True,
105
+ )
107
106
  if self.get_input_value("serialize_output_data", True):
108
107
  self.outputs.data = scan.to_dict()
109
108
  else:
@@ -83,7 +83,7 @@ def change_image_key_control(scan: NXtomoScan, config: dict) -> TomwerScanBase:
83
83
  filter(lambda item: item[1] is image_key_type, modifications.items())
84
84
  )
85
85
  frame_indexes = tuple(frame_indexes_dict.keys())
86
- _logger.warning(f"will modify {frame_indexes} to {image_key_type}")
86
+ _logger.info(f"will modify {frame_indexes} to {image_key_type}")
87
87
  _change_image_key_control(
88
88
  file_path=scan.master_file,
89
89
  entry=scan.entry,
@@ -137,15 +137,14 @@ class ImageKeyEditorTask(
137
137
  value = config["modifications"][key]
138
138
  config["modifications"][str(key)] = value
139
139
  config["modifications"] = new_modif
140
- with scan.acquire_process_file_lock():
141
- self.register_process(
142
- process_file=scan.process_file,
143
- entry=scan.entry,
144
- configuration=config,
145
- results={},
146
- process_index=scan.pop_process_index(),
147
- overwrite=True,
148
- )
140
+ self.register_process(
141
+ process_file=scan.process_file,
142
+ entry=scan.entry,
143
+ configuration=config,
144
+ results={},
145
+ process_index=scan.pop_process_index(),
146
+ overwrite=True,
147
+ )
149
148
  if self.get_input_value("serialize_output_data", True):
150
149
  self.outputs.data = scan.to_dict()
151
150
  else:
@@ -198,18 +197,17 @@ class ImageKeyUpgraderTask(
198
197
 
199
198
  # apply modification using tomoscan
200
199
  change_image_key_control(scan=scan, config=configuration)
201
- with scan.acquire_process_file_lock():
202
- self.register_process(
203
- process_file=scan.process_file,
204
- entry=scan.entry,
205
- configuration={
206
- ImageKey.from_value(key).value: ImageKey.from_value(value).value
207
- for key, value in operations.items()
208
- },
209
- results={},
210
- process_index=scan.pop_process_index(),
211
- overwrite=True,
212
- )
200
+ self.register_process(
201
+ process_file=scan.process_file,
202
+ entry=scan.entry,
203
+ configuration={
204
+ ImageKey.from_value(key).value: ImageKey.from_value(value).value
205
+ for key, value in operations.items()
206
+ },
207
+ results={},
208
+ process_index=scan.pop_process_index(),
209
+ overwrite=True,
210
+ )
213
211
  if self.get_input_value("serialize_output_data", True):
214
212
  self.outputs.data = scan.to_dict()
215
213
  else:
@@ -1,5 +1,6 @@
1
1
  """utils around screenshots.
2
2
  """
3
+
3
4
  from .icatbase import IcatProcessedDataBase
4
5
  from tomwer.core.scan.scanbase import TomwerScanBase
5
6