tomwer 1.2.0a1__py3-none-any.whl → 1.2.0a3__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/append_raw_darks_and_flats_frames_to_NXtomos.ows +44 -0
- orangecontrib/tomwer/tutorials/copy_reduced_darks_and_flats_meth1.ows +55 -0
- orangecontrib/tomwer/tutorials/copy_reduced_darks_and_flats_meth2.ows +48 -0
- orangecontrib/tomwer/tutorials/default_cor_search.ows +40 -0
- orangecontrib/tomwer/tutorials/hello_world_python_script.ows +50 -0
- orangecontrib/tomwer/tutorials/simple_slice_reconstruction_on_slurm.ows +50 -0
- orangecontrib/tomwer/tutorials/simple_volume_to_slurm_reconstruction.ows +8 -8
- orangecontrib/tomwer/widgets/__init__.py +1 -1
- orangecontrib/tomwer/widgets/cluster/FutureSupervisorOW.py +0 -1
- orangecontrib/tomwer/widgets/cluster/SlurmClusterOW.py +8 -6
- orangecontrib/tomwer/widgets/control/AdvancementOW.py +0 -1
- orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +1 -6
- orangecontrib/tomwer/widgets/control/DataListOW.py +0 -1
- orangecontrib/tomwer/widgets/control/DataListenerOW.py +4 -4
- orangecontrib/tomwer/widgets/control/DataSelectorOW.py +0 -1
- orangecontrib/tomwer/widgets/control/DataTransfertOW.py +7 -7
- orangecontrib/tomwer/widgets/control/DataValidatorOW.py +0 -1
- orangecontrib/tomwer/widgets/control/DataWatcherOW.py +0 -3
- orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +3 -2
- orangecontrib/tomwer/widgets/control/EmailOW.py +82 -0
- orangecontrib/tomwer/widgets/control/FilterOW.py +3 -3
- orangecontrib/tomwer/widgets/control/NXTomomillOW.py +1 -1
- orangecontrib/tomwer/widgets/control/NotifierOW.py +0 -1
- orangecontrib/tomwer/widgets/control/ReduceDarkFlatSelectorOW.py +93 -0
- orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +29 -5
- orangecontrib/tomwer/widgets/control/TimerOW.py +1 -2
- orangecontrib/tomwer/widgets/control/TomoObjSerieOW.py +0 -1
- orangecontrib/tomwer/widgets/control/VolumeSelector.py +0 -1
- orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +4 -10
- orangecontrib/tomwer/widgets/control/icons/email.png +0 -0
- orangecontrib/tomwer/widgets/control/icons/email.svg +58 -0
- orangecontrib/tomwer/widgets/control/icons/reduced_darkflat_selector.png +0 -0
- orangecontrib/tomwer/widgets/control/icons/reduced_darkflat_selector.svg +199 -0
- orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +0 -1
- orangecontrib/tomwer/widgets/debugtools/ObjectInspectorOW.py +0 -1
- orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +1 -2
- orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +1 -2
- orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +0 -1
- orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +0 -1
- orangecontrib/tomwer/widgets/other/PythonScriptOW.py +29 -1
- orangecontrib/tomwer/widgets/other/TomoObjsHub.py +28 -0
- orangecontrib/tomwer/widgets/other/icons/hub.png +0 -0
- orangecontrib/tomwer/widgets/other/icons/hub.svg +113 -0
- orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +18 -12
- orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +0 -2
- orangecontrib/tomwer/widgets/reconstruction/DarkRefAndCopyOW.py +21 -6
- orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +29 -7
- orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +18 -5
- orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +40 -13
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +37 -10
- orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +2 -3
- orangecontrib/tomwer/widgets/reconstruction/TofuOW.py +5 -4
- orangecontrib/tomwer/widgets/stitching/StitcherOW.py +0 -1
- orangecontrib/tomwer/widgets/stitching/ZStitchingConfigOW.py +0 -1
- orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +10 -4
- orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +0 -1
- orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +0 -1
- orangecontrib/tomwer/widgets/visualization/RadioStackOW.py +7 -5
- orangecontrib/tomwer/widgets/visualization/SampleMovedOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/SinogramViewerOW.py +0 -3
- orangecontrib/tomwer/widgets/visualization/SliceStackOW.py +7 -5
- orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +4 -4
- tomwer/__main__.py +139 -5
- tomwer/app/axis.py +16 -5
- tomwer/app/canvas_launcher/config.py +1 -1
- tomwer/app/canvas_launcher/mainwindow.py +164 -6
- tomwer/app/darkref.py +10 -181
- tomwer/app/darkrefpatch.py +10 -131
- tomwer/app/diffframe.py +11 -0
- tomwer/app/imagekeyeditor.py +12 -19
- tomwer/app/intensitynormalization.py +1 -0
- tomwer/app/lamino.py +7 -2
- tomwer/app/patchrawdarkflat.py +131 -0
- tomwer/app/radiostack.py +10 -0
- tomwer/app/reducedarkflat.py +205 -0
- tomwer/app/saaxis.py +27 -8
- tomwer/app/sadeltabeta.py +29 -8
- tomwer/app/samplemoved.py +11 -0
- tomwer/app/scanviewer.py +12 -0
- tomwer/app/sinogramviewer.py +11 -0
- tomwer/app/slicestack.py +11 -0
- tomwer/app/zstitching.py +12 -0
- tomwer/core/futureobject.py +4 -2
- tomwer/core/process/conditions/filters.py +26 -4
- tomwer/core/process/control/datadiscovery.py +4 -0
- tomwer/core/process/control/datawatcher/datawatcher.py +5 -1
- tomwer/core/process/control/email.py +148 -0
- tomwer/core/process/control/nxtomoconcatenate.py +9 -2
- tomwer/core/process/control/nxtomomill.py +58 -16
- tomwer/core/process/control/scanselector.py +4 -0
- tomwer/core/process/control/scantransfer.py +52 -23
- tomwer/core/process/control/test/test_concatenate_nxtomos.py +1 -0
- tomwer/core/process/control/test/test_email.py +52 -0
- tomwer/core/process/control/test/test_h52nx_process.py +106 -0
- tomwer/core/process/control/test/test_volume_link.py +5 -4
- tomwer/core/process/control/timer.py +27 -6
- tomwer/core/process/control/tomoobjserie.py +4 -0
- tomwer/core/process/control/volumeselector.py +4 -0
- tomwer/core/process/control/volumesymlink.py +47 -8
- tomwer/core/process/edit/darkflatpatch.py +49 -8
- tomwer/core/process/edit/imagekeyeditor.py +63 -13
- tomwer/core/process/reconstruction/axis/__init__.py +1 -1
- tomwer/core/process/reconstruction/axis/axis.py +61 -41
- tomwer/core/process/reconstruction/axis/params.py +4 -6
- tomwer/core/process/reconstruction/darkref/darkrefs.py +53 -16
- tomwer/core/process/reconstruction/darkref/darkrefscopy.py +12 -2
- tomwer/core/process/reconstruction/lamino/__init__.py +1 -1
- tomwer/core/process/reconstruction/lamino/tofu.py +22 -2
- tomwer/core/process/reconstruction/nabu/nabucommon.py +93 -14
- tomwer/core/process/reconstruction/nabu/nabuscores.py +70 -33
- tomwer/core/process/reconstruction/nabu/nabuslices.py +219 -41
- tomwer/core/process/reconstruction/nabu/nabuvolume.py +240 -108
- tomwer/core/process/reconstruction/nabu/utils.py +10 -36
- tomwer/core/process/reconstruction/normalization/normalization.py +10 -3
- tomwer/core/process/reconstruction/saaxis/__init__.py +1 -0
- tomwer/core/process/reconstruction/saaxis/saaxis.py +564 -376
- tomwer/core/process/reconstruction/sadeltabeta/__init__.py +1 -0
- tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +481 -268
- tomwer/core/process/reconstruction/scores/params.py +21 -8
- tomwer/core/process/reconstruction/test/test_darkref_copy.py +2 -0
- tomwer/core/process/reconstruction/test/test_saaxis.py +21 -8
- tomwer/core/process/reconstruction/test/test_sadeltabeta.py +8 -5
- tomwer/core/process/script/python.py +7 -2
- tomwer/core/process/stitching/nabustitcher.py +10 -3
- tomwer/core/process/task.py +2 -9
- tomwer/core/process/test/test_axis.py +25 -15
- tomwer/core/process/test/test_conditions.py +6 -6
- tomwer/core/process/test/test_dark_and_flat.py +20 -15
- tomwer/core/process/test/test_data_transfer.py +8 -8
- tomwer/core/process/test/test_data_watcher.py +1 -1
- tomwer/core/process/test/test_lamino.py +6 -6
- tomwer/core/process/test/test_nabu.py +13 -8
- tomwer/core/process/test/test_normalization.py +1 -0
- tomwer/core/process/test/test_timer.py +6 -6
- tomwer/core/process/visualization/dataviewer.py +4 -0
- tomwer/core/process/visualization/diffviewer.py +4 -0
- tomwer/core/process/visualization/imagestackviewer.py +4 -0
- tomwer/core/process/visualization/radiostack.py +4 -0
- tomwer/core/process/visualization/samplemoved.py +4 -0
- tomwer/core/process/visualization/sinogramviewer.py +4 -0
- tomwer/core/process/visualization/slicestack.py +4 -0
- tomwer/core/process/visualization/volumeviewer.py +4 -0
- tomwer/core/scan/hdf5scan.py +4 -4
- tomwer/core/scan/scanbase.py +5 -1
- tomwer/core/scan/test/test_process_registration.py +9 -9
- tomwer/core/settings.py +59 -1
- tomwer/core/test/test_lamino.py +2 -1
- tomwer/core/utils/__init__.py +16 -0
- tomwer/core/utils/locker.py +0 -1
- tomwer/core/utils/resource.py +6 -11
- tomwer/core/utils/scanutils.py +2 -0
- tomwer/gui/cluster/slurm.py +91 -7
- tomwer/gui/cluster/supervisor.py +16 -11
- tomwer/gui/cluster/test/test_cluster.py +16 -1
- tomwer/gui/conditions/filter.py +3 -3
- tomwer/gui/control/datalist.py +24 -11
- tomwer/gui/control/email.py +183 -0
- tomwer/gui/control/reducedarkflatselector.py +545 -0
- tomwer/gui/control/singletomoobj.py +23 -1
- tomwer/gui/control/test/test_email.py +35 -0
- tomwer/gui/control/test/test_reducedarkflat_selector.py +280 -0
- tomwer/gui/reconstruction/axis/CompareImages.py +1 -1
- tomwer/gui/reconstruction/axis/axis.py +10 -6
- tomwer/gui/reconstruction/axis/radioaxis.py +14 -6
- tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +2 -0
- tomwer/gui/reconstruction/darkref/darkrefwidget.py +4 -4
- tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +3 -1
- tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +34 -33
- tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +1 -1
- tomwer/gui/reconstruction/normalization/intensity.py +5 -5
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +1 -0
- tomwer/gui/reconstruction/saaxis/saaxis.py +6 -6
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +6 -6
- tomwer/gui/reconstruction/scores/scoreplot.py +6 -4
- tomwer/gui/samplemoved/__init__.py +2 -2
- tomwer/gui/stackplot.py +18 -7
- tomwer/gui/stacks.py +2 -2
- tomwer/gui/stitching/stitchandbackground.py +2 -2
- tomwer/gui/stitching/stitching.py +1 -1
- tomwer/gui/stitching/stitching_raw.py +1 -1
- tomwer/gui/utils/__init__.py +1 -85
- tomwer/gui/utils/illustrations.py +1 -1
- tomwer/gui/utils/inputwidget.py +41 -36
- tomwer/gui/utils/slider.py +2 -2
- tomwer/gui/utils/utils.py +93 -0
- tomwer/gui/visualization/dataviewer.py +8 -5
- tomwer/gui/visualization/diffviewer/diffviewer.py +4 -4
- tomwer/gui/visualization/reconstructionparameters.py +26 -6
- tomwer/gui/visualization/sinogramviewer.py +7 -1
- tomwer/gui/visualization/test/test_reconstruction_parameters.py +2 -4
- tomwer/gui/visualization/volumeviewer.py +2 -0
- tomwer/resources/__init__.py +55 -43
- tomwer/resources/gui/icons/compose.png +0 -0
- tomwer/resources/gui/icons/compose.svg +75 -0
- tomwer/synctools/datatransfert.py +3 -1
- tomwer/synctools/stacks/edit/darkflatpatch.py +39 -34
- tomwer/synctools/stacks/edit/imagekeyeditor.py +8 -27
- tomwer/synctools/stacks/processingstack.py +45 -9
- tomwer/synctools/stacks/reconstruction/axis.py +6 -5
- tomwer/synctools/stacks/reconstruction/dkrefcopy.py +1 -0
- tomwer/synctools/stacks/reconstruction/lamino.py +3 -3
- tomwer/synctools/stacks/reconstruction/nabu.py +49 -140
- tomwer/synctools/stacks/reconstruction/normalization.py +1 -0
- tomwer/synctools/stacks/reconstruction/saaxis.py +19 -33
- tomwer/synctools/stacks/reconstruction/sadeltabeta.py +16 -32
- tomwer/synctools/test/test_darkRefs.py +19 -10
- tomwer/synctools/test/test_foldertransfer.py +7 -7
- tomwer/third_party/nabu/preproc/phase.py +6 -8
- tomwer/third_party/nabu/utils.py +2 -3
- tomwer/version.py +1 -1
- {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/METADATA +15 -54
- {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/RECORD +219 -192
- {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/WHEEL +1 -1
- {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/entry_points.txt +3 -3
- /tomwer-1.2.0a1-py3.9-nspkg.pth → /tomwer-1.2.0a3-py3.11-nspkg.pth +0 -0
- {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/LICENSE +0 -0
- {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.2.0a1.dist-info → tomwer-1.2.0a3.dist-info}/top_level.txt +0 -0
tomwer/app/darkref.py
CHANGED
@@ -1,181 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
from tomwer.
|
11
|
-
from tomwer.core.scan.scanfactory import ScanFactory
|
12
|
-
from tomwer.core.utils.resource import increase_max_number_file
|
13
|
-
|
14
|
-
logging.basicConfig(level=logging.WARNING)
|
15
|
-
_logger = logging.getLogger(__name__)
|
16
|
-
|
17
|
-
|
18
|
-
def getinputinfo():
|
19
|
-
return "tomwer darkref [scanDir]"
|
20
|
-
|
21
|
-
|
22
|
-
def _exec_without_interaction(scan, dark_method, flat_method, overwrite):
|
23
|
-
recons_params = DKRFRP()
|
24
|
-
recons_params.overwrite_dark = overwrite
|
25
|
-
recons_params.overwrite_ref = overwrite
|
26
|
-
recons_params.dark_calc_method = dark_method
|
27
|
-
recons_params.flat_calc_method = flat_method
|
28
|
-
dark_ref = DarkRefs(
|
29
|
-
inputs={
|
30
|
-
"data": scan,
|
31
|
-
"dark_ref_params": recons_params,
|
32
|
-
}
|
33
|
-
)
|
34
|
-
_logger.info(f"Start processing of {scan}")
|
35
|
-
dark_ref.run()
|
36
|
-
_logger.info(f"End processing of {scan}")
|
37
|
-
return 0
|
38
|
-
|
39
|
-
|
40
|
-
def _exec_with_interaction(scan, dark_method, flat_method, overwrite):
|
41
|
-
from silx.gui import qt
|
42
|
-
|
43
|
-
from tomwer.gui import icons
|
44
|
-
from tomwer.gui.reconstruction.darkref.darkrefwidget import DarkRefWidget
|
45
|
-
from tomwer.gui.utils.splashscreen import getMainSplashScreen
|
46
|
-
from tomwer.synctools.darkref import QDKRFRP
|
47
|
-
|
48
|
-
class _DarkRefWidgetRunnable(DarkRefWidget):
|
49
|
-
sigScanReady = qt.Signal(str)
|
50
|
-
|
51
|
-
def __init__(self, scan, parent=None):
|
52
|
-
self.__scan = scan
|
53
|
-
self.__darkref_rp = QDKRFRP()
|
54
|
-
DarkRefWidget.__init__(self, parent=parent, reconsparams=self.__darkref_rp)
|
55
|
-
buttonExec = qt.QPushButton("execute", parent=self)
|
56
|
-
buttonExec.setAutoDefault(True)
|
57
|
-
# needed to be used as an application to return end only when the
|
58
|
-
# processing thread is needed
|
59
|
-
self._forceSync = True
|
60
|
-
self.layout().addWidget(buttonExec)
|
61
|
-
buttonExec.pressed.connect(self._process)
|
62
|
-
self.setWindowIcon(icons.getQIcon("tomwer"))
|
63
|
-
|
64
|
-
def _process(self):
|
65
|
-
process = DarkRefs(
|
66
|
-
inputs={
|
67
|
-
"data": self.__scan,
|
68
|
-
"dark_ref_params": self.__darkref_rp,
|
69
|
-
"force_sync": self._forceSync,
|
70
|
-
}
|
71
|
-
)
|
72
|
-
process.run()
|
73
|
-
|
74
|
-
def sigintHandler(*args):
|
75
|
-
"""Handler for the SIGINT signal."""
|
76
|
-
qt.QApplication.quit()
|
77
|
-
|
78
|
-
global app # QApplication must be global to avoid seg fault on quit
|
79
|
-
app = qt.QApplication.instance() or qt.QApplication(["tomwer"])
|
80
|
-
|
81
|
-
qt.QLocale.setDefault(qt.QLocale(qt.QLocale.English))
|
82
|
-
qt.QLocale.setDefault(qt.QLocale.c())
|
83
|
-
signal.signal(signal.SIGINT, sigintHandler)
|
84
|
-
sys.excepthook = qt.exceptionHandler
|
85
|
-
|
86
|
-
timer = qt.QTimer()
|
87
|
-
timer.start(500)
|
88
|
-
# Application have to wake up Python interpreter, else SIGINT is not
|
89
|
-
# catched
|
90
|
-
timer.timeout.connect(lambda: None)
|
91
|
-
|
92
|
-
splash = getMainSplashScreen()
|
93
|
-
|
94
|
-
widget = _DarkRefWidgetRunnable(scan)
|
95
|
-
# set up
|
96
|
-
widget.recons_params.overwrite_dark = overwrite
|
97
|
-
widget.recons_params.overwrite_flat = overwrite
|
98
|
-
widget.recons_params.dark_calc_method = dark_method
|
99
|
-
widget.recons_params.flat_calc_method = flat_method
|
100
|
-
splash.finish(widget)
|
101
|
-
widget.show()
|
102
|
-
return app.exec_()
|
103
|
-
|
104
|
-
|
105
|
-
def main(argv):
|
106
|
-
parser = argparse.ArgumentParser(description=__doc__)
|
107
|
-
parser.add_argument(
|
108
|
-
"scan_path", help="Data file to show (h5 file, edf files, spec files)"
|
109
|
-
)
|
110
|
-
parser.add_argument(
|
111
|
-
"--entry",
|
112
|
-
help="an entry can be specify in case of hdf5 the master file",
|
113
|
-
default=None,
|
114
|
-
)
|
115
|
-
parser.add_argument(
|
116
|
-
"--dark-method",
|
117
|
-
help="Define the method to be used for computing dark",
|
118
|
-
default=ReduceMethod.MEAN,
|
119
|
-
)
|
120
|
-
parser.add_argument(
|
121
|
-
"--flat-method",
|
122
|
-
help="Define the method to be used for computing flat",
|
123
|
-
default=ReduceMethod.MEDIAN,
|
124
|
-
)
|
125
|
-
parser.add_argument(
|
126
|
-
"--no-gui",
|
127
|
-
help="Will run directly the dark and ref without any interaction",
|
128
|
-
dest="run",
|
129
|
-
action="store_true",
|
130
|
-
default=False,
|
131
|
-
)
|
132
|
-
parser.add_argument(
|
133
|
-
"--overwrite",
|
134
|
-
dest="overwrite",
|
135
|
-
action="store_true",
|
136
|
-
default=False,
|
137
|
-
help="Overwrite dark/flats if exists",
|
138
|
-
)
|
139
|
-
parser.add_argument(
|
140
|
-
"--debug",
|
141
|
-
dest="debug",
|
142
|
-
action="store_true",
|
143
|
-
default=False,
|
144
|
-
help="Set logging system in debug mode",
|
145
|
-
)
|
146
|
-
|
147
|
-
options = parser.parse_args(argv[1:])
|
148
|
-
|
149
|
-
if options.debug:
|
150
|
-
logging.root.setLevel(logging.DEBUG)
|
151
|
-
|
152
|
-
increase_max_number_file()
|
153
|
-
|
154
|
-
scan = ScanFactory.create_scan_object(options.scan_path, entry=options.entry)
|
155
|
-
scan.set_process_index_frm_tomwer_process_file()
|
156
|
-
|
157
|
-
dark_method = ReduceMethod.from_value(options.dark_method)
|
158
|
-
flat_method = ReduceMethod.from_value(options.flat_method)
|
159
|
-
|
160
|
-
if options.run:
|
161
|
-
exit(
|
162
|
-
_exec_without_interaction(
|
163
|
-
scan=scan,
|
164
|
-
dark_method=dark_method,
|
165
|
-
flat_method=flat_method,
|
166
|
-
overwrite=options.overwrite,
|
167
|
-
)
|
168
|
-
)
|
169
|
-
else:
|
170
|
-
exit(
|
171
|
-
_exec_with_interaction(
|
172
|
-
scan=scan,
|
173
|
-
dark_method=dark_method,
|
174
|
-
flat_method=flat_method,
|
175
|
-
overwrite=options.overwrite,
|
176
|
-
)
|
177
|
-
)
|
178
|
-
|
179
|
-
|
180
|
-
if __name__ == "__main__":
|
181
|
-
main(sys.argv)
|
1
|
+
from silx.utils.deprecation import deprecated_warning
|
2
|
+
|
3
|
+
deprecated_warning(
|
4
|
+
"module",
|
5
|
+
name="tomwer.app.darkref",
|
6
|
+
reason="Has been moved",
|
7
|
+
replacement="tomwer.app.reducedarkflat",
|
8
|
+
only_once=True,
|
9
|
+
)
|
10
|
+
from tomwer.app.reducedarkflat import * # noqa F401
|
tomwer/app/darkrefpatch.py
CHANGED
@@ -1,131 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
from
|
11
|
-
|
12
|
-
from tomwer.core.scan.scanfactory import ScanFactory
|
13
|
-
from tomwer.core.utils.resource import increase_max_number_file
|
14
|
-
from tomwer.gui import icons
|
15
|
-
from tomwer.gui.edit.dkrfpatch import DarkRefPatchWidget
|
16
|
-
from tomwer.gui.utils.splashscreen import getMainSplashScreen
|
17
|
-
|
18
|
-
logging.basicConfig(level=logging.WARNING)
|
19
|
-
_logger = logging.getLogger(__name__)
|
20
|
-
|
21
|
-
|
22
|
-
class _DarkRefPatchDialog(qt.QDialog):
|
23
|
-
def __init__(self, parent):
|
24
|
-
qt.QDialog.__init__(self, parent)
|
25
|
-
self._scan = None
|
26
|
-
self.setLayout(qt.QVBoxLayout())
|
27
|
-
self._mainWidget = DarkRefPatchWidget(self)
|
28
|
-
self.layout().addWidget(self._mainWidget)
|
29
|
-
|
30
|
-
# buttons
|
31
|
-
types = qt.QDialogButtonBox.Ok
|
32
|
-
self._buttons = qt.QDialogButtonBox(parent=self)
|
33
|
-
self._buttons.setStandardButtons(types)
|
34
|
-
self._buttons.button(qt.QDialogButtonBox.Ok).setText("Apply")
|
35
|
-
self.layout().addWidget(self._buttons)
|
36
|
-
|
37
|
-
# connect signal slot
|
38
|
-
self._buttons.button(qt.QDialogButtonBox.Ok).clicked.connect(self._apply)
|
39
|
-
|
40
|
-
def _apply(self):
|
41
|
-
if self._scan is None:
|
42
|
-
raise ValueError("Scan should be set before applying patch")
|
43
|
-
url_sd = self._mainWidget.getStartDarkUrl()
|
44
|
-
url_sf = self._mainWidget.getStartFlatUrl()
|
45
|
-
url_ed = self._mainWidget.getEndDarkUrl()
|
46
|
-
url_ef = self._mainWidget.getEndFlatUrl()
|
47
|
-
add_dark_flat_nx_file(
|
48
|
-
file_path=self._scan.master_file,
|
49
|
-
entry=self._scan.entry,
|
50
|
-
darks_start=url_sd,
|
51
|
-
flats_start=url_sf,
|
52
|
-
darks_end=url_ed,
|
53
|
-
flats_end=url_ef,
|
54
|
-
)
|
55
|
-
|
56
|
-
def setScan(self, scan):
|
57
|
-
self._scan = scan
|
58
|
-
|
59
|
-
|
60
|
-
def main(argv):
|
61
|
-
parser = argparse.ArgumentParser(description=__doc__)
|
62
|
-
parser.add_argument(
|
63
|
-
"scan_path",
|
64
|
-
help="HDF5 - Nexus file path",
|
65
|
-
default=None,
|
66
|
-
)
|
67
|
-
parser.add_argument("entry", help="NXTomo entry to load", default=None)
|
68
|
-
parser.add_argument(
|
69
|
-
"--debug",
|
70
|
-
dest="debug",
|
71
|
-
action="store_true",
|
72
|
-
default=False,
|
73
|
-
help="Set logging system in debug mode",
|
74
|
-
)
|
75
|
-
|
76
|
-
options = parser.parse_args(argv[1:])
|
77
|
-
|
78
|
-
if options.debug:
|
79
|
-
logging.root.setLevel(logging.DEBUG)
|
80
|
-
|
81
|
-
increase_max_number_file()
|
82
|
-
|
83
|
-
global app # QApplication must be global to avoid seg fault on quit
|
84
|
-
app = qt.QApplication.instance() or qt.QApplication(["tomwer"])
|
85
|
-
splash = getMainSplashScreen()
|
86
|
-
qt.QApplication.setOverrideCursor(qt.Qt.WaitCursor)
|
87
|
-
qt.QApplication.processEvents()
|
88
|
-
|
89
|
-
qt.QLocale.setDefault(qt.QLocale(qt.QLocale.English))
|
90
|
-
qt.QLocale.setDefault(qt.QLocale.c())
|
91
|
-
signal.signal(signal.SIGINT, sigintHandler)
|
92
|
-
sys.excepthook = qt.exceptionHandler
|
93
|
-
|
94
|
-
timer = qt.QTimer()
|
95
|
-
timer.start(500)
|
96
|
-
# Application have to wake up Python interpreter, else SIGINT is not
|
97
|
-
# catch
|
98
|
-
timer.timeout.connect(lambda: None)
|
99
|
-
|
100
|
-
scan = ScanFactory.create_scan_object(
|
101
|
-
scan_path=options.scan_path, entry=options.entry
|
102
|
-
)
|
103
|
-
|
104
|
-
# define the process_index is any tomwer_processes_existing
|
105
|
-
scan.set_process_index_frm_tomwer_process_file()
|
106
|
-
|
107
|
-
if options.debug:
|
108
|
-
_logger.setLevel(logging.DEBUG)
|
109
|
-
|
110
|
-
window = _DarkRefPatchDialog(parent=None)
|
111
|
-
window.setScan(scan=scan)
|
112
|
-
window.setWindowTitle("patch dark & flat")
|
113
|
-
window.setWindowIcon(icons.getQIcon("tomwer"))
|
114
|
-
|
115
|
-
splash.finish(window)
|
116
|
-
window.show()
|
117
|
-
qt.QApplication.restoreOverrideCursor()
|
118
|
-
app.exec_()
|
119
|
-
|
120
|
-
|
121
|
-
def getinputinfo():
|
122
|
-
return "tomwer darkref-patch [scanDir]"
|
123
|
-
|
124
|
-
|
125
|
-
def sigintHandler(*args):
|
126
|
-
"""Handler for the SIGINT signal."""
|
127
|
-
qt.QApplication.quit()
|
128
|
-
|
129
|
-
|
130
|
-
if __name__ == "__main__":
|
131
|
-
main(sys.argv)
|
1
|
+
from silx.utils.deprecation import deprecated_warning
|
2
|
+
|
3
|
+
deprecated_warning(
|
4
|
+
"module",
|
5
|
+
name="tomwer.app.darkrefpatch",
|
6
|
+
reason="Has been moved",
|
7
|
+
replacement="tomwer.app.patchrawdarkflat",
|
8
|
+
only_once=True,
|
9
|
+
)
|
10
|
+
from tomwer.app.patchrawdarkflat import * # noqa F401
|
tomwer/app/diffframe.py
CHANGED
@@ -40,6 +40,12 @@ def main(argv):
|
|
40
40
|
)
|
41
41
|
parser.add_argument("--second-scan", default=None, help="Second data files")
|
42
42
|
parser.add_argument("--second-entry", default=None, help="Second entry")
|
43
|
+
parser.add_argument(
|
44
|
+
"--use-opengl-plot",
|
45
|
+
help="Use OpenGL for plots (instead of matplotlib)",
|
46
|
+
action="store_true",
|
47
|
+
default=False,
|
48
|
+
)
|
43
49
|
options = parser.parse_args(argv[1:])
|
44
50
|
options.scan_path = options.scan_path.rstrip(os.path.sep)
|
45
51
|
|
@@ -75,6 +81,11 @@ def main(argv):
|
|
75
81
|
else:
|
76
82
|
scan_2 = None
|
77
83
|
|
84
|
+
if options.use_opengl_plot:
|
85
|
+
import silx
|
86
|
+
|
87
|
+
silx.config.DEFAULT_PLOT_BACKEND = "gl"
|
88
|
+
|
78
89
|
# handle gui
|
79
90
|
widget = DiffFrameViewer(parent=None)
|
80
91
|
widget.addScan(scan_1)
|
tomwer/app/imagekeyeditor.py
CHANGED
@@ -6,12 +6,11 @@ import logging
|
|
6
6
|
import signal
|
7
7
|
import sys
|
8
8
|
|
9
|
-
from nxtomomill.utils import change_image_key_control
|
10
9
|
from silx.gui import qt
|
11
|
-
from tomoscan.esrf.scan.hdf5scan import ImageKey
|
12
10
|
|
13
11
|
from tomwer.core.scan.hdf5scan import HDF5TomoScan
|
14
12
|
from tomwer.core.utils.resource import increase_max_number_file
|
13
|
+
from tomwer.core.process.edit.imagekeyeditor import ImageKeyEditorTask
|
15
14
|
from tomwer.gui import icons
|
16
15
|
from tomwer.gui.edit.imagekeyeditor import ImageKeyDialog as _ImageKeyDialog
|
17
16
|
from tomwer.gui.utils.splashscreen import getMainSplashScreen
|
@@ -35,24 +34,18 @@ class ImageKeyDialog(_ImageKeyDialog):
|
|
35
34
|
if not self._scan:
|
36
35
|
raise ValueError("Scan should be set first")
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
task = ImageKeyEditorTask(
|
38
|
+
inputs={
|
39
|
+
"data": self._scan,
|
40
|
+
"configuration": {"modifications": self.getModifications()},
|
41
|
+
}
|
42
42
|
)
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
)
|
47
|
-
|
48
|
-
|
49
|
-
change_image_key_control(
|
50
|
-
file_path=self._scan.master_file,
|
51
|
-
entry=self._scan.entry,
|
52
|
-
frames_indexes=frame_indexes,
|
53
|
-
image_key_control_value=image_key_type.value,
|
54
|
-
logger=_logger,
|
55
|
-
)
|
43
|
+
try:
|
44
|
+
task.run()
|
45
|
+
except Exception as e:
|
46
|
+
_logger.error(e)
|
47
|
+
else:
|
48
|
+
print("edition succeed")
|
56
49
|
|
57
50
|
|
58
51
|
def getinputinfo():
|
tomwer/app/lamino.py
CHANGED
@@ -9,7 +9,7 @@ import sys
|
|
9
9
|
|
10
10
|
from silx.gui import qt
|
11
11
|
|
12
|
-
from tomwer.core.process.reconstruction.lamino.tofu import
|
12
|
+
from tomwer.core.process.reconstruction.lamino.tofu import LaminoReconstructionTask
|
13
13
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
14
14
|
from tomwer.core.scan.scanfactory import ScanFactory
|
15
15
|
from tomwer.core.utils.resource import increase_max_number_file
|
@@ -115,7 +115,12 @@ class ToFuDialog(qt.QDialog):
|
|
115
115
|
self.tofuWidget.setEnabled(False)
|
116
116
|
qt.QApplication.processEvents()
|
117
117
|
qt.QApplication.setOverrideCursor(qt.Qt.WaitCursor)
|
118
|
-
self._reconsProcess =
|
118
|
+
self._reconsProcess = LaminoReconstructionTask(
|
119
|
+
inputs={
|
120
|
+
"scan": self._scan,
|
121
|
+
"serialize_output_data": False,
|
122
|
+
}
|
123
|
+
)
|
119
124
|
self._reconsProcess.set_configuration(
|
120
125
|
(preprocess_add_options, reco_add_options)
|
121
126
|
)
|
@@ -0,0 +1,131 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
import argparse
|
5
|
+
import logging
|
6
|
+
import signal
|
7
|
+
import sys
|
8
|
+
|
9
|
+
from nxtomomill.utils import add_dark_flat_nx_file
|
10
|
+
from silx.gui import qt
|
11
|
+
|
12
|
+
from tomwer.core.scan.scanfactory import ScanFactory
|
13
|
+
from tomwer.core.utils.resource import increase_max_number_file
|
14
|
+
from tomwer.gui import icons
|
15
|
+
from tomwer.gui.edit.dkrfpatch import DarkRefPatchWidget
|
16
|
+
from tomwer.gui.utils.splashscreen import getMainSplashScreen
|
17
|
+
|
18
|
+
logging.basicConfig(level=logging.WARNING)
|
19
|
+
_logger = logging.getLogger(__name__)
|
20
|
+
|
21
|
+
|
22
|
+
class _DarkRefPatchDialog(qt.QDialog):
|
23
|
+
def __init__(self, parent):
|
24
|
+
qt.QDialog.__init__(self, parent)
|
25
|
+
self._scan = None
|
26
|
+
self.setLayout(qt.QVBoxLayout())
|
27
|
+
self._mainWidget = DarkRefPatchWidget(self)
|
28
|
+
self.layout().addWidget(self._mainWidget)
|
29
|
+
|
30
|
+
# buttons
|
31
|
+
types = qt.QDialogButtonBox.Ok
|
32
|
+
self._buttons = qt.QDialogButtonBox(parent=self)
|
33
|
+
self._buttons.setStandardButtons(types)
|
34
|
+
self._buttons.button(qt.QDialogButtonBox.Ok).setText("Apply")
|
35
|
+
self.layout().addWidget(self._buttons)
|
36
|
+
|
37
|
+
# connect signal slot
|
38
|
+
self._buttons.button(qt.QDialogButtonBox.Ok).clicked.connect(self._apply)
|
39
|
+
|
40
|
+
def _apply(self):
|
41
|
+
if self._scan is None:
|
42
|
+
raise ValueError("Scan should be set before applying patch")
|
43
|
+
url_sd = self._mainWidget.getStartDarkUrl()
|
44
|
+
url_sf = self._mainWidget.getStartFlatUrl()
|
45
|
+
url_ed = self._mainWidget.getEndDarkUrl()
|
46
|
+
url_ef = self._mainWidget.getEndFlatUrl()
|
47
|
+
add_dark_flat_nx_file(
|
48
|
+
file_path=self._scan.master_file,
|
49
|
+
entry=self._scan.entry,
|
50
|
+
darks_start=url_sd,
|
51
|
+
flats_start=url_sf,
|
52
|
+
darks_end=url_ed,
|
53
|
+
flats_end=url_ef,
|
54
|
+
)
|
55
|
+
|
56
|
+
def setScan(self, scan):
|
57
|
+
self._scan = scan
|
58
|
+
|
59
|
+
|
60
|
+
def main(argv):
|
61
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
62
|
+
parser.add_argument(
|
63
|
+
"scan_path",
|
64
|
+
help="HDF5 - Nexus file path",
|
65
|
+
default=None,
|
66
|
+
)
|
67
|
+
parser.add_argument("entry", help="NXTomo entry to load", default=None)
|
68
|
+
parser.add_argument(
|
69
|
+
"--debug",
|
70
|
+
dest="debug",
|
71
|
+
action="store_true",
|
72
|
+
default=False,
|
73
|
+
help="Set logging system in debug mode",
|
74
|
+
)
|
75
|
+
|
76
|
+
options = parser.parse_args(argv[1:])
|
77
|
+
|
78
|
+
if options.debug:
|
79
|
+
logging.root.setLevel(logging.DEBUG)
|
80
|
+
|
81
|
+
increase_max_number_file()
|
82
|
+
|
83
|
+
global app # QApplication must be global to avoid seg fault on quit
|
84
|
+
app = qt.QApplication.instance() or qt.QApplication(["tomwer"])
|
85
|
+
splash = getMainSplashScreen()
|
86
|
+
qt.QApplication.setOverrideCursor(qt.Qt.WaitCursor)
|
87
|
+
qt.QApplication.processEvents()
|
88
|
+
|
89
|
+
qt.QLocale.setDefault(qt.QLocale(qt.QLocale.English))
|
90
|
+
qt.QLocale.setDefault(qt.QLocale.c())
|
91
|
+
signal.signal(signal.SIGINT, sigintHandler)
|
92
|
+
sys.excepthook = qt.exceptionHandler
|
93
|
+
|
94
|
+
timer = qt.QTimer()
|
95
|
+
timer.start(500)
|
96
|
+
# Application have to wake up Python interpreter, else SIGINT is not
|
97
|
+
# catch
|
98
|
+
timer.timeout.connect(lambda: None)
|
99
|
+
|
100
|
+
scan = ScanFactory.create_scan_object(
|
101
|
+
scan_path=options.scan_path, entry=options.entry
|
102
|
+
)
|
103
|
+
|
104
|
+
# define the process_index is any tomwer_processes_existing
|
105
|
+
scan.set_process_index_frm_tomwer_process_file()
|
106
|
+
|
107
|
+
if options.debug:
|
108
|
+
_logger.setLevel(logging.DEBUG)
|
109
|
+
|
110
|
+
window = _DarkRefPatchDialog(parent=None)
|
111
|
+
window.setScan(scan=scan)
|
112
|
+
window.setWindowTitle("patch dark & flat")
|
113
|
+
window.setWindowIcon(icons.getQIcon("tomwer"))
|
114
|
+
|
115
|
+
splash.finish(window)
|
116
|
+
window.show()
|
117
|
+
qt.QApplication.restoreOverrideCursor()
|
118
|
+
app.exec_()
|
119
|
+
|
120
|
+
|
121
|
+
def getinputinfo():
|
122
|
+
return "tomwer darkref-patch [scanDir]"
|
123
|
+
|
124
|
+
|
125
|
+
def sigintHandler(*args):
|
126
|
+
"""Handler for the SIGINT signal."""
|
127
|
+
qt.QApplication.quit()
|
128
|
+
|
129
|
+
|
130
|
+
if __name__ == "__main__":
|
131
|
+
main(sys.argv)
|
tomwer/app/radiostack.py
CHANGED
@@ -43,6 +43,12 @@ def main(argv):
|
|
43
43
|
parser.add_argument(
|
44
44
|
"root_dir", help="Root dir to browse and to extract all radio under it."
|
45
45
|
)
|
46
|
+
parser.add_argument(
|
47
|
+
"--use-opengl-plot",
|
48
|
+
help="Use OpenGL for plots (instead of matplotlib)",
|
49
|
+
action="store_true",
|
50
|
+
default=False,
|
51
|
+
)
|
46
52
|
parser.add_argument(
|
47
53
|
"--debug",
|
48
54
|
dest="debug",
|
@@ -54,6 +60,10 @@ def main(argv):
|
|
54
60
|
increase_max_number_file()
|
55
61
|
|
56
62
|
options = parser.parse_args(argv[1:])
|
63
|
+
if options.use_opengl_plot:
|
64
|
+
import silx
|
65
|
+
|
66
|
+
silx.config.DEFAULT_PLOT_BACKEND = "gl"
|
57
67
|
|
58
68
|
global app # QApplication must be global to avoid seg fault on quit
|
59
69
|
app = qt.QApplication.instance() or qt.QApplication(["tomwer"])
|