tomwer 1.2.0a1__py3-none-any.whl → 1.2.0a3__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 (219) hide show
  1. orangecontrib/tomwer/tutorials/append_raw_darks_and_flats_frames_to_NXtomos.ows +44 -0
  2. orangecontrib/tomwer/tutorials/copy_reduced_darks_and_flats_meth1.ows +55 -0
  3. orangecontrib/tomwer/tutorials/copy_reduced_darks_and_flats_meth2.ows +48 -0
  4. orangecontrib/tomwer/tutorials/default_cor_search.ows +40 -0
  5. orangecontrib/tomwer/tutorials/hello_world_python_script.ows +50 -0
  6. orangecontrib/tomwer/tutorials/simple_slice_reconstruction_on_slurm.ows +50 -0
  7. orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +8 -8
  8. orangecontrib/tomwer/widgets/__init__.py +1 -1
  9. orangecontrib/tomwer/widgets/cluster/FutureSupervisorOW.py +0 -1
  10. orangecontrib/tomwer/widgets/cluster/SlurmClusterOW.py +8 -6
  11. orangecontrib/tomwer/widgets/control/AdvancementOW.py +0 -1
  12. orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +1 -6
  13. orangecontrib/tomwer/widgets/control/DataListOW.py +0 -1
  14. orangecontrib/tomwer/widgets/control/DataListenerOW.py +4 -4
  15. orangecontrib/tomwer/widgets/control/DataSelectorOW.py +0 -1
  16. orangecontrib/tomwer/widgets/control/DataTransfertOW.py +7 -7
  17. orangecontrib/tomwer/widgets/control/DataValidatorOW.py +0 -1
  18. orangecontrib/tomwer/widgets/control/DataWatcherOW.py +0 -3
  19. orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +3 -2
  20. orangecontrib/tomwer/widgets/control/EmailOW.py +82 -0
  21. orangecontrib/tomwer/widgets/control/FilterOW.py +3 -3
  22. orangecontrib/tomwer/widgets/control/NXTomomillOW.py +1 -1
  23. orangecontrib/tomwer/widgets/control/NotifierOW.py +0 -1
  24. orangecontrib/tomwer/widgets/control/ReduceDarkFlatSelectorOW.py +93 -0
  25. orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +29 -5
  26. orangecontrib/tomwer/widgets/control/TimerOW.py +1 -2
  27. orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +0 -1
  28. orangecontrib/tomwer/widgets/control/VolumeSelector.py +0 -1
  29. orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +4 -10
  30. orangecontrib/tomwer/widgets/control/icons/email.png +0 -0
  31. orangecontrib/tomwer/widgets/control/icons/email.svg +58 -0
  32. orangecontrib/tomwer/widgets/control/icons/reduced_darkflat_selector.png +0 -0
  33. orangecontrib/tomwer/widgets/control/icons/reduced_darkflat_selector.svg +199 -0
  34. orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +0 -1
  35. orangecontrib/tomwer/widgets/debugtools/ObjectInspectorOW.py +0 -1
  36. orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +1 -2
  37. orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +1 -2
  38. orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +0 -1
  39. orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +0 -1
  40. orangecontrib/tomwer/widgets/other/PythonScriptOW.py +29 -1
  41. orangecontrib/tomwer/widgets/other/TomoObjsHub.py +28 -0
  42. orangecontrib/tomwer/widgets/other/icons/hub.png +0 -0
  43. orangecontrib/tomwer/widgets/other/icons/hub.svg +113 -0
  44. orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +18 -12
  45. orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +0 -2
  46. orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py +21 -6
  47. orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +29 -7
  48. orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +18 -5
  49. orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +40 -13
  50. orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +37 -10
  51. orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +2 -3
  52. orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +5 -4
  53. orangecontrib/tomwer/widgets/stitching/StitcherOW.py +0 -1
  54. orangecontrib/tomwer/widgets/stitching/ZStitchingConfigOW.py +0 -1
  55. orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +10 -4
  56. orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
  57. orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +0 -1
  58. orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +0 -1
  59. orangecontrib/tomwer/widgets/visualization/RadioStackOW.py +7 -5
  60. orangecontrib/tomwer/widgets/visualization/SampleMovedOW.py +1 -1
  61. orangecontrib/tomwer/widgets/visualization/SinogramViewerOW.py +0 -3
  62. orangecontrib/tomwer/widgets/visualization/SliceStackOW.py +7 -5
  63. orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +4 -4
  64. tomwer/__main__.py +139 -5
  65. tomwer/app/axis.py +16 -5
  66. tomwer/app/canvas_launcher/config.py +1 -1
  67. tomwer/app/canvas_launcher/mainwindow.py +164 -6
  68. tomwer/app/darkref.py +10 -181
  69. tomwer/app/darkrefpatch.py +10 -131
  70. tomwer/app/diffframe.py +11 -0
  71. tomwer/app/imagekeyeditor.py +12 -19
  72. tomwer/app/intensitynormalization.py +1 -0
  73. tomwer/app/lamino.py +7 -2
  74. tomwer/app/patchrawdarkflat.py +131 -0
  75. tomwer/app/radiostack.py +10 -0
  76. tomwer/app/reducedarkflat.py +205 -0
  77. tomwer/app/saaxis.py +27 -8
  78. tomwer/app/sadeltabeta.py +29 -8
  79. tomwer/app/samplemoved.py +11 -0
  80. tomwer/app/scanviewer.py +12 -0
  81. tomwer/app/sinogramviewer.py +11 -0
  82. tomwer/app/slicestack.py +11 -0
  83. tomwer/app/zstitching.py +12 -0
  84. tomwer/core/futureobject.py +4 -2
  85. tomwer/core/process/conditions/filters.py +26 -4
  86. tomwer/core/process/control/datadiscovery.py +4 -0
  87. tomwer/core/process/control/datawatcher/datawatcher.py +5 -1
  88. tomwer/core/process/control/email.py +148 -0
  89. tomwer/core/process/control/nxtomoconcatenate.py +9 -2
  90. tomwer/core/process/control/nxtomomill.py +58 -16
  91. tomwer/core/process/control/scanselector.py +4 -0
  92. tomwer/core/process/control/scantransfer.py +52 -23
  93. tomwer/core/process/control/test/test_concatenate_nxtomos.py +1 -0
  94. tomwer/core/process/control/test/test_email.py +52 -0
  95. tomwer/core/process/control/test/test_h52nx_process.py +106 -0
  96. tomwer/core/process/control/test/test_volume_link.py +5 -4
  97. tomwer/core/process/control/timer.py +27 -6
  98. tomwer/core/process/control/tomoobjserie.py +4 -0
  99. tomwer/core/process/control/volumeselector.py +4 -0
  100. tomwer/core/process/control/volumesymlink.py +47 -8
  101. tomwer/core/process/edit/darkflatpatch.py +49 -8
  102. tomwer/core/process/edit/imagekeyeditor.py +63 -13
  103. tomwer/core/process/reconstruction/axis/__init__.py +1 -1
  104. tomwer/core/process/reconstruction/axis/axis.py +61 -41
  105. tomwer/core/process/reconstruction/axis/params.py +4 -6
  106. tomwer/core/process/reconstruction/darkref/darkrefs.py +53 -16
  107. tomwer/core/process/reconstruction/darkref/darkrefscopy.py +12 -2
  108. tomwer/core/process/reconstruction/lamino/__init__.py +1 -1
  109. tomwer/core/process/reconstruction/lamino/tofu.py +22 -2
  110. tomwer/core/process/reconstruction/nabu/nabucommon.py +93 -14
  111. tomwer/core/process/reconstruction/nabu/nabuscores.py +70 -33
  112. tomwer/core/process/reconstruction/nabu/nabuslices.py +219 -41
  113. tomwer/core/process/reconstruction/nabu/nabuvolume.py +240 -108
  114. tomwer/core/process/reconstruction/nabu/utils.py +10 -36
  115. tomwer/core/process/reconstruction/normalization/normalization.py +10 -3
  116. tomwer/core/process/reconstruction/saaxis/__init__.py +1 -0
  117. tomwer/core/process/reconstruction/saaxis/saaxis.py +564 -376
  118. tomwer/core/process/reconstruction/sadeltabeta/__init__.py +1 -0
  119. tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +481 -268
  120. tomwer/core/process/reconstruction/scores/params.py +21 -8
  121. tomwer/core/process/reconstruction/test/test_darkref_copy.py +2 -0
  122. tomwer/core/process/reconstruction/test/test_saaxis.py +21 -8
  123. tomwer/core/process/reconstruction/test/test_sadeltabeta.py +8 -5
  124. tomwer/core/process/script/python.py +7 -2
  125. tomwer/core/process/stitching/nabustitcher.py +10 -3
  126. tomwer/core/process/task.py +2 -9
  127. tomwer/core/process/test/test_axis.py +25 -15
  128. tomwer/core/process/test/test_conditions.py +6 -6
  129. tomwer/core/process/test/test_dark_and_flat.py +20 -15
  130. tomwer/core/process/test/test_data_transfer.py +8 -8
  131. tomwer/core/process/test/test_data_watcher.py +1 -1
  132. tomwer/core/process/test/test_lamino.py +6 -6
  133. tomwer/core/process/test/test_nabu.py +13 -8
  134. tomwer/core/process/test/test_normalization.py +1 -0
  135. tomwer/core/process/test/test_timer.py +6 -6
  136. tomwer/core/process/visualization/dataviewer.py +4 -0
  137. tomwer/core/process/visualization/diffviewer.py +4 -0
  138. tomwer/core/process/visualization/imagestackviewer.py +4 -0
  139. tomwer/core/process/visualization/radiostack.py +4 -0
  140. tomwer/core/process/visualization/samplemoved.py +4 -0
  141. tomwer/core/process/visualization/sinogramviewer.py +4 -0
  142. tomwer/core/process/visualization/slicestack.py +4 -0
  143. tomwer/core/process/visualization/volumeviewer.py +4 -0
  144. tomwer/core/scan/hdf5scan.py +4 -4
  145. tomwer/core/scan/scanbase.py +5 -1
  146. tomwer/core/scan/test/test_process_registration.py +9 -9
  147. tomwer/core/settings.py +59 -1
  148. tomwer/core/test/test_lamino.py +2 -1
  149. tomwer/core/utils/__init__.py +16 -0
  150. tomwer/core/utils/locker.py +0 -1
  151. tomwer/core/utils/resource.py +6 -11
  152. tomwer/core/utils/scanutils.py +2 -0
  153. tomwer/gui/cluster/slurm.py +91 -7
  154. tomwer/gui/cluster/supervisor.py +16 -11
  155. tomwer/gui/cluster/test/test_cluster.py +16 -1
  156. tomwer/gui/conditions/filter.py +3 -3
  157. tomwer/gui/control/datalist.py +24 -11
  158. tomwer/gui/control/email.py +183 -0
  159. tomwer/gui/control/reducedarkflatselector.py +545 -0
  160. tomwer/gui/control/singletomoobj.py +23 -1
  161. tomwer/gui/control/test/test_email.py +35 -0
  162. tomwer/gui/control/test/test_reducedarkflat_selector.py +280 -0
  163. tomwer/gui/reconstruction/axis/CompareImages.py +1 -1
  164. tomwer/gui/reconstruction/axis/axis.py +10 -6
  165. tomwer/gui/reconstruction/axis/radioaxis.py +14 -6
  166. tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +2 -0
  167. tomwer/gui/reconstruction/darkref/darkrefwidget.py +4 -4
  168. tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +3 -1
  169. tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +34 -33
  170. tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +1 -1
  171. tomwer/gui/reconstruction/normalization/intensity.py +5 -5
  172. tomwer/gui/reconstruction/saaxis/corrangeselector.py +1 -0
  173. tomwer/gui/reconstruction/saaxis/saaxis.py +6 -6
  174. tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +6 -6
  175. tomwer/gui/reconstruction/scores/scoreplot.py +6 -4
  176. tomwer/gui/samplemoved/__init__.py +2 -2
  177. tomwer/gui/stackplot.py +18 -7
  178. tomwer/gui/stacks.py +2 -2
  179. tomwer/gui/stitching/stitchandbackground.py +2 -2
  180. tomwer/gui/stitching/stitching.py +1 -1
  181. tomwer/gui/stitching/stitching_raw.py +1 -1
  182. tomwer/gui/utils/__init__.py +1 -85
  183. tomwer/gui/utils/illustrations.py +1 -1
  184. tomwer/gui/utils/inputwidget.py +41 -36
  185. tomwer/gui/utils/slider.py +2 -2
  186. tomwer/gui/utils/utils.py +93 -0
  187. tomwer/gui/visualization/dataviewer.py +8 -5
  188. tomwer/gui/visualization/diffviewer/diffviewer.py +4 -4
  189. tomwer/gui/visualization/reconstructionparameters.py +26 -6
  190. tomwer/gui/visualization/sinogramviewer.py +7 -1
  191. tomwer/gui/visualization/test/test_reconstruction_parameters.py +2 -4
  192. tomwer/gui/visualization/volumeviewer.py +2 -0
  193. tomwer/resources/__init__.py +55 -43
  194. tomwer/resources/gui/icons/compose.png +0 -0
  195. tomwer/resources/gui/icons/compose.svg +75 -0
  196. tomwer/synctools/datatransfert.py +3 -1
  197. tomwer/synctools/stacks/edit/darkflatpatch.py +39 -34
  198. tomwer/synctools/stacks/edit/imagekeyeditor.py +8 -27
  199. tomwer/synctools/stacks/processingstack.py +45 -9
  200. tomwer/synctools/stacks/reconstruction/axis.py +6 -5
  201. tomwer/synctools/stacks/reconstruction/dkrefcopy.py +1 -0
  202. tomwer/synctools/stacks/reconstruction/lamino.py +3 -3
  203. tomwer/synctools/stacks/reconstruction/nabu.py +49 -140
  204. tomwer/synctools/stacks/reconstruction/normalization.py +1 -0
  205. tomwer/synctools/stacks/reconstruction/saaxis.py +19 -33
  206. tomwer/synctools/stacks/reconstruction/sadeltabeta.py +16 -32
  207. tomwer/synctools/test/test_darkRefs.py +19 -10
  208. tomwer/synctools/test/test_foldertransfer.py +7 -7
  209. tomwer/third_party/nabu/preproc/phase.py +6 -8
  210. tomwer/third_party/nabu/utils.py +2 -3
  211. tomwer/version.py +1 -1
  212. {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/METADATA +15 -54
  213. {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/RECORD +219 -192
  214. {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/WHEEL +1 -1
  215. {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/entry_points.txt +3 -3
  216. /tomwer-1.2.0a1-py3.9-nspkg.pth → /tomwer-1.2.0a3-py3.11-nspkg.pth +0 -0
  217. {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/LICENSE +0 -0
  218. {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/namespace_packages.txt +0 -0
  219. {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/top_level.txt +0 -0
@@ -74,7 +74,6 @@ class EDF2NXOW(
74
74
  want_main_area = True
75
75
  want_control_area = False
76
76
  resizing_enabled = True
77
- compress_signal = False
78
77
 
79
78
  CONFIG_CLS = EDFConfig
80
79
 
@@ -89,8 +88,9 @@ class EDF2NXOW(
89
88
  _layout = gui.vBox(self.mainArea, self.name).layout()
90
89
  self.widget = EDFDataListMainWindow(parent=self)
91
90
  _layout.addWidget(self.widget)
91
+ # for edf default output path is still the 'near to input file'
92
+ self.widget._dialog._nxTomomillOutputWidget._closeToBlissFileRB.setChecked(True)
92
93
  # add 'convert auto' check box
93
-
94
94
  self._convertAutoCB = qt.QCheckBox(
95
95
  "convert automatically when edf scan send through 'edf scan' channel", self
96
96
  )
@@ -181,6 +181,7 @@ class EDF2NXOW(
181
181
  def get_task_inputs(self):
182
182
  return {
183
183
  "edf_to_nx_configuration": self.__configuration_cache.to_dict(),
184
+ "serialize_output_data": False,
184
185
  }
185
186
 
186
187
  def handleNewSignals(self) -> None:
@@ -0,0 +1,82 @@
1
+ from orangewidget import gui
2
+ from orangewidget.settings import Setting
3
+
4
+ from silx.gui import qt
5
+ from ewoksorange.bindings.owwidgets import OWEwoksWidgetNoThread
6
+
7
+ import tomwer.core.process.control.email
8
+ from tomwer.gui.control.email import Emailwidget
9
+ from tomwer.core.utils import concatenate_dict
10
+
11
+
12
+ class EmailOW(
13
+ OWEwoksWidgetNoThread,
14
+ ewokstaskclass=tomwer.core.process.control.email.TomoEmailTask,
15
+ ):
16
+ """
17
+ This widget will browse a folder and sub folder to find valid tomo scan project.
18
+ Contrary to the scan watcher it will parse all folder / sub folders then stop.
19
+ """
20
+
21
+ name = "email notifier"
22
+ id = "orangecontrib.widgets.tomwer.control.EmailOW.EmailOW"
23
+ description = (
24
+ "This widget will send an email to receivers when the input is provided. \n"
25
+ )
26
+ icon = "icons/email.svg"
27
+ priority = 146
28
+ keywords = [
29
+ "tomography",
30
+ "tomwer",
31
+ "tomo_obj",
32
+ "email",
33
+ "notifier",
34
+ "notification",
35
+ ]
36
+
37
+ want_main_area = True
38
+ want_control_area = False
39
+ resizing_enabled = True
40
+
41
+ _ewoks_default_inputs = Setting({"configuration": {}, "tomo_obj": None})
42
+
43
+ def __init__(self, *args, **kwargs):
44
+ super().__init__(*args, **kwargs)
45
+ self._widget = Emailwidget(parent=self)
46
+
47
+ self._box = gui.vBox(self.mainArea, self.name)
48
+ layout = self._box.layout()
49
+ layout.addWidget(self._widget)
50
+
51
+ # load settings
52
+ self._widget.setConfiguration(self._ewoks_default_inputs)
53
+
54
+ # connect signal / slot
55
+ self._widget.sigChanged.connect(self._updateSettings)
56
+
57
+ def _updateSettings(self):
58
+ self._ewoks_default_inputs = {
59
+ "configuration": self.getConfiguration(),
60
+ "tomo_obj": None,
61
+ }
62
+
63
+ # expose some API
64
+ def getConfiguration(self) -> dict:
65
+ return self._widget.getConfiguration()
66
+
67
+ def setConfiguration(self, config: dict):
68
+ self._widget.setConfiguration(config.get("configuration", {}))
69
+
70
+ def get_task_inputs(self):
71
+ return concatenate_dict(
72
+ super().get_task_inputs(),
73
+ {"configuration": self.getConfiguration()},
74
+ )
75
+
76
+ def sizeHint(self):
77
+ return qt.QSize(500, 200)
78
+
79
+ def _execute_ewoks_task(self, *args, **kwargs):
80
+ arguments = self._get_task_arguments()
81
+ if arguments.get("inputs", {}).get("tomo_obj", None) is not None:
82
+ super()._execute_ewoks_task(*args, **kwargs)
@@ -57,9 +57,8 @@ class NameFilterOW(SuperviseOW):
57
57
 
58
58
  want_main_area = True
59
59
  resizing_enabled = True
60
- compress_signal = False
61
60
 
62
- ewokstaskclass = tomwer.core.process.conditions.filters.FileNameFilter
61
+ ewokstaskclass = tomwer.core.process.conditions.filters.FileNameFilterTask
63
62
 
64
63
  class Inputs:
65
64
  data = Input(name="data", type=TomwerScanBase, multiple=True)
@@ -87,12 +86,13 @@ class NameFilterOW(SuperviseOW):
87
86
  if not isinstance(scan, TomwerScanBase):
88
87
  raise TypeError(f"{scan} is expected to be an instance of {TomwerScanBase}")
89
88
 
90
- process = filters.FileNameFilter(
89
+ process = filters.FileNameFilterTask(
91
90
  inputs={
92
91
  "data": scan,
93
92
  "pattern": self.getPattern(),
94
93
  "filter_type": self.getActiveFilter(),
95
94
  "invert_result": self.invertFilterAction(),
95
+ "serialize_output_data": False, # avoid spending time on scan serialization / deserialization when use orange
96
96
  }
97
97
  )
98
98
  process.run()
@@ -79,7 +79,6 @@ class NXTomomillOW(
79
79
  want_main_area = True
80
80
  want_control_area = False
81
81
  resizing_enabled = True
82
- compress_signal = False
83
82
 
84
83
  CONFIG_CLS = HDF5Config
85
84
 
@@ -144,6 +143,7 @@ class NXTomomillOW(
144
143
  def get_task_inputs(self):
145
144
  return {
146
145
  "h5_to_nx_configuration": self.__configuration_cache.to_dict(),
146
+ "serialize_output_data": False,
147
147
  }
148
148
 
149
149
  def handleNewSignals(self) -> None:
@@ -48,7 +48,6 @@ class NotifierWidgetOW(widget.OWBaseWidget):
48
48
 
49
49
  want_main_area = True
50
50
  resizing_enabled = False
51
- compress_signal = False
52
51
 
53
52
  _muted = settings.Setting(False)
54
53
 
@@ -0,0 +1,93 @@
1
+ import logging
2
+ from typing import Optional
3
+
4
+ from orangewidget import gui
5
+ from orangewidget.settings import Setting
6
+ from orangewidget.widget import Input, Output, OWBaseWidget
7
+
8
+ from tomwer.gui.control.reducedarkflatselector import ReduceDarkFlatSelectorDialog
9
+
10
+ logger = logging.getLogger(__name__)
11
+
12
+
13
+ class ReduceDarkFlatSelectorOW(OWBaseWidget, openclass=True):
14
+ name = "reduce dark-flat selector"
15
+ id = "orangecontrib.widgets.tomwer.control.ReduceDarkFlatSelectorOW.ReduceDarkFlatSelectorOW"
16
+ description = "Allow user to select one or several reduced dark / flat"
17
+ icon = "icons/reduced_darkflat_selector.svg"
18
+ priority = 242
19
+ keywords = [
20
+ "tomography",
21
+ "selection",
22
+ "tomwer",
23
+ "scan",
24
+ "data",
25
+ "reduce",
26
+ "dark",
27
+ "flat",
28
+ "reduced",
29
+ ]
30
+
31
+ want_main_area = True
32
+ want_control_area = False
33
+ resizing_enabled = True
34
+
35
+ _configuration = Setting(tuple())
36
+
37
+ class Inputs:
38
+ in_reduced_frames = Input(
39
+ name="reduced frames",
40
+ type=dict,
41
+ doc="dict of containing reduced frames (either dark or flat)",
42
+ multiple=True,
43
+ )
44
+
45
+ class Outputs:
46
+ out_reduced_darks = Output(
47
+ name="reduced dark(s)",
48
+ doc="dict of containing reduced darks(s)",
49
+ type=dict,
50
+ )
51
+ out_reduced_flats = Output(
52
+ name="reduced flat(s)",
53
+ type=dict,
54
+ doc="dict of containing reduced flat(s)",
55
+ )
56
+
57
+ def __init__(self, parent=None):
58
+ """ """
59
+ super().__init__(parent)
60
+
61
+ self._dialog = ReduceDarkFlatSelectorDialog(parent=self)
62
+ self._layout = gui.vBox(self.mainArea, self.name).layout()
63
+ self._layout.addWidget(self._dialog)
64
+
65
+ self._dialog.setConfiguration(self._configuration)
66
+
67
+ # connect signal / slot
68
+ self._dialog.sigSelectActiveAsDarks.connect(self._sendDarks)
69
+ self._dialog.sigSelectActiveAsFlats.connect(self._sendFlats)
70
+ self._dialog.sigUpdated.connect(self._updateConfiguration)
71
+
72
+ def _updateConfiguration(self):
73
+ self._configuration = self.getConfiguration()
74
+
75
+ def _sendDarks(self, darks: dict):
76
+ self.Outputs.out_reduced_darks.send(darks)
77
+
78
+ def _sendFlats(self, flats: dict):
79
+ self.Outputs.out_reduced_flats.send(flats)
80
+
81
+ @Inputs.in_reduced_frames
82
+ def addReduceFrames(self, reduce_frames: Optional[dict], *args, **kwargs):
83
+ if reduce_frames is not None:
84
+ self._dialog.addReduceFrames(reduce_frames)
85
+
86
+ # expose API
87
+ def getConfiguration(self) -> tuple:
88
+ return self._dialog.getConfiguration()
89
+
90
+ def setConfiguration(self, configuration: tuple) -> None:
91
+ if configuration is None:
92
+ return
93
+ return self._dialog.setConfiguration(configuration)
@@ -55,7 +55,6 @@ class SingleTomoObjOW(OWBaseWidget, openclass=True):
55
55
  want_main_area = True
56
56
  want_control_area = False
57
57
  resizing_enabled = True
58
- compress_signal = False
59
58
 
60
59
  ewokstaskclass = tomwer.core.process.control.singletomoobj.SingleTomoObjProcess
61
60
 
@@ -71,12 +70,22 @@ class SingleTomoObjOW(OWBaseWidget, openclass=True):
71
70
  reduced_darks = Output(
72
71
  name="reduced dark(s)",
73
72
  type=dict,
74
- doc="DataUrl of the reduced dark. Key is the relative position, value is the reduced dark",
73
+ doc="Reduced darks as a dict",
75
74
  )
76
75
  reduced_flats = Output(
77
76
  name="reduced flat(s)",
78
77
  type=dict,
79
- doc="DataUrl of the reduced flat. Key is the relative position, value is the reduced flat",
78
+ doc="Reduced flats as a dict",
79
+ )
80
+ relative_reduced_darks = Output(
81
+ name="relative reduced dark(s)",
82
+ type=dict,
83
+ doc="Reduced darks as a dict. Indexes are provided as relative so in [0.0, 1.0[",
84
+ )
85
+ relative_reduced_flats = Output(
86
+ name="relative reduced flat(s)",
87
+ type=dict,
88
+ doc="Reduced flats as a dict. Indexes are provided as relative so in [0.0, 1.0[",
80
89
  )
81
90
 
82
91
  def __init__(self, parent=None):
@@ -129,16 +138,31 @@ class SingleTomoObjOW(OWBaseWidget, openclass=True):
129
138
  # if the data is a scan then provide also access to the reduced frames. Can be convenient
130
139
  if isinstance(data, TomwerScanBase):
131
140
  if data.reduced_darks not in (None, {}):
141
+ reduced_darks = data.reduced_darks
142
+ self.Outputs.reduced_darks.send(reduced_darks)
143
+
132
144
  # we want to send those in relative position to have something generic. This is a convention for now
133
- self.Outputs.reduced_darks.send(
145
+ reduced_darks = (
134
146
  tomoscan.esrf.scan.utils.from_absolute_reduced_frames_to_relative(
135
147
  reduced_frames=data.reduced_darks, scan=data
136
148
  )
137
149
  )
150
+ reduced_darks[
151
+ "reduce_frames_name"
152
+ ] = f"darks from {data.get_identifier().short_description()}"
153
+ self.Outputs.relative_reduced_darks.send(reduced_darks)
154
+
138
155
  if data.reduced_flats not in (None, {}):
156
+ reduced_flats = data.reduced_flats
157
+ self.Outputs.reduced_flats.send(reduced_flats)
158
+
139
159
  # we want to send those in relative position to have something generic. This is a convention for now
140
- self.Outputs.reduced_flats.send(
160
+ reduced_flats = (
141
161
  tomoscan.esrf.scan.utils.from_absolute_reduced_frames_to_relative(
142
162
  reduced_frames=data.reduced_flats, scan=data
143
163
  )
144
164
  )
165
+ reduced_flats[
166
+ "reduce_frames_name"
167
+ ] = f"flats from {data.get_identifier().short_description()}"
168
+ self.Outputs.relative_reduced_flats.send(reduced_flats)
@@ -77,10 +77,9 @@ class TimerOW(SuperviseOW):
77
77
 
78
78
  want_main_area = True
79
79
  resizing_enabled = True
80
- compress_signal = False
81
80
  _waiting_time = Setting(int(1))
82
81
 
83
- ewokstaskclass = tomwer.core.process.control.timer.Timer
82
+ ewokstaskclass = tomwer.core.process.control.timer.TimerTask
84
83
 
85
84
  class Inputs:
86
85
  data = Input(name="data", type=TomwerScanBase, multiple=True)
@@ -55,7 +55,6 @@ class TomoObjSerieOW(OWBaseWidget, openclass=True):
55
55
  want_main_area = True
56
56
  want_control_area = False
57
57
  resizing_enabled = True
58
- compress_signal = False
59
58
 
60
59
  class Inputs:
61
60
  tomo_obj = Input(name="tomo obj", type=TomwerObject, multiple=True)
@@ -62,7 +62,6 @@ class VolumeSelectorOW(OWBaseWidget, openclass=True):
62
62
  want_main_area = True
63
63
  want_control_area = False
64
64
  resizing_enabled = True
65
- compress_signal = False
66
65
 
67
66
  _scanIDs = Setting(list())
68
67
 
@@ -40,7 +40,7 @@ import tomwer.core.process.control.volumesymlink
40
40
  from orangecontrib.tomwer.orange.managedprocess import SuperviseOW
41
41
  from tomwer.core.process.control.volumesymlink import (
42
42
  OutputType,
43
- VolumeSymbolicLinkProcess,
43
+ VolumeSymbolicLinkTask,
44
44
  )
45
45
  from tomwer.core.scan.scanbase import TomwerScanBase
46
46
 
@@ -73,9 +73,8 @@ class VolumeSymLinkOW(SuperviseOW):
73
73
 
74
74
  want_main_area = True
75
75
  resizing_enabled = True
76
- compress_signal = False
77
76
 
78
- ewokstaskclass = tomwer.core.process.control.volumesymlink.VolumeSymbolicLinkProcess
77
+ ewokstaskclass = tomwer.core.process.control.volumesymlink.VolumeSymbolicLinkTask
79
78
 
80
79
  _scans = Setting(list())
81
80
 
@@ -95,17 +94,12 @@ class VolumeSymLinkOW(SuperviseOW):
95
94
  def process(self, scan):
96
95
  if scan is None:
97
96
  return
98
- symlink_process = VolumeSymbolicLinkProcess(
97
+ symlink_process = VolumeSymbolicLinkTask(
99
98
  inputs={
100
99
  "data": scan,
101
100
  "output_type": self._mainWidget.getOutputType(),
102
101
  "output_folder": self._mainWidget.getOutputFolder(),
103
- }
104
- )
105
- symlink_process.set_configuration(
106
- {
107
- "output_type": self._mainWidget.getOutputType(),
108
- "output_folder": self._mainWidget.getOutputFolder(),
102
+ "serialize_output_data": False,
109
103
  }
110
104
  )
111
105
  ProcessManager().notify_dataset_state(
@@ -0,0 +1,58 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ width="48"
6
+ height="48"
7
+ viewBox="0 0 12.7 12.7"
8
+ version="1.1"
9
+ id="svg5"
10
+ inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
11
+ sodipodi:docname="email.svg"
12
+ inkscape:export-filename="email.png"
13
+ inkscape:export-xdpi="96"
14
+ inkscape:export-ydpi="96"
15
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
16
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ xmlns:svg="http://www.w3.org/2000/svg">
19
+ <sodipodi:namedview
20
+ id="namedview7"
21
+ pagecolor="#ffffff"
22
+ bordercolor="#000000"
23
+ borderopacity="0.25"
24
+ inkscape:showpageshadow="2"
25
+ inkscape:pageopacity="0.0"
26
+ inkscape:pagecheckerboard="0"
27
+ inkscape:deskcolor="#d1d1d1"
28
+ inkscape:document-units="mm"
29
+ showgrid="false"
30
+ inkscape:zoom="9.5144352"
31
+ inkscape:cx="8.8812419"
32
+ inkscape:cy="18.813518"
33
+ inkscape:window-width="1920"
34
+ inkscape:window-height="1131"
35
+ inkscape:window-x="0"
36
+ inkscape:window-y="32"
37
+ inkscape:window-maximized="1"
38
+ inkscape:current-layer="layer1" />
39
+ <defs
40
+ id="defs2" />
41
+ <g
42
+ inkscape:label="Layer 1"
43
+ inkscape:groupmode="layer"
44
+ id="layer1">
45
+ <rect
46
+ style="fill:none;stroke-width:0.265;stroke:#000000;stroke-opacity:1;stroke-dasharray:none;stroke-linejoin:round"
47
+ id="rect111"
48
+ width="10.505496"
49
+ height="7.0666666"
50
+ x="1.1707107"
51
+ y="2.9006319" />
52
+ <path
53
+ style="fill:none;stroke:#000000;stroke-width:0.264999;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
54
+ d="M 1.1442134,2.8768056 6.3157073,6.9139034 11.578496,2.9283596"
55
+ id="path908"
56
+ sodipodi:nodetypes="ccc" />
57
+ </g>
58
+ </svg>