tomwer 1.4.19__py3-none-any.whl → 1.5.0__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/tutorials/simple_volume_local_reconstruction.ows +11 -8
- orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +12 -9
- orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +1 -1
- orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +21 -10
- tomwer/app/axis.py +1 -1
- tomwer/app/reducedarkflat.py +2 -2
- tomwer/core/process/control/datalistener/rpcserver.py +2 -8
- tomwer/core/process/drac/binning.py +2 -2
- tomwer/core/process/drac/output.py +1 -1
- tomwer/core/process/edit/imagekeyeditor.py +4 -6
- tomwer/core/process/edit/nxtomoeditor.py +58 -20
- tomwer/core/process/output.py +6 -5
- tomwer/core/process/reconstruction/axis/anglemode.py +2 -2
- tomwer/core/process/reconstruction/axis/axis.py +1 -0
- tomwer/core/process/reconstruction/axis/mode.py +2 -2
- tomwer/core/process/reconstruction/axis/params.py +4 -4
- tomwer/core/process/reconstruction/axis/projectiontype.py +1 -1
- tomwer/core/process/reconstruction/axis/side.py +1 -1
- tomwer/core/process/reconstruction/darkref/darkrefs.py +2 -2
- tomwer/core/process/reconstruction/darkref/darkrefscopy.py +1 -1
- tomwer/core/process/reconstruction/darkref/params.py +2 -3
- tomwer/core/process/reconstruction/nabu/castvolume.py +4 -1
- tomwer/core/process/reconstruction/nabu/helical.py +3 -1
- tomwer/core/process/reconstruction/nabu/nabucommon.py +2 -2
- tomwer/core/process/reconstruction/nabu/nabuscores.py +1 -1
- tomwer/core/process/reconstruction/nabu/nabuslices.py +4 -4
- tomwer/core/process/reconstruction/nabu/plane.py +2 -2
- tomwer/core/process/reconstruction/nabu/target.py +1 -1
- tomwer/core/process/reconstruction/nabu/test/test_castvolume.py +2 -0
- tomwer/core/process/reconstruction/nabu/test/test_nabu_utils.py +9 -0
- tomwer/core/process/reconstruction/nabu/utils.py +18 -14
- tomwer/core/process/reconstruction/normalization/normalization.py +1 -1
- tomwer/core/process/reconstruction/normalization/params.py +4 -4
- tomwer/core/process/reconstruction/output.py +2 -2
- tomwer/core/process/reconstruction/saaxis/params.py +3 -3
- tomwer/core/process/reconstruction/saaxis/saaxis.py +5 -1
- tomwer/core/process/reconstruction/scores/params.py +2 -2
- tomwer/core/process/reconstruction/scores/scores.py +3 -3
- tomwer/core/process/reconstruction/tests/test_axis.py +1 -1
- tomwer/core/process/reconstruction/tests/test_saaxis.py +56 -66
- tomwer/core/process/stitching/metadataholder.py +5 -5
- tomwer/core/process/stitching/nabustitcher.py +1 -4
- tomwer/core/process/tests/test_normalization.py +2 -1
- tomwer/core/scan/edfscan.py +3 -3
- tomwer/core/scan/nxtomoscan.py +3 -3
- tomwer/core/scan/scanbase.py +3 -3
- tomwer/core/scan/scantype.py +1 -1
- tomwer/core/settings.py +1 -1
- tomwer/core/tomwer_object.py +1 -1
- tomwer/core/utils/nxtomoutils.py +2 -2
- tomwer/core/utils/spec.py +6 -3
- tomwer/gui/cluster/slurm.py +3 -3
- tomwer/gui/configuration/level.py +1 -1
- tomwer/gui/control/actions.py +1 -1
- tomwer/gui/control/datadiscovery.py +1 -1
- tomwer/gui/control/datalist.py +1 -1
- tomwer/gui/control/reducedarkflatselector.py +4 -4
- tomwer/gui/control/series/seriescreator.py +5 -5
- tomwer/gui/control/tomoobjdisplaymode.py +1 -1
- tomwer/gui/dataportal/gallery.py +6 -6
- tomwer/gui/edit/imagekeyeditor.py +7 -9
- tomwer/gui/edit/nxtomoeditor.py +420 -112
- tomwer/gui/edit/tests/test_nx_editor.py +155 -83
- tomwer/gui/reconstruction/axis/CalculationWidget.py +1 -1
- tomwer/gui/reconstruction/axis/EstimatedCORWidget.py +12 -8
- tomwer/gui/reconstruction/axis/EstimatedCorComboBox.py +2 -2
- tomwer/gui/reconstruction/axis/InputWidget.py +3 -3
- tomwer/gui/reconstruction/darkref/darkrefwidget.py +2 -2
- tomwer/gui/reconstruction/nabu/castvolume.py +16 -1
- tomwer/gui/reconstruction/nabu/nabuconfig/base.py +2 -4
- tomwer/gui/reconstruction/nabu/nabuconfig/ctf.py +6 -6
- tomwer/gui/reconstruction/nabu/nabuconfig/nabuconfig.py +1 -1
- tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +5 -5
- tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +2 -4
- tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +78 -52
- tomwer/gui/reconstruction/nabu/nabuflow.py +3 -13
- tomwer/gui/reconstruction/nabu/slices.py +11 -11
- tomwer/gui/reconstruction/nabu/test/test_cast_volume.py +19 -0
- tomwer/gui/reconstruction/nabu/volume.py +1 -1
- tomwer/gui/reconstruction/normalization/intensity.py +8 -12
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +2 -2
- tomwer/gui/reconstruction/saaxis/dimensionwidget.py +71 -67
- tomwer/gui/reconstruction/sacommon.py +1 -1
- tomwer/gui/reconstruction/scores/scoreplot.py +18 -10
- tomwer/gui/reconstruction/tests/test_saaxis.py +18 -16
- tomwer/gui/stitching/SingleAxisStitchingWidget.py +8 -8
- tomwer/gui/stitching/StitchingOptionsWidget.py +1 -1
- tomwer/gui/stitching/alignment.py +8 -8
- tomwer/gui/stitching/config/axisparams.py +2 -2
- tomwer/gui/stitching/config/output.py +1 -1
- tomwer/gui/stitching/config/positionoveraxis.py +1 -1
- tomwer/gui/stitching/config/stitchingstrategies.py +4 -6
- tomwer/gui/stitching/config/tomoobjdetails.py +21 -13
- tomwer/gui/stitching/normalization.py +6 -6
- tomwer/gui/stitching/tests/test_ZStitchingWindow.py +8 -1
- tomwer/gui/stitching/tests/test_preview.py +10 -7
- tomwer/gui/stitching/tests/utils.py +27 -18
- tomwer/gui/stitching/z_stitching/fineestimation.py +7 -9
- tomwer/gui/stitching/z_stitching/tests/test_raw_estimation.py +18 -7
- tomwer/gui/stitching/z_stitching/tests/test_stitching_window.py +7 -2
- tomwer/gui/utils/buttons.py +54 -36
- tomwer/gui/utils/flow.py +2 -2
- tomwer/gui/utils/loadingmode.py +1 -1
- tomwer/gui/utils/unitsystem.py +44 -33
- tomwer/gui/utils/vignettes.py +1 -1
- tomwer/gui/visualization/dataviewer.py +7 -7
- tomwer/gui/visualization/diffviewer/diffviewer.py +4 -4
- tomwer/gui/visualization/diffviewer/shiftwidget.py +4 -6
- tomwer/gui/visualization/reconstructionparameters.py +35 -23
- tomwer/gui/visualization/scanoverview.py +28 -11
- tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +25 -13
- tomwer/gui/visualization/test/test_reconstruction_parameters.py +2 -2
- tomwer/model/dataset.py +0 -0
- tomwer/resources/gui/icons/borders.png +0 -0
- tomwer/synctools/utils/scanstages.py +3 -3
- tomwer/tasks/reconstruction/cleardarkflat.py +42 -0
- tomwer/tests/app/test_stitching.py +1 -1
- tomwer/tests/orangecontrib/tomwer/widgets/edit/tests/test_nxtomo_editor.py +32 -20
- tomwer/tests/orangecontrib/tomwer/widgets/reconstruction/tests/test_nabu_widget.py +1 -1
- tomwer/version.py +2 -2
- {tomwer-1.4.19.dist-info → tomwer-1.5.0.dist-info}/METADATA +8 -8
- {tomwer-1.4.19.dist-info → tomwer-1.5.0.dist-info}/RECORD +126 -123
- {tomwer-1.4.19.dist-info → tomwer-1.5.0.dist-info}/WHEEL +1 -1
- {tomwer-1.4.19.dist-info → tomwer-1.5.0.dist-info}/entry_points.txt +0 -0
- {tomwer-1.4.19.dist-info → tomwer-1.5.0.dist-info}/licenses/LICENSE +0 -0
- {tomwer-1.4.19.dist-info → tomwer-1.5.0.dist-info}/top_level.txt +0 -0
@@ -3,6 +3,7 @@ import pickle
|
|
3
3
|
|
4
4
|
import numpy
|
5
5
|
import pytest
|
6
|
+
import pint
|
6
7
|
from nxtomomill.nexus.nxtomo import NXtomo
|
7
8
|
from orangecanvas.scheme.readwrite import literal_dumps
|
8
9
|
from silx.gui.utils.testutils import SignalListener
|
@@ -15,15 +16,21 @@ from tomwer.tests.utils import skip_gui_test
|
|
15
16
|
from tomwer.gui.utils.qt_utils import QSignalSpy
|
16
17
|
from tomwer.tests.conftest import qtapp # noqa F401
|
17
18
|
|
19
|
+
_ureg = pint.get_application_registry()
|
20
|
+
|
18
21
|
|
19
22
|
def getDefaultConfig() -> dict:
|
20
23
|
"""return the configuration of the NXtomo editor. First value is the value of the field, second is: is the associated lock button locked or not"""
|
21
24
|
return {
|
22
25
|
NXtomoEditorKeys.ENERGY: (5.9, False),
|
26
|
+
NXtomoEditorKeys.SAMPLE_SOURCE_DISTANCE: (-55.2, False),
|
27
|
+
NXtomoEditorKeys.PROPAGATION_DISTANCE: (10.1, True),
|
23
28
|
NXtomoEditorKeys.SAMPLE_DETECTOR_DISTANCE: (2.4, True),
|
24
29
|
NXtomoEditorKeys.FIELD_OF_VIEW: ("Full", False),
|
25
|
-
NXtomoEditorKeys.
|
26
|
-
NXtomoEditorKeys.
|
30
|
+
NXtomoEditorKeys.DETECTOR_X_PIXEL_SIZE: (0.023, True),
|
31
|
+
NXtomoEditorKeys.DETECTOR_Y_PIXEL_SIZE: (0.025, True),
|
32
|
+
NXtomoEditorKeys.SAMPLE_X_PIXEL_SIZE: (0.24, True),
|
33
|
+
NXtomoEditorKeys.SAMPLE_Y_PIXEL_SIZE: (0.26, True),
|
27
34
|
NXtomoEditorKeys.X_FLIPPED: (True, True),
|
28
35
|
NXtomoEditorKeys.Y_FLIPPED: (False, False),
|
29
36
|
NXtomoEditorKeys.X_TRANSLATION: (0.0,),
|
@@ -49,41 +56,41 @@ def test_NXtomoEditorOW(
|
|
49
56
|
signal_listener = SignalListener()
|
50
57
|
window.sigScanReady.connect(signal_listener)
|
51
58
|
# set up the widget to define and lock distance, energy and x pixel size
|
52
|
-
distance_widget = window.widget.mainWidget.
|
53
|
-
distance_widget.setValue(0.6)
|
54
|
-
distance_widget.setUnit(
|
55
|
-
distance_locker = window.widget.mainWidget.
|
59
|
+
distance_widget = window.widget.mainWidget._sampleDetectorDistanceMetricEntry
|
60
|
+
distance_widget.setValue(value_m=0.6)
|
61
|
+
distance_widget.setUnit(_ureg.millimeter)
|
62
|
+
distance_locker = window.widget.mainWidget._sampleDetectorDistanceLB
|
56
63
|
distance_locker.setLock(True)
|
57
64
|
energy_widget = window.widget.mainWidget._energyEntry
|
58
65
|
energy_widget.setValue(88.058)
|
59
66
|
energy_locker = window.widget.mainWidget._energyLockerLB
|
60
67
|
energy_locker.setLock(True)
|
61
|
-
x_pixel_widget = window.widget.mainWidget.
|
62
|
-
x_pixel_widget.setValue(45)
|
63
|
-
x_pixel_widget.setUnit(
|
64
|
-
x_pixel_locker = window.widget.mainWidget.
|
68
|
+
x_pixel_widget = window.widget.mainWidget._xDetectorPixelSizeMetricEntry
|
69
|
+
x_pixel_widget.setValue(value_m=45)
|
70
|
+
x_pixel_widget.setUnit(_ureg.nanometer)
|
71
|
+
x_pixel_locker = window.widget.mainWidget._xDetectorPixelSizeLB
|
65
72
|
x_pixel_locker.setLock(True)
|
66
73
|
|
67
74
|
# 1.0 create nx tomos with raw data
|
68
75
|
nx_tomo = NXtomo()
|
69
76
|
nx_tomo.instrument.detector.x_pixel_size = (
|
70
|
-
0.023 # should be overwrite by the configuration / lock buttons
|
77
|
+
0.023 * _ureg.meter # should be overwrite by the configuration / lock buttons
|
71
78
|
)
|
72
79
|
nx_tomo.instrument.detector.y_pixel_size = (
|
73
|
-
0.025 # should be overwrite by the configuration / lock buttons
|
80
|
+
0.025 * _ureg.meter # should be overwrite by the configuration / lock buttons
|
74
81
|
)
|
75
82
|
nx_tomo.instrument.detector.field_of_view = "full"
|
76
83
|
nx_tomo.instrument.detector.distance = (
|
77
|
-
2.4 # should be overwrite by the configuration / lock buttons
|
84
|
+
2.4 * _ureg.meter # should be overwrite by the configuration / lock buttons
|
78
85
|
)
|
79
86
|
nx_tomo.instrument.detector.x_flipped = (
|
80
87
|
False # should be overwrite by the configuration / lock buttons
|
81
88
|
)
|
82
89
|
nx_tomo.instrument.detector.y_flipped = True
|
83
|
-
nx_tomo.energy = 5.9
|
90
|
+
nx_tomo.energy = 5.9 * _ureg.keV
|
84
91
|
nx_tomo.instrument.detector.image_key_control = [ImageKey.PROJECTION.value] * 12
|
85
92
|
nx_tomo.instrument.detector.data = numpy.empty(shape=(12, 10, 10))
|
86
|
-
nx_tomo.sample.rotation_angle = numpy.linspace(0, 20, num=12)
|
93
|
+
nx_tomo.sample.rotation_angle = numpy.linspace(0, 20, num=12) * _ureg.degree
|
87
94
|
|
88
95
|
file_path = os.path.join(tmp_path, "nxtomo.nx")
|
89
96
|
entry = "entry0000"
|
@@ -109,18 +116,20 @@ def test_NXtomoEditorOW(
|
|
109
116
|
detector_data_as="as_numpy_array",
|
110
117
|
)
|
111
118
|
numpy.testing.assert_almost_equal(
|
112
|
-
overwrite_nx_tomo.instrument.detector.x_pixel_size.
|
119
|
+
overwrite_nx_tomo.instrument.detector.x_pixel_size.to_base_units().magnitude,
|
120
|
+
(45e-9 * _ureg.meter).to_base_units().magnitude,
|
113
121
|
)
|
114
122
|
assert (
|
115
|
-
overwrite_nx_tomo.instrument.detector.y_pixel_size
|
116
|
-
== nx_tomo.instrument.detector.y_pixel_size
|
123
|
+
overwrite_nx_tomo.instrument.detector.y_pixel_size
|
124
|
+
== nx_tomo.instrument.detector.y_pixel_size
|
117
125
|
)
|
118
126
|
assert (
|
119
127
|
overwrite_nx_tomo.instrument.detector.field_of_view
|
120
128
|
== nx_tomo.instrument.detector.field_of_view
|
121
129
|
)
|
122
130
|
numpy.testing.assert_almost_equal(
|
123
|
-
overwrite_nx_tomo.instrument.detector.distance.
|
131
|
+
overwrite_nx_tomo.instrument.detector.distance.to_base_units().magnitude,
|
132
|
+
(6.0e-4 * _ureg.meter).to_base_units().magnitude,
|
124
133
|
)
|
125
134
|
assert (
|
126
135
|
overwrite_nx_tomo.instrument.detector.x_flipped
|
@@ -131,7 +140,10 @@ def test_NXtomoEditorOW(
|
|
131
140
|
overwrite_nx_tomo.instrument.detector.y_flipped
|
132
141
|
== True # is not locked and is initially set to False (should load it and ignore overwriting)
|
133
142
|
)
|
134
|
-
numpy.testing.assert_almost_equal(
|
143
|
+
numpy.testing.assert_almost_equal(
|
144
|
+
overwrite_nx_tomo.energy.to_base_units().magnitude,
|
145
|
+
(88.058 * _ureg.keV).to_base_units().magnitude,
|
146
|
+
)
|
135
147
|
numpy.testing.assert_array_almost_equal(
|
136
148
|
overwrite_nx_tomo.instrument.detector.data,
|
137
149
|
nx_tomo.instrument.detector.data,
|
@@ -101,7 +101,7 @@ class TestNabuWidget(TestCaseQt):
|
|
101
101
|
self.wait_processing()
|
102
102
|
self.assertEqual(self.widget.getMode(), _NabuMode.HALF_ACQ)
|
103
103
|
self.patch_fov(value=FOV.FULL.value)
|
104
|
-
self.scan.
|
104
|
+
self.scan.clear_cache()
|
105
105
|
self.widget.process(self.scan)
|
106
106
|
self.wait_processing()
|
107
107
|
self.assertEqual(self.widget.getMode(), _NabuMode.FULL_FIELD)
|
tomwer/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: tomwer
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.5.0
|
4
4
|
Summary: "tomography workflow tools"
|
5
5
|
Home-page: https://gitlab.esrf.fr/tomotools/tomwer
|
6
6
|
Author: Henri Payno, Pierre Paleo, Pierre-Olivier Autran, Jérôme Lesaint, Alessandro Mirone
|
@@ -18,22 +18,22 @@ Classifier: Operating System :: POSIX
|
|
18
18
|
Classifier: Natural Language :: English
|
19
19
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
20
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
21
|
-
Requires-Python: >=3.
|
21
|
+
Requires-Python: >=3.9
|
22
22
|
Description-Content-Type: text/x-rst
|
23
23
|
License-File: LICENSE
|
24
24
|
Requires-Dist: numpy
|
25
25
|
Requires-Dist: setuptools
|
26
26
|
Requires-Dist: psutil
|
27
|
-
Requires-Dist: silx[full]
|
28
|
-
Requires-Dist: tomoscan>=2.
|
29
|
-
Requires-Dist: nxtomo
|
30
|
-
Requires-Dist: nxtomomill>=1.
|
27
|
+
Requires-Dist: silx[full]>=2.1.1
|
28
|
+
Requires-Dist: tomoscan>=2.2.0a6
|
29
|
+
Requires-Dist: nxtomo>=2.0.0dev2
|
30
|
+
Requires-Dist: nxtomomill>=1.2.0dev1
|
31
31
|
Requires-Dist: processview>=1.5.0
|
32
32
|
Requires-Dist: ewoks>=0.1.1
|
33
33
|
Requires-Dist: ewokscore<1.1.0
|
34
34
|
Requires-Dist: sluurp>=0.4.1
|
35
35
|
Requires-Dist: packaging
|
36
|
-
Requires-Dist:
|
36
|
+
Requires-Dist: pint
|
37
37
|
Requires-Dist: tqdm
|
38
38
|
Provides-Extra: full-base
|
39
39
|
Requires-Dist: orange-canvas-core; extra == "full-base"
|
@@ -227,7 +227,7 @@ Requires-Dist: ewoksnotify[full]; extra == "test"
|
|
227
227
|
Requires-Dist: pyicat_plus; extra == "test"
|
228
228
|
Requires-Dist: nabu>=2023.3.1dev; extra == "test"
|
229
229
|
Requires-Dist: pytest-asyncio; extra == "test"
|
230
|
-
Requires-Dist: tomoscan[test]>=2.
|
230
|
+
Requires-Dist: tomoscan[test]>=2.2.0a6; extra == "test"
|
231
231
|
Provides-Extra: setup-requires
|
232
232
|
Requires-Dist: setuptools; extra == "setup-requires"
|
233
233
|
Requires-Dist: numpy>=1.12; extra == "setup-requires"
|