tomwer 1.2.1__py3-none-any.whl → 1.3.12__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 +11 -11
- orangecontrib/tomwer/widgets/control/DataDiscoveryOW.py +2 -2
- orangecontrib/tomwer/widgets/control/DataListOW.py +9 -7
- orangecontrib/tomwer/widgets/control/DataListenerOW.py +6 -6
- orangecontrib/tomwer/widgets/control/DataSelectorOW.py +21 -10
- orangecontrib/tomwer/widgets/control/DataValidatorOW.py +6 -6
- orangecontrib/tomwer/widgets/control/EDF2NXTomomillOW.py +24 -7
- orangecontrib/tomwer/widgets/control/EmailOW.py +4 -4
- orangecontrib/tomwer/widgets/control/NXTomomillMixIn.py +3 -3
- orangecontrib/tomwer/widgets/control/NXTomomillOW.py +64 -23
- orangecontrib/tomwer/widgets/control/NXtomoConcatenate.py +20 -8
- orangecontrib/tomwer/widgets/control/NotifierOW.py +1 -0
- orangecontrib/tomwer/widgets/control/SingleTomoObjOW.py +6 -6
- orangecontrib/tomwer/widgets/control/VolumeSelector.py +7 -4
- orangecontrib/tomwer/widgets/control/VolumeSymLinkOW.py +182 -182
- orangecontrib/tomwer/widgets/debugtools/DatasetGeneratorOW.py +5 -5
- orangecontrib/tomwer/widgets/edit/DarkFlatPatchOW.py +4 -4
- orangecontrib/tomwer/widgets/edit/ImageKeyEditorOW.py +3 -3
- orangecontrib/tomwer/widgets/edit/ImageKeyUpgraderOW.py +8 -1
- 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 +22 -20
- orangecontrib/tomwer/widgets/reconstruction/CastNabuVolumeOW.py +19 -3
- orangecontrib/tomwer/widgets/reconstruction/NabuHelicalPrepareWeightsDoubleOW.py +184 -169
- orangecontrib/tomwer/widgets/reconstruction/NabuOW.py +23 -0
- orangecontrib/tomwer/widgets/reconstruction/NabuVolumeOW.py +39 -5
- orangecontrib/tomwer/widgets/reconstruction/SAAxisOW.py +18 -22
- orangecontrib/tomwer/widgets/reconstruction/SADeltaBetaOW.py +18 -26
- orangecontrib/tomwer/widgets/reconstruction/SinoNormOW.py +15 -19
- orangecontrib/tomwer/widgets/visualization/DataViewerOW.py +9 -9
- orangecontrib/tomwer/widgets/visualization/DiffViewerOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/LivesliceOW.py +1 -1
- orangecontrib/tomwer/widgets/visualization/NXtomoMetadataViewerOW.py +3 -3
- orangecontrib/tomwer/widgets/visualization/SinogramViewerOW.py +0 -1
- orangecontrib/tomwer/widgets/visualization/VolumeViewerOW.py +3 -29
- tomwer/__main__.py +7 -64
- tomwer/app/axis.py +3 -3
- tomwer/app/canvas.py +8 -0
- tomwer/app/canvas_launcher/config.py +16 -14
- tomwer/app/canvas_launcher/environ.py +1 -0
- tomwer/app/canvas_launcher/mainwindow.py +4 -1
- tomwer/app/darkref.py +1 -1
- tomwer/app/darkrefpatch.py +1 -1
- tomwer/app/diffframe.py +3 -3
- tomwer/app/imagekeyeditor.py +5 -5
- tomwer/app/imagekeyupgrader.py +5 -5
- tomwer/app/intensitynormalization.py +14 -13
- tomwer/app/{saaxis.py → multicor.py} +3 -3
- tomwer/app/{sadeltabeta.py → multipag.py} +3 -3
- tomwer/app/nabuapp.py +0 -11
- tomwer/app/radiostack.py +6 -4
- tomwer/app/samplemoved.py +3 -2
- tomwer/app/scanviewer.py +4 -2
- tomwer/app/sinogramviewer.py +3 -2
- tomwer/app/slicestack.py +3 -2
- tomwer/app/zstitching.py +88 -6
- 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 +19 -14
- tomwer/core/process/control/datawatcher/edfdwprocess.py +0 -9
- tomwer/core/process/control/nxtomoconcatenate.py +13 -13
- tomwer/core/process/control/nxtomomill.py +92 -34
- tomwer/core/process/control/scantransfer.py +20 -43
- 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 +14 -15
- tomwer/core/process/edit/imagekeyeditor.py +41 -39
- 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 +27 -0
- tomwer/core/process/output.py +52 -0
- tomwer/core/process/reconstruction/axis/axis.py +280 -69
- tomwer/core/process/reconstruction/axis/mode.py +163 -48
- tomwer/core/process/reconstruction/axis/params.py +29 -21
- tomwer/core/process/reconstruction/darkref/darkrefs.py +41 -127
- tomwer/core/process/reconstruction/darkref/darkrefscopy.py +4 -3
- tomwer/core/process/reconstruction/darkref/params.py +1 -1
- tomwer/core/process/reconstruction/nabu/castvolume.py +4 -4
- tomwer/core/process/reconstruction/nabu/helical.py +9 -5
- tomwer/core/process/reconstruction/nabu/nabucommon.py +71 -78
- tomwer/core/process/reconstruction/nabu/nabuscores.py +425 -53
- tomwer/core/process/reconstruction/nabu/nabuslices.py +114 -93
- tomwer/core/process/reconstruction/nabu/nabuvolume.py +54 -27
- tomwer/core/process/reconstruction/nabu/plane.py +9 -0
- tomwer/core/process/reconstruction/nabu/settings.py +2 -2
- tomwer/core/process/reconstruction/nabu/utils.py +164 -26
- tomwer/core/process/reconstruction/output.py +108 -0
- tomwer/core/process/reconstruction/saaxis/saaxis.py +238 -264
- tomwer/core/process/reconstruction/sadeltabeta/sadeltabeta.py +151 -87
- tomwer/core/process/reconstruction/scores/params.py +7 -4
- 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 +7 -7
- 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 +13 -12
- tomwer/core/process/task.py +34 -26
- tomwer/core/process/test/test_axis.py +13 -12
- tomwer/core/process/test/test_dark_and_flat.py +10 -7
- tomwer/core/process/test/test_data_transfer.py +10 -8
- tomwer/core/process/test/test_nabu.py +14 -6
- tomwer/core/process/test/test_normalization.py +4 -4
- tomwer/core/scan/blissscan.py +3 -3
- tomwer/core/scan/edfscan.py +13 -10
- tomwer/core/scan/hdf5scan.py +19 -530
- tomwer/core/scan/nxtomoscan.py +534 -0
- tomwer/core/scan/scanbase.py +72 -44
- tomwer/core/scan/scanfactory.py +13 -13
- tomwer/core/scan/test/test_edf.py +2 -2
- tomwer/core/scan/test/test_future_scan.py +3 -3
- tomwer/core/scan/test/test_h5.py +18 -16
- tomwer/core/scan/test/test_process_registration.py +4 -40
- tomwer/core/scan/test/test_scan.py +5 -78
- tomwer/core/settings.py +22 -2
- tomwer/core/test/test_scanutils.py +8 -7
- tomwer/core/test/test_utils.py +35 -28
- tomwer/core/tomwer_object.py +1 -1
- 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/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/core/volume/volumefactory.py +2 -2
- tomwer/gui/cluster/slurm.py +274 -65
- tomwer/gui/cluster/supervisor.py +12 -0
- tomwer/gui/cluster/test/test_cluster.py +14 -2
- tomwer/gui/cluster/test/test_supervisor.py +3 -3
- 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 +83 -16
- tomwer/gui/control/datalistener.py +4 -16
- tomwer/gui/control/datawatcher/controlwidget.py +2 -4
- tomwer/gui/control/datawatcher/datawatcher.py +1 -24
- 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 +9 -9
- 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 +3 -3
- tomwer/gui/control/tomoobjdisplaymode.py +8 -0
- tomwer/gui/debugtools/datasetgenerator.py +3 -3
- tomwer/gui/edit/dkrfpatch.py +20 -26
- tomwer/gui/edit/imagekeyeditor.py +11 -12
- tomwer/gui/edit/nxtomoeditor.py +111 -44
- tomwer/gui/edit/nxtomowarmer.py +7 -6
- tomwer/gui/edit/test/test_dkrf_patch.py +13 -13
- 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/imagefromfile.py +2 -2
- tomwer/gui/qfolderdialog.py +24 -1
- tomwer/gui/reconstruction/axis/CompareImages.py +88 -168
- tomwer/gui/reconstruction/axis/axis.py +171 -57
- tomwer/gui/reconstruction/axis/radioaxis.py +122 -257
- tomwer/gui/reconstruction/darkref/darkrefcopywidget.py +3 -2
- tomwer/gui/reconstruction/darkref/darkrefwidget.py +2 -1
- tomwer/gui/reconstruction/nabu/castvolume.py +14 -3
- 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/nabuconfig.py +2 -1
- tomwer/gui/reconstruction/nabu/nabuconfig/output.py +126 -35
- tomwer/gui/reconstruction/nabu/nabuconfig/phase.py +39 -32
- tomwer/gui/reconstruction/nabu/nabuconfig/preprocessing.py +222 -31
- tomwer/gui/reconstruction/nabu/nabuconfig/reconstruction.py +57 -27
- tomwer/gui/reconstruction/nabu/nabuflow.py +12 -20
- tomwer/gui/reconstruction/nabu/slices.py +10 -11
- tomwer/gui/reconstruction/nabu/volume.py +22 -10
- tomwer/gui/reconstruction/normalization/intensity.py +18 -48
- tomwer/gui/reconstruction/saaxis/corrangeselector.py +8 -24
- tomwer/gui/reconstruction/saaxis/dimensionwidget.py +1 -1
- tomwer/gui/reconstruction/saaxis/saaxis.py +9 -21
- tomwer/gui/reconstruction/sadeltabeta/saadeltabeta.py +45 -12
- tomwer/gui/reconstruction/scores/control.py +2 -9
- tomwer/gui/reconstruction/scores/scoreplot.py +13 -11
- tomwer/gui/reconstruction/test/test_axis.py +41 -16
- tomwer/gui/reconstruction/test/test_nabu.py +31 -9
- tomwer/gui/reconstruction/test/test_saaxis.py +3 -3
- tomwer/gui/reconstruction/test/test_sadeltabeta.py +12 -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 +267 -45
- tomwer/gui/stitching/stitching_preview.py +62 -55
- tomwer/gui/stitching/stitching_raw.py +13 -12
- tomwer/gui/stitching/z_stitching/fineestimation.py +0 -60
- tomwer/gui/utils/buttons.py +112 -29
- tomwer/gui/utils/inputwidget.py +43 -25
- tomwer/gui/utils/lineselector/lineselector.py +1 -1
- 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 +48 -35
- 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 +20 -36
- 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 +65 -67
- tomwer/gui/visualization/volumeviewer.py +114 -113
- tomwer/io/utils/h5pyutils.py +3 -3
- tomwer/io/utils/raw_and_processed_data.py +84 -0
- tomwer/io/utils/tomoobj.py +4 -6
- tomwer/io/utils/utils.py +7 -7
- tomwer/resources/gui/icons/parameters.svg +1 -1
- 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/resources/gui/illustrations/no_rot.svg +1 -1
- tomwer/synctools/stacks/edit/darkflatpatch.py +19 -14
- tomwer/synctools/stacks/edit/imagekeyeditor.py +2 -2
- tomwer/synctools/stacks/reconstruction/axis.py +4 -4
- tomwer/synctools/stacks/reconstruction/castvolume.py +22 -7
- tomwer/synctools/stacks/reconstruction/dkrefcopy.py +25 -20
- 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 +91 -41
- tomwer/tests/utils.py +5 -0
- tomwer/third_part/WaitingOverlay.py +110 -0
- tomwer/third_part/__init__.py +0 -0
- tomwer/version.py +2 -2
- tomwer-1.3.12-py3.11-nspkg.pth +1 -0
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/METADATA +73 -58
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/RECORD +287 -286
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.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 -760
- tomwer/gui/reconstruction/test/test_lamino.py +0 -189
- tomwer/resources/gui/icons/esrf_1.svg +0 -307
- tomwer/resources/gui/icons/lamino_parameters.svg +0 -70
- tomwer/resources/gui/icons/triangle.svg +0 -80
- 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/synctools/test/test_scanstages.py +0 -162
- tomwer/tests/utils/__init__.py +0 -247
- tomwer/tests/utils/utilstest.py +0 -220
- tomwer-1.2.1-py3.11-nspkg.pth +0 -1
- /tomwer/core/process/control/{email.py → emailnotifier.py} +0 -0
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/LICENSE +0 -0
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/entry_points.txt +0 -0
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/namespace_packages.txt +0 -0
- {tomwer-1.2.1.dist-info → tomwer-1.3.12.dist-info}/top_level.txt +0 -0
@@ -29,13 +29,13 @@ __date__ = "02/12/2021"
|
|
29
29
|
|
30
30
|
|
31
31
|
from silx.gui import qt
|
32
|
-
from
|
32
|
+
from nxtomo.nxobject.nxdetector import ImageKey
|
33
33
|
|
34
|
-
from tomwer.core.scan.
|
34
|
+
from tomwer.core.scan.nxtomoscan import NXtomoScan
|
35
35
|
from tomwer.core.utils.nxtomoutils import get_n_series
|
36
36
|
|
37
37
|
|
38
|
-
def check_dark_series(scan:
|
38
|
+
def check_dark_series(scan: NXtomoScan, logger=None, user_input: bool = True) -> bool:
|
39
39
|
"""
|
40
40
|
check:
|
41
41
|
- if scan has computed_dark attached. If there is more than one then ask confirmation to the user to process the dataset
|
@@ -43,15 +43,15 @@ def check_dark_series(scan: HDF5TomoScan, logger=None, user_input: bool = True)
|
|
43
43
|
|
44
44
|
ask confirmation for processing is done by a pop up dialog.
|
45
45
|
|
46
|
-
:param
|
46
|
+
:param NXtomoScan scan: scan to check
|
47
47
|
:param bool user_input: if True and if n series of flat is invalid then ask the user to confirm the processing. Else print a warning and refuse processing
|
48
48
|
|
49
49
|
:return: True if processing can be done else False
|
50
50
|
:note: user can 'force' the processing to be done
|
51
51
|
"""
|
52
|
-
if not isinstance(scan,
|
52
|
+
if not isinstance(scan, NXtomoScan):
|
53
53
|
raise TypeError(
|
54
|
-
f"scan is expected to be an instance of {
|
54
|
+
f"scan is expected to be an instance of {NXtomoScan} not a {type(scan)}"
|
55
55
|
)
|
56
56
|
try:
|
57
57
|
image_keys = scan.image_keys
|
@@ -82,13 +82,13 @@ def check_dark_series(scan: HDF5TomoScan, logger=None, user_input: bool = True)
|
|
82
82
|
return True
|
83
83
|
|
84
84
|
|
85
|
-
def check_flat_series(scan:
|
85
|
+
def check_flat_series(scan: NXtomoScan, logger, user_input: bool = True) -> bool:
|
86
86
|
"""
|
87
87
|
Insure the scan contains at least one serie of flat. Otherwise warn the user nabu will not be able to process
|
88
88
|
"""
|
89
|
-
if not isinstance(scan,
|
89
|
+
if not isinstance(scan, NXtomoScan):
|
90
90
|
raise TypeError(
|
91
|
-
f"scan is expected to be an instance of {
|
91
|
+
f"scan is expected to be an instance of {NXtomoScan} not a {type(scan)}"
|
92
92
|
)
|
93
93
|
try:
|
94
94
|
image_keys = scan.image_keys
|
@@ -22,17 +22,28 @@ class HelicalPrepareWeightsDouble(qt.QWidget):
|
|
22
22
|
)
|
23
23
|
self.layout().addWidget(self._outputFilePathQLE, 0, 2, 1, 1)
|
24
24
|
|
25
|
-
#
|
26
|
-
self.
|
27
|
-
self.layout().addWidget(self.
|
28
|
-
self.
|
29
|
-
self.
|
30
|
-
self.
|
31
|
-
self.
|
25
|
+
# transition_width_vertical
|
26
|
+
self._verticalTransitionWidthQDSP = qt.QLabel("transition width", self)
|
27
|
+
self.layout().addWidget(self._verticalTransitionWidthQDSP, 1, 0, 1, 1)
|
28
|
+
self._verticalTransitionWidthQDSP = qt.QDoubleSpinBox(self)
|
29
|
+
self._verticalTransitionWidthQDSP.setRange(0.0, 99999999)
|
30
|
+
self._verticalTransitionWidthQDSP.setValue(50.0)
|
31
|
+
self._verticalTransitionWidthQDSP.setToolTip(
|
32
32
|
"the transition width is used to determine how the weights are apodised near the upper and lower border"
|
33
33
|
)
|
34
34
|
# TODO: improve tooltip of this
|
35
|
-
self.layout().addWidget(self.
|
35
|
+
self.layout().addWidget(self._verticalTransitionWidthQDSP, 1, 1, 1, 2)
|
36
|
+
|
37
|
+
# transition_width_vertical
|
38
|
+
self._horizontalTransitionWidthQDSP = qt.QLabel("transition width", self)
|
39
|
+
self.layout().addWidget(self._horizontalTransitionWidthQDSP, 1, 0, 1, 1)
|
40
|
+
self._horizontalTransitionWidthQDSP = qt.QDoubleSpinBox(self)
|
41
|
+
self._horizontalTransitionWidthQDSP.setRange(0.0, 99999999)
|
42
|
+
self._horizontalTransitionWidthQDSP.setValue(50.0)
|
43
|
+
self._horizontalTransitionWidthQDSP.setToolTip(
|
44
|
+
"the transition width is used to determine how the weights are apodised near the upper and lower border"
|
45
|
+
)
|
46
|
+
self.layout().addWidget(self._horizontalTransitionWidthQDSP, 1, 1, 1, 2)
|
36
47
|
|
37
48
|
spacer = qt.QWidget(parent=self)
|
38
49
|
spacer.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding)
|
@@ -40,7 +51,8 @@ class HelicalPrepareWeightsDouble(qt.QWidget):
|
|
40
51
|
|
41
52
|
# connect signal / slot
|
42
53
|
self._outputFilePathQLE.editingFinished.connect(self._changed)
|
43
|
-
self.
|
54
|
+
self._verticalTransitionWidthQDSP.valueChanged.connect(self._changed)
|
55
|
+
self._horizontalTransitionWidthQDSP.valueChanged.connect(self._changed)
|
44
56
|
|
45
57
|
def _changed(self, *args, **kwargs):
|
46
58
|
self.sigConfigChanged.emit()
|
@@ -48,7 +60,8 @@ class HelicalPrepareWeightsDouble(qt.QWidget):
|
|
48
60
|
def getConfiguration(self) -> dict:
|
49
61
|
return {
|
50
62
|
"processes_file": self._outputFilePathQLE.text(),
|
51
|
-
"
|
63
|
+
"transition_width_vertical": self._verticalTransitionWidthQDSP.value(),
|
64
|
+
"transition_width_horizontal": self._horizontalTransitionWidthQDSP.value(),
|
52
65
|
}
|
53
66
|
|
54
67
|
def setConfiguration(self, config: dict):
|
@@ -56,6 +69,10 @@ class HelicalPrepareWeightsDouble(qt.QWidget):
|
|
56
69
|
if processes_file is not None:
|
57
70
|
self._outputFilePathQLE.setText(processes_file)
|
58
71
|
|
59
|
-
transition_width = config.get("
|
72
|
+
transition_width = config.get("transition_width_vertical", None)
|
73
|
+
if transition_width is not None:
|
74
|
+
self._verticalTransitionWidthQDSP.setValue(float(transition_width))
|
75
|
+
|
76
|
+
transition_width = config.get("transition_width_horizontal", None)
|
60
77
|
if transition_width is not None:
|
61
|
-
self.
|
78
|
+
self._horizontalTransitionWidthQDSP.setValue(float(transition_width))
|
@@ -30,10 +30,8 @@ __date__ = "11/02/2020"
|
|
30
30
|
|
31
31
|
from typing import Union
|
32
32
|
|
33
|
-
from tomwer.core.process.reconstruction.nabu.utils import
|
34
|
-
|
35
|
-
_NabuStages,
|
36
|
-
)
|
33
|
+
from tomwer.core.process.reconstruction.nabu.utils import _NabuStages
|
34
|
+
from tomwer.gui.configuration.level import ConfigurationLevel
|
37
35
|
|
38
36
|
|
39
37
|
class _FilteringObject:
|
@@ -156,7 +156,8 @@ class NabuConfiguration(qt.QWidget):
|
|
156
156
|
self._preProcessingWidget.setConfiguration(config["preproc"])
|
157
157
|
if "phase" in config:
|
158
158
|
self._phaseWidget.setConfiguration(config["phase"])
|
159
|
-
|
159
|
+
paganin = config["phase"].get("method", "")
|
160
|
+
if paganin == "":
|
160
161
|
self._phaseGB.setChecked(False)
|
161
162
|
else:
|
162
163
|
self._phaseGB.setChecked(True)
|
@@ -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
|
@@ -51,10 +52,25 @@ _logger = logging.getLogger(__name__)
|
|
51
52
|
|
52
53
|
|
53
54
|
class QNabuFileFormatComboBox(qt.QComboBox):
|
54
|
-
def __init__(
|
55
|
+
def __init__(
|
56
|
+
self, parent: typing.Optional[qt.QWidget] = ..., filter_formats=tuple()
|
57
|
+
) -> None:
|
58
|
+
"""
|
59
|
+
:param filter_format: if provided the given file format won't have an item on the ComboBox
|
60
|
+
"""
|
55
61
|
super().__init__(parent=parent)
|
62
|
+
if not isinstance(filter_formats, tuple):
|
63
|
+
raise TypeError(
|
64
|
+
f"filter_format should be a tuple. Get {type(filter_formats)} instead"
|
65
|
+
)
|
66
|
+
filter_formats = [
|
67
|
+
NabuOutputFileFormat.from_value(file_format)
|
68
|
+
for file_format in filter_formats
|
69
|
+
]
|
56
70
|
|
57
71
|
for ff in NabuOutputFileFormat:
|
72
|
+
if ff in filter_formats:
|
73
|
+
continue
|
58
74
|
if ff is NabuOutputFileFormat.JP2K:
|
59
75
|
if not has_glymur:
|
60
76
|
_logger.warning(
|
@@ -79,51 +95,110 @@ class QNabuFileFormatComboBoxIgnoreWheel(QNabuFileFormatComboBox):
|
|
79
95
|
pass
|
80
96
|
|
81
97
|
|
82
|
-
class NabuOutputLocationWidget(qt.
|
98
|
+
class NabuOutputLocationWidget(qt.QGroupBox):
|
99
|
+
sigOutputChanged = qt.Signal()
|
100
|
+
"""Emit when location changed"""
|
101
|
+
|
83
102
|
def __init__(self, *args, **kwargs) -> None:
|
84
|
-
super().__init__(*args, **kwargs)
|
85
|
-
self.setLayout(qt.
|
103
|
+
super().__init__(title="output folder", *args, **kwargs)
|
104
|
+
self.setLayout(qt.QGridLayout())
|
86
105
|
|
87
|
-
self._outputLabel = qt.QLabel("output:", self)
|
88
106
|
self.layout().setContentsMargins(0, 0, 0, 0)
|
89
107
|
self.layout().setSpacing(0)
|
90
|
-
self.layout().addWidget(self._outputLabel)
|
91
108
|
|
92
|
-
|
93
|
-
self.
|
94
|
-
|
109
|
+
# in scan folder
|
110
|
+
self._inScanFolderRB = qt.QRadioButton(
|
111
|
+
ProcessDataOutputDirMode.IN_SCAN_FOLDER.value, self
|
112
|
+
)
|
113
|
+
self._inScanFolderRB.setToolTip(
|
114
|
+
"Reconstruction will be saved at the same level as the acquisition folder. (near the NXtomo file (.nx) or under the spec acquisition folder)"
|
115
|
+
)
|
116
|
+
self.layout().addWidget(self._inScanFolderRB, 1, 0, 1, 1)
|
117
|
+
# in processed data dir
|
118
|
+
self._processedDataDirRB = qt.QRadioButton(
|
119
|
+
ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER.value, self
|
95
120
|
)
|
96
|
-
self.
|
121
|
+
self._inScanFolderRB.setToolTip(
|
122
|
+
"Reconstruction will be saved under the PROCESSED_DATA/dataset folder. if exists else under the scan folder."
|
123
|
+
)
|
124
|
+
self.layout().addWidget(self._processedDataDirRB, 2, 0, 1, 1)
|
125
|
+
# raw data dir
|
126
|
+
self._rawDataDirRB = qt.QRadioButton(
|
127
|
+
ProcessDataOutputDirMode.RAW_DATA_FOLDER.value, self
|
128
|
+
)
|
129
|
+
self._rawDataDirRB.setToolTip(
|
130
|
+
"Reconstruction will be saved under the RAW_DATA/dataset folder. if exists else under the scan folder."
|
131
|
+
)
|
132
|
+
self.layout().addWidget(self._rawDataDirRB, 3, 0, 1, 1)
|
133
|
+
# other dir
|
134
|
+
self._otherDirRB = qt.QRadioButton(ProcessDataOutputDirMode.OTHER.value, self)
|
135
|
+
self._otherDirRB.setToolTip(
|
136
|
+
"Reconstruction will be saved under user provided folder."
|
137
|
+
)
|
138
|
+
self.layout().addWidget(self._otherDirRB, 4, 0, 1, 1)
|
97
139
|
self._outputDirQLE = QLFileSystem(
|
98
140
|
"", self, filters=qt.QDir.NoDotAndDotDot | qt.QDir.Dirs
|
99
141
|
)
|
100
|
-
self.layout().addWidget(self._outputDirQLE)
|
142
|
+
self.layout().addWidget(self._outputDirQLE, 4, 1, 1, 1)
|
101
143
|
style = qt.QApplication.style()
|
102
144
|
icon_opendir = style.standardIcon(qt.QStyle.SP_DirOpenIcon)
|
103
145
|
self._selectOutputPB = qt.QPushButton(icon_opendir, "", self)
|
104
146
|
self._selectOutputPB.setIcon(icon_opendir)
|
105
|
-
general_tooltip =
|
106
|
-
|
107
|
-
|
108
|
-
|
147
|
+
general_tooltip = (
|
148
|
+
"You can enter a string with some keywords like {my_keyword}. Those will be interpreted during runtime according to scan metadata. Possible keywords are:"
|
149
|
+
+ "\n - 'scan_dir_name': returns name of the directory containing the acquisition (! not a path !)"
|
150
|
+
+ "\n - 'scan_basename': returns basename of the directory containing the acquisition"
|
151
|
+
+ "\n - 'scan_parent_dir_basename': returns basename of the PARENT directory containing the acquisition"
|
152
|
+
)
|
109
153
|
|
110
154
|
self._selectOutputPB.setToolTip(general_tooltip)
|
111
155
|
self._outputDirQLE.setToolTip(general_tooltip)
|
112
|
-
self.layout().addWidget(self._selectOutputPB)
|
156
|
+
self.layout().addWidget(self._selectOutputPB, 4, 2, 1, 1)
|
157
|
+
|
158
|
+
# set up:
|
159
|
+
self._inScanFolderRB.setChecked(True)
|
113
160
|
|
114
161
|
# connect signal / slot
|
115
|
-
self.
|
162
|
+
self._inScanFolderRB.toggled.connect(self._outputModeChanged)
|
163
|
+
self._processedDataDirRB.toggled.connect(self._outputModeChanged)
|
164
|
+
self._rawDataDirRB.toggled.connect(self._outputModeChanged)
|
165
|
+
self._otherDirRB.toggled.connect(self._outputModeChanged)
|
116
166
|
self._selectOutputPB.released.connect(self._selectOutput)
|
117
|
-
self.
|
118
|
-
self.
|
119
|
-
|
120
|
-
def
|
121
|
-
self.
|
122
|
-
|
167
|
+
self._inScanFolderRB.setChecked(True)
|
168
|
+
self._outputModeChanged()
|
169
|
+
|
170
|
+
def getOutputDirMode(self) -> ProcessDataOutputDirMode:
|
171
|
+
if self._inScanFolderRB.isChecked():
|
172
|
+
return ProcessDataOutputDirMode.IN_SCAN_FOLDER
|
173
|
+
elif self._processedDataDirRB.isChecked():
|
174
|
+
return ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER
|
175
|
+
elif self._rawDataDirRB.isChecked():
|
176
|
+
return ProcessDataOutputDirMode.RAW_DATA_FOLDER
|
177
|
+
elif self._otherDirRB.isChecked():
|
178
|
+
return ProcessDataOutputDirMode.OTHER
|
179
|
+
|
180
|
+
def setOutputDirMode(
|
181
|
+
self, mode: typing.Union[ProcessDataOutputDirMode, str]
|
182
|
+
) -> None:
|
183
|
+
mode = ProcessDataOutputDirMode.from_value(mode)
|
184
|
+
if mode is ProcessDataOutputDirMode.IN_SCAN_FOLDER:
|
185
|
+
self._inScanFolderRB.setChecked(True)
|
186
|
+
elif mode is ProcessDataOutputDirMode.PROCESSED_DATA_FOLDER:
|
187
|
+
self._processedDataDirRB.setChecked(True)
|
188
|
+
elif mode is ProcessDataOutputDirMode.RAW_DATA_FOLDER:
|
189
|
+
self._rawDataDirRB.setChecked(True)
|
190
|
+
elif mode is ProcessDataOutputDirMode.OTHER:
|
191
|
+
self._otherDirRB.setChecked(True)
|
192
|
+
|
193
|
+
def _outputModeChanged(self, *args, **kwargs):
|
194
|
+
outputMode = self.getOutputDirMode()
|
195
|
+
self._outputDirQLE.setVisible(outputMode is ProcessDataOutputDirMode.OTHER)
|
196
|
+
self._selectOutputPB.setVisible(outputMode is ProcessDataOutputDirMode.OTHER)
|
197
|
+
self.sigOutputChanged.emit()
|
123
198
|
|
124
199
|
def _selectOutput(self): # pragma: no cover
|
125
200
|
defaultDirectory = self._outputDirQLE.text()
|
126
|
-
if os.path.isdir(defaultDirectory):
|
201
|
+
if not os.path.isdir(defaultDirectory):
|
127
202
|
defaultDirectory = get_default_directory()
|
128
203
|
|
129
204
|
dialog = qt.QFileDialog(self, directory=defaultDirectory)
|
@@ -134,7 +209,6 @@ class NabuOutputLocationWidget(qt.QWidget):
|
|
134
209
|
return
|
135
210
|
|
136
211
|
self._outputDirQLE.setText(dialog.selectedFiles()[0])
|
137
|
-
self._outputDirChanged()
|
138
212
|
|
139
213
|
def getOutputDir(self):
|
140
214
|
"""
|
@@ -142,16 +216,15 @@ class NabuOutputLocationWidget(qt.QWidget):
|
|
142
216
|
:return: None if the default output directory is selected else
|
143
217
|
return path to the directory
|
144
218
|
"""
|
145
|
-
if self.
|
146
|
-
return None
|
147
|
-
else:
|
219
|
+
if self._otherDirRB.isChecked():
|
148
220
|
return self._outputDirQLE.text()
|
221
|
+
else:
|
222
|
+
return None
|
149
223
|
|
150
224
|
def setOutputDir(self, output_dir):
|
151
225
|
if output_dir in (None, ""):
|
152
|
-
|
226
|
+
pass
|
153
227
|
else:
|
154
|
-
self._defaultOutput.setChecked(False)
|
155
228
|
self._outputDirQLE.setText(output_dir)
|
156
229
|
|
157
230
|
|
@@ -171,7 +244,7 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
|
|
171
244
|
self.setLayout(qt.QGridLayout())
|
172
245
|
|
173
246
|
# output dir
|
174
|
-
self._output_dir_widget = NabuOutputLocationWidget(self)
|
247
|
+
self._output_dir_widget = NabuOutputLocationWidget(parent=self)
|
175
248
|
self.layout().addWidget(self._output_dir_widget, 0, 0, 1, 4)
|
176
249
|
self.registerWidget(self._output_dir_widget, "advanced")
|
177
250
|
|
@@ -208,7 +281,7 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
|
|
208
281
|
self._output_dir_widget._outputDirQLE.editingFinished.connect(
|
209
282
|
self._outputDirChanged
|
210
283
|
)
|
211
|
-
self._output_dir_widget.
|
284
|
+
self._output_dir_widget.sigOutputChanged.connect(self._outputDirChanged)
|
212
285
|
self._fileFormatCB.currentTextChanged.connect(self._fileFormatChanged)
|
213
286
|
self._framePerGroup.valueChanged.connect(self._framePerGroupChanged)
|
214
287
|
|
@@ -227,6 +300,12 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
|
|
227
300
|
def setOutputDir(self, dir):
|
228
301
|
return self._output_dir_widget.setOutputDir(dir)
|
229
302
|
|
303
|
+
def getOutputdirMode(self):
|
304
|
+
return self._output_dir_widget.getOutputDirMode()
|
305
|
+
|
306
|
+
def setOutputdirMode(self, mode):
|
307
|
+
return self._output_dir_widget.setOutputDirMode(mode=mode)
|
308
|
+
|
230
309
|
def getFileFormat(self) -> NabuOutputFileFormat:
|
231
310
|
return NabuOutputFileFormat.from_value(self._fileFormatCB.currentText())
|
232
311
|
|
@@ -245,13 +324,25 @@ class _NabuOutputConfig(_NabuStageConfigBase, qt.QWidget):
|
|
245
324
|
return {
|
246
325
|
"file_format": self.getFileFormat().value,
|
247
326
|
"location": self.getOutputDir() or "",
|
327
|
+
"output_dir_mode": self.getOutputdirMode().value,
|
248
328
|
# 'frames_per_group': self.getFramePerGroup(),
|
249
329
|
}
|
250
330
|
|
251
331
|
def setConfiguration(self, config):
|
252
332
|
if "file_format" in config:
|
253
333
|
self.setFileformat(config["file_format"])
|
254
|
-
|
255
|
-
|
334
|
+
location = config.get("location", None)
|
335
|
+
if location == "":
|
336
|
+
location = None
|
337
|
+
if location is not None:
|
338
|
+
self.setOutputDir(location)
|
256
339
|
if "frames_per_group" in config:
|
257
340
|
self.setFramePerGroup(int(config["frames_per_group"]))
|
341
|
+
|
342
|
+
# definition of default_output_dir_mode ensure backward compatibility
|
343
|
+
default_output_dir_mode = (
|
344
|
+
None if location is None else ProcessDataOutputDirMode.OTHER
|
345
|
+
)
|
346
|
+
output_dir_mode = config.get("output_dir_mode", default_output_dir_mode)
|
347
|
+
if output_dir_mode is not None:
|
348
|
+
self.setOutputdirMode(output_dir_mode)
|
@@ -53,10 +53,6 @@ class PaddingMode(_Enum):
|
|
53
53
|
REFLECT = "reflect"
|
54
54
|
|
55
55
|
|
56
|
-
# assert set(PaddingMode.values()) == set(PaganinPhaseRetrieval.available_padding_modes)
|
57
|
-
#
|
58
|
-
|
59
|
-
|
60
56
|
class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
|
61
57
|
"""
|
62
58
|
Widget to define the configuration of the nabu preprocessing
|
@@ -111,9 +107,9 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
111
107
|
|
112
108
|
# connect signal / slot
|
113
109
|
self._methodCB.currentIndexChanged.connect(self._methodChanged)
|
114
|
-
self._paganinOpts.sigConfChanged.connect(self.
|
115
|
-
self._unsharpOpts.sigConfChanged.connect(self.
|
116
|
-
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)
|
117
113
|
|
118
114
|
# set up
|
119
115
|
self._paganinOpts.setEnabled(self.getMethod() is not _NabuPhaseMethod.NONE)
|
@@ -122,7 +118,7 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
122
118
|
def _methodChanged(self, *args, **kwargs):
|
123
119
|
self._paganinOpts.setEnabled(self.getMethod() is not _NabuPhaseMethod.NONE)
|
124
120
|
self._ctfOpts.setEnabled(self.getMethod() is _NabuPhaseMethod.CTF)
|
125
|
-
self.
|
121
|
+
self.sigConfChanged.emit("method")
|
126
122
|
|
127
123
|
def _signalConfChanged(self, param):
|
128
124
|
self.sigConfChanged.emit(param)
|
@@ -163,6 +159,24 @@ class _NabuPhaseConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
163
159
|
def setDeltaBetaValue(self, value):
|
164
160
|
self._paganinOpts.setDeltaBetaValue(value)
|
165
161
|
|
162
|
+
def getUnsharpCoeff(self) -> float:
|
163
|
+
return self._unsharpOpts.getUnsharpCoeff()
|
164
|
+
|
165
|
+
def setUnsharpCoeff(self, coeff: float):
|
166
|
+
self._unsharpOpts.setUnsharpCoeff(coeff)
|
167
|
+
|
168
|
+
def getUnsharpSigma(self) -> float:
|
169
|
+
return self._unsharpOpts.getUnsharpSigma()
|
170
|
+
|
171
|
+
def setUnsharpSigma(self, sigma: float):
|
172
|
+
self._unsharpOpts.setUnsharpSigma(sigma)
|
173
|
+
|
174
|
+
def getPaddingType(self):
|
175
|
+
return self._paganinOpts.getPaddingType()
|
176
|
+
|
177
|
+
def setPaddingType(self, padding_type):
|
178
|
+
return self._paganinOpts.setPaddingType(padding_type)
|
179
|
+
|
166
180
|
|
167
181
|
class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
|
168
182
|
"""Configuration widget dedicated to the paganin options for nabu"""
|
@@ -202,33 +216,30 @@ class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
202
216
|
self.registerWidget(self._paddingTypeCB, "advanced")
|
203
217
|
|
204
218
|
# set up
|
205
|
-
# note: hide for now margin as it is not connected at nabu side
|
206
|
-
# self._margeQSB.setValue(50)
|
207
219
|
item_index = self._paddingTypeCB.findText(PaddingMode.EDGE.value)
|
208
220
|
self._paddingTypeCB.setCurrentIndex(item_index)
|
209
221
|
|
210
222
|
# connect signal - slot
|
211
223
|
self._deltaBetaQLE.editingFinished.connect(self._paganinDBChanged)
|
212
|
-
# note: hide for now margin as it is not connected at nabu side
|
213
|
-
# self._margeQSB.editingFinished.connect(self._paganinMargeChanged)
|
214
224
|
self._paddingTypeCB.currentIndexChanged.connect(self._paganinPaddingTypeChanged)
|
215
225
|
|
216
226
|
def _paganinDBChanged(self, *args, **kwargs):
|
217
|
-
self.
|
227
|
+
self.sigConfChanged.emit("delta_beta")
|
218
228
|
|
219
229
|
def _paganinMargeChanged(self, *args, **kwargs):
|
220
|
-
self.
|
230
|
+
self.sigConfChanged.emit("marge")
|
221
231
|
|
222
232
|
def _paganinPaddingTypeChanged(self, *args, **kwargs):
|
223
|
-
self.
|
233
|
+
self.sigConfChanged.emit("padding_type")
|
224
234
|
|
225
235
|
def getPaddingType(self) -> PaddingMode:
|
226
236
|
current_text = self._paddingTypeCB.currentText()
|
227
237
|
return PaddingMode.from_value(current_text)
|
228
238
|
|
229
|
-
|
230
|
-
|
231
|
-
|
239
|
+
def setPaddingType(self, padding_type):
|
240
|
+
padding_type = PaddingMode.from_value(padding_type)
|
241
|
+
item_index = self._paddingTypeCB.findText(padding_type.value)
|
242
|
+
self._paddingTypeCB.setCurrentIndex(item_index)
|
232
243
|
|
233
244
|
def getDeltaBeta(self) -> str:
|
234
245
|
return self._deltaBetaQLE.text()
|
@@ -239,22 +250,18 @@ class NabuPaganinConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
239
250
|
def getConfiguration(self):
|
240
251
|
return {
|
241
252
|
"delta_beta": self.getDeltaBeta(), # this one is not cast because can contain several values
|
242
|
-
# "margin": self.getMarge(),
|
243
253
|
"padding_type": self.getPaddingType().value,
|
244
254
|
}
|
245
255
|
|
246
256
|
def setConfiguration(self, conf):
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
self.
|
255
|
-
|
256
|
-
def _signalConfChanged(self, param):
|
257
|
-
self.sigConfChanged.emit(param)
|
257
|
+
# delta_beta
|
258
|
+
delta_beta = conf.get("delta_beta", None)
|
259
|
+
if delta_beta is not None:
|
260
|
+
self._deltaBetaQLE.setText(str(delta_beta))
|
261
|
+
# padding_type
|
262
|
+
padding_type = conf.get("padding_type", None)
|
263
|
+
if padding_type is not None:
|
264
|
+
self.setPaddingType(padding_type)
|
258
265
|
|
259
266
|
|
260
267
|
class NabuUnsharpConfig(qt.QWidget, base._NabuStageConfigBase):
|
@@ -321,10 +328,10 @@ class NabuUnsharpConfig(qt.QWidget, base._NabuStageConfigBase):
|
|
321
328
|
self._unsharpSigmaQLE.editingFinished.connect(self._unsharpSigmaChanged)
|
322
329
|
|
323
330
|
def _unsharpCoeffChanged(self, *args, **kwargs):
|
324
|
-
self.
|
331
|
+
self.sigConfChanged.emit("unsharp_coeff")
|
325
332
|
|
326
333
|
def _unsharpSigmaChanged(self, *args, **kwargs):
|
327
|
-
self.
|
334
|
+
self.sigConfChanged.emit("unsharp_sigma")
|
328
335
|
|
329
336
|
def isUnsharpCoeffActive(self):
|
330
337
|
return self._unsharpCoeffCB.isChecked()
|