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
@@ -22,9 +22,10 @@
22
22
  #
23
23
  #############################################################################
24
24
 
25
- import sysconfig
26
-
27
- import pkg_resources
25
+ try:
26
+ from orangecanvas.utils.pkgmeta import get_distribution
27
+ except ImportError:
28
+ from pkg_resources import get_distribution
28
29
 
29
30
  ICON = "../widgets/icons/tomwer.png"
30
31
 
@@ -33,13 +34,13 @@ BACKGROUND = "#C0CCFF"
33
34
 
34
35
  # Entry point for main Orange categories/widgets discovery
35
36
  def widget_discovery(discovery):
36
- dist = pkg_resources.get_distribution("tomwer")
37
+ dist = get_distribution("tomwer")
37
38
  pkgs = [
38
39
  "orangecontrib.tomwer.widgets.cluster",
39
40
  "orangecontrib.tomwer.widgets.control",
40
41
  "orangecontrib.tomwer.widgets.debugtools",
41
42
  "orangecontrib.tomwer.widgets.edit",
42
- "orangecontrib.tomwer.widgets.icat",
43
+ # "orangecontrib.tomwer.widgets.icat",
43
44
  "orangecontrib.tomwer.widgets.reconstruction",
44
45
  # "orangecontrib.tomwer.widgets.stitching",
45
46
  "orangecontrib.tomwer.widgets.visualization",
@@ -54,11 +55,9 @@ WIDGET_HELP_PATH = (
54
55
  # You still need to build help pages using
55
56
  # make htmlhelp
56
57
  # inside doc folder
57
- ("/build/sphinx/htmlhelp/index.html", None),
58
- #
59
- # Documentation included in wheel
60
- # Correct DATA_FILES entry is needed in setup.py and documentation has to be built
61
- # # before the wheel is created.
62
- (f"{sysconfig.get_path('data')}/help/tomwer/index.html", None),
63
- ("http://www.silx.org/pub/doc/tomwer/htmlhelp/0.9/", None),
58
+ # (
59
+ # "/home/payno/Documents/dev/tomography/tomwer/build/html/canvas/widgets/widgets.html",
60
+ # None,
61
+ # ),
62
+ ("https://tomwer.readthedocs.io/en/latest/canvas/widgets/widgets.html", None),
64
63
  )
@@ -258,12 +258,12 @@ class DataListenerOW(
258
258
 
259
259
  def _jsonRPCConfigChanged(self):
260
260
  self._blissConfiguration = self._widget.getBlissServerConfiguration()
261
- self._static_input[ # pylint: disable=E1137
262
- "bliss_server_configuration"
263
- ] = self._widget.getBlissServerConfiguration()
264
- self._static_input[ # pylint: disable=E1137
265
- "output_dir"
266
- ] = self._widget.getOutputFolder()
261
+ self._static_input["bliss_server_configuration"] = ( # pylint: disable=E1137
262
+ self._widget.getBlissServerConfiguration()
263
+ )
264
+ self._static_input["output_dir"] = ( # pylint: disable=E1137
265
+ self._widget.getOutputFolder()
266
+ )
267
267
  if self.is_active():
268
268
  self.activate(False)
269
269
  self.activate(True)
@@ -166,12 +166,12 @@ class DataValidatorOW(SuperviseOW):
166
166
  def _updateSettings(self):
167
167
  viewer = self._widget._centralWidget
168
168
  self._viewer_config["mode"] = viewer.getDisplayMode() # pylint: disable=E1137
169
- self._viewer_config[ # pylint: disable=E1137
170
- "slice_opt"
171
- ] = viewer.getSliceOption()
172
- self._viewer_config[ # pylint: disable=E1137
173
- "radio_opt"
174
- ] = viewer.getRadioOption()
169
+ self._viewer_config["slice_opt"] = ( # pylint: disable=E1137
170
+ viewer.getSliceOption()
171
+ )
172
+ self._viewer_config["radio_opt"] = ( # pylint: disable=E1137
173
+ viewer.getRadioOption()
174
+ )
175
175
 
176
176
  def _setSettings(self, settings):
177
177
  viewer = self._widget._centralWidget
@@ -36,9 +36,9 @@ class NXTomomillMixIn:
36
36
  assert (
37
37
  self.CONFIG_CLS is not None
38
38
  ), "inheriting classes are expected to redefine CONFIG_CLS"
39
- self._ewoks_default_inputs[
40
- "nxtomomill_cfg_file"
41
- ] = cfg_file # pylint: disable=E1137
39
+ self._ewoks_default_inputs["nxtomomill_cfg_file"] = (
40
+ cfg_file # pylint: disable=E1137
41
+ )
42
42
 
43
43
  if os.path.exists(cfg_file):
44
44
  try:
@@ -42,6 +42,7 @@ from tomwer.core.scan.blissscan import BlissScan
42
42
  from tomwer.core.scan.nxtomoscan import NXtomoScan, NXtomoScanIdentifier
43
43
  from tomwer.gui.control.datalist import BlissHDF5DataListMainWindow
44
44
  from tomwer.gui.control.nxtomomill import NXTomomillInput, OverwriteMessage
45
+ from tomwer.core.process.output import ProcessDataOutputDirMode
45
46
  from ewoksorange.bindings.owwidgets import invalid_data
46
47
 
47
48
 
@@ -137,9 +138,10 @@ class NXTomomillOW(
137
138
  self.add(nxtomo_scan)
138
139
  else:
139
140
  self._scans.append(scan)
140
- self._ewoks_default_inputs[ # pylint: disable=E1137
141
- "output_dir"
142
- ] = self.widget.getOutputFolder()
141
+ output_dir = self.widget.getOutputFolder()
142
+ if isinstance(output_dir, ProcessDataOutputDirMode):
143
+ output_dir = output_dir.value
144
+ self._ewoks_default_inputs["output_dir"] = output_dir # pylint: disable=E1137
143
145
 
144
146
  @property
145
147
  def request_input(self):
@@ -161,11 +163,11 @@ class NXTomomillOW(
161
163
  """
162
164
  # for now we want to avoid propagation any processing.
163
165
  # task will be executed only when the user validates the dialog
164
- h5_scan = super().get_task_inputs().get("hdf5_scan", None)
165
- if h5_scan is not None:
166
- if not isinstance(h5_scan, H5ToNxProcess):
167
- raise TypeError("hdf5_scan is expected to be an instance of NXtomoScan")
168
- self.add(h5_scan.path)
166
+ bliss_scan = super().get_task_inputs().get("bliss_scan", None)
167
+ if bliss_scan is not None:
168
+ if not isinstance(bliss_scan, BlissScan):
169
+ raise TypeError("bliss_scan is expected to be an instance of BlissScan")
170
+ self.add(bliss_scan.master_file)
169
171
 
170
172
  def _convertAndSend(self, bliss_url: str):
171
173
  """
@@ -147,9 +147,9 @@ class SingleTomoObjOW(OWBaseWidget, openclass=True):
147
147
  reduced_frames=data.reduced_darks, scan=data
148
148
  )
149
149
  )
150
- reduced_darks[
151
- "reduce_frames_name"
152
- ] = f"darks from {data.get_identifier().short_description()}"
150
+ reduced_darks["reduce_frames_name"] = (
151
+ f"darks from {data.get_identifier().short_description()}"
152
+ )
153
153
  self.Outputs.relative_reduced_darks.send(reduced_darks)
154
154
 
155
155
  if data.reduced_flats not in (None, {}):
@@ -162,7 +162,7 @@ class SingleTomoObjOW(OWBaseWidget, openclass=True):
162
162
  reduced_frames=data.reduced_flats, scan=data
163
163
  )
164
164
  )
165
- reduced_flats[
166
- "reduce_frames_name"
167
- ] = f"flats from {data.get_identifier().short_description()}"
165
+ reduced_flats["reduce_frames_name"] = (
166
+ f"flats from {data.get_identifier().short_description()}"
167
+ )
168
168
  self.Outputs.relative_reduced_flats.send(reduced_flats)
@@ -156,7 +156,7 @@ class _DatasetGeneratorThread(threading.Thread):
156
156
  n_proj=self.n_proj,
157
157
  n_ini_proj=self.n_proj,
158
158
  create_ini_dark=self.create_ini_dark,
159
- create_ini_ref=self.create_ini_flat,
159
+ create_ini_flat=self.create_ini_flat,
160
160
  dim=self.dims[0],
161
161
  ).scan
162
162
  elif self.type_to_generate == BlissScan.__name__:
@@ -1,98 +1,98 @@
1
- from orangewidget import gui
2
- from orangewidget.settings import Setting
3
-
4
- from silx.gui import qt
5
- import weakref
6
- from ewoksorange.bindings.owwidgets import OWEwoksWidgetOneThreadPerRun
7
-
8
- import tomwer.core.process.icat.createscreenshots
9
- from tomwer.gui.icat.createscreenshots import CreateRawDataScreenshotsWidget
10
- from processview.core.superviseprocess import SuperviseProcess
11
-
12
-
13
- class RawDataScreenshotCreatorOW(
14
- OWEwoksWidgetOneThreadPerRun,
15
- SuperviseProcess,
16
- ewokstaskclass=tomwer.core.process.icat.createscreenshots.CreateRawDataScreenshotsTask,
17
- ):
18
- """
19
- This widget can receive 'data' (scan) and but some screenshot to be pushed on GALLERY.
20
- """
21
-
22
- name = "Create raw data screenshots"
23
- id = "orangecontrib.widgets.tomwer.icat.RawDataScreenshotCreatorOW.RawDataScreenshotCreatorOW"
24
- description = "Create screenshot of the raw data from user wishes. \n"
25
- icon = "icons/raw_screenshots.svg"
26
- priority = 63
27
- keywords = [
28
- "tomography",
29
- "tomwer",
30
- "tomo_obj",
31
- "screenshot",
32
- "raw data",
33
- ]
34
-
35
- want_main_area = True
36
- want_control_area = False
37
- resizing_enabled = True
38
-
39
- _ewoks_default_inputs = Setting(
40
- {
41
- "raw_projections_required": True,
42
- "raw_projections_each": 90,
43
- "raw_darks_required": True,
44
- "raw_flats_required": True,
45
- }
46
- )
47
-
48
- _ewoks_inputs_to_hide_from_orange = (
49
- "__process__",
50
- "raw_projections_required",
51
- "raw_projections_each",
52
- "raw_darks_required",
53
- "raw_flats_required",
54
- )
55
-
56
- def __init__(self, *args, **kwargs):
57
- super().__init__(*args, **kwargs)
58
- SuperviseProcess.__init__(self)
59
- self._widget = CreateRawDataScreenshotsWidget(parent=self)
60
-
61
- self._box = gui.vBox(self.mainArea, self.name)
62
- layout = self._box.layout()
63
- layout.addWidget(self._widget)
64
-
65
- # load settings
66
- self._widget.setConfiguration(self._ewoks_default_inputs)
67
-
68
- # connect signal / slot
69
- self._widget.sigConfigChanged.connect(self._updateSettings)
70
-
71
- def _updateSettings(self):
72
- self._ewoks_default_inputs = self._widget.getConfiguration()
73
-
74
- def handleNewSignals(self) -> None:
75
- """Invoked by the workflow signal propagation manager after all
76
- signals handlers have been called.
77
- """
78
- # for now we want to avoid propagation any processing.
79
- # task will be executed only when the user validates the dialog
80
- if self.get_task_input_value("data", None) is None:
81
- return
82
- else:
83
- super().handleNewSignals()
84
-
85
- def get_task_inputs(self):
86
- task_inputs = super().get_task_inputs()
87
- configuration = self._widget.getConfiguration()
88
- task_inputs["raw_projections_required"] = configuration[
89
- "raw_projections_required"
90
- ]
91
- task_inputs["raw_projections_each"] = configuration["raw_projections_each"]
92
- task_inputs["raw_darks_required"] = configuration["raw_darks_required"]
93
- task_inputs["raw_flats_required"] = configuration["raw_flats_required"]
94
- task_inputs["__process__"] = weakref.ref(self)
95
- return task_inputs
96
-
97
- def sizeHint(self):
98
- return qt.QSize(500, 200)
1
+ # from orangewidget import gui
2
+ # from orangewidget.settings import Setting
3
+
4
+ # from silx.gui import qt
5
+ # import weakref
6
+ # from ewoksorange.bindings.owwidgets import OWEwoksWidgetOneThreadPerRun
7
+
8
+ # import tomwer.core.process.icat.createscreenshots
9
+ # from tomwer.gui.icat.createscreenshots import CreateRawDataScreenshotsWidget
10
+ # from processview.core.superviseprocess import SuperviseProcess
11
+
12
+
13
+ # class RawDataScreenshotCreatorOW(
14
+ # OWEwoksWidgetOneThreadPerRun,
15
+ # SuperviseProcess,
16
+ # ewokstaskclass=tomwer.core.process.icat.createscreenshots.CreateRawDataScreenshotsTask,
17
+ # ):
18
+ # """
19
+ # This widget can receive 'data' (scan) and but some screenshot to be pushed on GALLERY.
20
+ # """
21
+
22
+ # name = "Create raw data screenshots"
23
+ # id = "orangecontrib.widgets.tomwer.icat.RawDataScreenshotCreatorOW.RawDataScreenshotCreatorOW"
24
+ # description = "Create screenshot of the raw data from user wishes. \n"
25
+ # icon = "icons/raw_screenshots.svg"
26
+ # priority = 63
27
+ # keywords = [
28
+ # "tomography",
29
+ # "tomwer",
30
+ # "tomo_obj",
31
+ # "screenshot",
32
+ # "raw data",
33
+ # ]
34
+
35
+ # want_main_area = True
36
+ # want_control_area = False
37
+ # resizing_enabled = True
38
+
39
+ # _ewoks_default_inputs = Setting(
40
+ # {
41
+ # "raw_projections_required": True,
42
+ # "raw_projections_each": 90,
43
+ # "raw_darks_required": True,
44
+ # "raw_flats_required": True,
45
+ # }
46
+ # )
47
+
48
+ # _ewoks_inputs_to_hide_from_orange = (
49
+ # "__process__",
50
+ # "raw_projections_required",
51
+ # "raw_projections_each",
52
+ # "raw_darks_required",
53
+ # "raw_flats_required",
54
+ # )
55
+
56
+ # def __init__(self, *args, **kwargs):
57
+ # super().__init__(*args, **kwargs)
58
+ # SuperviseProcess.__init__(self)
59
+ # self._widget = CreateRawDataScreenshotsWidget(parent=self)
60
+
61
+ # self._box = gui.vBox(self.mainArea, self.name)
62
+ # layout = self._box.layout()
63
+ # layout.addWidget(self._widget)
64
+
65
+ # # load settings
66
+ # self._widget.setConfiguration(self._ewoks_default_inputs)
67
+
68
+ # # connect signal / slot
69
+ # self._widget.sigConfigChanged.connect(self._updateSettings)
70
+
71
+ # def _updateSettings(self):
72
+ # self._ewoks_default_inputs = self._widget.getConfiguration()
73
+
74
+ # def handleNewSignals(self) -> None:
75
+ # """Invoked by the workflow signal propagation manager after all
76
+ # signals handlers have been called.
77
+ # """
78
+ # # for now we want to avoid propagation any processing.
79
+ # # task will be executed only when the user validates the dialog
80
+ # if self.get_task_input_value("data", None) is None:
81
+ # return
82
+ # else:
83
+ # super().handleNewSignals()
84
+
85
+ # def get_task_inputs(self):
86
+ # task_inputs = super().get_task_inputs()
87
+ # configuration = self._widget.getConfiguration()
88
+ # task_inputs["raw_projections_required"] = configuration[
89
+ # "raw_projections_required"
90
+ # ]
91
+ # task_inputs["raw_projections_each"] = configuration["raw_projections_each"]
92
+ # task_inputs["raw_darks_required"] = configuration["raw_darks_required"]
93
+ # task_inputs["raw_flats_required"] = configuration["raw_flats_required"]
94
+ # task_inputs["__process__"] = weakref.ref(self)
95
+ # return task_inputs
96
+
97
+ # def sizeHint(self):
98
+ # return qt.QSize(500, 200)
@@ -1,129 +1,129 @@
1
- from typing import Optional
2
- from orangewidget import gui
3
- from orangewidget.settings import Setting
4
-
5
- from silx.gui import qt
6
- import weakref
7
- from ewoksorange.bindings.owwidgets import OWEwoksWidgetOneThreadPerRun
8
-
9
- from tomwer.core.scan.scanbase import TomwerScanBase
10
- import tomwer.core.process.icat.gallery
11
- from tomwer.gui.icat.gallery import GalleryWidget, _GalleryOutputDir
12
- from processview.core.superviseprocess import SuperviseProcess
13
-
14
-
15
- class SaveToGalleryAndPublishOW(
16
- OWEwoksWidgetOneThreadPerRun,
17
- SuperviseProcess,
18
- ewokstaskclass=tomwer.core.process.icat.gallery.SaveToGalleryAndPublishTask,
19
- ):
20
- """
21
- This widget can receive 'screenshots' signal (expected as a tuple (source, screenshots_dict)
22
- source is the tomo obj associated (so we can automate deduction of the output dir)
23
- screenshots_dict is a dict of str: DataUrl
24
- """
25
-
26
- name = "Save to gallery and publish"
27
- id = "orangecontrib.widgets.tomwer.icat.MoveToGalleryOW.SaveToGalleryAndPublishOW"
28
- description = "This widget will save screenshot of reconstruction to a specific location (acquisition gallery as the default end point) \n"
29
- icon = "icons/add_gallery.svg"
30
- priority = 63
31
- keywords = [
32
- "tomography",
33
- "tomwer",
34
- "tomo_obj",
35
- "screenshot",
36
- "acquisition",
37
- "gallery",
38
- ]
39
-
40
- want_main_area = True
41
- want_control_area = False
42
- resizing_enabled = True
43
-
44
- _ewoks_default_inputs = Setting(
45
- {
46
- "format": "png",
47
- "output_location_mode": "default",
48
- "custom_output": None,
49
- "screenshots": None,
50
- "overwrite": False,
51
- }
52
- )
53
-
54
- _ewoks_inputs_to_hide_from_orange = (
55
- "proposal",
56
- "dataset",
57
- "beamline",
58
- "dry_run",
59
- "__process__",
60
- )
61
-
62
- def __init__(self, *args, **kwargs):
63
- super().__init__(*args, **kwargs)
64
- SuperviseProcess.__init__(self)
65
- self._scan = None
66
- self._widget = GalleryWidget(parent=self)
67
-
68
- self._box = gui.vBox(self.mainArea, self.name)
69
- layout = self._box.layout()
70
- layout.addWidget(self._widget)
71
-
72
- # load settings
73
- self._widget.setConfiguration(self._ewoks_default_inputs)
74
-
75
- # connect signal / slot
76
- self._widget.sigConfigChanged.connect(self._updateSettings)
77
-
78
- def _updateSettings(self):
79
- self._ewoks_default_inputs = self._widget.getConfiguration()
80
-
81
- def setScan(self, scan: TomwerScanBase):
82
- self._scan = weakref.ref(scan)
83
- self._widget._publishConfig.setScan(scan=scan)
84
-
85
- def getScan(self) -> Optional[TomwerScanBase]:
86
- if self._scan is None:
87
- return None
88
- else:
89
- return self._scan()
90
-
91
- def handleNewSignals(self) -> None:
92
- """Invoked by the workflow signal propagation manager after all
93
- signals handlers have been called.
94
- """
95
- # update the widget when receive the scan (proposal, dataset...)
96
- screenshots = self.get_task_input_value("screenshots", None)
97
- if screenshots is None:
98
- return
99
- else:
100
- scan = screenshots.scan
101
- if scan != self.getScan():
102
- self.setScan(scan)
103
-
104
- if self.get_task_input_value("screenshots", None) is None:
105
- return
106
- else:
107
- super().handleNewSignals()
108
-
109
- def get_task_inputs(self):
110
- task_inputs = super().get_task_inputs()
111
- configuration = self._widget.getConfiguration()
112
-
113
- use_custom_output_dir = _GalleryOutputDir.OutputDirMode.from_value(
114
- configuration.get("output_location_mode", "default")
115
- )
116
- # if user requested to overwrite the output directory
117
- if use_custom_output_dir is _GalleryOutputDir.OutputDirMode.PROPOSAL_GALLERY:
118
- task_inputs["screenshots"]["output_dir"] = configuration["custom_output"]
119
-
120
- task_inputs["overwrite"] = configuration["overwrite"]
121
- task_inputs["format"] = configuration["output_format"]
122
- task_inputs["beamline"] = configuration["beamline"]
123
- task_inputs["dataset"] = configuration["dataset"]
124
- task_inputs["proposal"] = configuration["proposal"]
125
- task_inputs["__process__"] = weakref.ref(self)
126
- return task_inputs
127
-
128
- def sizeHint(self):
129
- return qt.QSize(500, 200)
1
+ # from typing import Optional
2
+ # from orangewidget import gui
3
+ # from orangewidget.settings import Setting
4
+
5
+ # from silx.gui import qt
6
+ # import weakref
7
+ # from ewoksorange.bindings.owwidgets import OWEwoksWidgetOneThreadPerRun
8
+
9
+ # from tomwer.core.scan.scanbase import TomwerScanBase
10
+ # import tomwer.core.process.icat.gallery
11
+ # from tomwer.gui.icat.gallery import GalleryWidget, _GalleryOutputDir
12
+ # from processview.core.superviseprocess import SuperviseProcess
13
+
14
+
15
+ # class SaveToGalleryAndPublishOW(
16
+ # OWEwoksWidgetOneThreadPerRun,
17
+ # SuperviseProcess,
18
+ # ewokstaskclass=tomwer.core.process.icat.gallery.SaveToGalleryAndPublishTask,
19
+ # ):
20
+ # """
21
+ # This widget can receive 'screenshots' signal (expected as a tuple (source, screenshots_dict)
22
+ # source is the tomo obj associated (so we can automate deduction of the output dir)
23
+ # screenshots_dict is a dict of str: DataUrl
24
+ # """
25
+
26
+ # name = "Save to gallery and publish"
27
+ # id = "orangecontrib.widgets.tomwer.icat.MoveToGalleryOW.SaveToGalleryAndPublishOW"
28
+ # description = "This widget will save screenshot of reconstruction to a specific location (acquisition gallery as the default end point) \n"
29
+ # icon = "icons/add_gallery.svg"
30
+ # priority = 63
31
+ # keywords = [
32
+ # "tomography",
33
+ # "tomwer",
34
+ # "tomo_obj",
35
+ # "screenshot",
36
+ # "acquisition",
37
+ # "gallery",
38
+ # ]
39
+
40
+ # want_main_area = True
41
+ # want_control_area = False
42
+ # resizing_enabled = True
43
+
44
+ # _ewoks_default_inputs = Setting(
45
+ # {
46
+ # "format": "png",
47
+ # "output_location_mode": "default",
48
+ # "custom_output": None,
49
+ # "screenshots": None,
50
+ # "overwrite": False,
51
+ # }
52
+ # )
53
+
54
+ # _ewoks_inputs_to_hide_from_orange = (
55
+ # "proposal",
56
+ # "dataset",
57
+ # "beamline",
58
+ # "dry_run",
59
+ # "__process__",
60
+ # )
61
+
62
+ # def __init__(self, *args, **kwargs):
63
+ # super().__init__(*args, **kwargs)
64
+ # SuperviseProcess.__init__(self)
65
+ # self._scan = None
66
+ # self._widget = GalleryWidget(parent=self)
67
+
68
+ # self._box = gui.vBox(self.mainArea, self.name)
69
+ # layout = self._box.layout()
70
+ # layout.addWidget(self._widget)
71
+
72
+ # # load settings
73
+ # self._widget.setConfiguration(self._ewoks_default_inputs)
74
+
75
+ # # connect signal / slot
76
+ # self._widget.sigConfigChanged.connect(self._updateSettings)
77
+
78
+ # def _updateSettings(self):
79
+ # self._ewoks_default_inputs = self._widget.getConfiguration()
80
+
81
+ # def setScan(self, scan: TomwerScanBase):
82
+ # self._scan = weakref.ref(scan)
83
+ # self._widget._publishConfig.setScan(scan=scan)
84
+
85
+ # def getScan(self) -> Optional[TomwerScanBase]:
86
+ # if self._scan is None:
87
+ # return None
88
+ # else:
89
+ # return self._scan()
90
+
91
+ # def handleNewSignals(self) -> None:
92
+ # """Invoked by the workflow signal propagation manager after all
93
+ # signals handlers have been called.
94
+ # """
95
+ # # update the widget when receive the scan (proposal, dataset...)
96
+ # screenshots = self.get_task_input_value("screenshots", None)
97
+ # if screenshots is None:
98
+ # return
99
+ # else:
100
+ # scan = screenshots.scan
101
+ # if scan != self.getScan():
102
+ # self.setScan(scan)
103
+
104
+ # if self.get_task_input_value("screenshots", None) is None:
105
+ # return
106
+ # else:
107
+ # super().handleNewSignals()
108
+
109
+ # def get_task_inputs(self):
110
+ # task_inputs = super().get_task_inputs()
111
+ # configuration = self._widget.getConfiguration()
112
+
113
+ # use_custom_output_dir = _GalleryOutputDir.OutputDirMode.from_value(
114
+ # configuration.get("output_location_mode", "default")
115
+ # )
116
+ # # if user requested to overwrite the output directory
117
+ # if use_custom_output_dir is _GalleryOutputDir.OutputDirMode.PROPOSAL_GALLERY:
118
+ # task_inputs["screenshots"]["output_dir"] = configuration["custom_output"]
119
+
120
+ # task_inputs["overwrite"] = configuration["overwrite"]
121
+ # task_inputs["format"] = configuration["output_format"]
122
+ # task_inputs["beamline"] = configuration["beamline"]
123
+ # task_inputs["dataset"] = configuration["dataset"]
124
+ # task_inputs["proposal"] = configuration["proposal"]
125
+ # task_inputs["__process__"] = weakref.ref(self)
126
+ # return task_inputs
127
+
128
+ # def sizeHint(self):
129
+ # return qt.QSize(500, 200)