tomwer 1.3.12__py3-none-any.whl → 1.3.13__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/widgets/reconstruction/DarkRefAndCopyOW.py +1 -0
- tomwer/core/process/reconstruction/darkref/darkrefscopy.py +16 -4
- tomwer/gui/control/selectorwidgetbase.py +3 -1
- tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +11 -0
- tomwer/synctools/stacks/reconstruction/dkrefcopy.py +10 -0
- tomwer/version.py +1 -1
- {tomwer-1.3.12.dist-info → tomwer-1.3.13.dist-info}/METADATA +1 -1
- {tomwer-1.3.12.dist-info → tomwer-1.3.13.dist-info}/RECORD +14 -14
- /tomwer-1.3.12-py3.11-nspkg.pth → /tomwer-1.3.13-py3.11-nspkg.pth +0 -0
- {tomwer-1.3.12.dist-info → tomwer-1.3.13.dist-info}/LICENSE +0 -0
- {tomwer-1.3.12.dist-info → tomwer-1.3.13.dist-info}/WHEEL +0 -0
- {tomwer-1.3.12.dist-info → tomwer-1.3.13.dist-info}/entry_points.txt +0 -0
- {tomwer-1.3.12.dist-info → tomwer-1.3.13.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.3.12.dist-info → tomwer-1.3.13.dist-info}/top_level.txt +0 -0
@@ -152,6 +152,7 @@ class DarkRefAndCopyOW(SuperviseOW, WidgetLongProcessing):
|
|
152
152
|
self.widget.recons_params.sigChanged.connect(self._updateSettingsVals)
|
153
153
|
self.widget.sigModeAutoChanged.connect(self._updateSettingsVals)
|
154
154
|
self.widget.sigCopyActivationChanged.connect(self._updateSettingsVals)
|
155
|
+
self.widget.sigClearCache.connect(self._processing_stack.clear_cache)
|
155
156
|
self._processing_stack.sigComputationStarted.connect(self._startProcessing)
|
156
157
|
self._processing_stack.sigComputationEnded.connect(self._endProcessing)
|
157
158
|
self._processing_stack.sigRefSetted.connect(self.widget.setRefSetBy)
|
@@ -34,6 +34,7 @@ __date__ = "17/08/2021"
|
|
34
34
|
|
35
35
|
import logging
|
36
36
|
import os
|
37
|
+
import h5py
|
37
38
|
import tempfile
|
38
39
|
from typing import Union
|
39
40
|
|
@@ -198,10 +199,21 @@ class DarkRefsCopy(DarkRefsTask):
|
|
198
199
|
update_mode="replace",
|
199
200
|
)
|
200
201
|
|
202
|
+
def _clear_cache_data_path(self, file_path: str, data_path: str):
|
203
|
+
if not os.path.exists(file_path):
|
204
|
+
return
|
205
|
+
with h5py.File(file_path, mode="a") as h5f:
|
206
|
+
if data_path in h5f:
|
207
|
+
del h5f[data_path]
|
208
|
+
|
201
209
|
def set_darks_and_flats_from_scan(self, scan: TomwerScanBase) -> bool:
|
202
210
|
if scan.reduced_flats in (None, {}):
|
203
211
|
logger.warning(f"No flat found for {scan}. Unable to copy them")
|
204
212
|
else:
|
213
|
+
self._clear_cache_data_path(
|
214
|
+
file_path=self._flats_url.file_path(),
|
215
|
+
data_path=self._flats_url.data_path(),
|
216
|
+
)
|
205
217
|
dicttoh5(
|
206
218
|
scan.reduced_flats,
|
207
219
|
h5file=self._flats_url.file_path(),
|
@@ -212,6 +224,10 @@ class DarkRefsCopy(DarkRefsTask):
|
|
212
224
|
if scan.reduced_darks in (None, {}):
|
213
225
|
logger.warning(f"No dark found for {scan}. Unable to copy them")
|
214
226
|
else:
|
227
|
+
self._clear_cache_data_path(
|
228
|
+
file_path=self._darks_url.file_path(),
|
229
|
+
data_path=self._darks_url.data_path(),
|
230
|
+
)
|
215
231
|
dicttoh5(
|
216
232
|
scan.reduced_darks,
|
217
233
|
h5file=self._darks_url.file_path(),
|
@@ -247,10 +263,6 @@ class DarkRefsCopy(DarkRefsTask):
|
|
247
263
|
overwrite=True,
|
248
264
|
)
|
249
265
|
|
250
|
-
def clean_save_files(self):
|
251
|
-
if os.path.exists(self._save_file):
|
252
|
-
os.remove(self._save_file)
|
253
|
-
|
254
266
|
def run(self):
|
255
267
|
"""
|
256
268
|
This is function triggered when a new scan / data is received.
|
@@ -156,7 +156,9 @@ class _SelectorWidget(qt.QMainWindow):
|
|
156
156
|
|
157
157
|
def removeSelectedDatasets(self):
|
158
158
|
sItem = self.dataList.selectedItems()
|
159
|
-
selection = [
|
159
|
+
selection = [
|
160
|
+
_item.data(qt.Qt.UserRole).get_identifier().to_str() for _item in sItem
|
161
|
+
]
|
160
162
|
|
161
163
|
with block_signals(self):
|
162
164
|
# make sure sigUpdated is called only once.
|
@@ -54,6 +54,7 @@ class DarkRefAndCopyWidget(DarkRefWidget):
|
|
54
54
|
"""Signal emitted when the mode auto change"""
|
55
55
|
sigCopyActivationChanged = qt.Signal()
|
56
56
|
"""Signal emitted when the copy is activated or deactivated"""
|
57
|
+
sigClearCache = qt.Signal()
|
57
58
|
|
58
59
|
def __init__(self, save_dir: str, parent=None, reconsparams=None, process_id=None):
|
59
60
|
DarkRefWidget.__init__(
|
@@ -79,6 +80,7 @@ class DarkRefAndCopyWidget(DarkRefWidget):
|
|
79
80
|
self._refCopyWidget.sigCopyActivationChanged.connect(
|
80
81
|
self._triggerCopyActivation
|
81
82
|
)
|
83
|
+
self._refCopyWidget.sigClearCache.connect(self.sigClearCache)
|
82
84
|
|
83
85
|
def setRefSetBy(self, scan_id: str):
|
84
86
|
self._refCopyWidget._statusBar.showMessage(f"ref set from {scan_id}")
|
@@ -155,6 +157,8 @@ class RefCopyWidget(qt.QGroupBox):
|
|
155
157
|
"""Signal emitted when the mode auto change"""
|
156
158
|
sigCopyActivationChanged = qt.Signal()
|
157
159
|
"""Signal emitted when the copy is activated or deactivated"""
|
160
|
+
sigClearCache = qt.Signal()
|
161
|
+
"""Signal when the cache needs to be cleared"""
|
158
162
|
|
159
163
|
_DEFAULT_DIRECTORY = "/lbsram/data/visitor"
|
160
164
|
"""Default directory used when the user need to set path to references"""
|
@@ -190,6 +194,12 @@ class RefCopyWidget(qt.QGroupBox):
|
|
190
194
|
spacer = qt.QWidget(self)
|
191
195
|
spacer.setSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Expanding)
|
192
196
|
self.layout().addWidget(spacer)
|
197
|
+
self._removeCacheFile = qt.QPushButton("clear cache")
|
198
|
+
self._removeCacheFile.setToolTip(
|
199
|
+
"Remove the file used for cacheing reduce dark / flat."
|
200
|
+
)
|
201
|
+
self.layout().addWidget(self._removeCacheFile)
|
202
|
+
|
193
203
|
self.layout().addWidget(self.__createStatusBarGUI())
|
194
204
|
|
195
205
|
self.setModeAuto(True)
|
@@ -201,6 +211,7 @@ class RefCopyWidget(qt.QGroupBox):
|
|
201
211
|
# connect signal / slot
|
202
212
|
self.toggled.connect(self._triggerCopyActivated)
|
203
213
|
self._qcbAutoMode.toggled.connect(self._triggerModeAutoChanged)
|
214
|
+
self._removeCacheFile.released.connect(self.sigClearCache)
|
204
215
|
|
205
216
|
def _triggerCopyActivated(self, *args, **kwargs):
|
206
217
|
self.sigCopyActivationChanged.emit()
|
@@ -26,6 +26,7 @@ __authors__ = ["H.Payno"]
|
|
26
26
|
__license__ = "MIT"
|
27
27
|
__date__ = "13/08/2021"
|
28
28
|
|
29
|
+
import os
|
29
30
|
import functools
|
30
31
|
import logging
|
31
32
|
import shutil
|
@@ -132,6 +133,15 @@ class DarkRefCopyProcessStack(FIFO, qt.QObject):
|
|
132
133
|
def _create_processing_thread(self, process_id=None) -> qt.QThread:
|
133
134
|
return _ProcessingThread(process_id=process_id, save_dir=self._save_dir)
|
134
135
|
|
136
|
+
def clear_cache(self):
|
137
|
+
"""
|
138
|
+
remove the file used to cache the reduced darks / flats.
|
139
|
+
This can be used in the case it contain unrelevant data. Like frame with another shape...
|
140
|
+
"""
|
141
|
+
cache_file = DarkRefsCopy.get_save_file(self._save_dir)
|
142
|
+
if os.path.exists(cache_file):
|
143
|
+
os.remove(cache_file)
|
144
|
+
|
135
145
|
|
136
146
|
class _ProcessingThread(ProcessingThread, SuperviseProcess):
|
137
147
|
"""
|
tomwer/version.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
tomwer-1.3.
|
1
|
+
tomwer-1.3.13-py3.11-nspkg.pth,sha256=UYCZtLWueceGiAlmXKRJUZ0TWQEubpPoQ1pVnAAsME0,502
|
2
2
|
orangecontrib/tomwer/__init__.py,sha256=B4DXy1gY_wXmNYa2aOfapmJb2mEuCAjoaNEGnpBs70g,148
|
3
3
|
orangecontrib/tomwer/state_summary.py,sha256=5_dPzweL3r0ye4ZfJo6IV2ThJI8fQhWoO2ySdJJajj8,1711
|
4
4
|
orangecontrib/tomwer/orange/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -151,7 +151,7 @@ orangecontrib/tomwer/widgets/other/icons/hub.png,sha256=wnKSaxw2WnBkSQjI86aLZfdm
|
|
151
151
|
orangecontrib/tomwer/widgets/other/icons/hub.svg,sha256=9EYoBKY-P-cO17nM48OPA9VDZSCbyGtrMRc80BGHflk,3735
|
152
152
|
orangecontrib/tomwer/widgets/reconstruction/AxisOW.py,sha256=ffbMYzHWALir19bZhpXjYIgMfJjyyaeov9Uxp5tNyGs,22342
|
153
153
|
orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py,sha256=Ev-TrwZ-HxmdMfZMsz512vhCOgXpGImVsdNdlPSnQIM,9604
|
154
|
-
orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py,sha256=
|
154
|
+
orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py,sha256=nToQw3tj9Wm8s3wPsVBeMYh_F6FBtCsAKLsc2Dic4kk,11066
|
155
155
|
orangecontrib/tomwer/widgets/reconstruction/NabuHelicalPrepareWeightsDoubleOW.py,sha256=aI8VcCK7m518xjjjvE8l3kpTQFEwjWF-hCKua4bBkJM,5967
|
156
156
|
orangecontrib/tomwer/widgets/reconstruction/NabuOW.py,sha256=LzHxCuLrEQIVeGaYmcEO7rwxaT98mbXPdpMc6dCaAHE,12673
|
157
157
|
orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py,sha256=B4iZdYHmbsim4qQD5UaMCg2lcJa3ZAim3_AZQC7bYIk,19195
|
@@ -220,7 +220,7 @@ orangecontrib/tomwer/widgets/visualization/icons/volumeviewer.svg,sha256=2uT9_px
|
|
220
220
|
tomwer/__init__.py,sha256=82Jp1abyG4UWdGuT4nNU7LxaUV6xxkOte5pIz3w69Do,1745
|
221
221
|
tomwer/__main__.py,sha256=jsDfWA2yl5am0dHQVkYwlKLxxqKNont6VDF-LusuawE,8575
|
222
222
|
tomwer/utils.py,sha256=EgVwJ5CQVjoBvcKNwyVoXv_P4ciI11oxb8fNyy82Lck,8465
|
223
|
-
tomwer/version.py,sha256=
|
223
|
+
tomwer/version.py,sha256=NB9NVW9JDgrzz_rw-aJi5JYGnpnQP-hHA1sASP_uZ14,4387
|
224
224
|
tomwer/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
225
225
|
tomwer/app/axis.py,sha256=Ax0wlTp9u0Ll_3ax23QP5Ck16_M9Kop7wx0hAbXrXyM,6004
|
226
226
|
tomwer/app/canvas.py,sha256=RbQqgE7DuNjv4nGG6BNfnSevQO5_lCl7N71hGcLoxwE,1561
|
@@ -318,7 +318,7 @@ tomwer/core/process/reconstruction/axis/params.py,sha256=y1RgFAk1wiJMeueSNJH5enU
|
|
318
318
|
tomwer/core/process/reconstruction/axis/projectiontype.py,sha256=0w_NZ0N95iInHuEQCIxJIxt7K-YpCUo2fZ-_vhZ6D7Q,1543
|
319
319
|
tomwer/core/process/reconstruction/darkref/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
320
320
|
tomwer/core/process/reconstruction/darkref/darkrefs.py,sha256=gbRq1IJ-9fxD71684wajQj3D_M9G6chm7ahZsjxTmpM,20862
|
321
|
-
tomwer/core/process/reconstruction/darkref/darkrefscopy.py,sha256=
|
321
|
+
tomwer/core/process/reconstruction/darkref/darkrefscopy.py,sha256=cWT2bM_ReVJ18cJKqQXp3IcKk0Z6W5NeJ03wpqTzjNk,13754
|
322
322
|
tomwer/core/process/reconstruction/darkref/params.py,sha256=Pnl8XJ4et-u169wzUdhB8_woBEXPXtrGPLZEbXSwZDQ,10080
|
323
323
|
tomwer/core/process/reconstruction/darkref/settings.py,sha256=35jliuOIjMKTOJjgn4uiotcDEr6RskpLHfRWWLm76dc,188
|
324
324
|
tomwer/core/process/reconstruction/nabu/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -461,7 +461,7 @@ tomwer/gui/control/nxtomomill.py,sha256=DI7DsO98O8h9mFcJ_1y1Kb8nD6w09at8YvJZNHR_
|
|
461
461
|
tomwer/gui/control/observations.py,sha256=oj2OqWYwiewgsZ5vNjzrMjB-YPopYyJmaBE5df09L7c,7735
|
462
462
|
tomwer/gui/control/reducedarkflatselector.py,sha256=hW2D69B2THZn8lIOaUQJHJ6aGIn-tHjcynEfIn4DftA,20536
|
463
463
|
tomwer/gui/control/scanselectorwidget.py,sha256=m3uxkoG4aNPPwamiI14l82PNS8tvIiOXmKhBJiwHgjU,2356
|
464
|
-
tomwer/gui/control/selectorwidgetbase.py,sha256=
|
464
|
+
tomwer/gui/control/selectorwidgetbase.py,sha256=faMzMHM4KDZ9L8irDnwSdGhwg2EjErbLPfXSNUqU9ko,5607
|
465
465
|
tomwer/gui/control/singletomoobj.py,sha256=5R_Uwgp5wdDQudxG2vyyq4Nj1GjhqH0HCeo_cFS7WuI,6777
|
466
466
|
tomwer/gui/control/tomoobjdisplaymode.py,sha256=u7JPqTD_stisI3ouckVr60yEqZuYWkpF_FI9rKhxPzo,159
|
467
467
|
tomwer/gui/control/volumeselectorwidget.py,sha256=mpbofAawBpzdc46IEkucTuiFJRDP18gWGdZjf5wUaTg,2082
|
@@ -510,7 +510,7 @@ tomwer/gui/reconstruction/axis/__init__.py,sha256=fUKWiRiG2o4Y-9RN-41VZMMM8L9Srl
|
|
510
510
|
tomwer/gui/reconstruction/axis/axis.py,sha256=QLyrJzJrShjlnO3tLkcnv2oexzVkxw-SGgn3cYfmmEY,27260
|
511
511
|
tomwer/gui/reconstruction/axis/radioaxis.py,sha256=hTweuwS-X32ZlpkHvP5X910zJ8p4fiJMsn_oUVtfvXM,92755
|
512
512
|
tomwer/gui/reconstruction/darkref/__init__.py,sha256=g9LASP8OJjxCPEHXO14hN0OLjLkeUve6etaPm1LIz4c,1373
|
513
|
-
tomwer/gui/reconstruction/darkref/darkrefcopywidget.py,sha256=
|
513
|
+
tomwer/gui/reconstruction/darkref/darkrefcopywidget.py,sha256=cfU2EJv_9LfCrKTHwnYwt2Kj4G6lMPbw0lbD-yjyT-Y,12053
|
514
514
|
tomwer/gui/reconstruction/darkref/darkrefwidget.py,sha256=O33udHaezaanZD9L5D525KrB4FD77g_Spr7gAUxGEag,16468
|
515
515
|
tomwer/gui/reconstruction/nabu/__init__.py,sha256=v2WxaBpu2zpGu7DEV96zaKAtHgRlcpORuAG2S0iF9O0,44
|
516
516
|
tomwer/gui/reconstruction/nabu/castvolume.py,sha256=4lrfdBt_24p9_kb9qmytEtIfzPXFPzYVdV57wgMLVWQ,15003
|
@@ -758,7 +758,7 @@ tomwer/synctools/stacks/edit/imagekeyeditor.py,sha256=NNDQWMJEuE50zBk_2zJAWbf6hC
|
|
758
758
|
tomwer/synctools/stacks/reconstruction/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
759
759
|
tomwer/synctools/stacks/reconstruction/axis.py,sha256=9Gqh0isvLYupypOq3P7XM_lU4Hcni4l3V2aUZsAVLrc,8876
|
760
760
|
tomwer/synctools/stacks/reconstruction/castvolume.py,sha256=PaoMuTxcj4Ms6N2MFnrCzmaCCC3wEZItYAwQ8NApe_o,8282
|
761
|
-
tomwer/synctools/stacks/reconstruction/dkrefcopy.py,sha256=
|
761
|
+
tomwer/synctools/stacks/reconstruction/dkrefcopy.py,sha256=01YdLs9xfmKFl7Wz3Qf9jawY6ePGp7fxcTus9BHNBeM,7402
|
762
762
|
tomwer/synctools/stacks/reconstruction/nabu.py,sha256=dDqw74kobhkawquJIwLDQH--PN6LbbthlqZ9MQUBJi4,7816
|
763
763
|
tomwer/synctools/stacks/reconstruction/normalization.py,sha256=wcw-tHjKUQMcija0bCExDl0InYsKHZNTeTk4w_hnaDI,5362
|
764
764
|
tomwer/synctools/stacks/reconstruction/saaxis.py,sha256=N5LM4QPE1H06WXjEH-PGIMfWgCHkwR02QR3PENZ_JzE,7126
|
@@ -776,10 +776,10 @@ tomwer/tests/test_utils.py,sha256=D0rNDSK6csEOYBY_7gD-4A3jp8rYAm8L1_Xg34A9I2s,30
|
|
776
776
|
tomwer/tests/utils.py,sha256=RAXx5A99WD4Vyuv_wjHBdr-Xu7UiThHRKw2eiB5GX10,107
|
777
777
|
tomwer/third_part/WaitingOverlay.py,sha256=GnqiytcJDp_24Cmz_2nZAP5HfpL3Yh7AzR2ATIusGsg,3906
|
778
778
|
tomwer/third_part/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
779
|
-
tomwer-1.3.
|
780
|
-
tomwer-1.3.
|
781
|
-
tomwer-1.3.
|
782
|
-
tomwer-1.3.
|
783
|
-
tomwer-1.3.
|
784
|
-
tomwer-1.3.
|
785
|
-
tomwer-1.3.
|
779
|
+
tomwer-1.3.13.dist-info/LICENSE,sha256=yR_hIZ1MfDh9x2_s23uFqBH7m5DgrBl9nJKkE37YChM,1877
|
780
|
+
tomwer-1.3.13.dist-info/METADATA,sha256=wWs75qkhJSr9ujUassUsmSCC5PGtRboBkMv07SI5Fu0,11460
|
781
|
+
tomwer-1.3.13.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
782
|
+
tomwer-1.3.13.dist-info/entry_points.txt,sha256=fIcDnCxjgwzfIylLYhUsFyiNZjZMxsfRQBxi4f-cJg8,440
|
783
|
+
tomwer-1.3.13.dist-info/namespace_packages.txt,sha256=Iut-JTfT11SZHHm77_ZeszD7pZDWXcTweCbvrJpqDyQ,14
|
784
|
+
tomwer-1.3.13.dist-info/top_level.txt,sha256=Yz5zKh0FPiImtzHYcPuztG1AO8-6KEpUWgoChGbA0Ys,21
|
785
|
+
tomwer-1.3.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|