tomwer 2.0.0.dev0__py3-none-any.whl → 2.0.0.dev2__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.
- orangecontrib/tomwer/__init__.py +1 -1
- orangecontrib/tomwer/orange/managedprocess.py +10 -10
- orangecontrib/tomwer/orange/task_widgets/__init__.py +1 -0
- orangecontrib/tomwer/tutorials/__init__.py +1 -0
- orangecontrib/tomwer/tutorials/darks and flats copy - method 2.ows +42 -0
- orangecontrib/tomwer/tutorials/untitled.ows +15 -0
- orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +3 -3
- orangecontrib/tomwer/widgets/control/NXTomomillOW.py +2 -2
- orangecontrib/tomwer/widgets/control/NXtomoConcatenate.py +3 -3
- orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +1 -1
- orangecontrib/tomwer/widgets/control/__init__.py +0 -1
- orangecontrib/tomwer/widgets/dataportal/__init__.py +1 -2
- orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +2 -2
- orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +3 -3
- orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +4 -4
- orangecontrib/tomwer/widgets/reconstruction/CopyReducedDarkAndFlatOW.py +1 -1
- orangecontrib/tomwer/widgets/reconstruction/MultiCoROW.py +0 -16
- orangecontrib/tomwer/widgets/reconstruction/MultiPagOW.py +1 -1
- orangecontrib/tomwer/widgets/reconstruction/__init__.py +1 -1
- tomwer/core/reconstruction/multi/multicor/multicor.py +0 -1
- tomwer/core/reconstruction/multi/scores/ComputedScore.py +2 -10
- tomwer/core/reconstruction/multi/scores/ScoreMethod.py +0 -1
- tomwer/core/reconstruction/multi/scores/compute.py +2 -39
- tomwer/core/utils/scanutils.py +4 -1
- tomwer/gui/__init__.py +1 -3
- tomwer/gui/conditions/filter.py +1 -1
- tomwer/gui/reconstruction/darkflat/darkflatwidget.py +1 -1
- tomwer/gui/reconstruction/multicor/MultiCoRTabWidget.py +1 -1
- tomwer/gui/reconstruction/multicor/MultiCoRWindow.py +14 -13
- tomwer/gui/reconstruction/multipag/DBScorePlot.py +2 -2
- tomwer/gui/reconstruction/multipag/MultiPagWindowBase.py +15 -12
- tomwer/gui/reconstruction/nabu/castvolume.py +1 -1
- tomwer/gui/reconstruction/nabu/volume/NabuVolumeWidget.py +1 -1
- tomwer/gui/reconstruction/scores/actions/_ScoresPlotAction.py +30 -0
- tomwer/gui/reconstruction/scores/scoreplot.py +53 -70
- tomwer/gui/utils/vignettes.py +0 -6
- tomwer/models/model/__init__.py +1 -0
- tomwer/models/model/_common/data.py +36 -0
- tomwer/models/model/_common/process.py +12 -0
- tomwer/models/model/_common/tomoobj.py +45 -0
- tomwer/models/model/_common/volume.py +26 -0
- tomwer/models/model/cluster/__init__.py +0 -0
- tomwer/models/model/cluster/future_supervisor.py +23 -0
- tomwer/models/model/conditions/__init__.py +0 -0
- tomwer/models/model/conditions/filters.py +26 -0
- tomwer/models/model/control/__init__.py +0 -0
- tomwer/models/model/control/datadiscovery.py +13 -0
- tomwer/models/model/control/scanselector.py +13 -0
- tomwer/models/model/control/singletomoobj.py +16 -0
- tomwer/models/model/control/volumeselector.py +13 -0
- tomwer/models/model/dataportal/__init__.py +0 -0
- tomwer/models/model/dataportal/publish.py +24 -0
- tomwer/models/model/edit/__init__.py +1 -0
- tomwer/models/model/edit/dark_flat_patch.py +13 -0
- tomwer/models/model/edit/imagekey_editor.py +13 -0
- tomwer/models/model/edit/imagekey_upgrader.py +13 -0
- tomwer/models/model/reconstruction/__init__.py +0 -0
- tomwer/{model → models/model}/reconstruction/cast_volume.py +1 -1
- tomwer/models/model/visualization/__init__.py +0 -0
- tomwer/models/reconstruction/__init__.py +0 -0
- tomwer/models/reconstruction/cast_volume.py +145 -0
- tomwer/models/reconstruction/compute_dark_flat.py +56 -0
- tomwer/models/reconstruction/copy_reduced_frames.py +140 -0
- tomwer/models/reconstruction/cor.py +58 -0
- tomwer/models/reconstruction/estimate_motion_io.py +44 -0
- tomwer/models/reconstruction/multicor.py +73 -0
- tomwer/models/reconstruction/nabu_settings.py +20 -0
- tomwer/models/reconstruction/nabu_slices.py +78 -0
- tomwer/models/reconstruction/nabu_volume.py +62 -0
- tomwer/models/reconstruction/reduced_frames.py +46 -0
- tomwer/models/visualization/__init__.py +0 -0
- tomwer/models/visualization/dataviewer.py +8 -0
- tomwer/models/visualization/volume_viewer.py +23 -0
- tomwer/tasks/cluster/__init__.py +1 -0
- tomwer/tasks/cluster/supervisor.py +1 -1
- tomwer/tasks/conditions/__init__.py +1 -0
- tomwer/tasks/conditions/filters.py +1 -1
- tomwer/tasks/control/datadiscovery.py +1 -1
- tomwer/tasks/control/scanselector.py +1 -1
- tomwer/tasks/control/singletomoobj.py +1 -1
- tomwer/tasks/control/volumeselector.py +1 -1
- tomwer/tasks/dataportal/publish.py +1 -1
- tomwer/tasks/edit/darkflatpatch.py +1 -1
- tomwer/tasks/edit/imagekey_upgrader.py +1 -1
- tomwer/tasks/edit/imagekeyeditor.py +1 -1
- tomwer/tasks/reconstruction/copydarkflat.py +2 -2
- tomwer/tasks/reconstruction/cor.py +1 -1
- tomwer/tasks/reconstruction/nabu/castvolume.py +1 -1
- tomwer/tasks/reconstruction/nabu/config.py +1 -1
- tomwer/tasks/reconstruction/nabu/estimate_motion.py +1 -1
- tomwer/tasks/reconstruction/nabu/multicor.py +1 -1
- tomwer/tasks/reconstruction/nabu/multipag.py +0 -2
- tomwer/tasks/reconstruction/nabu/nabuvolume.py +1 -1
- tomwer/tasks/reconstruction/nabu/slices.py +1 -1
- tomwer/tasks/reconstruction/reducedarkflat.py +2 -2
- tomwer/tasks/reconstruction/tests/test_dark_and_flat.py +1 -1
- tomwer/tasks/script/__init__.py +1 -0
- tomwer/tasks/visualization/__init__.py +1 -0
- tomwer/tasks/visualization/dataviewer.py +1 -1
- tomwer/tasks/visualization/volume_viewer.py +1 -1
- tomwer/tests/orangecontrib/tomwer/widgets/reconstruction/tests/test_cast_volumeow.py +1 -1
- tomwer/version.py +1 -1
- {tomwer-2.0.0.dev0.dist-info → tomwer-2.0.0.dev2.dist-info}/METADATA +1 -1
- {tomwer-2.0.0.dev0.dist-info → tomwer-2.0.0.dev2.dist-info}/RECORD +144 -104
- tomwer-2.0.0.dev2.dist-info/pkg_info +205 -0
- tomwer-2.0.0.dev2.dist-info/sources.txt +1030 -0
- tomwer/app/canvas_launcher/schemeedit.py +0 -23
- /tomwer/{model/_common → gui/reconstruction/scores/actions}/__init__.py +0 -0
- /tomwer/{model → models}/__init__.py +0 -0
- /tomwer/{model/cluster → models/_common}/__init__.py +0 -0
- /tomwer/{model → models}/_common/data.py +0 -0
- /tomwer/{model → models}/_common/process.py +0 -0
- /tomwer/{model → models}/_common/tomoobj.py +0 -0
- /tomwer/{model → models}/_common/volume.py +0 -0
- /tomwer/{model/conditions → models/cluster}/__init__.py +0 -0
- /tomwer/{model → models}/cluster/future_supervisor.py +0 -0
- /tomwer/{model/control → models/conditions}/__init__.py +0 -0
- /tomwer/{model → models}/conditions/filters.py +0 -0
- /tomwer/{model/dataportal → models/control}/__init__.py +0 -0
- /tomwer/{model → models}/control/datadiscovery.py +0 -0
- /tomwer/{model → models}/control/scanselector.py +0 -0
- /tomwer/{model → models}/control/singletomoobj.py +0 -0
- /tomwer/{model → models}/control/volumeselector.py +0 -0
- /tomwer/{model/reconstruction → models/dataportal}/__init__.py +0 -0
- /tomwer/{model → models}/dataportal/publish.py +0 -0
- /tomwer/{model → models}/edit/__init__.py +0 -0
- /tomwer/{model → models}/edit/dark_flat_patch.py +0 -0
- /tomwer/{model → models}/edit/imagekey_editor.py +0 -0
- /tomwer/{model → models}/edit/imagekey_upgrader.py +0 -0
- /tomwer/{model/visualization → models/model/_common}/__init__.py +0 -0
- /tomwer/{model → models/model}/reconstruction/compute_dark_flat.py +0 -0
- /tomwer/{model → models/model}/reconstruction/copy_reduced_frames.py +0 -0
- /tomwer/{model → models/model}/reconstruction/cor.py +0 -0
- /tomwer/{model → models/model}/reconstruction/estimate_motion_io.py +0 -0
- /tomwer/{model → models/model}/reconstruction/multicor.py +0 -0
- /tomwer/{model → models/model}/reconstruction/nabu_settings.py +0 -0
- /tomwer/{model → models/model}/reconstruction/nabu_slices.py +0 -0
- /tomwer/{model → models/model}/reconstruction/nabu_volume.py +0 -0
- /tomwer/{model → models/model}/reconstruction/reduced_frames.py +0 -0
- /tomwer/{model → models/model}/visualization/dataviewer.py +0 -0
- /tomwer/{model → models/model}/visualization/volume_viewer.py +0 -0
- {tomwer-2.0.0.dev0.dist-info → tomwer-2.0.0.dev2.dist-info}/WHEEL +0 -0
- {tomwer-2.0.0.dev0.dist-info → tomwer-2.0.0.dev2.dist-info}/entry_points.txt +0 -0
- {tomwer-2.0.0.dev0.dist-info → tomwer-2.0.0.dev2.dist-info}/licenses/LICENSE +0 -0
- {tomwer-2.0.0.dev0.dist-info → tomwer-2.0.0.dev2.dist-info}/top_level.txt +0 -0
orangecontrib/tomwer/__init__.py
CHANGED
|
@@ -30,29 +30,29 @@ class _SuperviseBase(SuperviseProcess):
|
|
|
30
30
|
except Exception as e:
|
|
31
31
|
_logger.warning(f"Fail to update process name. Error is {e}")
|
|
32
32
|
|
|
33
|
-
def notify_skip(self,
|
|
33
|
+
def notify_skip(self, tomo_obj, details=None):
|
|
34
34
|
ProcessManager().notify_dataset_state(
|
|
35
|
-
dataset=
|
|
35
|
+
dataset=tomo_obj, process=self, state=DatasetState.SKIPPED, details=details
|
|
36
36
|
)
|
|
37
37
|
|
|
38
|
-
def notify_pending(self,
|
|
38
|
+
def notify_pending(self, tomo_obj, details=None):
|
|
39
39
|
ProcessManager().notify_dataset_state(
|
|
40
|
-
dataset=
|
|
40
|
+
dataset=tomo_obj, process=self, state=DatasetState.PENDING, details=details
|
|
41
41
|
)
|
|
42
42
|
|
|
43
|
-
def notify_succeed(self,
|
|
43
|
+
def notify_succeed(self, tomo_obj, details=None):
|
|
44
44
|
ProcessManager().notify_dataset_state(
|
|
45
|
-
dataset=
|
|
45
|
+
dataset=tomo_obj, process=self, state=DatasetState.SUCCEED, details=details
|
|
46
46
|
)
|
|
47
47
|
|
|
48
|
-
def notify_failed(self,
|
|
48
|
+
def notify_failed(self, tomo_obj, details=None):
|
|
49
49
|
ProcessManager().notify_dataset_state(
|
|
50
|
-
dataset=
|
|
50
|
+
dataset=tomo_obj, process=self, state=DatasetState.FAILED, details=details
|
|
51
51
|
)
|
|
52
52
|
|
|
53
|
-
def notify_on_going(self,
|
|
53
|
+
def notify_on_going(self, tomo_obj, details=None):
|
|
54
54
|
ProcessManager().notify_dataset_state(
|
|
55
|
-
dataset=
|
|
55
|
+
dataset=tomo_obj, process=self, state=DatasetState.ON_GOING, details=details
|
|
56
56
|
)
|
|
57
57
|
|
|
58
58
|
def _startProcessing(self, *args, **kwargs):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Some generic widgets for Orange Canvas in the use case of tomography."""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Set of tutorials for Orange3-Tomwer."""
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
+
<scheme version="2.0" title="darks and flats copy - method 2" description="">
|
|
3
|
+
<nodes>
|
|
4
|
+
<node id="0" name="scan selector" qualified_name="orangecontrib.tomwer.widgets.control.DataSelectorOW.DataSelectorOW" project_name="tomwer" version="" title="scan selector" position="(-519.0, -209.0)" />
|
|
5
|
+
<node id="1" name="image-key-upgrader" qualified_name="orangecontrib.tomwer.widgets.edit.ImageKeyUpgraderOW.ImageKeyUpgraderOW" project_name="tomwer" version="" title="image-key-upgrader" position="(-293.0, -209.0)" />
|
|
6
|
+
<node id="2" name="scan selector" qualified_name="orangecontrib.tomwer.widgets.control.DataSelectorOW.DataSelectorOW" project_name="tomwer" version="" title="scan selector (1)" position="(291.0, -211.0)" />
|
|
7
|
+
<node id="3" name="copy reduced darks and flats" qualified_name="orangecontrib.tomwer.widgets.reconstruction.CopyReducedDarkAndFlatOW.CopyReducedDarkAndFlatOW" project_name="tomwer" version="" title="copy reduced darks and flats" position="(61.0, -213.0)" />
|
|
8
|
+
</nodes>
|
|
9
|
+
<links>
|
|
10
|
+
<link id="0" source_node_id="0" sink_node_id="1" source_channel="data" sink_channel="data" enabled="true" source_channel_id="data" sink_channel_id="data" />
|
|
11
|
+
<link id="1" source_node_id="1" sink_node_id="3" source_channel="data" sink_channel="data" enabled="true" source_channel_id="data" sink_channel_id="data" />
|
|
12
|
+
<link id="2" source_node_id="3" sink_node_id="2" source_channel="data" sink_channel="data" enabled="true" source_channel_id="data" sink_channel_id="data" />
|
|
13
|
+
</links>
|
|
14
|
+
<annotations>
|
|
15
|
+
<text id="0" type="text/plain" rect="(-597.0, -79.0, 150.0, 126.0)" font-family="Sans" font-size="16">step2: provide scans for which we need to copy reduced darks and flats</text>
|
|
16
|
+
<arrow id="1" start="(-522.0, -87.0)" end="(-523.0, -151.0)" fill="#C1272D" />
|
|
17
|
+
<text id="2" type="text/plain" rect="(-379.0, -87.0, 236.0, 111.0)" font-family="Sans" font-size="16">invalid any existing darks or flats frames (else reduced darks and flats will use them instead of making the copy)</text>
|
|
18
|
+
<arrow id="3" start="(-293.0, -97.0)" end="(-290.0, -158.0)" fill="#C1272D" />
|
|
19
|
+
<text id="4" type="text/plain" rect="(-70.0, -81.0, 270.0, 80.0)" font-family="Sans" font-size="16">will copy reduced darks / flats to `dataset_{darks|flats}.hdf5` to be used for reconstruction</text>
|
|
20
|
+
<arrow id="5" start="(61.99999999999998, -91.0)" end="(61.99999999999998, -142.0)" fill="#C1272D" />
|
|
21
|
+
<text id="6" type="text/plain" rect="(-141.0, -427.0, 464.0, 85.0)" font-family="Sans" font-size="16">step1: provide reduced darks and flats from the 'copy' tab,
|
|
22
|
+
unselecting auto and setting them through `select darks url` and `select flats url`</text>
|
|
23
|
+
<arrow id="7" start="(57.0, -334.0)" end="(58.99999999999997, -259.00000000000006)" fill="#C1272D" />
|
|
24
|
+
<text id="8" type="text/plain" rect="(241.0, -94.0, 150.0, 88.0)" font-family="Sans" font-size="16">result: scans with copied reduced darks / flats</text>
|
|
25
|
+
<text id="9" type="text/plain" rect="(-601.0, -590.0, 932.0, 68.0)" font-family="Sans" font-size="16">Context: on this workflow we want to copy reduced flats / darks from a dataset to others.
|
|
26
|
+
This one of the various way to do this.
|
|
27
|
+
</text>
|
|
28
|
+
<text id="10" type="text/plain" rect="(-593.0, 94.0, 919.0, 84.0)" font-family="Sans" font-size="16">Note: reduced darks / flats can be saved to disk from another python script using the `silx.io.dictdump` dicttoh5 function.
|
|
29
|
+
Reduced darks and flats are dictionary with index in the sequence as key (so index==0 if the dark / flat serie is done at the beginning) and the reduced darks / flats as value (2D numpy array) </text>
|
|
30
|
+
<arrow id="11" start="(291.0, -109.0)" end="(290.0, -158.0)" fill="#C1272D" />
|
|
31
|
+
</annotations>
|
|
32
|
+
<thumbnail />
|
|
33
|
+
<node_properties>
|
|
34
|
+
<properties node_id="0" format="literal">{'_scanIDs': [], 'controlAreaVisible': True, 'savedWidgetGeometry': None, '__version__': 1}</properties>
|
|
35
|
+
<properties node_id="1" format="literal">{'_ewoks_default_inputs': {'operations': {}}, '_ewoks_execinfo': {}, '_ewoks_task_options': {}, '_ewoks_varinfo': {}, 'controlAreaVisible': True, 'default_inputs': {}, 'savedWidgetGeometry': None, '__version__': 1}</properties>
|
|
36
|
+
<properties node_id="2" format="literal">{'_scanIDs': [], 'controlAreaVisible': True, 'savedWidgetGeometry': None, '__version__': 1}</properties>
|
|
37
|
+
<properties node_id="3" format="literal">{'_auto_mode': True, '_ewoks_default_inputs': {}, '_ewoks_execinfo': {}, '_ewoks_task_options': {}, '_ewoks_varinfo': {}, 'controlAreaVisible': True, 'default_inputs': {}, 'savedWidgetGeometry': None, '__version__': 1}</properties>
|
|
38
|
+
</node_properties>
|
|
39
|
+
<session_state>
|
|
40
|
+
<window_groups />
|
|
41
|
+
</session_state>
|
|
42
|
+
</scheme>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
+
<scheme version="2.0" title="" description="">
|
|
3
|
+
<nodes>
|
|
4
|
+
<node id="0" name="nabu volume reconstruction" qualified_name="orangecontrib.tomwer.widgets.reconstruction.NabuVolumeOW.NabuVolumeOW" project_name="tomwer" version="" title="nabu volume reconstruction" position="(440.0, 214.0)" />
|
|
5
|
+
</nodes>
|
|
6
|
+
<links />
|
|
7
|
+
<annotations />
|
|
8
|
+
<thumbnail />
|
|
9
|
+
<node_properties>
|
|
10
|
+
<properties node_id="0" format="literal">{'_ewoks_default_inputs': {'data': None, 'nabu_volume_params': None, 'nabu_params': None}, 'controlAreaVisible': True, 'savedWidgetGeometry': b'\x01\xd9\xd0\xcb\x00\x03\x00\x00\x00\x00\x03\x08\x00\x00\x01o\x00\x00\x04\xd1\x00\x00\x03\xe5\x00\x00\x03\x08\x00\x00\x01\x94\x00\x00\x04\xd1\x00\x00\x03\xe5\x00\x00\x00\x00\x00\x00\x00\x00\x07\x80\x00\x00\x03\x08\x00\x00\x01\x94\x00\x00\x04\xd1\x00\x00\x03\xe5', '__version__': 1}</properties>
|
|
11
|
+
</node_properties>
|
|
12
|
+
<session_state>
|
|
13
|
+
<window_groups />
|
|
14
|
+
</session_state>
|
|
15
|
+
</scheme>
|
|
@@ -171,7 +171,7 @@ class EDF2NXOW(
|
|
|
171
171
|
edf_to_nx_configuration=self.__configuration_cache.to_nested_model().model_dump()
|
|
172
172
|
)
|
|
173
173
|
|
|
174
|
-
self.notify_on_going(
|
|
174
|
+
self.notify_on_going(tomo_obj=NXtomoScan(output_file, output_entry))
|
|
175
175
|
try:
|
|
176
176
|
self._execute_ewoks_task( # pylint: disable=E1123
|
|
177
177
|
propagate=True,
|
|
@@ -210,9 +210,9 @@ class EDF2NXOW(
|
|
|
210
210
|
"entry",
|
|
211
211
|
)
|
|
212
212
|
if task_suceeded:
|
|
213
|
-
self.notify_succeed(
|
|
213
|
+
self.notify_succeed(tomo_obj=scan)
|
|
214
214
|
else:
|
|
215
|
-
self.notify_failed(
|
|
215
|
+
self.notify_failed(tomo_obj=scan)
|
|
216
216
|
except Exception as e:
|
|
217
217
|
logger.error(f"failed to handle task finished callback. Reason is {e}")
|
|
218
218
|
|
|
@@ -303,9 +303,9 @@ class NXTomomillOW(
|
|
|
303
303
|
config = H52nxModel.from_dict(config)
|
|
304
304
|
scan = task_executor.current_task.outputs.data
|
|
305
305
|
if task_suceeded:
|
|
306
|
-
self.notify_succeed(
|
|
306
|
+
self.notify_succeed(tomo_obj=scan)
|
|
307
307
|
else:
|
|
308
|
-
self.notify_failed(
|
|
308
|
+
self.notify_failed(tomo_obj=scan)
|
|
309
309
|
except Exception as e:
|
|
310
310
|
logger.error(f"failed to handle task finished callback. Reason is {e}")
|
|
311
311
|
|
|
@@ -164,9 +164,9 @@ class NXtomoConcatenateOW(
|
|
|
164
164
|
task_suceeded = task_executor.succeeded
|
|
165
165
|
scan = task_executor.current_task.outputs.data
|
|
166
166
|
if task_suceeded:
|
|
167
|
-
self.notify_succeed(
|
|
167
|
+
self.notify_succeed(tomo_obj=scan)
|
|
168
168
|
else:
|
|
169
|
-
self.notify_failed(
|
|
169
|
+
self.notify_failed(tomo_obj=scan)
|
|
170
170
|
except Exception as e:
|
|
171
171
|
_logger.error(f"failed to handle task finished callback. Reason is {e}")
|
|
172
172
|
|
|
@@ -186,7 +186,7 @@ class NXtomoConcatenateOW(
|
|
|
186
186
|
),
|
|
187
187
|
entry=self.getOutputEntry(),
|
|
188
188
|
)
|
|
189
|
-
self.notify_pending(
|
|
189
|
+
self.notify_pending(tomo_obj=scan_about_to_be_created)
|
|
190
190
|
self.execute_ewoks_task()
|
|
191
191
|
|
|
192
192
|
def sizeHint(self) -> qt.QSize:
|
|
@@ -13,7 +13,7 @@ from tomwer.core.scan.scanfactory import ScanFactory
|
|
|
13
13
|
from tomwer.core.tomwer_object import TomwerObject
|
|
14
14
|
from tomwer.core.volume.volumefactory import VolumeFactory
|
|
15
15
|
from tomwer.gui.control.singletomoobj import SingleTomoObj
|
|
16
|
-
from tomwer.
|
|
16
|
+
from tomwer.models.reconstruction.reduced_frames import ReducedFrames
|
|
17
17
|
from tomwer.core.utils.scanutils import create_scan_reduced_darks_and_flats_models
|
|
18
18
|
|
|
19
19
|
_logger = logging.getLogger(__name__)
|
|
@@ -146,8 +146,8 @@ class DarkFlatPatchOW(
|
|
|
146
146
|
task_suceeded = task_executor.succeeded
|
|
147
147
|
scan = task_executor.current_task.inputs.data
|
|
148
148
|
if task_suceeded:
|
|
149
|
-
self.notify_succeed(
|
|
149
|
+
self.notify_succeed(tomo_obj=scan)
|
|
150
150
|
else:
|
|
151
|
-
self.notify_failed(
|
|
151
|
+
self.notify_failed(tomo_obj=scan)
|
|
152
152
|
except Exception as e:
|
|
153
153
|
_logger.error(f"failed to handle task finished callback. Reason is {e}")
|
|
@@ -64,7 +64,7 @@ class ImageKeyEditorOW(
|
|
|
64
64
|
if scan is not self._scan:
|
|
65
65
|
self._scan = scan
|
|
66
66
|
self.widget.setScan(scan)
|
|
67
|
-
self.notify_pending(
|
|
67
|
+
self.notify_pending(tomo_obj=scan)
|
|
68
68
|
self.activateWindow()
|
|
69
69
|
self.raise_()
|
|
70
70
|
self.show()
|
|
@@ -93,8 +93,8 @@ class ImageKeyEditorOW(
|
|
|
93
93
|
task_suceeded = task_executor.succeeded
|
|
94
94
|
scan = task_executor.current_task.inputs.data
|
|
95
95
|
if task_suceeded:
|
|
96
|
-
self.notify_succeed(
|
|
96
|
+
self.notify_succeed(tomo_obj=scan)
|
|
97
97
|
else:
|
|
98
|
-
self.notify_failed(
|
|
98
|
+
self.notify_failed(tomo_obj=scan)
|
|
99
99
|
except Exception as e:
|
|
100
100
|
_logger.error(f"failed to handle task finished callback. Reason is {e}")
|
|
@@ -80,14 +80,14 @@ class ImageKeyUpgraderOW(
|
|
|
80
80
|
except KeyError:
|
|
81
81
|
pass
|
|
82
82
|
else:
|
|
83
|
-
self.notify_pending(
|
|
83
|
+
self.notify_pending(tomo_obj=scan)
|
|
84
84
|
return task_inputs
|
|
85
85
|
|
|
86
86
|
def _execute_ewoks_task(self, propagate, log_missing_inputs=False):
|
|
87
87
|
task_arguments = self._get_task_arguments()
|
|
88
88
|
scan = task_arguments.get("inputs", {}).get("data", None)
|
|
89
89
|
if scan is not None:
|
|
90
|
-
self.notify_pending(
|
|
90
|
+
self.notify_pending(tomo_obj=scan)
|
|
91
91
|
super()._execute_ewoks_task( # pylint: disable=E1123
|
|
92
92
|
propagate=propagate, log_missing_inputs=log_missing_inputs
|
|
93
93
|
)
|
|
@@ -98,8 +98,8 @@ class ImageKeyUpgraderOW(
|
|
|
98
98
|
task_suceeded = task_executor.succeeded
|
|
99
99
|
scan = task_executor.current_task.inputs.data
|
|
100
100
|
if task_suceeded:
|
|
101
|
-
self.notify_succeed(
|
|
101
|
+
self.notify_succeed(tomo_obj=scan)
|
|
102
102
|
else:
|
|
103
|
-
self.notify_failed(
|
|
103
|
+
self.notify_failed(tomo_obj=scan)
|
|
104
104
|
except Exception as e:
|
|
105
105
|
_logger.error(f"failed to handle task finished callback. Reason is {e}")
|
|
@@ -21,7 +21,7 @@ from tomwer.gui.reconstruction.darkflat.darkflatcopywidget import (
|
|
|
21
21
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
|
22
22
|
from tomwer.core.utils.scanutils import create_scan_reduced_darks_and_flats_models
|
|
23
23
|
from tomwer.tasks.reconstruction.copydarkflat import CopyReducedDarkFlatTask
|
|
24
|
-
from tomwer.
|
|
24
|
+
from tomwer.models.reconstruction.reduced_frames import ReducedFrames
|
|
25
25
|
from orangecontrib.tomwer.orange.ewoks_compatibility import unpack_variable
|
|
26
26
|
|
|
27
27
|
_logger = logging.getLogger(__name__)
|
|
@@ -209,22 +209,6 @@ class MultiCoROW(
|
|
|
209
209
|
self.raise_()
|
|
210
210
|
self.show()
|
|
211
211
|
|
|
212
|
-
def cancel(self, scan):
|
|
213
|
-
# function call when we want to cancel the given scan
|
|
214
|
-
if scan is None:
|
|
215
|
-
return
|
|
216
|
-
if scan in self._widget._processing_stack:
|
|
217
|
-
self._widget._processing_stack.remove(scan)
|
|
218
|
-
if (
|
|
219
|
-
self._widget._processing_stack._data_currently_computed.get_identifier().to_str()
|
|
220
|
-
== scan.get_identifier().to_str()
|
|
221
|
-
):
|
|
222
|
-
# stop current processing
|
|
223
|
-
self._widget._processing_stack.cancel()
|
|
224
|
-
# if possible process next
|
|
225
|
-
if self._widget._processing_stack.can_process_next():
|
|
226
|
-
self._widget._processing_stack._process_next()
|
|
227
|
-
|
|
228
212
|
def computeEstimatedCor(self) -> float | None:
|
|
229
213
|
"""callback when calculation of a estimated cor is requested"""
|
|
230
214
|
scan = self.get_task_input_value("data", None)
|
|
@@ -202,7 +202,7 @@ class MultiPagOW(SuperviseOW, openclass=True):
|
|
|
202
202
|
DatasetState.WAIT_USER_VALIDATION,
|
|
203
203
|
):
|
|
204
204
|
details = "Was pending and has been replaced by another scan."
|
|
205
|
-
self.notify_skip(
|
|
205
|
+
self.notify_skip(tomo_obj=scan, details=details)
|
|
206
206
|
self.Outputs.nabu_params.send(
|
|
207
207
|
scan.nabu_recons_params,
|
|
208
208
|
)
|
|
@@ -10,10 +10,9 @@ class ComputedScore:
|
|
|
10
10
|
Will all result of the different score calculation method and getter on those and their inverse
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
def __init__(self, tv, std
|
|
13
|
+
def __init__(self, tv, std):
|
|
14
14
|
self._tv = tv
|
|
15
15
|
self._std = std
|
|
16
|
-
self._tomo_consistency = tomo_consistency
|
|
17
16
|
|
|
18
17
|
@property
|
|
19
18
|
def total_variation(self):
|
|
@@ -23,10 +22,6 @@ class ComputedScore:
|
|
|
23
22
|
def std(self):
|
|
24
23
|
return self._std
|
|
25
24
|
|
|
26
|
-
@property
|
|
27
|
-
def tomo_consistency(self):
|
|
28
|
-
return self._tomo_consistency
|
|
29
|
-
|
|
30
25
|
def get(self, method: ScoreMethod):
|
|
31
26
|
method = ScoreMethod(method)
|
|
32
27
|
if method is ScoreMethod.TV:
|
|
@@ -37,8 +32,6 @@ class ComputedScore:
|
|
|
37
32
|
return self.std
|
|
38
33
|
elif method is ScoreMethod.STD_INVERSE:
|
|
39
34
|
return 1.0 / self.std
|
|
40
|
-
elif method is ScoreMethod.TOMO_CONSISTENCY:
|
|
41
|
-
return self.tomo_consistency
|
|
42
35
|
else:
|
|
43
36
|
raise ValueError(f"{method} is an unrecognized method")
|
|
44
37
|
|
|
@@ -49,8 +42,7 @@ class ComputedScore:
|
|
|
49
42
|
return (
|
|
50
43
|
self.total_variation == __value.total_variation
|
|
51
44
|
and self.std == __value.std
|
|
52
|
-
and self.tomo_consistency == __value.tomo_consistency
|
|
53
45
|
)
|
|
54
46
|
|
|
55
47
|
def __str__(self) -> str:
|
|
56
|
-
return f"std: {self.std} - tv: {self.total_variation}
|
|
48
|
+
return f"std: {self.std} - tv: {self.total_variation}"
|
|
@@ -10,29 +10,6 @@ from tomwer.core.reconstruction.multi.scores.ScoreMethod import ScoreMethod
|
|
|
10
10
|
_logger = logging.getLogger(__name__)
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
def compute_tomo_consistency(
|
|
14
|
-
data: numpy.ndarray,
|
|
15
|
-
original_sinogram,
|
|
16
|
-
angles,
|
|
17
|
-
original_axis_position,
|
|
18
|
-
detector_width,
|
|
19
|
-
):
|
|
20
|
-
from silx.opencl.projection import Projection
|
|
21
|
-
|
|
22
|
-
projector = Projection(
|
|
23
|
-
slice_shape=data.shape,
|
|
24
|
-
angles=angles,
|
|
25
|
-
detector_width=detector_width,
|
|
26
|
-
axis_position=original_axis_position,
|
|
27
|
-
)
|
|
28
|
-
sinogram = projector.projection(data)
|
|
29
|
-
sinogram_n = (sinogram - sinogram.min()) / (sinogram.max() - sinogram.min())
|
|
30
|
-
original_sinogram_n = (original_sinogram - original_sinogram.min()) / (
|
|
31
|
-
original_sinogram.max() - original_sinogram.min()
|
|
32
|
-
)
|
|
33
|
-
return 1.0 / (numpy.sum(numpy.abs(sinogram_n - original_sinogram_n)) + 1)
|
|
34
|
-
|
|
35
|
-
|
|
36
13
|
def compute_score_contrast_std(data: numpy.ndarray):
|
|
37
14
|
"""
|
|
38
15
|
Compute a contrast score by simply computing the standard deviation of
|
|
@@ -93,22 +70,8 @@ def compute_score(
|
|
|
93
70
|
pass
|
|
94
71
|
else:
|
|
95
72
|
raise ValueError(f"Data is expected to be 2D. Not {data.ndim}D")
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return compute_tomo_consistency(
|
|
99
|
-
data=data,
|
|
100
|
-
angles=angles,
|
|
101
|
-
original_sinogram=original_sinogram,
|
|
102
|
-
original_axis_position=original_axis_position,
|
|
103
|
-
detector_width=detector_width,
|
|
104
|
-
)
|
|
105
|
-
except ImportError:
|
|
106
|
-
return None
|
|
107
|
-
except Exception as e:
|
|
108
|
-
_logger.warning(f"Fail to compute 'tomo consistency' score. Reason is {e}")
|
|
109
|
-
return None
|
|
110
|
-
else:
|
|
111
|
-
fct = METHOD_TO_FCT.get(method, None)
|
|
73
|
+
|
|
74
|
+
fct = METHOD_TO_FCT.get(method, None)
|
|
112
75
|
|
|
113
76
|
if fct is not None:
|
|
114
77
|
return fct(data)
|
tomwer/core/utils/scanutils.py
CHANGED
|
@@ -25,7 +25,10 @@ from tomwer.core.scan.nxtomoscan import NXtomoScan
|
|
|
25
25
|
from tomwer.core.scan.edfscan import EDFTomoScan
|
|
26
26
|
from tomwer.core.scan.scanfactory import ScanFactory
|
|
27
27
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
|
28
|
-
from tomwer.
|
|
28
|
+
from tomwer.models.reconstruction.reduced_frames import (
|
|
29
|
+
ReducedFrames,
|
|
30
|
+
ReducedFramesInfos,
|
|
31
|
+
)
|
|
29
32
|
|
|
30
33
|
_logger = logging.getLogger(__name__)
|
|
31
34
|
|
tomwer/gui/__init__.py
CHANGED
tomwer/gui/conditions/filter.py
CHANGED
|
@@ -11,7 +11,7 @@ from __future__ import annotations
|
|
|
11
11
|
from silx.gui import qt
|
|
12
12
|
from typing import get_args
|
|
13
13
|
|
|
14
|
-
from tomwer.
|
|
14
|
+
from tomwer.models.conditions.filters import InputModel
|
|
15
15
|
from tomwer.gui import icons
|
|
16
16
|
from tomwer.gui.utils.sandboxes import (
|
|
17
17
|
RegularExpressionSandBox,
|
|
@@ -7,7 +7,7 @@ from silx.gui import qt
|
|
|
7
7
|
|
|
8
8
|
from tomoscan.framereducer.method import ReduceMethod
|
|
9
9
|
|
|
10
|
-
from tomwer.
|
|
10
|
+
from tomwer.models.reconstruction.compute_dark_flat import (
|
|
11
11
|
DEFAULT_EDF_SPEC_FLAT_PATTERN,
|
|
12
12
|
DEFAULT_EDF_SPEC_DARK_PATTERN,
|
|
13
13
|
)
|
|
@@ -36,7 +36,7 @@ class MultiCoRTabWidget(qt.QTabWidget):
|
|
|
36
36
|
self._localPlatformSettings, settings_icons, TAB_LABEL_PLATFORM_SETTINGS
|
|
37
37
|
)
|
|
38
38
|
# results
|
|
39
|
-
self._resultsViewer = CoRScorePlot(self, variable_name="
|
|
39
|
+
self._resultsViewer = CoRScorePlot(self, variable_name="CoR", backend=backend)
|
|
40
40
|
results_icon = icons.getQIcon("results")
|
|
41
41
|
self.addTab(self._resultsViewer, results_icon, "reconstructed slices")
|
|
42
42
|
|
|
@@ -13,7 +13,6 @@ from tomwer.gui.reconstruction.multicor.NabuAutoCorDiag import NabuAutoCorDiag
|
|
|
13
13
|
from tomwer.gui.reconstruction.multicor.MultiCoRTabWidget import MultiCoRTabWidget
|
|
14
14
|
from tomwer.gui.reconstruction.scores.control import ControlWidget
|
|
15
15
|
from tomwer.gui.utils.buttons import TabBrowsersButtons
|
|
16
|
-
from tomwer.gui.utils.scandescription import ScanNameLabelAndShape
|
|
17
16
|
from tomwer.gui.reconstruction.cor.QCoRParams import QCoRParams as _QCoRParams
|
|
18
17
|
|
|
19
18
|
_logger = logging.getLogger(__name__)
|
|
@@ -39,23 +38,26 @@ class MultiCoRWindow(qt.QMainWindow):
|
|
|
39
38
|
self._mainWidget = qt.QWidget(self)
|
|
40
39
|
self._mainWidget.setLayout(qt.QVBoxLayout())
|
|
41
40
|
|
|
42
|
-
self._scanInfo = ScanNameLabelAndShape(self)
|
|
43
|
-
self._mainWidget.layout().addWidget(self._scanInfo)
|
|
44
41
|
self._tabWidget = MultiCoRTabWidget(self, backend=backend)
|
|
45
42
|
self._mainWidget.layout().addWidget(self._tabWidget)
|
|
46
43
|
self.setCentralWidget(self._mainWidget)
|
|
44
|
+
|
|
47
45
|
# next and previous buttons for browsing the tab widget
|
|
46
|
+
self._buttonsWidget = qt.QWidget()
|
|
47
|
+
self._buttonsWidget.setLayout(qt.QHBoxLayout())
|
|
48
|
+
# Note: avoid using a DockWidget to avoid having a QSplitter :(
|
|
49
|
+
self._mainWidget.layout().addWidget(self._buttonsWidget)
|
|
50
|
+
self._buttonsWidget.layout().setSpacing(0)
|
|
51
|
+
self._buttonsWidget.layout().setContentsMargins(0, 0, 0, 0)
|
|
52
|
+
|
|
48
53
|
self._browserButtons = TabBrowsersButtons(self)
|
|
49
|
-
self.
|
|
50
|
-
self.
|
|
51
|
-
self.
|
|
52
|
-
self._dockWidgetBrwButtons.setFeatures(qt.QDockWidget.DockWidgetMovable)
|
|
53
|
-
# control widget (validate, compute, cor positions)
|
|
54
|
+
self._buttonsWidget.layout().addWidget(self._browserButtons)
|
|
55
|
+
self._browserButtons.layout().setSpacing(2)
|
|
56
|
+
self._browserButtons.layout().setContentsMargins(0, 0, 0, 0)
|
|
54
57
|
self._multicorControl = ControlWidget(self)
|
|
55
|
-
self.
|
|
56
|
-
self.
|
|
57
|
-
self.
|
|
58
|
-
self._dockWidgetCtrl.setFeatures(qt.QDockWidget.DockWidgetMovable)
|
|
58
|
+
self._buttonsWidget.layout().addWidget(self._multicorControl)
|
|
59
|
+
self._multicorControl.layout().setSpacing(2)
|
|
60
|
+
self._multicorControl.layout().setContentsMargins(0, 0, 0, 0)
|
|
59
61
|
|
|
60
62
|
# connect signal / slot
|
|
61
63
|
self._multicorControl.sigValidateRequest.connect(self.sigValidated)
|
|
@@ -103,7 +105,6 @@ class MultiCoRWindow(qt.QMainWindow):
|
|
|
103
105
|
def setScan(self, scan):
|
|
104
106
|
self._scan = scan
|
|
105
107
|
self._tabWidget.setScan(scan)
|
|
106
|
-
self._scanInfo.setScan(scan)
|
|
107
108
|
self._updateSinogramLine()
|
|
108
109
|
self._loadEstimatedCorFromScan(scan)
|
|
109
110
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
|
4
|
-
from tomwer.gui.reconstruction.scores.scoreplot import
|
|
4
|
+
from tomwer.gui.reconstruction.scores.scoreplot import DeltaBetaSelection
|
|
5
5
|
from tomwer.gui.reconstruction.scores.scoreplot import ScorePlot as _ScorePlot
|
|
6
6
|
from tomwer.tasks.reconstruction.nabu.multipag import MultiPagTask
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class DBScorePlot(_ScorePlot, constructor=
|
|
9
|
+
class DBScorePlot(_ScorePlot, constructor=DeltaBetaSelection):
|
|
10
10
|
"""Score plot dedicated to center delta / beta values."""
|
|
11
11
|
|
|
12
12
|
def _updateScores(self) -> None:
|
|
@@ -6,7 +6,6 @@ from tomwer.core.reconstruction.multi.scores.ScoreMethod import ScoreMethod
|
|
|
6
6
|
from tomwer.gui.reconstruction.multipag.MultiPagTabWidget import MultiPagTabWidget
|
|
7
7
|
from tomwer.gui.reconstruction.scores.control import ControlWidget
|
|
8
8
|
from tomwer.gui.utils.buttons import TabBrowsersButtons
|
|
9
|
-
from tomwer.gui.utils.scandescription import ScanNameLabelAndShape
|
|
10
9
|
from tomwer.gui.reconstruction.multipag.QMultiPagParams import (
|
|
11
10
|
QMultiPagParams as _QMultiPagParams,
|
|
12
11
|
)
|
|
@@ -28,23 +27,28 @@ class MultiPagWindowBase(qt.QMainWindow):
|
|
|
28
27
|
# central widget
|
|
29
28
|
self._mainWidget = qt.QWidget(self)
|
|
30
29
|
self._mainWidget.setLayout(qt.QVBoxLayout())
|
|
31
|
-
self._scanInfo = ScanNameLabelAndShape(self)
|
|
32
|
-
self._mainWidget.layout().addWidget(self._scanInfo)
|
|
33
30
|
self._tabWidget = MultiPagTabWidget(self, backend=backend)
|
|
34
31
|
self._mainWidget.layout().addWidget(self._tabWidget)
|
|
35
32
|
self.setCentralWidget(self._mainWidget)
|
|
33
|
+
|
|
36
34
|
# next and previous buttons for browsing the tab widget
|
|
35
|
+
# Note: avoid using a DockWidget to avoid having a QSplitter :(
|
|
36
|
+
self._buttonsWidget = qt.QWidget()
|
|
37
|
+
self._buttonsWidget.setLayout(qt.QHBoxLayout())
|
|
38
|
+
self._mainWidget.layout().addWidget(self._buttonsWidget)
|
|
39
|
+
self._buttonsWidget.layout().setSpacing(0)
|
|
40
|
+
self._buttonsWidget.layout().setContentsMargins(0, 0, 0, 0)
|
|
41
|
+
|
|
37
42
|
self._browserButtons = TabBrowsersButtons(self)
|
|
38
|
-
self.
|
|
39
|
-
self.
|
|
40
|
-
self.
|
|
41
|
-
|
|
43
|
+
self._buttonsWidget.layout().addWidget(self._browserButtons)
|
|
44
|
+
self._browserButtons.layout().setSpacing(2)
|
|
45
|
+
self._browserButtons.layout().setContentsMargins(0, 0, 0, 0)
|
|
46
|
+
|
|
42
47
|
# control widget (validate, compute, cor positions)
|
|
43
48
|
self._sadbControl = ControlWidget(self)
|
|
44
|
-
self.
|
|
45
|
-
self.
|
|
46
|
-
self.
|
|
47
|
-
self._dockWidgetCtrl.setFeatures(qt.QDockWidget.DockWidgetMovable)
|
|
49
|
+
self._buttonsWidget.layout().addWidget(self._sadbControl)
|
|
50
|
+
self._sadbControl.layout().setSpacing(2)
|
|
51
|
+
self._sadbControl.layout().setContentsMargins(0, 0, 0, 0)
|
|
48
52
|
|
|
49
53
|
# expose signals
|
|
50
54
|
self.sigConfigurationChanged = self._tabWidget.sigConfigurationChanged
|
|
@@ -75,7 +79,6 @@ class MultiPagWindowBase(qt.QMainWindow):
|
|
|
75
79
|
def setScan(self, scan):
|
|
76
80
|
self._scan = scan
|
|
77
81
|
self._tabWidget.setScan(scan)
|
|
78
|
-
self._scanInfo.setScan(scan)
|
|
79
82
|
|
|
80
83
|
def getScan(self):
|
|
81
84
|
return self._scan
|
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
from silx.gui import qt
|
|
4
4
|
from silx.gui.utils import blockSignals
|
|
5
5
|
|
|
6
|
-
from tomwer.
|
|
6
|
+
from tomwer.models.reconstruction.cast_volume import InputModel
|
|
7
7
|
from tomwer.core.reconstruction.output import NabuOutputFileFormat
|
|
8
8
|
from tomwer.gui.reconstruction.nabu.nabuconfig.output import QNabuFileFormatComboBox
|
|
9
9
|
from nxtomomill.models.utils import convert_str_to_tuple
|
|
@@ -6,7 +6,7 @@ from tomwer.core.reconstruction.nabu.stages import NabuStages
|
|
|
6
6
|
from tomwer.gui import icons
|
|
7
7
|
from tomwer.gui.reconstruction.nabu.nabuconfig.base import _NabuStageConfigBase
|
|
8
8
|
from tomwer.gui.utils._outputdir import OutputDirWidget as _OutputDirWidget
|
|
9
|
-
from tomwer.
|
|
9
|
+
from tomwer.models.reconstruction.nabu_volume import InputModel
|
|
10
10
|
|
|
11
11
|
from .SliceSelector import SliceSelector
|
|
12
12
|
|