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
tomwer/gui/imagefromfile.py
CHANGED
@@ -34,7 +34,7 @@ import logging
|
|
34
34
|
|
35
35
|
from silx.gui import qt
|
36
36
|
from silx.io.url import DataUrl
|
37
|
-
from
|
37
|
+
from silx.io.utils import open as open_hdf5
|
38
38
|
|
39
39
|
from tomwer.core.scan.scanbase import TomwerScanBase
|
40
40
|
from tomwer.synctools.imageloaderthread import ImageLoaderThread
|
@@ -71,7 +71,7 @@ class ImageFromFile(_Image):
|
|
71
71
|
|
72
72
|
def get_nabu_entry():
|
73
73
|
try:
|
74
|
-
with
|
74
|
+
with open_hdf5(_file) as h5s:
|
75
75
|
for node in h5s:
|
76
76
|
if "reconstruction" in h5s[node]:
|
77
77
|
return "/".join(
|
tomwer/gui/qfolderdialog.py
CHANGED
@@ -78,6 +78,11 @@ class QDataDialog(qt.QFileDialog):
|
|
78
78
|
os.environ["TOMWER_DEFAULT_INPUT_DIR"]
|
79
79
|
):
|
80
80
|
self.setDirectory(os.environ["TOMWER_DEFAULT_INPUT_DIR"])
|
81
|
+
elif self.directory() != os.getcwd() or str(self.directory()).startswith(
|
82
|
+
"/data"
|
83
|
+
):
|
84
|
+
# if the directory as already been set by the user. Avoid redefining it
|
85
|
+
pass
|
81
86
|
elif os.path.isdir("/data"):
|
82
87
|
self.setDirectory("/data")
|
83
88
|
|
@@ -279,6 +284,8 @@ class QVolumeDialog(qt.QDialog):
|
|
279
284
|
|
280
285
|
def _selectFileOrFolder(self):
|
281
286
|
dialog = QDataDialog(self, multiSelection=True)
|
287
|
+
# AnyFile because for HDF5 a file is expected, for .edf... a folder is expected
|
288
|
+
dialog.setFileMode(qt.QFileDialog.AnyFile)
|
282
289
|
dialog.setNameFilters(
|
283
290
|
[
|
284
291
|
"Any files (*)",
|
@@ -291,7 +298,19 @@ class QVolumeDialog(qt.QDialog):
|
|
291
298
|
if dialog.exec_() == qt.QDialog.Accepted:
|
292
299
|
selected_files = dialog.selectedFiles()
|
293
300
|
if len(selected_files) > 0:
|
294
|
-
|
301
|
+
file_or_folder = selected_files[0]
|
302
|
+
# in case the user provided a .edf, .tiff... file try to make is life simpler.
|
303
|
+
if file_or_folder.endswith(
|
304
|
+
(
|
305
|
+
f".{EDFVolume.DEFAULT_DATA_EXTENSION}",
|
306
|
+
f".{TIFFVolume.DEFAULT_DATA_EXTENSION}",
|
307
|
+
f".{JP2KVolume.DEFAULT_DATA_EXTENSION}",
|
308
|
+
f".{JP2KVolume.DEFAULT_DATA_EXTENSION}",
|
309
|
+
)
|
310
|
+
):
|
311
|
+
file_or_folder = os.path.dirname(file_or_folder)
|
312
|
+
|
313
|
+
self.setFilePath(file_or_folder)
|
295
314
|
|
296
315
|
def _selectDataPath(self):
|
297
316
|
self._guessDataPathAuto.setChecked(False)
|
@@ -525,6 +544,10 @@ class QVolumeDialog(qt.QDialog):
|
|
525
544
|
constructor = TIFFVolume
|
526
545
|
elif file_extension in self._JP2K_EXTENSIONS:
|
527
546
|
constructor = JP2KVolume
|
547
|
+
else:
|
548
|
+
raise NotImplementedError(
|
549
|
+
f"unhandled file extension ({file_extension})"
|
550
|
+
)
|
528
551
|
volume = constructor(
|
529
552
|
folder=file_path,
|
530
553
|
volume_basename=None if basename in ("", None) else basename,
|
@@ -33,75 +33,24 @@ import weakref
|
|
33
33
|
import numpy
|
34
34
|
from silx.gui import icons as silx_icons
|
35
35
|
from silx.gui import qt
|
36
|
-
from silx.gui.plot import
|
36
|
+
from silx.gui.plot.CompareImages import (
|
37
|
+
CompareImages as _CompareImages,
|
38
|
+
VisualizationMode,
|
39
|
+
)
|
40
|
+
|
41
|
+
from silx.gui.plot.tools.compare.toolbar import VisualizationModeToolButton
|
37
42
|
from silx.gui.plot import tools
|
38
43
|
|
39
|
-
from tomwer.gui import icons as tomwer_icons
|
40
44
|
|
41
45
|
_logger = logging.getLogger(__name__)
|
42
46
|
|
43
47
|
|
44
|
-
class
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
Use :meth:`setCompareWidget` to connect this toolbar to a specific
|
49
|
-
:class:`CompareImages` widget.
|
50
|
-
|
51
|
-
:param Union[qt.QWidget,None] parent: Parent of this widget.
|
52
|
-
"""
|
53
|
-
|
54
|
-
def __init__(self, parent=None):
|
55
|
-
qt.QToolBar.__init__(self, parent)
|
56
|
-
|
57
|
-
self.__compareWidget = None
|
58
|
-
|
59
|
-
menu = qt.QMenu(self)
|
60
|
-
self.__visualizationAction = qt.QAction(self)
|
61
|
-
self.__visualizationAction.setMenu(menu)
|
62
|
-
self.__visualizationAction.setCheckable(False)
|
63
|
-
self.addAction(self.__visualizationAction)
|
64
|
-
self.__visualizationGroup = qt.QActionGroup(self)
|
65
|
-
self.__visualizationGroup.setExclusive(True)
|
66
|
-
self.__visualizationGroup.triggered.connect(self.__visualizationModeChanged)
|
67
|
-
|
68
|
-
icon = silx_icons.getQIcon("compare-mode-a")
|
69
|
-
action = qt.QAction(icon, "Display frame 1", self)
|
70
|
-
action.setIconVisibleInMenu(True)
|
71
|
-
action.setCheckable(True)
|
72
|
-
action.setShortcut(qt.QKeySequence(qt.Qt.Key_A))
|
73
|
-
action.setProperty("mode", CompareImages.VisualizationMode.ONLY_A)
|
74
|
-
menu.addAction(action)
|
75
|
-
self.__visualizationGroup.addAction(action)
|
76
|
-
|
77
|
-
icon = silx_icons.getQIcon("compare-mode-b")
|
78
|
-
action = qt.QAction(icon, "Display frame 2", self)
|
79
|
-
action.setIconVisibleInMenu(True)
|
80
|
-
action.setCheckable(True)
|
81
|
-
action.setShortcut(qt.QKeySequence(qt.Qt.Key_B))
|
82
|
-
action.setProperty("mode", CompareImages.VisualizationMode.ONLY_B)
|
83
|
-
menu.addAction(action)
|
84
|
-
self.__visualizationGroup.addAction(action)
|
85
|
-
|
86
|
-
icon = silx_icons.getQIcon("compare-mode-rbneg-channel")
|
87
|
-
action = qt.QAction(icon, "Subtract in color mode", self)
|
88
|
-
action.setIconVisibleInMenu(True)
|
89
|
-
action.setCheckable(True)
|
90
|
-
action.setShortcut(qt.QKeySequence(qt.Qt.Key_C))
|
91
|
-
action.setProperty(
|
92
|
-
"mode", _CompareImages.VisualizationMode.COMPOSITE_RED_BLUE_GRAY_NEG
|
93
|
-
)
|
94
|
-
menu.addAction(action)
|
95
|
-
self.__visualizationGroup.addAction(action)
|
48
|
+
class CompareImages(_CompareImages):
|
49
|
+
sigCropImagesChanged = qt.Signal()
|
50
|
+
"""Emit when cropping of the compared images has changed"""
|
96
51
|
|
97
|
-
|
98
|
-
|
99
|
-
action.setIconVisibleInMenu(True)
|
100
|
-
action.setCheckable(True)
|
101
|
-
action.setShortcut(qt.QKeySequence(qt.Qt.Key_S))
|
102
|
-
action.setProperty("mode", _CompareImages.VisualizationMode.COMPOSITE_A_MINUS_B)
|
103
|
-
menu.addAction(action)
|
104
|
-
self.__visualizationGroup.addAction(action)
|
52
|
+
def __init__(self, parent=None, backend=None):
|
53
|
+
super().__init__(parent, backend)
|
105
54
|
|
106
55
|
# create crop images action
|
107
56
|
icon = silx_icons.getQIcon("crop")
|
@@ -110,126 +59,39 @@ class CompareImagesToolBar(qt.QToolBar):
|
|
110
59
|
action.setChecked(True)
|
111
60
|
action.triggered.connect(self.__cropComparedImagesChanged)
|
112
61
|
self.__cropComparedImages = action
|
113
|
-
self.addAction(action)
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
self.__updateSelectedActions
|
125
|
-
)
|
126
|
-
compareWidget = widget
|
127
|
-
if compareWidget is None:
|
128
|
-
self.__compareWidget = None
|
129
|
-
else:
|
130
|
-
self.__compareWidget = weakref.ref(compareWidget)
|
131
|
-
if compareWidget is not None:
|
132
|
-
widget.sigConfigurationChanged.connect(self.__updateSelectedActions)
|
133
|
-
self.__updateSelectedActions()
|
134
|
-
|
135
|
-
def getCompareWidget(self):
|
136
|
-
"""Returns the connected widget.
|
137
|
-
|
138
|
-
:rtype: CompareImages
|
139
|
-
"""
|
140
|
-
if self.__compareWidget is None:
|
141
|
-
return None
|
142
|
-
else:
|
143
|
-
return self.__compareWidget()
|
144
|
-
|
145
|
-
def __updateSelectedActions(self):
|
146
|
-
"""
|
147
|
-
Update the state of this tool bar according to the state of the
|
148
|
-
connected :class:`CompareImages` widget.
|
149
|
-
"""
|
150
|
-
widget = self.getCompareWidget()
|
151
|
-
if widget is None:
|
152
|
-
return
|
153
|
-
|
154
|
-
mode = widget.getVisualizationMode()
|
155
|
-
action = None
|
156
|
-
for a in self.__visualizationGroup.actions():
|
157
|
-
actionMode = a.property("mode")
|
158
|
-
if mode == actionMode:
|
159
|
-
action = a
|
160
|
-
break
|
161
|
-
old = self.__visualizationGroup.blockSignals(True)
|
162
|
-
if action is not None:
|
163
|
-
# Check this action
|
164
|
-
action.setChecked(True)
|
165
|
-
else:
|
166
|
-
action = self.__visualizationGroup.checkedAction()
|
167
|
-
if action is not None:
|
168
|
-
# Uncheck this action
|
169
|
-
action.setChecked(False)
|
170
|
-
self.__updateVisualizationMenu()
|
171
|
-
self.__visualizationGroup.blockSignals(old)
|
172
|
-
|
173
|
-
def __visualizationModeChanged(self, selectedAction):
|
174
|
-
"""Called when user requesting changes of the visualization mode."""
|
175
|
-
self.__updateVisualizationMenu()
|
176
|
-
widget = self.getCompareWidget()
|
177
|
-
if widget is not None:
|
178
|
-
mode = selectedAction.property("mode")
|
179
|
-
widget.setVisualizationMode(mode)
|
62
|
+
self._compareToolBar.addAction(action)
|
63
|
+
|
64
|
+
# define visible compare mode
|
65
|
+
self._compareToolBar._visualizationToolButton.setVisibleModes(
|
66
|
+
[
|
67
|
+
VisualizationMode.ONLY_A,
|
68
|
+
VisualizationMode.ONLY_B,
|
69
|
+
VisualizationMode.COMPOSITE_RED_BLUE_GRAY_NEG,
|
70
|
+
VisualizationMode.COMPOSITE_A_MINUS_B,
|
71
|
+
]
|
72
|
+
)
|
180
73
|
|
181
74
|
def __cropComparedImagesChanged(self):
|
182
|
-
|
183
|
-
|
184
|
-
cropCompositeImage = self.__cropComparedImages.isChecked()
|
185
|
-
widget.setCropComparedImages(cropCompositeImage)
|
186
|
-
|
187
|
-
def __updateVisualizationMenu(self):
|
188
|
-
"""Update the state of the action containing visualization menu."""
|
189
|
-
selectedAction = self.__visualizationGroup.checkedAction()
|
190
|
-
if selectedAction is not None:
|
191
|
-
self.__visualizationAction.setText(selectedAction.text())
|
192
|
-
self.__visualizationAction.setIcon(selectedAction.icon())
|
193
|
-
self.__visualizationAction.setToolTip(selectedAction.toolTip())
|
194
|
-
else:
|
195
|
-
self.__visualizationAction.setText("")
|
196
|
-
self.__visualizationAction.setIcon(qt.QIcon())
|
197
|
-
self.__visualizationAction.setToolTip("")
|
198
|
-
|
199
|
-
|
200
|
-
class CompareImages(_CompareImages.CompareImages):
|
201
|
-
sigCropImagesChanged = qt.Signal()
|
202
|
-
"""Emit when cropping of the compared images has changed"""
|
203
|
-
|
204
|
-
def __init__(self, parent=None, backend=None):
|
205
|
-
super().__init__(parent, backend=backend)
|
206
|
-
self.__cropComparedImages = True
|
75
|
+
cropCompositeImage = self.__cropComparedImages.isChecked()
|
76
|
+
self.setCropComparedImages(cropCompositeImage)
|
207
77
|
|
208
78
|
def cropComparedImages(self) -> bool:
|
209
|
-
return self.__cropComparedImages
|
79
|
+
return self.__cropComparedImages.isChecked()
|
210
80
|
|
211
81
|
def setCropComparedImages(self, crop):
|
212
|
-
self.__cropComparedImages
|
82
|
+
self.__cropComparedImages.setChecked(crop)
|
213
83
|
self.sigCropImagesChanged.emit()
|
214
84
|
|
215
85
|
def _createToolBars(self, plot):
|
216
86
|
"""Create tool bars displayed by the widget"""
|
217
|
-
|
218
|
-
|
219
|
-
)
|
220
|
-
self._imageToolBar =
|
221
|
-
|
87
|
+
toolBar = tools.InteractiveModeToolBar(parent=self, plot=plot)
|
88
|
+
self._interactiveModeToolBar = toolBar
|
89
|
+
toolBar = tools.ImageToolBar(parent=self, plot=plot)
|
90
|
+
self._imageToolBar = toolBar
|
222
91
|
toolBar = CompareImagesToolBar(self)
|
223
92
|
toolBar.setCompareWidget(self)
|
224
93
|
self._compareToolBar = toolBar
|
225
94
|
|
226
|
-
def _createStatusBar(self, plot):
|
227
|
-
self._statusBar = CompareImagesStatusBar(self)
|
228
|
-
self._statusBar.setCompareWidget(self)
|
229
|
-
|
230
|
-
def getCompareToolBar(self):
|
231
|
-
return self._compareToolBar
|
232
|
-
|
233
95
|
|
234
96
|
class CompareImagesStatusBar(qt.QStatusBar):
|
235
97
|
"""StatusBar containing specific information contained in a
|
@@ -407,3 +269,61 @@ class CompareImagesStatusBar(qt.QStatusBar):
|
|
407
269
|
text2 = self._formatData(data2)
|
408
270
|
self._label1.setText("Frame 1: %s" % text1)
|
409
271
|
self._label2.setText("Frame 2: %s" % text2)
|
272
|
+
|
273
|
+
|
274
|
+
class CompareImagesToolBar(qt.QToolBar):
|
275
|
+
def __init__(self, parent=None):
|
276
|
+
qt.QToolBar.__init__(self, parent)
|
277
|
+
|
278
|
+
self.__compareWidget = None
|
279
|
+
|
280
|
+
self._visualizationToolButton = VisualizationModeToolButton(self)
|
281
|
+
self._visualizationToolButton.setPopupMode(qt.QToolButton.InstantPopup)
|
282
|
+
self._visualizationToolButton.sigSelected.connect(self.__visualizationChanged)
|
283
|
+
self.addWidget(self._visualizationToolButton)
|
284
|
+
|
285
|
+
def __visualizationChanged(self, mode: VisualizationMode):
|
286
|
+
widget = self.getCompareWidget()
|
287
|
+
if widget is not None:
|
288
|
+
widget.setVisualizationMode(mode)
|
289
|
+
|
290
|
+
def setCompareWidget(self, widget):
|
291
|
+
"""
|
292
|
+
Connect this tool bar to a specific :class:`CompareImages` widget.
|
293
|
+
|
294
|
+
:param Union[None,CompareImages] widget: The widget to connect with.
|
295
|
+
"""
|
296
|
+
compareWidget = self.getCompareWidget()
|
297
|
+
if compareWidget is not None:
|
298
|
+
compareWidget.sigConfigurationChanged.disconnect(
|
299
|
+
self.__updateSelectedActions
|
300
|
+
)
|
301
|
+
compareWidget = widget
|
302
|
+
self.setEnabled(compareWidget is not None)
|
303
|
+
if compareWidget is None:
|
304
|
+
self.__compareWidget = None
|
305
|
+
else:
|
306
|
+
self.__compareWidget = weakref.ref(compareWidget)
|
307
|
+
if compareWidget is not None:
|
308
|
+
widget.sigConfigurationChanged.connect(self.__updateSelectedActions)
|
309
|
+
self.__updateSelectedActions()
|
310
|
+
|
311
|
+
def getCompareWidget(self):
|
312
|
+
"""Returns the connected widget.
|
313
|
+
|
314
|
+
:rtype: CompareImages
|
315
|
+
"""
|
316
|
+
if self.__compareWidget is None:
|
317
|
+
return None
|
318
|
+
else:
|
319
|
+
return self.__compareWidget()
|
320
|
+
|
321
|
+
def __updateSelectedActions(self):
|
322
|
+
"""
|
323
|
+
Update the state of this tool bar according to the state of the
|
324
|
+
connected :class:`CompareImages` widget.
|
325
|
+
"""
|
326
|
+
widget = self.getCompareWidget()
|
327
|
+
if widget is None:
|
328
|
+
return
|
329
|
+
self._visualizationToolButton.setSelected(widget.getVisualizationMode())
|