tomwer 1.3.0.dev2__py3-none-any.whl → 1.3.0rc10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- orangecontrib/tomwer/widgets/__init__.py +11 -12
- orangecontrib/tomwer/widgets/control/DataListenerOW.py +6 -6
- orangecontrib/tomwer/widgets/control/DataValidatorOW.py +6 -6
- orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +3 -3
- orangecontrib/tomwer/widgets/control/NXTomomillOW.py +10 -8
- orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +6 -6
- orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +1 -1
- orangecontrib/tomwer/widgets/icat/RawDataScreenshotCreatorOW.py +98 -98
- orangecontrib/tomwer/widgets/icat/SaveToGalleryAndPublishOW.py +129 -129
- orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +13 -12
- orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +11 -9
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +11 -9
- orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +12 -15
- orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +9 -9
- orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/SinogramViewerOW.py +0 -1
- tomwer/__main__.py +0 -10
- tomwer/app/canvas_launcher/config.py +3 -3
- tomwer/app/canvas_launcher/environ.py +1 -0
- tomwer/app/intensitynormalization.py +12 -11
- tomwer/app/nabuapp.py +0 -11
- tomwer/app/zstitching.py +11 -1
- tomwer/core/process/control/datalistener/datalistener.py +15 -10
- tomwer/core/process/control/nxtomomill.py +1 -1
- tomwer/core/process/control/scantransfer.py +8 -32
- tomwer/core/process/edit/darkflatpatch.py +8 -9
- tomwer/core/process/edit/imagekeyeditor.py +20 -22
- tomwer/core/process/icat/screenshots.py +1 -0
- tomwer/core/process/reconstruction/axis/axis.py +263 -59
- tomwer/core/process/reconstruction/axis/mode.py +161 -50
- tomwer/core/process/reconstruction/axis/params.py +23 -20
- tomwer/core/process/reconstruction/darkref/darkrefs.py +12 -13
- tomwer/core/process/reconstruction/nabu/castvolume.py +3 -3
- tomwer/core/process/reconstruction/nabu/nabucommon.py +43 -19
- tomwer/core/process/reconstruction/nabu/nabuscores.py +34 -7
- tomwer/core/process/reconstruction/nabu/nabuslices.py +81 -26
- tomwer/core/process/reconstruction/nabu/nabuvolume.py +31 -26
- tomwer/core/process/reconstruction/nabu/plane.py +9 -0
- tomwer/core/process/reconstruction/nabu/utils.py +32 -9
- tomwer/core/process/reconstruction/saaxis/saaxis.py +4 -1
- tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +9 -1
- tomwer/core/process/reconstruction/scores/params.py +3 -3
- tomwer/core/process/reconstruction/test/test_darkref_copy.py +4 -4
- tomwer/core/process/stitching/nabustitcher.py +11 -10
- tomwer/core/process/task.py +33 -27
- tomwer/core/process/test/test_axis.py +7 -6
- tomwer/core/process/test/test_data_transfer.py +3 -3
- tomwer/core/process/test/test_nabu.py +10 -2
- tomwer/core/process/test/test_normalization.py +2 -2
- tomwer/core/scan/blissscan.py +3 -3
- tomwer/core/scan/edfscan.py +9 -9
- tomwer/core/scan/nxtomoscan.py +11 -11
- tomwer/core/scan/scanbase.py +31 -24
- tomwer/core/scan/test/test_future_scan.py +1 -1
- tomwer/core/scan/test/test_h5.py +4 -4
- tomwer/core/scan/test/test_process_registration.py +2 -2
- tomwer/core/scan/test/test_scan.py +1 -75
- tomwer/core/settings.py +3 -3
- tomwer/core/test/test_utils.py +2 -2
- tomwer/core/volume/edfvolume.py +6 -6
- tomwer/core/volume/hdf5volume.py +6 -6
- tomwer/core/volume/jp2kvolume.py +6 -6
- tomwer/core/volume/rawvolume.py +6 -6
- tomwer/core/volume/tiffvolume.py +12 -12
- tomwer/gui/cluster/slurm.py +14 -9
- tomwer/gui/cluster/supervisor.py +12 -0
- tomwer/gui/cluster/test/test_cluster.py +1 -2
- tomwer/gui/cluster/test/test_supervisor.py +1 -1
- tomwer/gui/control/datalist.py +5 -0
- tomwer/gui/control/datawatcher/controlwidget.py +2 -4
- tomwer/gui/control/reducedarkflatselector.py +8 -8
- tomwer/gui/control/test/test_single_tomo_obj.py +1 -1
- tomwer/gui/edit/dkrfpatch.py +4 -4
- tomwer/gui/edit/nxtomowarmer.py +2 -2
- tomwer/gui/edit/test/test_dkrf_patch.py +6 -6
- tomwer/gui/imagefromfile.py +2 -2
- tomwer/gui/qfolderdialog.py +5 -0
- tomwer/gui/reconstruction/axis/CompareImages.py +94 -168
- tomwer/gui/reconstruction/axis/radioaxis.py +58 -182
- tomwer/gui/reconstruction/darkref/darkrefwidget.py +2 -1
- tomwer/gui/reconstruction/nabu/castvolume.py +8 -1
- tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +54 -21
- tomwer/gui/reconstruction/normalization/intensity.py +3 -25
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +1 -1
- tomwer/gui/reconstruction/saaxis/saaxis.py +1 -11
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +0 -10
- tomwer/gui/reconstruction/scores/scoreplot.py +1 -6
- tomwer/gui/reconstruction/test/test_axis.py +18 -4
- tomwer/gui/reconstruction/test/test_nabu.py +3 -0
- tomwer/gui/stitching/stitching.py +2 -2
- tomwer/gui/stitching/stitching_preview.py +7 -53
- tomwer/gui/stitching/stitching_raw.py +3 -3
- tomwer/gui/utils/inputwidget.py +12 -2
- tomwer/gui/utils/lineselector/lineselector.py +1 -1
- tomwer/gui/visualization/dataviewer.py +47 -17
- tomwer/gui/visualization/sinogramviewer.py +19 -26
- tomwer/gui/visualization/test/test_volumeviewer.py +64 -66
- tomwer/gui/visualization/volumeviewer.py +105 -105
- tomwer/io/utils/h5pyutils.py +7 -3
- tomwer/io/utils/utils.py +3 -3
- tomwer/resources/gui/icons/parameters.svg +1 -1
- tomwer/resources/gui/illustrations/no_rot.svg +1 -1
- tomwer/synctools/stacks/edit/darkflatpatch.py +17 -12
- tomwer/tests/test_scripts.py +0 -3
- tomwer/third_part/WaitingOverlay.py +110 -0
- tomwer/third_part/__init__.py +0 -0
- tomwer/version.py +2 -2
- {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/METADATA +32 -31
- {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/RECORD +115 -153
- {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/WHEEL +1 -1
- orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +0 -197
- orangecontrib/tomwer/widgets/reconstruction/icons/XY_lamino.svg +0 -168
- orangecontrib/tomwer/widgets/reconstruction/icons/XZ_lamino.svg +0 -275
- orangecontrib/tomwer/widgets/reconstruction/icons/YZ_lamino.svg +0 -182
- tomwer/app/lamino.py +0 -143
- tomwer/core/process/reconstruction/lamino/__init__.py +0 -1
- tomwer/core/process/reconstruction/lamino/tofu.py +0 -1000
- tomwer/core/process/test/test_lamino.py +0 -76
- tomwer/core/test/test_lamino.py +0 -92
- tomwer/gui/reconstruction/lamino/__init__.py +0 -31
- tomwer/gui/reconstruction/lamino/tofu/TofuOptionLoader.py +0 -107
- tomwer/gui/reconstruction/lamino/tofu/__init__.py +0 -1
- tomwer/gui/reconstruction/lamino/tofu/misc.py +0 -148
- tomwer/gui/reconstruction/lamino/tofu/projections.py +0 -896
- tomwer/gui/reconstruction/lamino/tofu/settings.py +0 -75
- tomwer/gui/reconstruction/lamino/tofu/tofu.py +0 -432
- tomwer/gui/reconstruction/lamino/tofu/tofuexpert.py +0 -567
- tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +0 -757
- tomwer/gui/reconstruction/test/test_lamino.py +0 -194
- tomwer/resources/gui/icons/lamino_parameters.svg +0 -70
- tomwer/resources/gui/illustrations/lamino_angle.png +0 -0
- tomwer/resources/gui/illustrations/lamino_angle.svg +0 -509
- tomwer/resources/gui/illustrations/lamino_beta_angle.png +0 -0
- tomwer/resources/gui/illustrations/lamino_beta_angle.svg +0 -97
- tomwer/resources/gui/illustrations/lamino_theta_angle.png +0 -0
- tomwer/resources/gui/illustrations/lamino_theta_angle.svg +0 -368
- tomwer/resources/gui/illustrations/manual_slice.png +0 -0
- tomwer/resources/gui/illustrations/manual_slice.svg +0 -221
- tomwer/resources/gui/illustrations/psi_angle.png +0 -0
- tomwer/resources/gui/illustrations/psi_angle.svg +0 -479
- tomwer/resources/gui/illustrations/rotation_center.png +0 -0
- tomwer/resources/gui/illustrations/rotation_center.svg +0 -276
- tomwer/resources/gui/illustrations/slice_stack.png +0 -0
- tomwer/resources/gui/illustrations/slice_stack.svg +0 -266
- tomwer/resources/gui/illustrations/xy_slice.png +0 -0
- tomwer/resources/gui/illustrations/xy_slice.svg +0 -269
- tomwer/resources/gui/illustrations/xz_slice.png +0 -0
- tomwer/resources/gui/illustrations/xz_slice.svg +0 -270
- tomwer/resources/gui/illustrations/yz_slice.png +0 -0
- tomwer/resources/gui/illustrations/yz_slice.svg +0 -270
- tomwer/synctools/stacks/reconstruction/lamino.py +0 -233
- /tomwer-1.3.0.dev2-py3.11-nspkg.pth → /tomwer-1.3.0rc10-py3.11-nspkg.pth +0 -0
- {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/LICENSE +0 -0
- {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/entry_points.txt +0 -0
- {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.3.0.dev2.dist-info → tomwer-1.3.0rc10.dist-info}/top_level.txt +0 -0
tomwer/core/test/test_utils.py
CHANGED
@@ -279,8 +279,8 @@ class TestMockNXtomo(unittest.TestCase):
|
|
279
279
|
n_ini_proj=20,
|
280
280
|
n_alignement_proj=2,
|
281
281
|
create_ini_dark=True,
|
282
|
-
|
283
|
-
|
282
|
+
create_ini_flat=True,
|
283
|
+
create_final_flat=True,
|
284
284
|
n_refs=10,
|
285
285
|
)
|
286
286
|
self.assertTrue(0 in mock.scan.darks.keys())
|
tomwer/core/volume/edfvolume.py
CHANGED
@@ -86,11 +86,11 @@ class EDFVolume(_EDFVolume, TomwerVolumeBase, Dataset):
|
|
86
86
|
file_prefix=self._volume_basename,
|
87
87
|
metadata={
|
88
88
|
"name": self.url.file_path(),
|
89
|
-
"creation_time":
|
90
|
-
|
91
|
-
|
92
|
-
"modification_time":
|
93
|
-
|
94
|
-
|
89
|
+
"creation_time": (
|
90
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
91
|
+
),
|
92
|
+
"modification_time": (
|
93
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
94
|
+
),
|
95
95
|
},
|
96
96
|
)
|
tomwer/core/volume/hdf5volume.py
CHANGED
@@ -103,11 +103,11 @@ class HDF5Volume(_HDF5Volume, TomwerVolumeBase, Dataset):
|
|
103
103
|
entry=self.url.data_path(),
|
104
104
|
metadata={
|
105
105
|
"name": self.url.file_path(),
|
106
|
-
"creation_time":
|
107
|
-
|
108
|
-
|
109
|
-
"modification_time":
|
110
|
-
|
111
|
-
|
106
|
+
"creation_time": (
|
107
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
108
|
+
),
|
109
|
+
"modification_time": (
|
110
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
111
|
+
),
|
112
112
|
},
|
113
113
|
)
|
tomwer/core/volume/jp2kvolume.py
CHANGED
@@ -87,11 +87,11 @@ class JP2KVolume(_JP2KVolume, TomwerVolumeBase, Dataset):
|
|
87
87
|
file_prefix=self._volume_basename,
|
88
88
|
metadata={
|
89
89
|
"name": self.url.file_path(),
|
90
|
-
"creation_time":
|
91
|
-
|
92
|
-
|
93
|
-
"modification_time":
|
94
|
-
|
95
|
-
|
90
|
+
"creation_time": (
|
91
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
92
|
+
),
|
93
|
+
"modification_time": (
|
94
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
95
|
+
),
|
96
96
|
},
|
97
97
|
)
|
tomwer/core/volume/rawvolume.py
CHANGED
@@ -97,11 +97,11 @@ class RawVolume(_RawVolume, TomwerVolumeBase, Dataset):
|
|
97
97
|
file_path=self.url.file_path(),
|
98
98
|
metadata={
|
99
99
|
"name": self.url.file_path(),
|
100
|
-
"creation_time":
|
101
|
-
|
102
|
-
|
103
|
-
"modification_time":
|
104
|
-
|
105
|
-
|
100
|
+
"creation_time": (
|
101
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
102
|
+
),
|
103
|
+
"modification_time": (
|
104
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
105
|
+
),
|
106
106
|
},
|
107
107
|
)
|
tomwer/core/volume/tiffvolume.py
CHANGED
@@ -103,12 +103,12 @@ class TIFFVolume(_TIFFVolume, TomwerVolumeBase, Dataset):
|
|
103
103
|
file_prefix=self._volume_basename,
|
104
104
|
metadata={
|
105
105
|
"name": self.url.file_path(),
|
106
|
-
"creation_time":
|
107
|
-
|
108
|
-
|
109
|
-
"modification_time":
|
110
|
-
|
111
|
-
|
106
|
+
"creation_time": (
|
107
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
108
|
+
),
|
109
|
+
"modification_time": (
|
110
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
111
|
+
),
|
112
112
|
},
|
113
113
|
)
|
114
114
|
|
@@ -145,12 +145,12 @@ class MultiTIFFVolume(_MultiTIFFVolume, TomwerVolumeBase, Dataset):
|
|
145
145
|
tiff_file=self.url.file_path(),
|
146
146
|
metadata={
|
147
147
|
"name": self.url.file_path(),
|
148
|
-
"creation_time":
|
149
|
-
|
150
|
-
|
151
|
-
"modification_time":
|
152
|
-
|
153
|
-
|
148
|
+
"creation_time": (
|
149
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
150
|
+
),
|
151
|
+
"modification_time": (
|
152
|
+
datetime.fromtimestamp(stat.st_ctime) if stat else None
|
153
|
+
),
|
154
154
|
},
|
155
155
|
)
|
156
156
|
|
tomwer/gui/cluster/slurm.py
CHANGED
@@ -168,6 +168,7 @@ class SlurmSettingsWindow(qt.QMainWindow):
|
|
168
168
|
"job_name": settingsClass.PROJECT_NAME,
|
169
169
|
"walltime": settingsClass.DEFAULT_WALLTIME,
|
170
170
|
"python_venv": settingsClass.PYTHON_VENV,
|
171
|
+
"modules": settingsClass.MODULES_TO_LOAD,
|
171
172
|
}
|
172
173
|
)
|
173
174
|
|
@@ -270,7 +271,7 @@ class SlurmSettingsWidget(qt.QWidget):
|
|
270
271
|
self.layout().addRow(self._preProcessingGroup)
|
271
272
|
|
272
273
|
# python venv
|
273
|
-
self._pythonVenv = qt.QLineEdit("", self)
|
274
|
+
self._pythonVenv = qt.QLineEdit("/scisoft/tomotools/activate stable", self)
|
274
275
|
self._sourceScriptCB = qt.QRadioButton("source script (python venv)", self)
|
275
276
|
self._preProcessingButtonGroup.addButton(self._sourceScriptCB)
|
276
277
|
self._preProcessingGroup.layout().addRow(self._sourceScriptCB, self._pythonVenv)
|
@@ -280,13 +281,13 @@ class SlurmSettingsWidget(qt.QWidget):
|
|
280
281
|
"""
|
281
282
|
)
|
282
283
|
|
283
|
-
self._modulesQLE = qt.QLineEdit("
|
284
|
-
self._modulesCB = qt.QRadioButton("module to load", self)
|
284
|
+
self._modulesQLE = qt.QLineEdit(", ".join(SlurmSettings.MODULES_TO_LOAD), self)
|
285
|
+
self._modulesCB = qt.QRadioButton("module(s) to load", self)
|
285
286
|
self._preProcessingButtonGroup.addButton(self._modulesCB)
|
286
287
|
self._preProcessingGroup.layout().addRow(self._modulesCB, self._modulesQLE)
|
287
288
|
self._preProcessingGroup.setToolTip(
|
288
289
|
"""
|
289
|
-
Optional list of modules to load before executing the script.
|
290
|
+
Optional list of modules to load before executing the script. each module must be separated by a coma
|
290
291
|
"""
|
291
292
|
)
|
292
293
|
|
@@ -372,8 +373,7 @@ class SlurmSettingsWidget(qt.QWidget):
|
|
372
373
|
self._nGpu.setValue(n_gpu)
|
373
374
|
self._jobName.setText(SlurmSettings.PROJECT_NAME)
|
374
375
|
self._wallTimeQLE.setText(SlurmSettings.DEFAULT_WALLTIME)
|
375
|
-
self.
|
376
|
-
self._sourceScriptCB.setChecked(True)
|
376
|
+
self._modulesCB.setChecked(True) # by default we go for modules
|
377
377
|
self._preProcessingModeChanged()
|
378
378
|
self._partitionChanged()
|
379
379
|
self._nGpuChanged()
|
@@ -569,7 +569,7 @@ class SlurmSettingsWidget(qt.QWidget):
|
|
569
569
|
self.sigConfigChanged.emit()
|
570
570
|
|
571
571
|
def getConfiguration(self) -> dict:
|
572
|
-
|
572
|
+
config = {
|
573
573
|
"cpu-per-task": self.getNCores(),
|
574
574
|
"n_tasks": self.getNWorkers(),
|
575
575
|
"n_jobs": self.getNJobs(),
|
@@ -578,10 +578,15 @@ class SlurmSettingsWidget(qt.QWidget):
|
|
578
578
|
"n_gpus": self.getNGPU(),
|
579
579
|
"job_name": self.getProjectName(),
|
580
580
|
"walltime": self.getWallTime(),
|
581
|
-
"python_venv": self.getPythonExe(),
|
582
|
-
"modules": self.getModulesToLoad(),
|
583
581
|
"sbatch_extra_params": self.getSBatchExtraParams(),
|
584
582
|
}
|
583
|
+
if self._modulesCB.isChecked():
|
584
|
+
config["modules"] = self.getModulesToLoad()
|
585
|
+
elif self._sourceScriptCB.isChecked():
|
586
|
+
config["python_venv"] = self.getPythonExe()
|
587
|
+
else:
|
588
|
+
raise ValueError("'modules' or python environement should be enable")
|
589
|
+
return config
|
585
590
|
|
586
591
|
def getSlurmClusterConfiguration(self):
|
587
592
|
from tomwer.core.cluster import SlurmClusterConfiguration
|
tomwer/gui/cluster/supervisor.py
CHANGED
@@ -102,6 +102,7 @@ class FutureTomwerScanObserverWidget(qt.QWidget):
|
|
102
102
|
)
|
103
103
|
if future_tomo_obj is not None:
|
104
104
|
self.sigConversionRequested.emit(future_tomo_obj)
|
105
|
+
self.observationTable.model().updateIndices()
|
105
106
|
self.observationTable.model().layoutChanged.emit()
|
106
107
|
|
107
108
|
def _cancelSelected(self, *args, **kwargs):
|
@@ -123,6 +124,7 @@ class FutureTomwerScanObserverWidget(qt.QWidget):
|
|
123
124
|
self.observationTable.model().filtered_status = (
|
124
125
|
self.filterWidget.getFilteredStatus()
|
125
126
|
)
|
127
|
+
self.observationTable.model().endResetModel()
|
126
128
|
|
127
129
|
def updateView(self):
|
128
130
|
"""
|
@@ -265,6 +267,16 @@ class _DatasetProcessModel(qt.QAbstractTableModel):
|
|
265
267
|
del self._tomoObjStatus[future_tomo_obj]
|
266
268
|
self.layoutChanged.emit()
|
267
269
|
|
270
|
+
def updateIndices(self):
|
271
|
+
"""
|
272
|
+
Update tomo object indices when a tomo object has been removed (during a convertion for example)
|
273
|
+
"""
|
274
|
+
tomo_objs = list(self.futureTomoObjs.values())
|
275
|
+
self.futureTomoObjs.clear()
|
276
|
+
for i_tomo_obj, tomo_obj in enumerate(tomo_objs):
|
277
|
+
self.futureTomoObjs[i_tomo_obj] = tomo_obj
|
278
|
+
self._computeUnfilteredFutureTomoObjs()
|
279
|
+
|
268
280
|
def getUnfilteredFutureTomoObjs(self):
|
269
281
|
return self._filteredFutureTomoObjs
|
270
282
|
|
@@ -61,9 +61,8 @@ class TestSlurmWidget(TestCaseQt):
|
|
61
61
|
"partition": SlurmSettings.PARTITION,
|
62
62
|
"n_gpus": SlurmSettings.N_GPUS_PER_WORKER,
|
63
63
|
"job_name": "tomwer_{scan}_-_{process}_-_{info}",
|
64
|
-
"modules": tuple(),
|
65
64
|
"n_jobs": 1,
|
66
|
-
"
|
65
|
+
"modules": ("tomotools/stable",),
|
67
66
|
"walltime": "01:00:00",
|
68
67
|
"sbatch_extra_params": {
|
69
68
|
"export": "NONE",
|
tomwer/gui/control/datalist.py
CHANGED
@@ -242,6 +242,11 @@ class BlissHDF5DataListDialog(_DataListDialog):
|
|
242
242
|
os.environ["TOMWER_DEFAULT_INPUT_DIR"]
|
243
243
|
):
|
244
244
|
dialog.setDirectory(os.environ["TOMWER_DEFAULT_INPUT_DIR"])
|
245
|
+
elif dialog.directory() != os.getcwd() or str(dialog.directory()).startswith(
|
246
|
+
"/data"
|
247
|
+
):
|
248
|
+
# if the directory as already been set by the user. Avoid redefining it
|
249
|
+
pass
|
245
250
|
elif os.path.isdir("/data"):
|
246
251
|
dialog.setDirectory("/data")
|
247
252
|
|
@@ -99,10 +99,8 @@ class ControlWidget(qt.QWidget):
|
|
99
99
|
"""
|
100
100
|
Ask the user the path to the folder to observe
|
101
101
|
"""
|
102
|
-
defaultDirectory = self.
|
102
|
+
defaultDirectory = self._qteFolderSelected.text()
|
103
103
|
if defaultDirectory is None or not os.path.isdir(defaultDirectory):
|
104
|
-
if os.path.isdir(self.DEFAULT_DIRECTORY):
|
105
|
-
defaultDirectory = self.DEFAULT_DIRECTORY
|
106
104
|
if defaultDirectory is None:
|
107
105
|
defaultDirectory = get_default_directory()
|
108
106
|
|
@@ -113,4 +111,4 @@ class ControlWidget(qt.QWidget):
|
|
113
111
|
dialog.close()
|
114
112
|
return
|
115
113
|
|
116
|
-
self.
|
114
|
+
self._qteFolderSelected.setText(dialog.selectedFiles()[0])
|
@@ -12,7 +12,7 @@ from silx.gui.dialog.DataFileDialog import DataFileDialog
|
|
12
12
|
|
13
13
|
from tomoscan.esrf.scan.utils import cwd_context
|
14
14
|
from tomoscan.framereducer.target import REDUCER_TARGET
|
15
|
-
from tomoscan.io import HDF5File
|
15
|
+
from tomoscan.io import HDF5File, get_swmr_mode
|
16
16
|
|
17
17
|
from tomwer.io.utils import get_default_directory
|
18
18
|
|
@@ -249,7 +249,7 @@ class ReduceDarkFlatSelectorTableWidget(qt.QWidget):
|
|
249
249
|
if not os.path.exists(file_path):
|
250
250
|
_logger.error(f"file doesn't exists ({file_path})")
|
251
251
|
|
252
|
-
with HDF5File(file_path, mode="r") as h5f:
|
252
|
+
with HDF5File(file_path, mode="r", swmr=get_swmr_mode()) as h5f:
|
253
253
|
entries = tuple(h5f.keys())
|
254
254
|
|
255
255
|
res = []
|
@@ -289,16 +289,16 @@ class ReduceDarkFlatSelectorTableWidget(qt.QWidget):
|
|
289
289
|
for target in REDUCER_TARGET.values():
|
290
290
|
if target in reduced_info_dict:
|
291
291
|
reduced_frames = reduced_info_dict[target]
|
292
|
-
reduced_frames[
|
293
|
-
"
|
294
|
-
|
292
|
+
reduced_frames["reduce_frames_name"] = (
|
293
|
+
f"{target} from {url.data_path()}@{os.path.basename(url.file_path())}"
|
294
|
+
)
|
295
295
|
result.append(reduced_frames)
|
296
296
|
|
297
297
|
if len(reduced_frames) == 0:
|
298
298
|
# else we consider the data_path is the valid one
|
299
|
-
reduced_frames[
|
300
|
-
"
|
301
|
-
|
299
|
+
reduced_frames["reduce_frames_name"] = (
|
300
|
+
f"{url.data_path()}@{os.path.basename(url.file_path())}"
|
301
|
+
)
|
302
302
|
result.append(reduced_frames)
|
303
303
|
|
304
304
|
return tuple(result)
|
tomwer/gui/edit/dkrfpatch.py
CHANGED
@@ -37,7 +37,7 @@ from silx.gui.dialog.DataFileDialog import DataFileDialog
|
|
37
37
|
from silx.io.url import DataUrl
|
38
38
|
from silx.io.utils import h5py_read_dataset
|
39
39
|
from nxtomo.nxobject.nxdetector import ImageKey
|
40
|
-
from tomoscan.io import HDF5File
|
40
|
+
from tomoscan.io import HDF5File, get_swmr_mode
|
41
41
|
|
42
42
|
import tomwer.core.utils.nxtomoutils as nxtomo_utils
|
43
43
|
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
@@ -83,7 +83,7 @@ class _DarkOrFlatUrl(qt.QWidget):
|
|
83
83
|
url = self._redirectDataPath(url, logger=_logger)
|
84
84
|
|
85
85
|
def dataset_invalid(url):
|
86
|
-
with HDF5File(url.file_path(), mode="r") as h5s:
|
86
|
+
with HDF5File(url.file_path(), mode="r", swmr=get_swmr_mode()) as h5s:
|
87
87
|
if not isinstance(h5s[url.data_path()], h5py.Dataset):
|
88
88
|
return True
|
89
89
|
return False
|
@@ -113,7 +113,7 @@ class _DarkOrFlatUrl(qt.QWidget):
|
|
113
113
|
|
114
114
|
def _redirectDataPath(self, url, logger=None):
|
115
115
|
try:
|
116
|
-
with HDF5File(url.file_path(), mode="r") as h5s:
|
116
|
+
with HDF5File(url.file_path(), mode="r", swmr=get_swmr_mode()) as h5s:
|
117
117
|
node = h5s[url.data_path()]
|
118
118
|
|
119
119
|
if NXtomoScan.entry_is_nx_tomo(node):
|
@@ -188,7 +188,7 @@ class _DarkOrFlatUrl(qt.QWidget):
|
|
188
188
|
def _getImageKey(self, url):
|
189
189
|
# if we are on a 'detector / data dataset' then we can try to reach
|
190
190
|
# image_key information
|
191
|
-
with HDF5File(url.file_path(), mode="r") as h5s:
|
191
|
+
with HDF5File(url.file_path(), mode="r", swmr=get_swmr_mode()) as h5s:
|
192
192
|
dataset = h5s[url.data_path()]
|
193
193
|
grp_parent = dataset.parent
|
194
194
|
if grp_parent is not None and NXtomoScan.is_nxdetector(grp_parent):
|
tomwer/gui/edit/nxtomowarmer.py
CHANGED
@@ -3,7 +3,7 @@ import h5py
|
|
3
3
|
from silx.gui import qt
|
4
4
|
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
5
5
|
from tomwer.gui import icons
|
6
|
-
from tomoscan.io import HDF5File
|
6
|
+
from tomoscan.io import HDF5File, get_swmr_mode
|
7
7
|
|
8
8
|
|
9
9
|
class NXtomoProxyWarmer(qt.QWidget):
|
@@ -44,7 +44,7 @@ class NXtomoProxyWarmer(qt.QWidget):
|
|
44
44
|
if scan is None:
|
45
45
|
self._activateWarning(False)
|
46
46
|
elif isinstance(scan, NXtomoScan):
|
47
|
-
with HDF5File(scan.master_file, mode="r") as h5f:
|
47
|
+
with HDF5File(scan.master_file, mode="r", swmr=get_swmr_mode()) as h5f:
|
48
48
|
entry = h5f.get(
|
49
49
|
name=scan.entry, getclass=True, getlink=True, default=None
|
50
50
|
)
|
@@ -67,8 +67,8 @@ class TestDarkOrFlatUrl(TestCaseQt):
|
|
67
67
|
n_ini_proj=20,
|
68
68
|
n_proj=20,
|
69
69
|
create_ini_dark=True,
|
70
|
-
|
71
|
-
|
70
|
+
create_ini_flat=True,
|
71
|
+
create_final_flat=True,
|
72
72
|
)
|
73
73
|
self._scan = hdf5_mock.scan
|
74
74
|
self.scan_url = DataUrl(
|
@@ -135,8 +135,8 @@ class TestDarkRefPatchWidget(TestCaseQt):
|
|
135
135
|
n_ini_proj=20,
|
136
136
|
n_proj=20,
|
137
137
|
create_ini_dark=True,
|
138
|
-
|
139
|
-
|
138
|
+
create_ini_flat=True,
|
139
|
+
create_final_flat=True,
|
140
140
|
)
|
141
141
|
self._scanWithDarkAndRef = hdf5_mock.scan
|
142
142
|
|
@@ -145,8 +145,8 @@ class TestDarkRefPatchWidget(TestCaseQt):
|
|
145
145
|
n_ini_proj=20,
|
146
146
|
n_proj=20,
|
147
147
|
create_ini_dark=False,
|
148
|
-
|
149
|
-
|
148
|
+
create_ini_flat=False,
|
149
|
+
create_final_flat=False,
|
150
150
|
)
|
151
151
|
self._scan = hdf5_mock.scan
|
152
152
|
assert len(self._scan.darks) == 0
|
tomwer/gui/imagefromfile.py
CHANGED
@@ -34,7 +34,7 @@ import logging
|
|
34
34
|
|
35
35
|
from silx.gui import qt
|
36
36
|
from silx.io.url import DataUrl
|
37
|
-
from tomoscan.io import HDF5File
|
37
|
+
from tomoscan.io import HDF5File, get_swmr_mode
|
38
38
|
|
39
39
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
40
40
|
from tomwer.synctools.imageloaderthread import ImageLoaderThread
|
@@ -71,7 +71,7 @@ class ImageFromFile(_Image):
|
|
71
71
|
|
72
72
|
def get_nabu_entry():
|
73
73
|
try:
|
74
|
-
with HDF5File(_file, mode="r", swmr=
|
74
|
+
with HDF5File(_file, mode="r", swmr=get_swmr_mode()) as h5s:
|
75
75
|
for node in h5s:
|
76
76
|
if "reconstruction" in h5s[node]:
|
77
77
|
return "/".join(
|
tomwer/gui/qfolderdialog.py
CHANGED
@@ -78,6 +78,11 @@ class QDataDialog(qt.QFileDialog):
|
|
78
78
|
os.environ["TOMWER_DEFAULT_INPUT_DIR"]
|
79
79
|
):
|
80
80
|
self.setDirectory(os.environ["TOMWER_DEFAULT_INPUT_DIR"])
|
81
|
+
elif self.directory() != os.getcwd() or str(self.directory()).startswith(
|
82
|
+
"/data"
|
83
|
+
):
|
84
|
+
# if the directory as already been set by the user. Avoid redefining it
|
85
|
+
pass
|
81
86
|
elif os.path.isdir("/data"):
|
82
87
|
self.setDirectory("/data")
|
83
88
|
|