tomwer 1.3.7__py3-none-any.whl → 1.3.8__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 (108) hide show
  1. tomwer/core/process/reconstruction/nabu/utils.py +2 -0
  2. tomwer/gui/control/datawatcher/datawatcher.py +1 -24
  3. tomwer/version.py +1 -1
  4. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/METADATA +1 -1
  5. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/RECORD +11 -108
  6. orangecontrib/tomwer/test/TestAcquisition.py +0 -246
  7. orangecontrib/tomwer/widgets/cluster/test/test_future_supervisorow.py +0 -87
  8. orangecontrib/tomwer/widgets/cluster/test/test_slurm_clusterow.py +0 -67
  9. orangecontrib/tomwer/widgets/control/test/test_advancement.py +0 -51
  10. orangecontrib/tomwer/widgets/control/test/test_data_validator.py +0 -55
  11. orangecontrib/tomwer/widgets/control/test/test_datadiscovery.py +0 -131
  12. orangecontrib/tomwer/widgets/control/test/test_datalist.py +0 -70
  13. orangecontrib/tomwer/widgets/control/test/test_datalistener.py +0 -137
  14. orangecontrib/tomwer/widgets/control/test/test_dataselector.py +0 -95
  15. orangecontrib/tomwer/widgets/control/test/test_datawatcher.py +0 -436
  16. orangecontrib/tomwer/widgets/control/test/test_emailow.py +0 -29
  17. orangecontrib/tomwer/widgets/control/test/test_notifier.py +0 -51
  18. orangecontrib/tomwer/widgets/control/test/test_nxtomo_concatenate_ow.py +0 -64
  19. orangecontrib/tomwer/widgets/control/test/test_nxtomomill.py +0 -160
  20. orangecontrib/tomwer/widgets/control/test/test_reduce_dark_flat_selector.py +0 -40
  21. orangecontrib/tomwer/widgets/control/test/test_singletomoobj.py +0 -40
  22. orangecontrib/tomwer/widgets/control/test/test_timerow.py +0 -51
  23. orangecontrib/tomwer/widgets/control/test/test_tomoobj_serie.py +0 -96
  24. orangecontrib/tomwer/widgets/control/test/test_volume_selector.py +0 -69
  25. orangecontrib/tomwer/widgets/control/test/test_volumesymlink.py +0 -51
  26. orangecontrib/tomwer/widgets/debugtools/test/test_dataset_generator.py +0 -57
  27. orangecontrib/tomwer/widgets/debugtools/test/test_object_inspector.py +0 -62
  28. orangecontrib/tomwer/widgets/other/test/test_pythonscript.py +0 -31
  29. orangecontrib/tomwer/widgets/reconstruction/test/test_axis.py +0 -224
  30. orangecontrib/tomwer/widgets/reconstruction/test/test_cast_volumeow.py +0 -85
  31. orangecontrib/tomwer/widgets/reconstruction/test/test_dark_refs_widget.py +0 -136
  32. orangecontrib/tomwer/widgets/reconstruction/test/test_delta_beta_selector.py +0 -15
  33. orangecontrib/tomwer/widgets/reconstruction/test/test_i_norm.py +0 -226
  34. orangecontrib/tomwer/widgets/reconstruction/test/test_nabu_helical_prepare_weights_double.py +0 -20
  35. orangecontrib/tomwer/widgets/reconstruction/test/test_nabu_volume.py +0 -100
  36. orangecontrib/tomwer/widgets/reconstruction/test/test_nabu_widget.py +0 -107
  37. orangecontrib/tomwer/widgets/reconstruction/test/test_sa_delta_beta.py +0 -194
  38. orangecontrib/tomwer/widgets/reconstruction/test/test_saaxis.py +0 -220
  39. orangecontrib/tomwer/widgets/stitching/test/test_zstitching.py +0 -308
  40. orangecontrib/tomwer/widgets/test/test_conditions.py +0 -111
  41. orangecontrib/tomwer/widgets/test/test_darkref.py +0 -251
  42. orangecontrib/tomwer/widgets/test/test_foldertransfert.py +0 -131
  43. orangecontrib/tomwer/widgets/visualization/test/test_dataviewerow.py +0 -83
  44. orangecontrib/tomwer/widgets/visualization/test/test_diffviewerow.py +0 -65
  45. orangecontrib/tomwer/widgets/visualization/test/test_live_sliceow.py +0 -63
  46. orangecontrib/tomwer/widgets/visualization/test/test_nxtomo_metadata_viewer.py +0 -29
  47. orangecontrib/tomwer/widgets/visualization/test/test_radio_stackow.py +0 -56
  48. orangecontrib/tomwer/widgets/visualization/test/test_sample_movedow.py +0 -72
  49. orangecontrib/tomwer/widgets/visualization/test/test_sinogram_viewerow.py +0 -56
  50. orangecontrib/tomwer/widgets/visualization/test/test_slice_stackow.py +0 -57
  51. orangecontrib/tomwer/widgets/visualization/test/test_volume_viewerow.py +0 -57
  52. tomwer/core/log/test/test_processlog.py +0 -41
  53. tomwer/core/process/edit/test/test_darkflatpatch.py +0 -269
  54. tomwer/core/process/edit/test/test_imagekey_editor.py +0 -125
  55. tomwer/core/process/icat/test/test_create_screenshots.py +0 -98
  56. tomwer/core/process/icat/test/test_gallery.py +0 -170
  57. tomwer/core/process/reconstruction/nabu/test/test_castvolume.py +0 -143
  58. tomwer/core/process/reconstruction/nabu/test/test_nabu_utils.py +0 -203
  59. tomwer/core/process/reconstruction/nabu/test/test_nabunormalization.py +0 -222
  60. tomwer/core/process/script/test/test_script.py +0 -68
  61. tomwer/core/process/stitching/test/test_metadataholder.py +0 -17
  62. tomwer/core/process/visualization/test/test_data_viewer.py +0 -39
  63. tomwer/core/process/visualization/test/test_diff_viewer.py +0 -39
  64. tomwer/core/process/visualization/test/test_image_stack_viewer.py +0 -41
  65. tomwer/core/process/visualization/test/test_radio_stack.py +0 -39
  66. tomwer/core/process/visualization/test/test_sample_moved.py +0 -41
  67. tomwer/core/process/visualization/test/test_sinogram_viewer.py +0 -39
  68. tomwer/core/process/visualization/test/test_slice_stack.py +0 -39
  69. tomwer/core/process/visualization/test/test_volume_viewer.py +0 -39
  70. tomwer/core/utils/test/test_image.py +0 -30
  71. tomwer/core/utils/test/test_nxtomo.py +0 -66
  72. tomwer/core/utils/test/test_scan_utils.py +0 -46
  73. tomwer/core/utils/test/test_time.py +0 -6
  74. tomwer/core/volume/test/test_volumes.py +0 -21
  75. tomwer/gui/control/serie/test/test_creator.py +0 -451
  76. tomwer/gui/control/serie/test/test_nxtomo_concatenate.py +0 -21
  77. tomwer/gui/icat/test/test_create_screenshots_gui.py +0 -23
  78. tomwer/gui/icat/test/test_gallery_gui.py +0 -37
  79. tomwer/gui/reconstruction/nabu/test/test_check.py +0 -92
  80. tomwer/gui/reconstruction/nabu/test/test_ctf.py +0 -46
  81. tomwer/gui/reconstruction/nabu/test/test_helical.py +0 -21
  82. tomwer/gui/reconstruction/nabu/test/test_nabu_preprocessing.py +0 -81
  83. tomwer/gui/reconstruction/normalization/test/test_intensity.py +0 -119
  84. tomwer/gui/stitching/config/tests/test_axisparams.py +0 -25
  85. tomwer/gui/stitching/tests/test_axis_ordered_list.py +0 -21
  86. tomwer/gui/stitching/tests/test_normalization.py +0 -27
  87. tomwer/gui/stitching/tests/test_preview.py +0 -85
  88. tomwer/gui/stitching/tests/test_stitching_raw.py +0 -110
  89. tomwer/gui/stitching/tests/test_z_stitching.py +0 -67
  90. tomwer/gui/stitching/tests/utils.py +0 -79
  91. tomwer/gui/stitching/z_stitching/tests/test_fine_estimation.py +0 -35
  92. tomwer/gui/stitching/z_stitching/tests/test_raw_estimation.py +0 -215
  93. tomwer/gui/stitching/z_stitching/tests/test_stitching_window.py +0 -51
  94. tomwer/gui/utils/test/test_completer.py +0 -67
  95. tomwer/gui/utils/test/test_line_selector.py +0 -21
  96. tomwer/gui/utils/test/test_splashscreen.py +0 -8
  97. tomwer/gui/utils/test/test_vignettes.py +0 -68
  98. tomwer/io/utils/test/test_raw_and_processed_data.py +0 -10
  99. tomwer/io/utils/test/test_utils.py +0 -92
  100. tomwer/tests/test_ewoks/test_conversion.py +0 -104
  101. tomwer/tests/test_ewoks/test_single_node_execution.py +0 -112
  102. tomwer/tests/test_ewoks/test_workflows.py +0 -160
  103. /tomwer-1.3.7-py3.11-nspkg.pth → /tomwer-1.3.8-py3.11-nspkg.pth +0 -0
  104. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/LICENSE +0 -0
  105. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/WHEEL +0 -0
  106. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/entry_points.txt +0 -0
  107. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/namespace_packages.txt +0 -0
  108. {tomwer-1.3.7.dist-info → tomwer-1.3.8.dist-info}/top_level.txt +0 -0
@@ -1,222 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2016-2017 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
- __authors__ = ["H. Payno"]
27
- __license__ = "MIT"
28
- __date__ = "29/03/2022"
29
-
30
-
31
- import configparser
32
- from collections import namedtuple
33
-
34
- import numpy
35
- import pytest
36
- from silx.io.url import DataUrl
37
- from tomoscan.io import HDF5File
38
- from nabu.pipeline.config import get_default_nabu_config
39
- from nabu.pipeline.fullfield.nabu_config import (
40
- nabu_config as nabu_fullfield_default_config,
41
- )
42
- from tomwer.core.process.reconstruction.nabu import settings as nabu_settings
43
- from tomwer.core.process.reconstruction.nabu.nabuslices import NabuSlicesTask
44
- from tomwer.core.process.reconstruction.normalization.normalization import (
45
- SinoNormalizationTask,
46
- )
47
- from tomwer.core.process.reconstruction.normalization.params import (
48
- SinoNormalizationParams,
49
- )
50
- from tomwer.core.utils.scanutils import MockNXtomo
51
- from tomwer.core.process.reconstruction.output import PROCESS_FOLDER_NAME
52
-
53
- try:
54
- import nabu
55
- except ImportError:
56
- has_nabu = False
57
- else:
58
- has_nabu = True
59
- import os
60
-
61
- _norm_setting = namedtuple("_norm_setting", ["method", "source", "extra_infos"])
62
-
63
- _nabu_norm_field = namedtuple(
64
- "_nabu_norm_field",
65
- ["sino_normalization", "has_sino_normalization_file"],
66
- )
67
-
68
-
69
- normalization_config_test = (
70
- # no normalization
71
- (
72
- _norm_setting(method="none", source=None, extra_infos=None),
73
- _nabu_norm_field(
74
- sino_normalization="",
75
- has_sino_normalization_file=False,
76
- ),
77
- ),
78
- # chebyshev normalization
79
- (
80
- _norm_setting(method="chebyshev", source=None, extra_infos=None),
81
- _nabu_norm_field(
82
- sino_normalization="chebyshev",
83
- has_sino_normalization_file=False,
84
- ),
85
- ),
86
- # divide by a scalar
87
- (
88
- _norm_setting(method="division", source="scalar", extra_infos={"value": 12.0}),
89
- _nabu_norm_field(
90
- sino_normalization="division",
91
- has_sino_normalization_file=True,
92
- ),
93
- ),
94
- # substract a roi
95
- (
96
- _norm_setting(
97
- method="subtraction",
98
- source="manual ROI",
99
- extra_infos={
100
- "start_x": 0.0,
101
- "end_x": 1.0,
102
- "start_y": 0.0,
103
- "end_y": 1.0,
104
- "calc_fct": "mean",
105
- "calc_area": "volume",
106
- "calc_method": "scalar",
107
- },
108
- ),
109
- _nabu_norm_field(
110
- sino_normalization="subtraction",
111
- has_sino_normalization_file=True,
112
- ),
113
- ),
114
- # substract from a dataset
115
- (
116
- _norm_setting(
117
- method="subtraction",
118
- source="from dataset",
119
- extra_infos={
120
- "dataset_url": DataUrl(
121
- file_path="random_dataset.hdf5",
122
- data_path="data",
123
- scheme="silx",
124
- ),
125
- "calc_fct": "median",
126
- "calc_area": "volume",
127
- "calc_method": "scalar",
128
- },
129
- ),
130
- _nabu_norm_field(
131
- sino_normalization="subtraction",
132
- has_sino_normalization_file=True,
133
- ),
134
- ),
135
- )
136
-
137
-
138
- @pytest.mark.skipif(
139
- (not has_nabu or nabu.version < "2022.2"),
140
- reason="nabu not available or the current version doesn't handle sino normlaization yet",
141
- )
142
- @pytest.mark.parametrize(
143
- "norm_setting, expected_nabu_conf", [item for item in normalization_config_test]
144
- )
145
- def test_normalization(norm_setting, expected_nabu_conf, tmp_path):
146
- """
147
- Insure normalization is correctly provided to nabu configuration file
148
- For this run a normalization process followed by a nabu process.
149
- """
150
- scan_dir = tmp_path / "scan"
151
- scan_dir.mkdir()
152
-
153
- nabu_cfg_folders = os.path.join(scan_dir, nabu_settings.NABU_CFG_FILE_FOLDER)
154
- os.makedirs(nabu_cfg_folders, exist_ok=True)
155
-
156
- random_dataset_file = os.path.join(nabu_cfg_folders, "random_dataset.hdf5")
157
-
158
- # create a random dataset if necessary
159
- with HDF5File(random_dataset_file, mode="w") as h5f:
160
- h5f["data"] = numpy.ones((20, 20))
161
-
162
- mock = MockNXtomo(
163
- scan_path=scan_dir,
164
- n_proj=10,
165
- n_ini_proj=10,
166
- scan_range=180,
167
- dim=20,
168
- )
169
- scan = mock.scan
170
-
171
- cfg_folder = os.path.join(str(scan_dir), PROCESS_FOLDER_NAME, "nabu_cfg_files")
172
- cfg_file = os.path.join(cfg_folder, "entry_scan.cfg")
173
- assert not os.path.exists(cfg_file)
174
- norm_params = SinoNormalizationParams(
175
- method=norm_setting.method,
176
- source=norm_setting.source,
177
- extra_infos=norm_setting.extra_infos,
178
- )
179
-
180
- normalization = SinoNormalizationTask(
181
- inputs={
182
- "data": scan,
183
- "configuration": norm_params.to_dict(),
184
- "serialize_output_data": False,
185
- },
186
- varinfo=None,
187
- )
188
- normalization.run()
189
-
190
- # insure the method is style valid
191
- assert scan.intensity_normalization.method.value == norm_setting.method
192
- assert (
193
- "tomwer_processing_res_code" in scan.intensity_normalization.get_extra_infos()
194
- )
195
-
196
- process = NabuSlicesTask(
197
- inputs={
198
- "data": scan,
199
- "dry_run": True,
200
- "nabu_params": get_default_nabu_config(nabu_fullfield_default_config),
201
- "serialize_output_data": False,
202
- },
203
- varinfo=None,
204
- )
205
- process.run()
206
- assert os.path.exists(cfg_file)
207
-
208
- configuration = configparser.ConfigParser(allow_no_value=True)
209
- configuration.read(cfg_file)
210
-
211
- preproc_section = configuration["preproc"]
212
- sino_normalization = preproc_section.get("sino_normalization", "")
213
- sino_normalization_file = preproc_section.get("sino_normalization_file", "")
214
- assert sino_normalization == expected_nabu_conf.sino_normalization
215
- if expected_nabu_conf.has_sino_normalization_file:
216
- url = DataUrl(path=sino_normalization_file)
217
- assert url.is_valid()
218
- else:
219
- assert sino_normalization_file == ""
220
- assert (
221
- "tomwer_processing_res_code" in scan.intensity_normalization.get_extra_infos()
222
- )
@@ -1,68 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017-2021 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
-
26
- __authors__ = ["H. Payno"]
27
- __license__ = "MIT"
28
- __date__ = "18/06/2021"
29
-
30
-
31
- import os
32
- import shutil
33
- import tempfile
34
- import unittest
35
-
36
- from tomwer.core.process.script.python import PythonScript
37
- from tomwer.core.utils.scanutils import MockNXtomo
38
-
39
-
40
- class TestPythonScript(unittest.TestCase):
41
- def setUp(self):
42
- self.tempdir = tempfile.mkdtemp()
43
- dim = 10
44
- mock = MockNXtomo(
45
- scan_path=os.path.join(self.tempdir, "scan1"),
46
- n_proj=10,
47
- n_ini_proj=10,
48
- scan_range=180,
49
- dim=dim,
50
- )
51
- self.scan = mock.scan
52
-
53
- def tearDown(self):
54
- shutil.rmtree(self.tempdir)
55
-
56
- def test(self):
57
- process = PythonScript(inputs={"data": self.scan})
58
- process.definition()
59
- process.program_version()
60
- process.program_name()
61
- # TODO: configuration should be passed in inputs during construction
62
- process.set_configuration(
63
- {
64
- "scriptText": "print('toto')",
65
- }
66
- )
67
-
68
- process.run()
@@ -1,17 +0,0 @@
1
- from tomwer.core.process.stitching.metadataholder import StitchingMetadata
2
-
3
-
4
- def test_to_dict_from_dict():
5
- """Test conversion of StitchingMetadata from dict and to dict"""
6
- metadata = StitchingMetadata(tomo_obj=None)
7
- metadata._pixel_or_voxel_size = [12.3, 2.5, None]
8
- metadata._pos_as_m = [None, 3.6, None]
9
- metadata._pos_as_px = [5, 9, 8]
10
-
11
- ddict = metadata.to_dict()
12
- assert isinstance(ddict, dict)
13
-
14
- loaded_metadata = StitchingMetadata.from_dict(ddict, tomo_obj=None)
15
- assert loaded_metadata == metadata
16
- assert loaded_metadata.to_dict() == ddict
17
- assert isinstance(str(loaded_metadata), str)
@@ -1,39 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017-2019 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
- __authors__ = ["H. Payno"]
26
- __license__ = "MIT"
27
- __date__ = "10/12/2021"
28
-
29
-
30
- from tomwer.core.process.visualization.dataviewer import _DataViewerPlaceHolder
31
-
32
-
33
- def test_data_viewer():
34
- process = _DataViewerPlaceHolder(
35
- inputs={
36
- "data": None,
37
- }
38
- )
39
- process.run()
@@ -1,39 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017-2019 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
- __authors__ = ["H. Payno"]
26
- __license__ = "MIT"
27
- __date__ = "10/12/2021"
28
-
29
-
30
- from tomwer.core.process.visualization.diffviewer import _DiffViewerPlaceHolder
31
-
32
-
33
- def test_diff_viewer():
34
- process = _DiffViewerPlaceHolder(
35
- inputs={
36
- "data": None,
37
- }
38
- )
39
- process.run()
@@ -1,41 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017-2019 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
- __authors__ = ["H. Payno"]
26
- __license__ = "MIT"
27
- __date__ = "10/12/2021"
28
-
29
-
30
- from tomwer.core.process.visualization.imagestackviewer import (
31
- _ImageStackViewerPlaceHolder,
32
- )
33
-
34
-
35
- def test_image_stack_viewer():
36
- process = _ImageStackViewerPlaceHolder(
37
- inputs={
38
- "data": None,
39
- }
40
- )
41
- process.run()
@@ -1,39 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017-2019 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
- __authors__ = ["H. Payno"]
26
- __license__ = "MIT"
27
- __date__ = "10/12/2021"
28
-
29
-
30
- from tomwer.core.process.visualization.radiostack import _RadioStackPlaceHolder
31
-
32
-
33
- def test_radio_stack():
34
- process = _RadioStackPlaceHolder(
35
- inputs={
36
- "data": None,
37
- }
38
- )
39
- process.run()
@@ -1,41 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017-2019 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
- __authors__ = ["H. Payno"]
26
- __license__ = "MIT"
27
- __date__ = "10/12/2021"
28
-
29
-
30
- from tomwer.core.process.visualization.imagestackviewer import (
31
- _ImageStackViewerPlaceHolder,
32
- )
33
-
34
-
35
- def test_sample_moved():
36
- process = _ImageStackViewerPlaceHolder(
37
- inputs={
38
- "data": None,
39
- }
40
- )
41
- process.run()
@@ -1,39 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017-2019 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
- __authors__ = ["H. Payno"]
26
- __license__ = "MIT"
27
- __date__ = "10/12/2021"
28
-
29
-
30
- from tomwer.core.process.visualization.sinogramviewer import _SinogramViewerPlaceHolder
31
-
32
-
33
- def test_sinogram_viewer():
34
- process = _SinogramViewerPlaceHolder(
35
- inputs={
36
- "data": None,
37
- }
38
- )
39
- process.run()
@@ -1,39 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017-2019 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
- __authors__ = ["H. Payno"]
26
- __license__ = "MIT"
27
- __date__ = "10/12/2021"
28
-
29
-
30
- from tomwer.core.process.visualization.slicestack import _SliceStackPlaceHolder
31
-
32
-
33
- def test_slice_stack():
34
- process = _SliceStackPlaceHolder(
35
- inputs={
36
- "data": None,
37
- }
38
- )
39
- process.run()
@@ -1,39 +0,0 @@
1
- # coding: utf-8
2
- # /*##########################################################################
3
- #
4
- # Copyright (c) 2017-2019 European Synchrotron Radiation Facility
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- # ###########################################################################*/
25
- __authors__ = ["H. Payno"]
26
- __license__ = "MIT"
27
- __date__ = "10/12/2021"
28
-
29
-
30
- from tomwer.core.process.visualization.volumeviewer import _VolumeViewerPlaceHolder
31
-
32
-
33
- def test_volume_viewer():
34
- process = _VolumeViewerPlaceHolder(
35
- inputs={
36
- "data": None,
37
- }
38
- )
39
- process.run()
@@ -1,30 +0,0 @@
1
- import numpy
2
- import pytest
3
-
4
- from tomwer.core.utils.image import ImageScaleMethod, scale_img2_to_img1, shift_img
5
-
6
-
7
- @pytest.mark.parametrize(
8
- "use_scipy, dx, dy, cval", ((True, 1.0, -2.3, 0), (False, 0.0, 3.6, 2))
9
- )
10
- def test_shift_image(use_scipy, dx, dy, cval):
11
- data = numpy.linspace(0, 12, 100 * 100).reshape(100, 100)
12
- assert isinstance(
13
- shift_img(data=data, dx=dx, dy=dy, cval=cval, use_scipy=use_scipy),
14
- numpy.ndarray,
15
- )
16
-
17
-
18
- def test_scale_img2_to_img1():
19
- """
20
- test scale_img2_to_img1 function
21
- """
22
- img_1 = numpy.linspace(0, 10, 100 * 100, dtype=numpy.float16).reshape(100, 100)
23
- img_2 = numpy.linspace(20, 100, 100 * 100, dtype=numpy.float16).reshape(100, 100)
24
-
25
- rescale_img = scale_img2_to_img1(img_2, img_1, method=ImageScaleMethod.MEAN)
26
- numpy.testing.assert_array_almost_equal(
27
- img_2,
28
- rescale_img,
29
- decimal=1,
30
- )