tomwer 1.2.8__py3-none-any.whl → 1.3.0a0__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/icat_publication.ows +58 -0
- orangecontrib/tomwer/widgets/__init__.py +1 -0
- orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +2 -2
- orangecontrib/tomwer/widgets/control/DataListOW.py +9 -7
- orangecontrib/tomwer/widgets/control/DataSelectorOW.py +21 -10
- orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +11 -5
- orangecontrib/tomwer/widgets/control/EmailOW.py +4 -4
- orangecontrib/tomwer/widgets/control/NXTomomillOW.py +31 -18
- orangecontrib/tomwer/widgets/control/NXtomoConcatenate.py +14 -7
- orangecontrib/tomwer/widgets/control/NotifierOW.py +1 -0
- orangecontrib/tomwer/widgets/control/VolumeSelector.py +7 -4
- orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +182 -182
- orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +4 -4
- orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +4 -4
- orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +3 -3
- orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +2 -0
- orangecontrib/tomwer/widgets/edit/NXtomoEditorOW.py +3 -3
- orangecontrib/tomwer/widgets/edit/test/test_nxtomo_editor.py +3 -3
- orangecontrib/tomwer/widgets/icat/PublishProcessedDataOW.py +115 -0
- orangecontrib/tomwer/widgets/icat/RawDataScreenshotCreatorOW.py +98 -0
- orangecontrib/tomwer/widgets/icat/SaveToGalleryAndPublishOW.py +129 -0
- orangecontrib/tomwer/widgets/icat/__init__.py +13 -0
- orangecontrib/tomwer/widgets/icat/icons/add_gallery.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/add_gallery.svg +82 -0
- orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/publish_processed_data.svg +95 -0
- orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.png +0 -0
- orangecontrib/tomwer/widgets/icat/icons/raw_screenshots.svg +143 -0
- orangecontrib/tomwer/widgets/icons/tomwer_data_portal.png +0 -0
- orangecontrib/tomwer/widgets/icons/tomwer_data_portal.svg +76 -0
- orangecontrib/tomwer/widgets/reconstruction/AxisOW.py +9 -8
- orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +3 -3
- orangecontrib/tomwer/widgets/reconstruction/NabuHelicalPrepareWeightsDoubleOW.py +179 -169
- orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +23 -0
- orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +39 -5
- orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +7 -13
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +7 -17
- orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +3 -4
- orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +3 -3
- orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +3 -29
- tomwer/__main__.py +11 -58
- tomwer/app/canvas.py +8 -0
- tomwer/app/canvas_launcher/config.py +13 -11
- tomwer/app/darkref.py +1 -1
- tomwer/app/darkrefpatch.py +1 -1
- tomwer/app/imagekeyeditor.py +5 -5
- tomwer/app/imagekeyupgrader.py +5 -5
- tomwer/app/intensitynormalization.py +2 -2
- tomwer/app/radiostack.py +2 -2
- tomwer/app/zstitching.py +74 -3
- tomwer/core/cluster/cluster.py +26 -0
- tomwer/core/log/logger.py +7 -5
- tomwer/core/process/conditions/filters.py +1 -1
- tomwer/core/process/control/datalistener/datalistener.py +3 -3
- tomwer/core/process/control/nxtomoconcatenate.py +13 -13
- tomwer/core/process/control/nxtomomill.py +83 -25
- tomwer/core/process/control/scantransfer.py +11 -10
- tomwer/core/process/control/scanvalidator.py +3 -2
- tomwer/core/process/control/test/test_concatenate_nxtomos.py +9 -9
- tomwer/core/process/control/test/test_email.py +4 -4
- tomwer/core/process/control/test/test_h52nx_process.py +59 -7
- tomwer/core/process/control/test/test_volume_link.py +64 -64
- tomwer/core/process/control/timer.py +1 -1
- tomwer/core/process/control/volumesymlink.py +200 -200
- tomwer/core/process/edit/darkflatpatch.py +6 -6
- tomwer/core/process/edit/imagekeyeditor.py +17 -18
- tomwer/core/process/icat/__init__.py +0 -0
- tomwer/core/process/icat/createscreenshots.py +100 -0
- tomwer/core/process/icat/gallery.py +377 -0
- tomwer/core/process/icat/icatbase.py +36 -0
- tomwer/core/process/icat/publish.py +228 -0
- tomwer/core/process/icat/screenshots.py +26 -0
- tomwer/core/process/output.py +52 -0
- tomwer/core/process/reconstruction/axis/axis.py +17 -10
- tomwer/core/process/reconstruction/axis/mode.py +4 -0
- tomwer/core/process/reconstruction/axis/params.py +9 -4
- tomwer/core/process/reconstruction/darkref/darkrefs.py +8 -6
- tomwer/core/process/reconstruction/darkref/darkrefscopy.py +1 -1
- tomwer/core/process/reconstruction/darkref/params.py +1 -1
- tomwer/core/process/reconstruction/lamino/tofu.py +4 -4
- tomwer/core/process/reconstruction/nabu/castvolume.py +1 -1
- tomwer/core/process/reconstruction/nabu/helical.py +9 -5
- tomwer/core/process/reconstruction/nabu/nabucommon.py +32 -62
- tomwer/core/process/reconstruction/nabu/nabuscores.py +387 -61
- tomwer/core/process/reconstruction/nabu/nabuslices.py +33 -21
- tomwer/core/process/reconstruction/nabu/nabuvolume.py +37 -14
- tomwer/core/process/reconstruction/nabu/settings.py +2 -2
- tomwer/core/process/reconstruction/nabu/utils.py +129 -24
- tomwer/core/process/reconstruction/output.py +108 -0
- tomwer/core/process/reconstruction/saaxis/saaxis.py +233 -263
- tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +140 -86
- tomwer/core/process/reconstruction/scores/params.py +4 -1
- tomwer/core/process/reconstruction/scores/scores.py +13 -0
- tomwer/core/process/reconstruction/test/test_axis_params.py +2 -2
- tomwer/core/process/reconstruction/test/test_darkref.py +3 -3
- tomwer/core/process/reconstruction/test/test_darkref_copy.py +3 -3
- tomwer/core/process/reconstruction/test/test_saaxis.py +3 -4
- tomwer/core/process/reconstruction/test/test_sadeltabeta.py +2 -2
- tomwer/core/process/stitching/nabustitcher.py +2 -2
- tomwer/core/process/test/test_axis.py +6 -6
- tomwer/core/process/test/test_dark_and_flat.py +10 -7
- tomwer/core/process/test/test_data_transfer.py +7 -6
- tomwer/core/process/test/test_nabu.py +4 -4
- tomwer/core/process/test/test_normalization.py +2 -2
- tomwer/core/scan/edfscan.py +4 -1
- tomwer/core/scan/hdf5scan.py +19 -500
- tomwer/core/scan/nxtomoscan.py +532 -0
- tomwer/core/scan/scanbase.py +42 -20
- tomwer/core/scan/scanfactory.py +13 -13
- tomwer/core/scan/test/test_future_scan.py +2 -2
- tomwer/core/scan/test/test_h5.py +12 -10
- tomwer/core/scan/test/test_process_registration.py +2 -2
- tomwer/core/scan/test/test_scan.py +4 -3
- tomwer/core/settings.py +20 -0
- tomwer/core/test/test_scanutils.py +8 -7
- tomwer/core/test/test_utils.py +33 -26
- tomwer/core/utils/__init__.py +0 -466
- tomwer/core/utils/deprecation.py +1 -1
- tomwer/core/utils/dictutils.py +14 -0
- tomwer/core/utils/lbsram.py +35 -0
- tomwer/core/utils/nxtomoutils.py +1 -1
- tomwer/core/utils/scanutils.py +6 -6
- tomwer/core/utils/spec.py +263 -0
- tomwer/core/volume/volumefactory.py +2 -2
- tomwer/gui/cluster/slurm.py +260 -60
- tomwer/gui/cluster/test/test_cluster.py +13 -0
- tomwer/gui/cluster/test/test_supervisor.py +2 -2
- tomwer/gui/configuration/__init__.py +0 -0
- tomwer/gui/{reconstruction/nabu → configuration}/action.py +1 -32
- tomwer/gui/configuration/level.py +22 -0
- tomwer/gui/control/actions.py +54 -0
- tomwer/gui/control/datalist.py +78 -16
- tomwer/gui/control/datalistener.py +4 -16
- tomwer/gui/control/{email.py → emailnotifier.py} +9 -18
- tomwer/gui/control/history.py +2 -2
- tomwer/gui/control/observations.py +2 -2
- tomwer/gui/control/reducedarkflatselector.py +1 -1
- tomwer/gui/control/selectorwidgetbase.py +36 -9
- tomwer/gui/control/serie/seriecreator.py +5 -22
- tomwer/gui/control/test/test_email.py +1 -1
- tomwer/gui/control/test/test_scanvalidator.py +6 -5
- tomwer/gui/control/test/test_single_tomo_obj.py +2 -2
- tomwer/gui/control/tomoobjdisplaymode.py +8 -0
- tomwer/gui/debugtools/datasetgenerator.py +3 -3
- tomwer/gui/edit/dkrfpatch.py +16 -22
- tomwer/gui/edit/imagekeyeditor.py +8 -11
- tomwer/gui/edit/nxtomoeditor.py +111 -44
- tomwer/gui/edit/nxtomowarmer.py +4 -4
- tomwer/gui/edit/test/test_dkrf_patch.py +7 -7
- tomwer/gui/edit/test/test_image_key_editor.py +3 -3
- tomwer/gui/edit/test/test_nx_editor.py +40 -16
- tomwer/gui/icat/__init__.py +0 -0
- tomwer/gui/icat/createscreenshots.py +80 -0
- tomwer/gui/icat/gallery.py +214 -0
- tomwer/gui/icat/publish.py +187 -0
- tomwer/gui/reconstruction/axis/axis.py +171 -57
- tomwer/gui/reconstruction/axis/radioaxis.py +80 -95
- tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +3 -2
- tomwer/gui/reconstruction/lamino/tofu/projections.py +1 -1
- tomwer/gui/reconstruction/lamino/tofu/tofuoutput.py +3 -6
- tomwer/gui/reconstruction/nabu/castvolume.py +1 -1
- tomwer/gui/reconstruction/nabu/check.py +9 -9
- tomwer/gui/reconstruction/nabu/helical.py +29 -12
- tomwer/gui/reconstruction/nabu/nabuconfig/base.py +2 -4
- tomwer/gui/reconstruction/nabu/nabuconfig/output.py +110 -33
- tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +9 -12
- tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +219 -29
- tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +3 -6
- tomwer/gui/reconstruction/nabu/nabuflow.py +12 -20
- tomwer/gui/reconstruction/nabu/slices.py +6 -7
- tomwer/gui/reconstruction/nabu/volume.py +22 -10
- tomwer/gui/reconstruction/normalization/intensity.py +15 -23
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +7 -23
- tomwer/gui/reconstruction/saaxis/dimensionwidget.py +1 -1
- tomwer/gui/reconstruction/saaxis/saaxis.py +7 -9
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +2 -1
- tomwer/gui/reconstruction/scores/control.py +2 -9
- tomwer/gui/reconstruction/scores/scoreplot.py +11 -5
- tomwer/gui/reconstruction/test/test_axis.py +23 -12
- tomwer/gui/reconstruction/test/test_lamino.py +8 -3
- tomwer/gui/reconstruction/test/test_nabu.py +28 -9
- tomwer/gui/reconstruction/test/test_saaxis.py +3 -3
- tomwer/gui/reconstruction/test/test_sadeltabeta.py +2 -2
- tomwer/gui/settings.py +5 -28
- tomwer/gui/stackplot.py +2 -5
- tomwer/gui/stitching/action.py +49 -0
- tomwer/gui/stitching/config/axisparams.py +7 -24
- tomwer/gui/stitching/config/output.py +10 -8
- tomwer/gui/stitching/config/positionoveraxis.py +22 -23
- tomwer/gui/stitching/normalization.py +117 -0
- tomwer/gui/stitching/stitchandbackground.py +4 -6
- tomwer/gui/stitching/stitching.py +265 -43
- tomwer/gui/stitching/stitching_preview.py +62 -5
- tomwer/gui/stitching/stitching_raw.py +2 -5
- tomwer/gui/stitching/z_stitching/fineestimation.py +0 -60
- tomwer/gui/utils/buttons.py +112 -29
- tomwer/gui/utils/inputwidget.py +33 -25
- tomwer/gui/utils/scandescription.py +4 -0
- tomwer/gui/utils/step.py +144 -0
- tomwer/gui/utils/unitsystem.py +2 -5
- tomwer/gui/utils/vignettes.py +176 -15
- tomwer/gui/visualization/dataviewer.py +1 -18
- tomwer/gui/visualization/diffviewer/diffviewer.py +7 -16
- tomwer/gui/visualization/diffviewer/shiftwidget.py +2 -5
- tomwer/gui/visualization/scanoverview.py +1 -1
- tomwer/gui/visualization/sinogramviewer.py +1 -10
- tomwer/gui/visualization/test/test_diffviewer.py +3 -3
- tomwer/gui/visualization/test/test_nx_tomo_metadata_viewer.py +4 -4
- tomwer/gui/visualization/test/test_sinogramviewer.py +2 -2
- tomwer/gui/visualization/test/test_stacks.py +3 -3
- tomwer/gui/visualization/test/test_volumeviewer.py +2 -2
- tomwer/io/utils/raw_and_processed_data.py +84 -0
- tomwer/io/utils/tomoobj.py +4 -6
- tomwer/resources/gui/icons/ruler.png +0 -0
- tomwer/resources/gui/icons/ruler.svg +273 -0
- tomwer/resources/gui/icons/short_description.png +0 -0
- tomwer/resources/gui/icons/short_description.svg +58 -0
- tomwer/resources/gui/icons/url.png +0 -0
- tomwer/resources/gui/icons/url.svg +58 -0
- tomwer/synctools/stacks/edit/darkflatpatch.py +2 -2
- tomwer/synctools/stacks/edit/imagekeyeditor.py +2 -2
- tomwer/synctools/stacks/reconstruction/axis.py +4 -4
- tomwer/synctools/stacks/reconstruction/castvolume.py +2 -2
- tomwer/synctools/stacks/reconstruction/dkrefcopy.py +4 -10
- tomwer/synctools/stacks/reconstruction/nabu.py +2 -2
- tomwer/synctools/stacks/reconstruction/normalization.py +2 -2
- tomwer/synctools/stacks/reconstruction/saaxis.py +2 -2
- tomwer/synctools/stacks/reconstruction/sadeltabeta.py +2 -2
- tomwer/synctools/test/test_darkRefs.py +7 -58
- tomwer/synctools/test/test_foldertransfer.py +6 -6
- tomwer/synctools/utils/scanstages.py +6 -6
- tomwer/tests/conftest.py +34 -0
- tomwer/tests/datasets.py +13 -0
- tomwer/tests/test_scripts.py +92 -39
- tomwer/tests/utils.py +5 -0
- tomwer/version.py +3 -3
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/METADATA +39 -44
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/RECORD +248 -209
- tomwer/resources/gui/icons/esrf_1.svg +0 -307
- tomwer/resources/gui/icons/triangle.svg +0 -80
- tomwer/synctools/test/test_scanstages.py +0 -162
- tomwer/tests/utils/__init__.py +0 -247
- tomwer/tests/utils/utilstest.py +0 -220
- /tomwer/app/{saaxis.py → multicor.py} +0 -0
- /tomwer/app/{sadeltabeta.py → multipag.py} +0 -0
- /tomwer/core/process/control/{email.py → emailnotifier.py} +0 -0
- /tomwer-1.2.8-py3.11-nspkg.pth → /tomwer-1.3.0a0-py3.11-nspkg.pth +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/LICENSE +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/WHEEL +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/entry_points.txt +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.2.8.dist-info → tomwer-1.3.0a0.dist-info}/top_level.txt +0 -0
@@ -34,8 +34,9 @@ import typing
|
|
34
34
|
|
35
35
|
from silx.gui import qt
|
36
36
|
|
37
|
-
from tomwer.core.process.reconstruction.
|
37
|
+
from tomwer.core.process.reconstruction.output import NabuOutputFileFormat
|
38
38
|
from tomwer.core.process.reconstruction.nabu.utils import _NabuStages
|
39
|
+
from tomwer.core.process.reconstruction.output import ProcessDataOutputDirMode
|
39
40
|
from tomwer.gui.qlefilesystem import QLFileSystem
|
40
41
|
from tomwer.gui.reconstruction.nabu.nabuconfig.base import _NabuStageConfigBase
|
41
42
|
from tomwer.io.utils import get_default_directory
|
@@ -79,51 +80,110 @@ class QNabuFileFormatComboBoxIgnoreWheel(QNabuFileFormatComboBox):
|
|
79
80
|
pass
|
80
81
|
|
81
82
|
|
82
|
-
class NabuOutputLocationWidget(qt.
|
83
|
+
class NabuOutputLocationWidget(qt.QGroupBox):
|
84
|
+
sigOutputChanged = qt.Signal()
|
85
|
+
"""Emit when location changed"""
|
86
|
+
|
83
87
|
def __init__(self, *args, **kwargs) -> None:
|
84
|
-
super().__init__(*args, **kwargs)
|
85
|
-
self.setLayout(qt.
|
88
|
+
super().__init__(title="output folder", *args, **kwargs)
|
89
|
+
self.setLayout(qt.QGridLayout())
|
86
90
|
|
87
|
-
self._outputLabel = qt.QLabel("output:", self)
|
88
91
|
self.layout().setContentsMargins(0, 0, 0, 0)
|
89
92
|
self.layout().setSpacing(0)
|
90
|
-
self.layout().addWidget(self._outputLabel)
|
91
93
|
|
92
|
-
|
93
|
-
self.
|
94
|
-
|
94
|
+
# in scan folder
|
95
|
+
self._inScanFolderRB = qt.QRadioButton(
|
96
|
+
ProcessDataOutputDirMode.IN_SCAN_FOLDER.value, self
|
97
|
+
)
|
98
|
+
self._inScanFolderRB.setToolTip(
|
99
|
+
"Reconstruction will be saved at the same level as the acquisition folder. (near the NXtomo file (.nx) or under the spec acquisition folder)"
|
100
|
+
)
|
101
|
+
self.layout().addWidget(self._inScanFolderRB, 1, 0, 1, 1)
|
102
|
+
# in processed data dir
|
103
|
+
self._processedDataDirRB = qt.QRadioButton(
|
104
|
+
ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER.value, self
|
105
|
+
)
|
106
|
+
self._inScanFolderRB.setToolTip(
|
107
|
+
"Reconstruction will be saved under the PROCESSED_DATA/dataset folder. if exists else under the scan folder."
|
95
108
|
)
|
96
|
-
self.layout().addWidget(self.
|
109
|
+
self.layout().addWidget(self._processedDataDirRB, 2, 0, 1, 1)
|
110
|
+
# raw data dir
|
111
|
+
self._rawDataDirRB = qt.QRadioButton(
|
112
|
+
ProcessDataOutputDirMode.RAW_DATA_FOLDER.value, self
|
113
|
+
)
|
114
|
+
self._rawDataDirRB.setToolTip(
|
115
|
+
"Reconstruction will be saved under the RAW_DATA/dataset folder. if exists else under the scan folder."
|
116
|
+
)
|
117
|
+
self.layout().addWidget(self._rawDataDirRB, 3, 0, 1, 1)
|
118
|
+
# other dir
|
119
|
+
self._otherDirRB = qt.QRadioButton(ProcessDataOutputDirMode.OTHER.value, self)
|
120
|
+
self._otherDirRB.setToolTip(
|
121
|
+
"Reconstruction will be saved under user provided folder."
|
122
|
+
)
|
123
|
+
self.layout().addWidget(self._otherDirRB, 4, 0, 1, 1)
|
97
124
|
self._outputDirQLE = QLFileSystem(
|
98
125
|
"", self, filters=qt.QDir.NoDotAndDotDot | qt.QDir.Dirs
|
99
126
|
)
|
100
|
-
self.layout().addWidget(self._outputDirQLE)
|
127
|
+
self.layout().addWidget(self._outputDirQLE, 4, 1, 1, 1)
|
101
128
|
style = qt.QApplication.style()
|
102
129
|
icon_opendir = style.standardIcon(qt.QStyle.SP_DirOpenIcon)
|
103
130
|
self._selectOutputPB = qt.QPushButton(icon_opendir, "", self)
|
104
131
|
self._selectOutputPB.setIcon(icon_opendir)
|
105
|
-
general_tooltip =
|
106
|
-
|
107
|
-
|
108
|
-
|
132
|
+
general_tooltip = (
|
133
|
+
"You can enter a string with some keywords like {my_keyword}. Those will be interpreted during runtime according to scan metadata. Possible keywords are:"
|
134
|
+
+ "\n - 'scan_dir_name': returns name of the directory containing the acquisition (! not a path !)"
|
135
|
+
+ "\n - 'scan_basename': returns basename of the directory containing the acquisition"
|
136
|
+
+ "\n - 'scan_parent_dir_basename': returns basename of the PARENT directory containing the acquisition"
|
137
|
+
)
|
109
138
|
|
110
139
|
self._selectOutputPB.setToolTip(general_tooltip)
|
111
140
|
self._outputDirQLE.setToolTip(general_tooltip)
|
112
|
-
self.layout().addWidget(self._selectOutputPB)
|
141
|
+
self.layout().addWidget(self._selectOutputPB, 4, 2, 1, 1)
|
142
|
+
|
143
|
+
# set up:
|
144
|
+
self._inScanFolderRB.setChecked(True)
|
113
145
|
|
114
146
|
# connect signal / slot
|
115
|
-
self.
|
147
|
+
self._inScanFolderRB.toggled.connect(self._outputModeChanged)
|
148
|
+
self._processedDataDirRB.toggled.connect(self._outputModeChanged)
|
149
|
+
self._rawDataDirRB.toggled.connect(self._outputModeChanged)
|
150
|
+
self._otherDirRB.toggled.connect(self._outputModeChanged)
|
116
151
|
self._selectOutputPB.released.connect(self._selectOutput)
|
117
|
-
self.
|
118
|
-
self.
|
119
|
-
|
120
|
-
def
|
121
|
-
self.
|
122
|
-
|
152
|
+
self._inScanFolderRB.setChecked(True)
|
153
|
+
self._outputModeChanged()
|
154
|
+
|
155
|
+
def getOutputDirMode(self) -> ProcessDataOutputDirMode:
|
156
|
+
if self._inScanFolderRB.isChecked():
|
157
|
+
return ProcessDataOutputDirMode.IN_SCAN_FOLDER
|
158
|
+
elif self._processedDataDirRB.isChecked():
|
159
|
+
return ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER
|
160
|
+
elif self._rawDataDirRB.isChecked():
|
161
|
+
return ProcessDataOutputDirMode.RAW_DATA_FOLDER
|
162
|
+
elif self._otherDirRB.isChecked():
|
163
|
+
return ProcessDataOutputDirMode.OTHER
|
164
|
+
|
165
|
+
def setOutputDirMode(
|
166
|
+
self, mode: typing.Union[ProcessDataOutputDirMode, str]
|
167
|
+
) -> None:
|
168
|
+
mode = ProcessDataOutputDirMode.from_value(mode)
|
169
|
+
if mode is ProcessDataOutputDirMode.IN_SCAN_FOLDER:
|
170
|
+
self._inScanFolderRB.setChecked(True)
|
171
|
+
elif mode is ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER:
|
172
|
+
self._processedDataDirRB.setChecked(True)
|
173
|
+
elif mode is ProcessDataOutputDirMode.RAW_DATA_FOLDER:
|
174
|
+
self._rawDataDirRB.setChecked(True)
|
175
|
+
elif mode is ProcessDataOutputDirMode.OTHER:
|
176
|
+
self._otherDirRB.setChecked(True)
|
177
|
+
|
178
|
+
def _outputModeChanged(self, *args, **kwargs):
|
179
|
+
outputMode = self.getOutputDirMode()
|
180
|
+
self._outputDirQLE.setVisible(outputMode is ProcessDataOutputDirMode.OTHER)
|
181
|
+
self._selectOutputPB.setVisible(outputMode is ProcessDataOutputDirMode.OTHER)
|
182
|
+
self.sigOutputChanged.emit()
|
123
183
|
|
124
184
|
def _selectOutput(self): # pragma: no cover
|
125
185
|
defaultDirectory = self._outputDirQLE.text()
|
126
|
-
if os.path.isdir(defaultDirectory):
|
186
|
+
if not os.path.isdir(defaultDirectory):
|
127
187
|
defaultDirectory = get_default_directory()
|
128
188
|
|
129
189
|
dialog = qt.QFileDialog(self, directory=defaultDirectory)
|
@@ -141,16 +201,15 @@ class NabuOutputLocationWidget(qt.QWidget):
|
|
141
201
|
:return: None if the default output directory is selected else
|
142
202
|
return path to the directory
|
143
203
|
"""
|
144
|
-
if self.
|
145
|
-
return None
|
146
|
-
else:
|
204
|
+
if self._otherDirRB.isChecked():
|
147
205
|
return self._outputDirQLE.text()
|
206
|
+
else:
|
207
|
+
return None
|
148
208
|
|
149
209
|
def setOutputDir(self, output_dir):
|
150
210
|
if output_dir in (None, ""):
|
151
|
-
|
211
|
+
pass
|
152
212
|
else:
|
153
|
-
self._defaultOutput.setChecked(False)
|
154
213
|
self._outputDirQLE.setText(output_dir)
|
155
214
|
|
156
215
|
|
@@ -170,7 +229,7 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
|
|
170
229
|
self.setLayout(qt.QGridLayout())
|
171
230
|
|
172
231
|
# output dir
|
173
|
-
self._output_dir_widget = NabuOutputLocationWidget(self)
|
232
|
+
self._output_dir_widget = NabuOutputLocationWidget(parent=self)
|
174
233
|
self.layout().addWidget(self._output_dir_widget, 0, 0, 1, 4)
|
175
234
|
self.registerWidget(self._output_dir_widget, "advanced")
|
176
235
|
|
@@ -207,7 +266,7 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
|
|
207
266
|
self._output_dir_widget._outputDirQLE.editingFinished.connect(
|
208
267
|
self._outputDirChanged
|
209
268
|
)
|
210
|
-
self._output_dir_widget.
|
269
|
+
self._output_dir_widget.sigOutputChanged.connect(self._outputDirChanged)
|
211
270
|
self._fileFormatCB.currentTextChanged.connect(self._fileFormatChanged)
|
212
271
|
self._framePerGroup.valueChanged.connect(self._framePerGroupChanged)
|
213
272
|
|
@@ -226,6 +285,12 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
|
|
226
285
|
def setOutputDir(self, dir):
|
227
286
|
return self._output_dir_widget.setOutputDir(dir)
|
228
287
|
|
288
|
+
def getOutputdirMode(self):
|
289
|
+
return self._output_dir_widget.getOutputDirMode()
|
290
|
+
|
291
|
+
def setOutputdirMode(self, mode):
|
292
|
+
return self._output_dir_widget.setOutputDirMode(mode=mode)
|
293
|
+
|
229
294
|
def getFileFormat(self) -> NabuOutputFileFormat:
|
230
295
|
return NabuOutputFileFormat.from_value(self._fileFormatCB.currentText())
|
231
296
|
|
@@ -244,13 +309,25 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
|
|
244
309
|
return {
|
245
310
|
"file_format": self.getFileFormat().value,
|
246
311
|
"location": self.getOutputDir() or "",
|
312
|
+
"output_dir_mode": self.getOutputdirMode().value,
|
247
313
|
# 'frames_per_group': self.getFramePerGroup(),
|
248
314
|
}
|
249
315
|
|
250
316
|
def setConfiguration(self, config):
|
251
317
|
if "file_format" in config:
|
252
318
|
self.setFileformat(config["file_format"])
|
253
|
-
|
254
|
-
|
319
|
+
location = config.get("location", None)
|
320
|
+
if location == "":
|
321
|
+
location = None
|
322
|
+
if location is not None:
|
323
|
+
self.setOutputDir(location)
|
255
324
|
if "frames_per_group" in config:
|
256
325
|
self.setFramePerGroup(int(config["frames_per_group"]))
|
326
|
+
|
327
|
+
# definition of default_output_dir_mode ensure backward compatibility
|
328
|
+
default_output_dir_mode = (
|
329
|
+
None if location is None else ProcessDataOutputDirMode.OTHER
|
330
|
+
)
|
331
|
+
output_dir_mode = config.get("output_dir_mode", default_output_dir_mode)
|
332
|
+
if output_dir_mode is not None:
|
333
|
+
self.setOutputdirMode(output_dir_mode)
|
@@ -107,9 +107,9 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
107
107
|
|
108
108
|
# connect signal / slot
|
109
109
|
self._methodCB.currentIndexChanged.connect(self._methodChanged)
|
110
|
-
self._paganinOpts.sigConfChanged.connect(self.
|
111
|
-
self._unsharpOpts.sigConfChanged.connect(self.
|
112
|
-
self._ctfOpts.sigConfChanged.connect(self.
|
110
|
+
self._paganinOpts.sigConfChanged.connect(self.sigConfChanged)
|
111
|
+
self._unsharpOpts.sigConfChanged.connect(self.sigConfChanged)
|
112
|
+
self._ctfOpts.sigConfChanged.connect(self.sigConfChanged)
|
113
113
|
|
114
114
|
# set up
|
115
115
|
self._paganinOpts.setEnabled(self.getMethod() is not _NabuPhaseMethod.NONE)
|
@@ -118,7 +118,7 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
118
118
|
def _methodChanged(self, *args, **kwargs):
|
119
119
|
self._paganinOpts.setEnabled(self.getMethod() is not _NabuPhaseMethod.NONE)
|
120
120
|
self._ctfOpts.setEnabled(self.getMethod() is _NabuPhaseMethod.CTF)
|
121
|
-
self.
|
121
|
+
self.sigConfChanged.emit("method")
|
122
122
|
|
123
123
|
def _signalConfChanged(self, param):
|
124
124
|
self.sigConfChanged.emit(param)
|
@@ -224,13 +224,13 @@ class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
224
224
|
self._paddingTypeCB.currentIndexChanged.connect(self._paganinPaddingTypeChanged)
|
225
225
|
|
226
226
|
def _paganinDBChanged(self, *args, **kwargs):
|
227
|
-
self.
|
227
|
+
self.sigConfChanged.emit("delta_beta")
|
228
228
|
|
229
229
|
def _paganinMargeChanged(self, *args, **kwargs):
|
230
|
-
self.
|
230
|
+
self.sigConfChanged.emit("marge")
|
231
231
|
|
232
232
|
def _paganinPaddingTypeChanged(self, *args, **kwargs):
|
233
|
-
self.
|
233
|
+
self.sigConfChanged.emit("padding_type")
|
234
234
|
|
235
235
|
def getPaddingType(self) -> PaddingMode:
|
236
236
|
current_text = self._paddingTypeCB.currentText()
|
@@ -263,9 +263,6 @@ class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
263
263
|
if padding_type is not None:
|
264
264
|
self.setPaddingType(padding_type)
|
265
265
|
|
266
|
-
def _signalConfChanged(self, param):
|
267
|
-
self.sigConfChanged.emit(param)
|
268
|
-
|
269
266
|
|
270
267
|
class NabuUnsharpConfig(qt.QWidget, base._NabuStageConfigBase):
|
271
268
|
"""Configuration widget dedicated to the unsharp options for nabu"""
|
@@ -331,10 +328,10 @@ class NabuUnsharpConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
331
328
|
self._unsharpSigmaQLE.editingFinished.connect(self._unsharpSigmaChanged)
|
332
329
|
|
333
330
|
def _unsharpCoeffChanged(self, *args, **kwargs):
|
334
|
-
self.
|
331
|
+
self.sigConfChanged.emit("unsharp_coeff")
|
335
332
|
|
336
333
|
def _unsharpSigmaChanged(self, *args, **kwargs):
|
337
|
-
self.
|
334
|
+
self.sigConfChanged.emit("unsharp_sigma")
|
338
335
|
|
339
336
|
def isUnsharpCoeffActive(self):
|
340
337
|
return self._unsharpCoeffCB.isChecked()
|
@@ -29,13 +29,13 @@ __date__ = "06/12/2021"
|
|
29
29
|
|
30
30
|
|
31
31
|
import logging
|
32
|
-
from typing import Optional
|
32
|
+
from typing import Optional, Union
|
33
33
|
|
34
34
|
from silx.gui import qt
|
35
35
|
|
36
36
|
from tomwer.core.process.reconstruction.nabu.utils import (
|
37
37
|
_NabuStages,
|
38
|
-
|
38
|
+
RingCorrectionMethod,
|
39
39
|
)
|
40
40
|
from tomwer.gui.reconstruction.nabu.nabuconfig.base import _NabuStageConfigBase
|
41
41
|
from tomwer.gui.utils.scrollarea import QComboBoxIgnoreWheel as QComboBox
|
@@ -78,6 +78,9 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
|
|
78
78
|
self._dffSigmaQDSB.setMinimum(0.0)
|
79
79
|
self._dffSigmaQDSB.setDecimals(2)
|
80
80
|
self._dffSigmaQDSB.setSingleStep(0.1)
|
81
|
+
self._dffSigmaQDSB.setToolTip(
|
82
|
+
"Sigma value to give to the double flat field unsharp mask"
|
83
|
+
)
|
81
84
|
self.layout().addWidget(self._dffSigmaQDSB, 1, 3, 1, 1)
|
82
85
|
self.registerWidget(self._flatFieldCB, "required")
|
83
86
|
self._dffOptWidgets = [
|
@@ -92,10 +95,10 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
|
|
92
95
|
self.registerWidget(self._sinoRingCorrectionCB, "required")
|
93
96
|
|
94
97
|
self._sinoRingCorrectionMthd = QComboBox(parent=self, scrollArea=scrollArea)
|
95
|
-
for method in
|
98
|
+
for method in RingCorrectionMethod:
|
96
99
|
self._sinoRingCorrectionMthd.addItem(method.value)
|
97
100
|
## force method to be None by default
|
98
|
-
idx = self._sinoRingCorrectionMthd.findText(
|
101
|
+
idx = self._sinoRingCorrectionMthd.findText(RingCorrectionMethod.NONE.value)
|
99
102
|
self._sinoRingCorrectionMthd.setCurrentIndex(idx)
|
100
103
|
|
101
104
|
self.layout().addWidget(self._sinoRingCorrectionMthd, 2, 2, 1, 1)
|
@@ -232,8 +235,8 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
|
|
232
235
|
self._sinoRingCorrectionMthd.currentIndexChanged.connect(
|
233
236
|
self._sinoRingCorrectionChanged
|
234
237
|
)
|
235
|
-
self._sinoRingsOpts.
|
236
|
-
self._sinoRingsOpts.
|
238
|
+
self._sinoRingsOpts._levelsMunch.valueChanged.connect(self._sinoRingOptsChanged)
|
239
|
+
self._sinoRingsOpts._sigmaMunch.valueChanged.connect(self._sinoRingOptsChanged)
|
237
240
|
|
238
241
|
self._tiltCorrection.toggled.connect(self._tiltCorrectionChanged)
|
239
242
|
self._tiltCorrection.sigChanged.connect(self._tiltCorrectionChanged)
|
@@ -266,9 +269,13 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
|
|
266
269
|
self._signalConfChanged("take_logarithm")
|
267
270
|
|
268
271
|
def _sinoRingCorrectionChanged(self, *args, **kwargs):
|
269
|
-
self.
|
270
|
-
|
271
|
-
|
272
|
+
method = self.getSinoRingcorrectionMethod()
|
273
|
+
if method is not RingCorrectionMethod.NONE.value:
|
274
|
+
self._sinoRingsOpts.setVisible(True)
|
275
|
+
self._sinoRingsOpts.setMethod(method)
|
276
|
+
else:
|
277
|
+
self._sinoRingsOpts.setVisible(False)
|
278
|
+
|
272
279
|
self._signalConfChanged("sino_rings_correction")
|
273
280
|
|
274
281
|
def _sinoRingOptsChanged(self, *args, **kwargs):
|
@@ -341,8 +348,11 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
|
|
341
348
|
opt_as_dict = {}
|
342
349
|
for opt in options.split(";"):
|
343
350
|
opt = opt.replace(" ", "")
|
344
|
-
|
345
|
-
|
351
|
+
if len(opt.split("=")) == 2:
|
352
|
+
key, value = opt.split("=")
|
353
|
+
opt_as_dict[key] = value
|
354
|
+
else:
|
355
|
+
_logger.info(f"ignore option {opt}. Invalid synthax")
|
346
356
|
|
347
357
|
self._sinoRingsOpts.setOptions(opt_as_dict)
|
348
358
|
|
@@ -412,8 +422,8 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
|
|
412
422
|
sino_rings_correction = conf.get("sino_rings_correction", None)
|
413
423
|
if sino_rings_correction is not None:
|
414
424
|
if sino_rings_correction == "":
|
415
|
-
sino_rings_correction =
|
416
|
-
sino_rings_correction =
|
425
|
+
sino_rings_correction = RingCorrectionMethod.NONE
|
426
|
+
sino_rings_correction = RingCorrectionMethod.from_value(
|
417
427
|
sino_rings_correction
|
418
428
|
).value
|
419
429
|
idx = self._sinoRingCorrectionMthd.findText(sino_rings_correction)
|
@@ -431,32 +441,212 @@ class _NabuPreProcessingConfig(_NabuStageConfigBase, qt.QWidget):
|
|
431
441
|
|
432
442
|
|
433
443
|
class SinoRingsOptions(qt.QWidget):
|
444
|
+
_VO_DIMS = ("horizontaly", "horizontaly and vertically")
|
445
|
+
|
434
446
|
def __init__(self, parent=None, *args, **kwargs):
|
435
447
|
super().__init__(parent, *args, **kwargs)
|
448
|
+
self._method = None
|
436
449
|
self.setLayout(qt.QFormLayout())
|
437
|
-
self.
|
438
|
-
self.
|
439
|
-
|
440
|
-
|
441
|
-
self.
|
442
|
-
self.
|
443
|
-
self.layout().addRow(
|
444
|
-
|
450
|
+
self.layout().setContentsMargins(0, 0, 0, 0)
|
451
|
+
self.layout().setSpacing(0)
|
452
|
+
# munch parameters
|
453
|
+
self._sigmaMunchLabel = qt.QLabel("sigma", self)
|
454
|
+
self._sigmaMunch = qt.QDoubleSpinBox(self)
|
455
|
+
self._sigmaMunch.setRange(0.0, 2147483647)
|
456
|
+
self.layout().addRow(self._sigmaMunchLabel, self._sigmaMunch)
|
457
|
+
|
458
|
+
self._levelsMunchLabel = qt.QLabel("levels", self)
|
459
|
+
self._levelsMunch = qt.QSpinBox(self)
|
460
|
+
self._levelsMunch.setRange(0, 2147483647)
|
461
|
+
self.layout().addRow(self._levelsMunchLabel, self._levelsMunch)
|
462
|
+
|
463
|
+
self._paddingMunch = qt.QCheckBox("padding", self)
|
464
|
+
self.layout().addWidget(self._paddingMunch)
|
465
|
+
|
466
|
+
# vo parameters
|
467
|
+
self._snrVOLabel = qt.QLabel("snr", self)
|
468
|
+
self._snrVO = qt.QDoubleSpinBox(self)
|
469
|
+
self._snrVO.setMinimum(0.0)
|
470
|
+
tooltip = "Ratio used to locate large stripes. Greater is less sensitive."
|
471
|
+
self._snrVO.setToolTip(tooltip)
|
472
|
+
self._snrVOLabel.setToolTip(tooltip)
|
473
|
+
self.layout().addRow(self._snrVOLabel, self._snrVO)
|
474
|
+
|
475
|
+
self._laSizeVOLabel = qt.QLabel("la_size", self)
|
476
|
+
self._laSizeVO = qt.QSpinBox(self)
|
477
|
+
self._laSizeVO.setMinimum(0)
|
478
|
+
tooltip = "Window size of the median filter to remove large stripes."
|
479
|
+
self._laSizeVO.setToolTip(tooltip)
|
480
|
+
self._laSizeVOLabel.setToolTip(tooltip)
|
481
|
+
self.layout().addRow(self._laSizeVOLabel, self._laSizeVO)
|
482
|
+
|
483
|
+
self._smSizeVOLabel = qt.QLabel("sm_size", self)
|
484
|
+
self._smSizeVO = qt.QSpinBox(self)
|
485
|
+
self._smSizeVO.setMinimum(0)
|
486
|
+
tooltip = "Window size of the median filter to remove small-to-medium stripes."
|
487
|
+
self._laSizeVO.setToolTip(tooltip)
|
488
|
+
self._smSizeVOLabel.setToolTip(tooltip)
|
489
|
+
self.layout().addRow(self._smSizeVOLabel, self._smSizeVO)
|
490
|
+
|
491
|
+
self._dimVOLabel = qt.QLabel("dimension", self)
|
492
|
+
self._dimVO = qt.QComboBox(self)
|
493
|
+
self._dimVO.addItems(self._VO_DIMS)
|
494
|
+
self.layout().addRow(self._dimVOLabel, self._dimVO)
|
495
|
+
|
496
|
+
# sino mean deringer
|
497
|
+
self._sigmaLowLabel = qt.QLabel("signal low", self)
|
498
|
+
self._sigmaLow = qt.QDoubleSpinBox(self)
|
499
|
+
self._sigmaLow.setMinimum(0.0)
|
500
|
+
self._sigmaHighLabel = qt.QLabel("signal high", self)
|
501
|
+
self.layout().addRow(self._sigmaLowLabel, self._sigmaLow)
|
502
|
+
|
503
|
+
self._sigmaHigh = qt.QDoubleSpinBox(self)
|
504
|
+
self._sigmaHigh.setMinimum(0.0)
|
505
|
+
tooltip = (
|
506
|
+
"sigma low and sigma high values are defining the standard deviation of "
|
507
|
+
"gaussian(sigma_low) * (1 - gaussian(sigma_high)). \n"
|
508
|
+
"High values of sigma mean stronger effect of associated filters."
|
509
|
+
)
|
510
|
+
self._sigmaHigh.setToolTip(tooltip)
|
511
|
+
self._sigmaLow.setToolTip(tooltip)
|
512
|
+
self.layout().addRow(self._sigmaHighLabel, self._sigmaHigh)
|
445
513
|
# set up
|
446
|
-
self.
|
447
|
-
|
514
|
+
self.resetConfiguration()
|
515
|
+
|
516
|
+
def resetConfiguration(self):
|
517
|
+
self.setMethod(method=RingCorrectionMethod.MUNCH)
|
518
|
+
self._levelsMunch.setValue(10)
|
519
|
+
self._sigmaMunch.setValue(1.0)
|
520
|
+
self._paddingMunch.setChecked(False)
|
521
|
+
|
522
|
+
self._sigmaHigh.setValue(30.0)
|
523
|
+
self._sigmaLow.setValue(0.0)
|
524
|
+
|
525
|
+
self._snrVO.setValue(3.0)
|
526
|
+
self._laSizeVO.setValue(51)
|
527
|
+
self._smSizeVO.setValue(21)
|
528
|
+
|
529
|
+
def getVoDim(self):
|
530
|
+
if self._dimVO.currentText() == self._VO_DIMS[0]:
|
531
|
+
return 1
|
532
|
+
elif self._dimVO.currentText() == self._VO_DIMS[1]:
|
533
|
+
return 2
|
534
|
+
else:
|
535
|
+
raise NotImplementedError
|
536
|
+
|
537
|
+
def setVoDim(self, dim: Union[int, str]):
|
538
|
+
if dim in ("1", 1, self._VO_DIMS[0]):
|
539
|
+
self._dimVO.setCurrentText(self._VO_DIMS[0])
|
540
|
+
elif dim in ("2", 2, self._VO_DIMS[1]):
|
541
|
+
self._dimVO.setCurrentText(self._VO_DIMS[1])
|
542
|
+
else:
|
543
|
+
raise NotImplementedError(f"dim {dim} not handled")
|
448
544
|
|
449
545
|
def getOptions(self) -> dict:
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
546
|
+
if self.getMethod() is RingCorrectionMethod.NONE:
|
547
|
+
return {}
|
548
|
+
elif self.getMethod() is RingCorrectionMethod.MUNCH:
|
549
|
+
return {
|
550
|
+
"sigma": self._sigmaMunch.value(),
|
551
|
+
"levels": self._levelsMunch.value(),
|
552
|
+
"padding": self._paddingMunch.isChecked(),
|
553
|
+
}
|
554
|
+
elif self.getMethod() is RingCorrectionMethod.VO:
|
555
|
+
return {
|
556
|
+
"snr": self._snrVO.value(),
|
557
|
+
"la_size": self._laSizeVO.value(),
|
558
|
+
"sm_size": self._smSizeVO.value(),
|
559
|
+
"dim": self.getVoDim(),
|
560
|
+
}
|
561
|
+
elif self.getMethod() in (
|
562
|
+
RingCorrectionMethod.MEAN_DIVISION,
|
563
|
+
RingCorrectionMethod.MEAN_SUBTRACTION,
|
564
|
+
):
|
565
|
+
return {
|
566
|
+
"filter_cutoff": (self._sigmaLow.value(), self._sigmaHigh.value()),
|
567
|
+
}
|
568
|
+
else:
|
569
|
+
raise NotImplementedError
|
454
570
|
|
455
571
|
def setOptions(self, options: dict) -> None:
|
572
|
+
# handle munch propertoies
|
456
573
|
if "sigma" in options:
|
457
|
-
self.
|
574
|
+
self._sigmaMunch.setValue(float(options["sigma"]))
|
458
575
|
if "levels" in options:
|
459
|
-
self.
|
576
|
+
self._levelsMunch.setValue(int(options["levels"]))
|
577
|
+
padding = options.get("padding")
|
578
|
+
if padding is not None:
|
579
|
+
self._paddingMunch.setChecked(padding in (True, 1, "1", "True"))
|
580
|
+
# handle VO properties
|
581
|
+
snr = options.get("snr")
|
582
|
+
if snr is not None:
|
583
|
+
self._snrVO.setValue(float(snr))
|
584
|
+
la_size = options.get("la_size")
|
585
|
+
if la_size is not None:
|
586
|
+
self._laSizeVO.setValue(int(la_size))
|
587
|
+
sm_size = options.get("sm_size")
|
588
|
+
if sm_size is not None:
|
589
|
+
self._smSizeVO.setValue(int(sm_size))
|
590
|
+
dim = options.get("dim")
|
591
|
+
if dim is not None:
|
592
|
+
self.setVoDim(dim)
|
593
|
+
# handle mean subtraction or division options
|
594
|
+
filter_cutoff = options.get("filter_cutoff")
|
595
|
+
if filter_cutoff is not None:
|
596
|
+
low_pass, high_pass = filter_cutoff
|
597
|
+
self._sigmaLow.setValue(float(low_pass))
|
598
|
+
self._sigmaHigh.setValue(float(high_pass))
|
599
|
+
|
600
|
+
def setMethod(self, method: RingCorrectionMethod):
|
601
|
+
method = RingCorrectionMethod.from_value(method)
|
602
|
+
self._method = method
|
603
|
+
# handle munch options
|
604
|
+
self._sigmaMunch.setVisible(method is RingCorrectionMethod.MUNCH)
|
605
|
+
self._sigmaMunchLabel.setVisible(method is RingCorrectionMethod.MUNCH)
|
606
|
+
self._levelsMunch.setVisible(method is RingCorrectionMethod.MUNCH)
|
607
|
+
self._levelsMunchLabel.setVisible(method is RingCorrectionMethod.MUNCH)
|
608
|
+
self._paddingMunch.setVisible(method is RingCorrectionMethod.MUNCH)
|
609
|
+
# handle VO options
|
610
|
+
self._snrVO.setVisible(method is RingCorrectionMethod.VO)
|
611
|
+
self._snrVOLabel.setVisible(method is RingCorrectionMethod.VO)
|
612
|
+
self._laSizeVO.setVisible(method is RingCorrectionMethod.VO)
|
613
|
+
self._laSizeVOLabel.setVisible(method is RingCorrectionMethod.VO)
|
614
|
+
self._smSizeVO.setVisible(method is RingCorrectionMethod.VO)
|
615
|
+
self._smSizeVOLabel.setVisible(method is RingCorrectionMethod.VO)
|
616
|
+
self._dimVO.setVisible(method is RingCorrectionMethod.VO)
|
617
|
+
self._dimVOLabel.setVisible(method is RingCorrectionMethod.VO)
|
618
|
+
# mean subtractions / division deringer
|
619
|
+
self._sigmaLow.setVisible(
|
620
|
+
method
|
621
|
+
in (
|
622
|
+
RingCorrectionMethod.MEAN_DIVISION,
|
623
|
+
RingCorrectionMethod.MEAN_SUBTRACTION,
|
624
|
+
)
|
625
|
+
)
|
626
|
+
self._sigmaLowLabel.setVisible(
|
627
|
+
method
|
628
|
+
in (
|
629
|
+
RingCorrectionMethod.MEAN_DIVISION,
|
630
|
+
RingCorrectionMethod.MEAN_SUBTRACTION,
|
631
|
+
)
|
632
|
+
)
|
633
|
+
self._sigmaHigh.setVisible(
|
634
|
+
method
|
635
|
+
in (
|
636
|
+
RingCorrectionMethod.MEAN_DIVISION,
|
637
|
+
RingCorrectionMethod.MEAN_SUBTRACTION,
|
638
|
+
)
|
639
|
+
)
|
640
|
+
self._sigmaHighLabel.setVisible(
|
641
|
+
method
|
642
|
+
in (
|
643
|
+
RingCorrectionMethod.MEAN_DIVISION,
|
644
|
+
RingCorrectionMethod.MEAN_SUBTRACTION,
|
645
|
+
)
|
646
|
+
)
|
647
|
+
|
648
|
+
def getMethod(self) -> RingCorrectionMethod:
|
649
|
+
return self._method
|
460
650
|
|
461
651
|
|
462
652
|
class TiltCorrection(qt.QGroupBox):
|
@@ -85,16 +85,13 @@ class SliceGroupBox(qt.QGroupBox):
|
|
85
85
|
|
86
86
|
# connect signal / slot
|
87
87
|
self._modeCB.currentIndexChanged.connect(self._updateSliceQLEVisibilty)
|
88
|
-
self._modeCB.currentIndexChanged.connect(self.
|
89
|
-
self._sliceQLE.editingFinished.connect(self.
|
90
|
-
self.toggled.connect(self.
|
88
|
+
self._modeCB.currentIndexChanged.connect(self.sigSlicesChanged)
|
89
|
+
self._sliceQLE.editingFinished.connect(self.sigSlicesChanged)
|
90
|
+
self.toggled.connect(self.sigSlicesChanged)
|
91
91
|
|
92
92
|
def _updateSliceQLEVisibilty(self, *args, **kwargs):
|
93
93
|
self._sliceQLE.setVisible(self.getMode() == NabuSliceMode.OTHER)
|
94
94
|
|
95
|
-
def _triggerSlicesChanged(self):
|
96
|
-
self.sigSlicesChanged.emit()
|
97
|
-
|
98
95
|
def setMode(self, mode: NabuSliceMode):
|
99
96
|
mode = NabuSliceMode.from_value(mode)
|
100
97
|
item_index = self._modeCB.findText(mode.value)
|