datalab-platform 0.0.1.dev0__py3-none-any.whl → 1.0.0__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.
- datalab/__init__.py +35 -2
- datalab/adapters_metadata/__init__.py +31 -0
- datalab/adapters_metadata/base_adapter.py +316 -0
- datalab/adapters_metadata/common.py +422 -0
- datalab/adapters_metadata/geometry_adapter.py +98 -0
- datalab/adapters_metadata/table_adapter.py +84 -0
- datalab/adapters_plotpy/__init__.py +54 -0
- datalab/adapters_plotpy/annotations.py +124 -0
- datalab/adapters_plotpy/base.py +110 -0
- datalab/adapters_plotpy/converters.py +86 -0
- datalab/adapters_plotpy/factories.py +80 -0
- datalab/adapters_plotpy/objects/__init__.py +0 -0
- datalab/adapters_plotpy/objects/base.py +197 -0
- datalab/adapters_plotpy/objects/image.py +157 -0
- datalab/adapters_plotpy/objects/scalar.py +565 -0
- datalab/adapters_plotpy/objects/signal.py +264 -0
- datalab/adapters_plotpy/roi/__init__.py +0 -0
- datalab/adapters_plotpy/roi/base.py +146 -0
- datalab/adapters_plotpy/roi/factory.py +93 -0
- datalab/adapters_plotpy/roi/image.py +207 -0
- datalab/adapters_plotpy/roi/signal.py +72 -0
- datalab/app.py +98 -0
- datalab/config.py +817 -0
- datalab/control/__init__.py +0 -0
- datalab/control/baseproxy.py +776 -0
- datalab/control/proxy.py +343 -0
- datalab/control/remote.py +1005 -0
- datalab/data/doc/DataLab_en.pdf +0 -0
- datalab/data/doc/DataLab_fr.pdf +0 -0
- datalab/data/icons/analysis/delete_results.svg +109 -0
- datalab/data/icons/analysis/fw1e2.svg +156 -0
- datalab/data/icons/analysis/fwhm.svg +156 -0
- datalab/data/icons/analysis/histogram.svg +49 -0
- datalab/data/icons/analysis/peak_detect.svg +160 -0
- datalab/data/icons/analysis/plot_results.svg +151 -0
- datalab/data/icons/analysis/show_results.svg +83 -0
- datalab/data/icons/analysis/stats.svg +49 -0
- datalab/data/icons/analysis.svg +120 -0
- datalab/data/icons/apply.svg +3 -0
- datalab/data/icons/check_all.svg +15 -0
- datalab/data/icons/collapse.svg +44 -0
- datalab/data/icons/collapse_selection.svg +63 -0
- datalab/data/icons/console.svg +101 -0
- datalab/data/icons/create/1d-normal.svg +8 -0
- datalab/data/icons/create/1d-poisson.svg +9 -0
- datalab/data/icons/create/1d-uniform.svg +8 -0
- datalab/data/icons/create/1d-zero.svg +57 -0
- datalab/data/icons/create/2d-gaussian.svg +56 -0
- datalab/data/icons/create/2d-normal.svg +38 -0
- datalab/data/icons/create/2d-poisson.svg +38 -0
- datalab/data/icons/create/2d-ramp.svg +90 -0
- datalab/data/icons/create/2d-sinc.svg +62 -0
- datalab/data/icons/create/2d-uniform.svg +38 -0
- datalab/data/icons/create/2d-zero.svg +13 -0
- datalab/data/icons/create/checkerboard.svg +39 -0
- datalab/data/icons/create/cosine.svg +12 -0
- datalab/data/icons/create/exponential.svg +55 -0
- datalab/data/icons/create/gaussian.svg +12 -0
- datalab/data/icons/create/grating.svg +29 -0
- datalab/data/icons/create/linear_chirp.svg +7 -0
- datalab/data/icons/create/logistic.svg +7 -0
- datalab/data/icons/create/lorentzian.svg +12 -0
- datalab/data/icons/create/planck.svg +12 -0
- datalab/data/icons/create/polynomial.svg +7 -0
- datalab/data/icons/create/pulse.svg +12 -0
- datalab/data/icons/create/ring.svg +18 -0
- datalab/data/icons/create/sawtooth.svg +7 -0
- datalab/data/icons/create/siemens.svg +35 -0
- datalab/data/icons/create/sinc.svg +12 -0
- datalab/data/icons/create/sine.svg +7 -0
- datalab/data/icons/create/square.svg +7 -0
- datalab/data/icons/create/square_pulse.svg +7 -0
- datalab/data/icons/create/step.svg +7 -0
- datalab/data/icons/create/step_pulse.svg +12 -0
- datalab/data/icons/create/triangle.svg +7 -0
- datalab/data/icons/create/voigt.svg +12 -0
- datalab/data/icons/edit/annotations.svg +72 -0
- datalab/data/icons/edit/annotations_copy.svg +114 -0
- datalab/data/icons/edit/annotations_delete.svg +83 -0
- datalab/data/icons/edit/annotations_edit.svg +98 -0
- datalab/data/icons/edit/annotations_export.svg +85 -0
- datalab/data/icons/edit/annotations_import.svg +85 -0
- datalab/data/icons/edit/annotations_paste.svg +100 -0
- datalab/data/icons/edit/copy_titles.svg +109 -0
- datalab/data/icons/edit/delete.svg +84 -0
- datalab/data/icons/edit/delete_all.svg +214 -0
- datalab/data/icons/edit/duplicate.svg +64 -0
- datalab/data/icons/edit/goto_source.svg +60 -0
- datalab/data/icons/edit/metadata.svg +60 -0
- datalab/data/icons/edit/metadata_add.svg +80 -0
- datalab/data/icons/edit/metadata_copy.svg +96 -0
- datalab/data/icons/edit/metadata_delete.svg +62 -0
- datalab/data/icons/edit/metadata_export.svg +68 -0
- datalab/data/icons/edit/metadata_import.svg +68 -0
- datalab/data/icons/edit/metadata_paste.svg +79 -0
- datalab/data/icons/edit/move_down.svg +55 -0
- datalab/data/icons/edit/move_up.svg +54 -0
- datalab/data/icons/edit/new_group.svg +76 -0
- datalab/data/icons/edit/recompute.svg +60 -0
- datalab/data/icons/edit/rename.svg +49 -0
- datalab/data/icons/edit.svg +16 -0
- datalab/data/icons/expand.svg +44 -0
- datalab/data/icons/expand_selection.svg +63 -0
- datalab/data/icons/fit/cdf_fit.svg +56 -0
- datalab/data/icons/fit/exponential_fit.svg +55 -0
- datalab/data/icons/fit/gaussian_fit.svg +62 -0
- datalab/data/icons/fit/interactive_fit.svg +101 -0
- datalab/data/icons/fit/linear_fit.svg +57 -0
- datalab/data/icons/fit/lorentzian_fit.svg +209 -0
- datalab/data/icons/fit/multigaussian_fit.svg +85 -0
- datalab/data/icons/fit/multilorentzian_fit.svg +85 -0
- datalab/data/icons/fit/piecewiseexponential_fit.svg +209 -0
- datalab/data/icons/fit/planckian_fit.svg +62 -0
- datalab/data/icons/fit/polynomial_fit.svg +59 -0
- datalab/data/icons/fit/sigmoid_fit.svg +56 -0
- datalab/data/icons/fit/sinusoidal_fit.svg +72 -0
- datalab/data/icons/fit/twohalfgaussian_fit.svg +63 -0
- datalab/data/icons/fit/voigt_fit.svg +57 -0
- datalab/data/icons/group.svg +56 -0
- datalab/data/icons/h5/h5array.svg +59 -0
- datalab/data/icons/h5/h5attrs.svg +75 -0
- datalab/data/icons/h5/h5browser.svg +133 -0
- datalab/data/icons/h5/h5file.svg +69 -0
- datalab/data/icons/h5/h5group.svg +49 -0
- datalab/data/icons/h5/h5scalar.svg +1 -0
- datalab/data/icons/help_pdf.svg +46 -0
- datalab/data/icons/history.svg +7 -0
- datalab/data/icons/image.svg +135 -0
- datalab/data/icons/io/fileopen_directory.svg +60 -0
- datalab/data/icons/io/fileopen_h5.svg +84 -0
- datalab/data/icons/io/fileopen_ima.svg +187 -0
- datalab/data/icons/io/fileopen_py.svg +123 -0
- datalab/data/icons/io/fileopen_sig.svg +138 -0
- datalab/data/icons/io/filesave_h5.svg +97 -0
- datalab/data/icons/io/filesave_ima.svg +200 -0
- datalab/data/icons/io/filesave_py.svg +136 -0
- datalab/data/icons/io/filesave_sig.svg +151 -0
- datalab/data/icons/io/import_text.svg +144 -0
- datalab/data/icons/io/save_to_directory.svg +134 -0
- datalab/data/icons/io.svg +84 -0
- datalab/data/icons/libre-camera-flash-off.svg +1 -0
- datalab/data/icons/libre-camera-flash-on.svg +1 -0
- datalab/data/icons/libre-gui-about.svg +1 -0
- datalab/data/icons/libre-gui-action-delete.svg +1 -0
- datalab/data/icons/libre-gui-add.svg +1 -0
- datalab/data/icons/libre-gui-arrow-down.svg +1 -0
- datalab/data/icons/libre-gui-arrow-left.svg +1 -0
- datalab/data/icons/libre-gui-arrow-right.svg +1 -0
- datalab/data/icons/libre-gui-arrow-up.svg +1 -0
- datalab/data/icons/libre-gui-close.svg +40 -0
- datalab/data/icons/libre-gui-cogs.svg +1 -0
- datalab/data/icons/libre-gui-globe.svg +1 -0
- datalab/data/icons/libre-gui-help.svg +1 -0
- datalab/data/icons/libre-gui-link.svg +1 -0
- datalab/data/icons/libre-gui-menu.svg +1 -0
- datalab/data/icons/libre-gui-pencil.svg +1 -0
- datalab/data/icons/libre-gui-plugin.svg +1 -0
- datalab/data/icons/libre-gui-questions.svg +1 -0
- datalab/data/icons/libre-gui-settings.svg +1 -0
- datalab/data/icons/libre-gui-unlink.svg +1 -0
- datalab/data/icons/libre-tech-ram.svg +1 -0
- datalab/data/icons/libre-toolbox.svg +1 -0
- datalab/data/icons/logs.svg +1 -0
- datalab/data/icons/markers.svg +74 -0
- datalab/data/icons/menu.svg +13 -0
- datalab/data/icons/new_ima.svg +148 -0
- datalab/data/icons/new_sig.svg +123 -0
- datalab/data/icons/operations/abs.svg +116 -0
- datalab/data/icons/operations/arithmetic.svg +123 -0
- datalab/data/icons/operations/average.svg +124 -0
- datalab/data/icons/operations/complex_from_magnitude_phase.svg +116 -0
- datalab/data/icons/operations/complex_from_real_imag.svg +124 -0
- datalab/data/icons/operations/constant.svg +116 -0
- datalab/data/icons/operations/constant_add.svg +109 -0
- datalab/data/icons/operations/constant_divide.svg +109 -0
- datalab/data/icons/operations/constant_multiply.svg +109 -0
- datalab/data/icons/operations/constant_subtract.svg +109 -0
- datalab/data/icons/operations/convert_dtype.svg +117 -0
- datalab/data/icons/operations/convolution.svg +46 -0
- datalab/data/icons/operations/deconvolution.svg +57 -0
- datalab/data/icons/operations/derivative.svg +127 -0
- datalab/data/icons/operations/difference.svg +52 -0
- datalab/data/icons/operations/division.svg +139 -0
- datalab/data/icons/operations/exp.svg +116 -0
- datalab/data/icons/operations/flip_horizontally.svg +69 -0
- datalab/data/icons/operations/flip_vertically.svg +74 -0
- datalab/data/icons/operations/im.svg +124 -0
- datalab/data/icons/operations/integral.svg +50 -0
- datalab/data/icons/operations/inverse.svg +143 -0
- datalab/data/icons/operations/log10.svg +109 -0
- datalab/data/icons/operations/phase.svg +116 -0
- datalab/data/icons/operations/power.svg +118 -0
- datalab/data/icons/operations/product.svg +124 -0
- datalab/data/icons/operations/profile.svg +379 -0
- datalab/data/icons/operations/profile_average.svg +399 -0
- datalab/data/icons/operations/profile_radial.svg +261 -0
- datalab/data/icons/operations/profile_segment.svg +262 -0
- datalab/data/icons/operations/quadratic_difference.svg +84 -0
- datalab/data/icons/operations/re.svg +124 -0
- datalab/data/icons/operations/rotate_left.svg +72 -0
- datalab/data/icons/operations/rotate_right.svg +72 -0
- datalab/data/icons/operations/signals_to_image.svg +314 -0
- datalab/data/icons/operations/sqrt.svg +110 -0
- datalab/data/icons/operations/std.svg +124 -0
- datalab/data/icons/operations/sum.svg +102 -0
- datalab/data/icons/play_demo.svg +9 -0
- datalab/data/icons/processing/axis_transform.svg +62 -0
- datalab/data/icons/processing/bandpass.svg +79 -0
- datalab/data/icons/processing/bandstop.svg +71 -0
- datalab/data/icons/processing/binning.svg +126 -0
- datalab/data/icons/processing/clip.svg +119 -0
- datalab/data/icons/processing/detrending.svg +173 -0
- datalab/data/icons/processing/distribute_on_grid.svg +769 -0
- datalab/data/icons/processing/edge_detection.svg +46 -0
- datalab/data/icons/processing/erase.svg +1 -0
- datalab/data/icons/processing/exposure.svg +143 -0
- datalab/data/icons/processing/fourier.svg +104 -0
- datalab/data/icons/processing/highpass.svg +59 -0
- datalab/data/icons/processing/interpolation.svg +71 -0
- datalab/data/icons/processing/level_adjustment.svg +70 -0
- datalab/data/icons/processing/lowpass.svg +60 -0
- datalab/data/icons/processing/morphology.svg +49 -0
- datalab/data/icons/processing/noise_addition.svg +114 -0
- datalab/data/icons/processing/noise_reduction.svg +38 -0
- datalab/data/icons/processing/normalize.svg +84 -0
- datalab/data/icons/processing/offset_correction.svg +131 -0
- datalab/data/icons/processing/resampling1d.svg +101 -0
- datalab/data/icons/processing/resampling2d.svg +240 -0
- datalab/data/icons/processing/reset_positions.svg +185 -0
- datalab/data/icons/processing/resize.svg +9 -0
- datalab/data/icons/processing/reverse_signal_x.svg +171 -0
- datalab/data/icons/processing/stability.svg +11 -0
- datalab/data/icons/processing/swap_x_y.svg +65 -0
- datalab/data/icons/processing/thresholding.svg +63 -0
- datalab/data/icons/processing/windowing.svg +45 -0
- datalab/data/icons/properties.svg +26 -0
- datalab/data/icons/reset.svg +9 -0
- datalab/data/icons/restore.svg +40 -0
- datalab/data/icons/roi/roi.svg +76 -0
- datalab/data/icons/roi/roi_coordinate.svg +78 -0
- datalab/data/icons/roi/roi_copy.svg +112 -0
- datalab/data/icons/roi/roi_delete.svg +81 -0
- datalab/data/icons/roi/roi_export.svg +87 -0
- datalab/data/icons/roi/roi_graphical.svg +78 -0
- datalab/data/icons/roi/roi_grid.svg +67 -0
- datalab/data/icons/roi/roi_ima.svg +188 -0
- datalab/data/icons/roi/roi_import.svg +87 -0
- datalab/data/icons/roi/roi_new.svg +81 -0
- datalab/data/icons/roi/roi_new_circle.svg +95 -0
- datalab/data/icons/roi/roi_new_polygon.svg +110 -0
- datalab/data/icons/roi/roi_new_rectangle.svg +70 -0
- datalab/data/icons/roi/roi_paste.svg +98 -0
- datalab/data/icons/roi/roi_sig.svg +124 -0
- datalab/data/icons/shapes.svg +134 -0
- datalab/data/icons/signal.svg +103 -0
- datalab/data/icons/table.svg +85 -0
- datalab/data/icons/table_unavailable.svg +102 -0
- datalab/data/icons/to_signal.svg +124 -0
- datalab/data/icons/tour/next.svg +44 -0
- datalab/data/icons/tour/previous.svg +44 -0
- datalab/data/icons/tour/rewind.svg +51 -0
- datalab/data/icons/tour/stop.svg +47 -0
- datalab/data/icons/tour/tour.svg +16 -0
- datalab/data/icons/uncheck_all.svg +78 -0
- datalab/data/icons/view/curve_antialiasing.svg +50 -0
- datalab/data/icons/view/new_window.svg +98 -0
- datalab/data/icons/view/refresh-auto.svg +57 -0
- datalab/data/icons/view/refresh-manual.svg +51 -0
- datalab/data/icons/view/reset_curve_styles.svg +96 -0
- datalab/data/icons/view/show_first.svg +55 -0
- datalab/data/icons/view/show_titles.svg +46 -0
- datalab/data/icons/visualization.svg +51 -0
- datalab/data/logo/DataLab-Banner-150.png +0 -0
- datalab/data/logo/DataLab-Banner-200.png +0 -0
- datalab/data/logo/DataLab-Banner2-100.png +0 -0
- datalab/data/logo/DataLab-Splash.png +0 -0
- datalab/data/logo/DataLab-watermark.png +0 -0
- datalab/data/logo/DataLab.svg +83 -0
- datalab/data/tests/reordering_test.h5 +0 -0
- datalab/data/tutorials/fabry_perot/fabry-perot1.jpg +0 -0
- datalab/data/tutorials/fabry_perot/fabry-perot2.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_13.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_18.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_23.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_30.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_35.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_40.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_45.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_50.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_55.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_60.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_65.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_70.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_75.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_80.jpg +0 -0
- datalab/env.py +542 -0
- datalab/gui/__init__.py +89 -0
- datalab/gui/actionhandler.py +1701 -0
- datalab/gui/docks.py +473 -0
- datalab/gui/h5io.py +150 -0
- datalab/gui/macroeditor.py +310 -0
- datalab/gui/main.py +2081 -0
- datalab/gui/newobject.py +217 -0
- datalab/gui/objectview.py +766 -0
- datalab/gui/panel/__init__.py +48 -0
- datalab/gui/panel/base.py +3254 -0
- datalab/gui/panel/image.py +157 -0
- datalab/gui/panel/macro.py +607 -0
- datalab/gui/panel/signal.py +164 -0
- datalab/gui/plothandler.py +800 -0
- datalab/gui/processor/__init__.py +84 -0
- datalab/gui/processor/base.py +2456 -0
- datalab/gui/processor/catcher.py +75 -0
- datalab/gui/processor/image.py +1214 -0
- datalab/gui/processor/signal.py +755 -0
- datalab/gui/profiledialog.py +333 -0
- datalab/gui/roieditor.py +633 -0
- datalab/gui/roigrideditor.py +208 -0
- datalab/gui/settings.py +612 -0
- datalab/gui/tour.py +908 -0
- datalab/h5/__init__.py +12 -0
- datalab/h5/common.py +314 -0
- datalab/h5/generic.py +580 -0
- datalab/h5/native.py +39 -0
- datalab/h5/utils.py +95 -0
- datalab/objectmodel.py +640 -0
- datalab/plugins/_readme_.txt +9 -0
- datalab/plugins/datalab_imageformats.py +175 -0
- datalab/plugins/datalab_testdata.py +190 -0
- datalab/plugins.py +355 -0
- datalab/tests/__init__.py +199 -0
- datalab/tests/backbone/__init__.py +1 -0
- datalab/tests/backbone/config_unit_test.py +170 -0
- datalab/tests/backbone/config_versioning_unit_test.py +34 -0
- datalab/tests/backbone/dictlistserial_app_test.py +38 -0
- datalab/tests/backbone/errorcatcher_unit_test.py +69 -0
- datalab/tests/backbone/errormsgbox_unit_test.py +50 -0
- datalab/tests/backbone/execenv_unit.py +262 -0
- datalab/tests/backbone/loadtest_gdi.py +147 -0
- datalab/tests/backbone/long_callback.py +96 -0
- datalab/tests/backbone/main_app_test.py +137 -0
- datalab/tests/backbone/memory_leak.py +43 -0
- datalab/tests/backbone/procisolation1_unit.py +128 -0
- datalab/tests/backbone/procisolation2_unit.py +171 -0
- datalab/tests/backbone/procisolation_unit_test.py +22 -0
- datalab/tests/backbone/profiling_app.py +27 -0
- datalab/tests/backbone/strings_unit_test.py +65 -0
- datalab/tests/backbone/title_formatting_unit_test.py +82 -0
- datalab/tests/conftest.py +131 -0
- datalab/tests/features/__init__.py +1 -0
- datalab/tests/features/applauncher/__init__.py +1 -0
- datalab/tests/features/applauncher/launcher1_app_test.py +28 -0
- datalab/tests/features/applauncher/launcher2_app_test.py +30 -0
- datalab/tests/features/common/__init__.py +1 -0
- datalab/tests/features/common/add_metadata_app_test.py +134 -0
- datalab/tests/features/common/add_metadata_unit_test.py +267 -0
- datalab/tests/features/common/annotations_management_unit_test.py +152 -0
- datalab/tests/features/common/auto_analysis_recompute_unit_test.py +240 -0
- datalab/tests/features/common/createobject_unit_test.py +50 -0
- datalab/tests/features/common/geometry_results_app_test.py +135 -0
- datalab/tests/features/common/interactive_processing_test.py +1109 -0
- datalab/tests/features/common/io_app_test.py +75 -0
- datalab/tests/features/common/large_results_app_test.py +187 -0
- datalab/tests/features/common/metadata_all_patterns_test.py +103 -0
- datalab/tests/features/common/metadata_app_test.py +139 -0
- datalab/tests/features/common/metadata_io_unit_test.py +60 -0
- datalab/tests/features/common/misc_app_test.py +236 -0
- datalab/tests/features/common/multiple_geometry_results_unit_test.py +122 -0
- datalab/tests/features/common/multiple_table_results_unit_test.py +64 -0
- datalab/tests/features/common/operation_modes_app_test.py +392 -0
- datalab/tests/features/common/plot_results_app_test.py +278 -0
- datalab/tests/features/common/reorder_app_test.py +75 -0
- datalab/tests/features/common/result_deletion_unit_test.py +96 -0
- datalab/tests/features/common/result_merged_label_unit_test.py +154 -0
- datalab/tests/features/common/result_shape_settings_unit_test.py +223 -0
- datalab/tests/features/common/roi_plotitem_unit_test.py +64 -0
- datalab/tests/features/common/roieditor_unit_test.py +102 -0
- datalab/tests/features/common/save_to_dir_app_test.py +163 -0
- datalab/tests/features/common/save_to_dir_unit_test.py +474 -0
- datalab/tests/features/common/stat_app_test.py +40 -0
- datalab/tests/features/common/stats_tools_unit_test.py +77 -0
- datalab/tests/features/common/table_results_app_test.py +52 -0
- datalab/tests/features/common/textimport_unit_test.py +131 -0
- datalab/tests/features/common/uuid_preservation_test.py +281 -0
- datalab/tests/features/common/worker_unit_test.py +402 -0
- datalab/tests/features/control/__init__.py +1 -0
- datalab/tests/features/control/connect_dialog.py +28 -0
- datalab/tests/features/control/embedded1_unit_test.py +304 -0
- datalab/tests/features/control/embedded2_unit_test.py +52 -0
- datalab/tests/features/control/remoteclient_app_test.py +219 -0
- datalab/tests/features/control/remoteclient_unit.py +75 -0
- datalab/tests/features/control/simpleclient_unit_test.py +321 -0
- datalab/tests/features/hdf5/__init__.py +1 -0
- datalab/tests/features/hdf5/h5browser1_unit_test.py +31 -0
- datalab/tests/features/hdf5/h5browser2_unit.py +55 -0
- datalab/tests/features/hdf5/h5browser_app_test.py +77 -0
- datalab/tests/features/hdf5/h5import_app_test.py +25 -0
- datalab/tests/features/hdf5/h5importer_app_test.py +34 -0
- datalab/tests/features/image/__init__.py +1 -0
- datalab/tests/features/image/annotations_app_test.py +28 -0
- datalab/tests/features/image/annotations_unit_test.py +80 -0
- datalab/tests/features/image/average_app_test.py +46 -0
- datalab/tests/features/image/background_dialog_test.py +70 -0
- datalab/tests/features/image/blobs_app_test.py +50 -0
- datalab/tests/features/image/contour_app_test.py +42 -0
- datalab/tests/features/image/contour_fabryperot_app_test.py +51 -0
- datalab/tests/features/image/denoise_app_test.py +31 -0
- datalab/tests/features/image/distribute_on_grid_app_test.py +95 -0
- datalab/tests/features/image/edges_app_test.py +31 -0
- datalab/tests/features/image/erase_app_test.py +21 -0
- datalab/tests/features/image/fft2d_app_test.py +27 -0
- datalab/tests/features/image/flatfield_app_test.py +40 -0
- datalab/tests/features/image/geometry_transform_unit_test.py +396 -0
- datalab/tests/features/image/imagetools_app_test.py +51 -0
- datalab/tests/features/image/imagetools_unit_test.py +27 -0
- datalab/tests/features/image/load_app_test.py +73 -0
- datalab/tests/features/image/morph_app_test.py +32 -0
- datalab/tests/features/image/offsetcorrection_app_test.py +30 -0
- datalab/tests/features/image/peak2d_app_test.py +53 -0
- datalab/tests/features/image/profile_app_test.py +73 -0
- datalab/tests/features/image/profile_dialog_test.py +56 -0
- datalab/tests/features/image/roi_app_test.py +98 -0
- datalab/tests/features/image/roi_circ_app_test.py +62 -0
- datalab/tests/features/image/roi_manipulation_app_test.py +268 -0
- datalab/tests/features/image/roigrid_unit_test.py +60 -0
- datalab/tests/features/image/side_by_side_app_test.py +52 -0
- datalab/tests/features/macro/__init__.py +1 -0
- datalab/tests/features/macro/macro_app_test.py +28 -0
- datalab/tests/features/macro/macroeditor_unit_test.py +102 -0
- datalab/tests/features/signal/__init__.py +1 -0
- datalab/tests/features/signal/baseline_dialog_test.py +53 -0
- datalab/tests/features/signal/deltax_dialog_unit_test.py +34 -0
- datalab/tests/features/signal/fft1d_app_test.py +26 -0
- datalab/tests/features/signal/filter_app_test.py +44 -0
- datalab/tests/features/signal/fitdialog_unit_test.py +50 -0
- datalab/tests/features/signal/interpolation_app_test.py +110 -0
- datalab/tests/features/signal/loadbigsignal_app_test.py +80 -0
- datalab/tests/features/signal/multiple_rois_unit_test.py +132 -0
- datalab/tests/features/signal/pulse_features_app_test.py +118 -0
- datalab/tests/features/signal/pulse_features_roi_app_test.py +55 -0
- datalab/tests/features/signal/roi_app_test.py +78 -0
- datalab/tests/features/signal/roi_manipulation_app_test.py +261 -0
- datalab/tests/features/signal/select_xy_cursor_unit_test.py +46 -0
- datalab/tests/features/signal/signalpeakdetection_dialog_test.py +33 -0
- datalab/tests/features/signal/signals_to_image_app_test.py +98 -0
- datalab/tests/features/signal/xarray_compat_app_test.py +128 -0
- datalab/tests/features/tour_unit_test.py +22 -0
- datalab/tests/features/utilities/__init__.py +1 -0
- datalab/tests/features/utilities/installconf_unit_test.py +21 -0
- datalab/tests/features/utilities/logview_app_test.py +21 -0
- datalab/tests/features/utilities/logview_error.py +24 -0
- datalab/tests/features/utilities/logview_unit_test.py +21 -0
- datalab/tests/features/utilities/memstatus_app_test.py +42 -0
- datalab/tests/features/utilities/settings_unit_test.py +88 -0
- datalab/tests/scenarios/__init__.py +1 -0
- datalab/tests/scenarios/beautiful_app.py +121 -0
- datalab/tests/scenarios/common.py +463 -0
- datalab/tests/scenarios/demo.py +212 -0
- datalab/tests/scenarios/example_app_test.py +47 -0
- datalab/tests/scenarios/scenario_h5_app_test.py +75 -0
- datalab/tests/scenarios/scenario_ima1_app_test.py +34 -0
- datalab/tests/scenarios/scenario_ima2_app_test.py +34 -0
- datalab/tests/scenarios/scenario_mac_app_test.py +58 -0
- datalab/tests/scenarios/scenario_sig1_app_test.py +36 -0
- datalab/tests/scenarios/scenario_sig2_app_test.py +35 -0
- datalab/utils/__init__.py +1 -0
- datalab/utils/conf.py +304 -0
- datalab/utils/dephash.py +105 -0
- datalab/utils/qthelpers.py +633 -0
- datalab/utils/strings.py +34 -0
- datalab/utils/tests.py +0 -0
- datalab/widgets/__init__.py +1 -0
- datalab/widgets/connection.py +138 -0
- datalab/widgets/filedialog.py +91 -0
- datalab/widgets/fileviewer.py +84 -0
- datalab/widgets/fitdialog.py +788 -0
- datalab/widgets/h5browser.py +1048 -0
- datalab/widgets/imagebackground.py +111 -0
- datalab/widgets/instconfviewer.py +175 -0
- datalab/widgets/logviewer.py +80 -0
- datalab/widgets/signalbaseline.py +90 -0
- datalab/widgets/signalcursor.py +208 -0
- datalab/widgets/signaldeltax.py +151 -0
- datalab/widgets/signalpeak.py +199 -0
- datalab/widgets/status.py +249 -0
- datalab/widgets/textimport.py +786 -0
- datalab/widgets/warningerror.py +223 -0
- datalab/widgets/wizard.py +286 -0
- datalab_platform-1.0.0.dist-info/METADATA +121 -0
- datalab_platform-1.0.0.dist-info/RECORD +494 -0
- datalab_platform-0.0.1.dev0.dist-info/METADATA +0 -67
- datalab_platform-0.0.1.dev0.dist-info/RECORD +0 -7
- {datalab_platform-0.0.1.dev0.dist-info → datalab_platform-1.0.0.dist-info}/WHEEL +0 -0
- {datalab_platform-0.0.1.dev0.dist-info → datalab_platform-1.0.0.dist-info}/entry_points.txt +0 -0
- {datalab_platform-0.0.1.dev0.dist-info → datalab_platform-1.0.0.dist-info}/licenses/LICENSE +0 -0
- {datalab_platform-0.0.1.dev0.dist-info → datalab_platform-1.0.0.dist-info}/top_level.txt +0 -0
datalab/config.py
ADDED
|
@@ -0,0 +1,817 @@
|
|
|
1
|
+
# Copyright (c) DataLab Platform Developers, BSD 3-Clause license, see LICENSE file.
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
DataLab configuration module
|
|
5
|
+
----------------------------
|
|
6
|
+
|
|
7
|
+
This module handles `DataLab` configuration (options, images and icons).
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
import os.path as osp
|
|
14
|
+
import sys
|
|
15
|
+
from typing import Literal
|
|
16
|
+
|
|
17
|
+
from guidata import configtools
|
|
18
|
+
from plotpy.config import CONF as PLOTPY_CONF
|
|
19
|
+
from plotpy.config import MAIN_BG_COLOR, MAIN_FG_COLOR
|
|
20
|
+
from plotpy.constants import LUTAlpha
|
|
21
|
+
from plotpy.styles import MarkerParam, ShapeParam
|
|
22
|
+
from sigima.config import options as sigima_options
|
|
23
|
+
from sigima.proc.title_formatting import (
|
|
24
|
+
PlaceholderTitleFormatter,
|
|
25
|
+
set_default_title_formatter,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
from datalab import __version__
|
|
29
|
+
from datalab.utils import conf
|
|
30
|
+
|
|
31
|
+
# Configure Sigima to use DataLab-compatible placeholder title formatting
|
|
32
|
+
set_default_title_formatter(PlaceholderTitleFormatter())
|
|
33
|
+
|
|
34
|
+
CONF_VERSION = "1.0.0"
|
|
35
|
+
|
|
36
|
+
APP_NAME = "DataLab"
|
|
37
|
+
MOD_NAME = "datalab"
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def get_config_app_name() -> str:
|
|
41
|
+
"""Get configuration application name with major version suffix.
|
|
42
|
+
|
|
43
|
+
This function returns the application name used for configuration storage.
|
|
44
|
+
Starting from v1.0, the major version is appended to allow different major
|
|
45
|
+
versions to coexist on the same machine without interfering with each other.
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
str: Configuration application name (e.g., "DataLab" for v0.x,
|
|
49
|
+
"DataLab_v1" for v1.x)
|
|
50
|
+
|
|
51
|
+
Examples:
|
|
52
|
+
- v0.20.x → "DataLab" (configuration stored in ~/.DataLab)
|
|
53
|
+
- v1.0.x → "DataLab_v1" (configuration stored in ~/.DataLab_v1)
|
|
54
|
+
- v2.0.x → "DataLab_v2" (configuration stored in ~/.DataLab_v2)
|
|
55
|
+
"""
|
|
56
|
+
major_version = __version__.split(".", maxsplit=1)[0]
|
|
57
|
+
|
|
58
|
+
# Keep v0.x configuration folder unchanged for backward compatibility
|
|
59
|
+
if major_version == "0":
|
|
60
|
+
return APP_NAME
|
|
61
|
+
|
|
62
|
+
return f"{APP_NAME}_v{major_version}"
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
_ = configtools.get_translation(MOD_NAME)
|
|
66
|
+
|
|
67
|
+
APP_DESC = _("""DataLab is a generic signal and image processing platform""")
|
|
68
|
+
APP_PATH = osp.dirname(__file__)
|
|
69
|
+
|
|
70
|
+
DEBUG = os.environ.get("DEBUG", "").lower() in ("1", "true")
|
|
71
|
+
if DEBUG:
|
|
72
|
+
print("*** DEBUG mode *** [Reset configuration file, do not redirect std I/O]")
|
|
73
|
+
|
|
74
|
+
TEST_SEGFAULT_ERROR = len(os.environ.get("TEST_SEGFAULT_ERROR", "")) > 0
|
|
75
|
+
if TEST_SEGFAULT_ERROR:
|
|
76
|
+
print('*** TEST_SEGFAULT_ERROR mode *** [Enabling test action in "?" menu]')
|
|
77
|
+
DATETIME_FORMAT = "%d/%m/%Y - %H:%M:%S"
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
configtools.add_image_module_path(MOD_NAME, osp.join("data", "logo"))
|
|
81
|
+
configtools.add_image_module_path(MOD_NAME, osp.join("data", "icons"))
|
|
82
|
+
|
|
83
|
+
DATAPATH = configtools.get_module_data_path(MOD_NAME, "data")
|
|
84
|
+
SHOTPATH = osp.join(
|
|
85
|
+
configtools.get_module_data_path(MOD_NAME), os.pardir, "doc", "images", "shots"
|
|
86
|
+
)
|
|
87
|
+
OTHER_PLUGINS_PATHLIST = [configtools.get_module_data_path(MOD_NAME, "plugins")]
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def is_frozen(module_name: str) -> bool:
|
|
91
|
+
"""Test if module has been frozen (py2exe/cx_Freeze/pyinstaller)
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
module_name (str): module name
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
bool: True if module has been frozen (py2exe/cx_Freeze/pyinstaller)
|
|
98
|
+
"""
|
|
99
|
+
datapath = configtools.get_module_path(module_name)
|
|
100
|
+
parentdir = osp.normpath(osp.join(datapath, osp.pardir))
|
|
101
|
+
return not osp.isfile(__file__) or osp.isfile(parentdir) # library.zip
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
IS_FROZEN = is_frozen(MOD_NAME)
|
|
105
|
+
if IS_FROZEN:
|
|
106
|
+
OTHER_PLUGINS_PATHLIST.append(osp.join(osp.dirname(sys.executable), "plugins"))
|
|
107
|
+
try:
|
|
108
|
+
os.mkdir(OTHER_PLUGINS_PATHLIST[-1])
|
|
109
|
+
except OSError:
|
|
110
|
+
pass
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def get_mod_source_dir() -> str | None:
|
|
114
|
+
"""Return module source directory
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
str | None: module source directory, or None if not found
|
|
118
|
+
"""
|
|
119
|
+
if IS_FROZEN:
|
|
120
|
+
devdir = osp.abspath(osp.join(sys.prefix, os.pardir, os.pardir))
|
|
121
|
+
else:
|
|
122
|
+
devdir = osp.abspath(osp.join(osp.dirname(__file__), os.pardir))
|
|
123
|
+
if osp.isfile(osp.join(devdir, MOD_NAME, "__init__.py")):
|
|
124
|
+
return devdir
|
|
125
|
+
# Unhandled case (this should not happen, but just in case):
|
|
126
|
+
return None
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
class MainSection(conf.Section, metaclass=conf.SectionMeta):
|
|
130
|
+
"""Class defining the main configuration section structure.
|
|
131
|
+
Each class attribute is an option (metaclass is automatically affecting
|
|
132
|
+
option names in .INI file based on class attribute names)."""
|
|
133
|
+
|
|
134
|
+
color_mode = conf.EnumOption(["auto", "dark", "light"], default="auto")
|
|
135
|
+
process_isolation_enabled = conf.Option()
|
|
136
|
+
rpc_server_enabled = conf.Option()
|
|
137
|
+
rpc_server_port = conf.Option()
|
|
138
|
+
traceback_log_path = conf.ConfigPathOption()
|
|
139
|
+
traceback_log_available = conf.Option()
|
|
140
|
+
faulthandler_enabled = conf.Option()
|
|
141
|
+
faulthandler_log_path = conf.ConfigPathOption()
|
|
142
|
+
faulthandler_log_available = conf.Option()
|
|
143
|
+
window_maximized = conf.Option()
|
|
144
|
+
window_position = conf.Option()
|
|
145
|
+
window_size = conf.Option()
|
|
146
|
+
window_state = conf.Option()
|
|
147
|
+
base_dir = conf.WorkingDirOption()
|
|
148
|
+
available_memory_threshold = conf.Option()
|
|
149
|
+
current_tab = conf.Option()
|
|
150
|
+
plugins_enabled = conf.Option()
|
|
151
|
+
plugins_path = conf.Option()
|
|
152
|
+
tour_enabled = conf.Option()
|
|
153
|
+
v020_plugins_warning_ignore = conf.Option() # True: do not warn, False: warn
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
class ConsoleSection(conf.Section, metaclass=conf.SectionMeta):
|
|
157
|
+
"""Classs defining the console configuration section structure.
|
|
158
|
+
Each class attribute is an option (metaclass is automatically affecting
|
|
159
|
+
option names in .INI file based on class attribute names)."""
|
|
160
|
+
|
|
161
|
+
console_enabled = conf.Option()
|
|
162
|
+
show_console_on_error = conf.Option()
|
|
163
|
+
max_line_count = conf.Option()
|
|
164
|
+
external_editor_path = conf.Option()
|
|
165
|
+
external_editor_args = conf.Option()
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class IOSection(conf.Section, metaclass=conf.SectionMeta):
|
|
169
|
+
"""Class defining the I/O configuration section structure.
|
|
170
|
+
Each class attribute is an option (metaclass is automatically affecting
|
|
171
|
+
option names in .INI file based on class attribute names)."""
|
|
172
|
+
|
|
173
|
+
# HDF5 file format options
|
|
174
|
+
# ------------------------
|
|
175
|
+
# When opening an HDF5 file, ask user for confirmation if the current workspace
|
|
176
|
+
# has to be cleared before loading the file:
|
|
177
|
+
h5_clear_workspace = conf.Option() # True: clear workspace, False: do not clear
|
|
178
|
+
h5_clear_workspace_ask = conf.Option() # True: ask user, False: do not ask
|
|
179
|
+
# Signal or image title when importing from HDF5 file:
|
|
180
|
+
# - True: use HDF5 full dataset path in signal or image title
|
|
181
|
+
# - False: use HDF5 dataset name in signal or image title
|
|
182
|
+
h5_fullpath_in_title = conf.Option()
|
|
183
|
+
# Signal or image title when importing from HDF5 file:
|
|
184
|
+
# - True: add HDF5 file name in signal or image title
|
|
185
|
+
# - False: do not add HDF5 file name in signal or image title
|
|
186
|
+
h5_fname_in_title = conf.Option()
|
|
187
|
+
|
|
188
|
+
# ImageIO supported file formats:
|
|
189
|
+
imageio_formats = conf.Option()
|
|
190
|
+
|
|
191
|
+
# Dialog settings persistence (JSON-serialized datasets):
|
|
192
|
+
save_to_directory_settings = conf.DataSetOption()
|
|
193
|
+
add_metadata_settings = conf.DataSetOption()
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class ProcSection(conf.Section, metaclass=conf.SectionMeta):
|
|
197
|
+
"""Class defining the Processing configuration section structure.
|
|
198
|
+
Each class attribute is an option (metaclass is automatically affecting
|
|
199
|
+
option names in .INI file based on class attribute names)."""
|
|
200
|
+
|
|
201
|
+
# Operation mode:
|
|
202
|
+
# - "single": single operand mode
|
|
203
|
+
# - "pairwise": pairwise operation mode
|
|
204
|
+
operation_mode = conf.EnumOption(["single", "pairwise"], default="single")
|
|
205
|
+
|
|
206
|
+
# ROI extraction strategy:
|
|
207
|
+
# - True: extract all ROIs in a single signal or image
|
|
208
|
+
# - False: extract each ROI in a separate signal or image
|
|
209
|
+
extract_roi_singleobj = conf.Option()
|
|
210
|
+
|
|
211
|
+
# Keep analysis results after processing:
|
|
212
|
+
# - True: keep analysis results (dangerous because results may not be valid anymore)
|
|
213
|
+
# - False: do not keep analysis results (default)
|
|
214
|
+
keep_results = conf.Option()
|
|
215
|
+
|
|
216
|
+
# Show systematically result dialog after processing:
|
|
217
|
+
show_result_dialog = conf.Option()
|
|
218
|
+
|
|
219
|
+
# Use xmin and xmax bounds from current signal when creating a new signal:
|
|
220
|
+
use_signal_bounds = conf.Option()
|
|
221
|
+
|
|
222
|
+
# Use dimensions from current image when creating a new image:
|
|
223
|
+
use_image_dims = conf.Option()
|
|
224
|
+
|
|
225
|
+
# FFT shift enabled state for signal/image processing:
|
|
226
|
+
# - True: FFT shift is enabled (default)
|
|
227
|
+
# - False: FFT shift is disabled
|
|
228
|
+
fft_shift_enabled = conf.Option()
|
|
229
|
+
|
|
230
|
+
# Auto-normalize convolution kernel for signal/image processing:
|
|
231
|
+
# - True: automatically normalize kernel (default)
|
|
232
|
+
# - False: do not normalize kernel
|
|
233
|
+
auto_normalize_kernel = conf.Option()
|
|
234
|
+
|
|
235
|
+
# Ignore warnings during computation:
|
|
236
|
+
# - True: ignore warnings
|
|
237
|
+
# - False: do not ignore warnings
|
|
238
|
+
ignore_warnings = conf.Option()
|
|
239
|
+
|
|
240
|
+
# X-array compatibility behavior for multi-signal computations:
|
|
241
|
+
# - "ask": ask user for confirmation when x-arrays are incompatible (default)
|
|
242
|
+
# - "interpolate": automatically interpolate when x-arrays are incompatible
|
|
243
|
+
xarray_compat_behavior = conf.EnumOption(["ask", "interpolate"], default="ask")
|
|
244
|
+
|
|
245
|
+
# History and analysis tabs font
|
|
246
|
+
small_mono_font = conf.FontOption()
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class ViewSection(conf.Section, metaclass=conf.SectionMeta):
|
|
250
|
+
"""Class defining the view configuration section structure.
|
|
251
|
+
Each class attribute is an option (metaclass is automatically affecting
|
|
252
|
+
option names in .INI file based on class attribute names)."""
|
|
253
|
+
|
|
254
|
+
# Toolbar position:
|
|
255
|
+
# - "top": top
|
|
256
|
+
# - "bottom": bottom
|
|
257
|
+
# - "left": left
|
|
258
|
+
# - "right": right
|
|
259
|
+
plot_toolbar_position = conf.Option()
|
|
260
|
+
|
|
261
|
+
# Ignore information message when inserting object title as annotation label:
|
|
262
|
+
ignore_title_insertion_msg = conf.Option()
|
|
263
|
+
|
|
264
|
+
# String formatting for shape legends
|
|
265
|
+
sig_format = conf.Option()
|
|
266
|
+
ima_format = conf.Option()
|
|
267
|
+
|
|
268
|
+
show_label = conf.Option()
|
|
269
|
+
auto_refresh = conf.Option()
|
|
270
|
+
show_first_only = conf.Option() # Show only first selected item
|
|
271
|
+
show_contrast = conf.Option()
|
|
272
|
+
sig_linewidth = conf.Option()
|
|
273
|
+
sig_linewidth_perfs_threshold = conf.Option()
|
|
274
|
+
sig_antialiasing = conf.Option()
|
|
275
|
+
sig_autodownsampling = conf.Option()
|
|
276
|
+
sig_autodownsampling_maxpoints = conf.Option()
|
|
277
|
+
|
|
278
|
+
# Autoscale margin settings for plots (percentage values)
|
|
279
|
+
sig_autoscale_margin_percent = conf.Option()
|
|
280
|
+
ima_autoscale_margin_percent = conf.Option()
|
|
281
|
+
|
|
282
|
+
# If True, lock aspect ratio of images to 1:1 (ignore physical pixel size)
|
|
283
|
+
ima_aspect_ratio_1_1 = conf.Option()
|
|
284
|
+
|
|
285
|
+
# Default visualization settings at item creation
|
|
286
|
+
# (e.g. see adapter's `make_item` methods in datalab/adapters_plotpy/*.py)
|
|
287
|
+
ima_eliminate_outliers = conf.Option()
|
|
288
|
+
|
|
289
|
+
# Default visualization settings, persisted in object metadata
|
|
290
|
+
# (e.g. see `BaseDataPanel.update_metadata_view_settings`)
|
|
291
|
+
sig_def_shade = conf.Option()
|
|
292
|
+
sig_def_curvestyle = conf.Option()
|
|
293
|
+
sig_def_baseline = conf.Option()
|
|
294
|
+
# ⚠️ Do not add "sig_def_use_dsamp" and "sig_def_dsamp_factor" options here
|
|
295
|
+
# because it would not be compatible with the auto-downsampling feature.
|
|
296
|
+
|
|
297
|
+
# Default visualization settings, persisted in object metadata
|
|
298
|
+
# (e.g. see `BaseDataPanel.update_metadata_view_settings`)
|
|
299
|
+
ima_def_colormap = conf.Option()
|
|
300
|
+
ima_def_invert_colormap = conf.Option()
|
|
301
|
+
ima_def_interpolation = conf.Option()
|
|
302
|
+
ima_def_alpha = conf.Option()
|
|
303
|
+
ima_def_alpha_function = conf.Option()
|
|
304
|
+
|
|
305
|
+
# Annotated shape and marker visualization settings for signals
|
|
306
|
+
sig_shape_param = conf.DataSetOption()
|
|
307
|
+
sig_marker_param = conf.DataSetOption()
|
|
308
|
+
|
|
309
|
+
# Annotated shape and marker visualization settings for images
|
|
310
|
+
ima_shape_param = conf.DataSetOption()
|
|
311
|
+
ima_marker_param = conf.DataSetOption()
|
|
312
|
+
|
|
313
|
+
# Datetime axis format strings for different time units
|
|
314
|
+
# Format strings use Python's strftime format codes
|
|
315
|
+
sig_datetime_format_s = conf.Option() # Format for s, min, h
|
|
316
|
+
sig_datetime_format_ms = conf.Option() # Format for ms, us, ns
|
|
317
|
+
|
|
318
|
+
# Maximum number of geometry shapes to draw on plot
|
|
319
|
+
# Even if more results are stored, only the first N shapes are drawn
|
|
320
|
+
max_shapes_to_draw = conf.Option()
|
|
321
|
+
|
|
322
|
+
# Maximum number of table cells (rows × columns) to display in merged result
|
|
323
|
+
# label on plot. If exceeded, rows are truncated to stay within this limit.
|
|
324
|
+
# This prevents slowdown with results that have many columns (e.g., polygons)
|
|
325
|
+
max_cells_in_label = conf.Option()
|
|
326
|
+
|
|
327
|
+
# Maximum number of columns to display in merged result label
|
|
328
|
+
# If exceeded, only the first N columns are shown. This ensures readability
|
|
329
|
+
# for results with many columns (e.g., polygon coordinates: x0, y0, x1, y1...)
|
|
330
|
+
max_cols_in_label = conf.Option()
|
|
331
|
+
|
|
332
|
+
# Show merged result label on plot by default
|
|
333
|
+
show_result_label = conf.Option()
|
|
334
|
+
|
|
335
|
+
@classmethod
|
|
336
|
+
def get_def_dict(cls, category: Literal["ima", "sig"]) -> dict:
|
|
337
|
+
"""Get default visualization settings as a dictionary
|
|
338
|
+
|
|
339
|
+
Args:
|
|
340
|
+
category: category ("ima" or "sig", respectively for image and signal)
|
|
341
|
+
|
|
342
|
+
Returns:
|
|
343
|
+
Default visualization settings as a dictionary
|
|
344
|
+
"""
|
|
345
|
+
assert category in ("ima", "sig")
|
|
346
|
+
prefix = f"{category}_def_"
|
|
347
|
+
def_dict = {}
|
|
348
|
+
for attrname in dir(cls):
|
|
349
|
+
if attrname.startswith(prefix):
|
|
350
|
+
name = attrname[len(prefix) :]
|
|
351
|
+
opt = getattr(cls, attrname)
|
|
352
|
+
defval = opt.get(None)
|
|
353
|
+
if defval is not None:
|
|
354
|
+
def_dict[name] = defval
|
|
355
|
+
return def_dict
|
|
356
|
+
|
|
357
|
+
@classmethod
|
|
358
|
+
def set_def_dict(cls, category: Literal["ima", "sig"], def_dict: dict) -> None:
|
|
359
|
+
"""Set default visualization settings from a dictionary
|
|
360
|
+
|
|
361
|
+
Args:
|
|
362
|
+
category: category ("ima" or "sig", respectively for image and signal)
|
|
363
|
+
def_dict: default visualization settings as a dictionary
|
|
364
|
+
"""
|
|
365
|
+
assert category in ("ima", "sig")
|
|
366
|
+
prefix = f"{category}_def_"
|
|
367
|
+
for attrname in dir(cls):
|
|
368
|
+
if attrname.startswith(prefix):
|
|
369
|
+
name = attrname[len(prefix) :]
|
|
370
|
+
opt = getattr(cls, attrname)
|
|
371
|
+
if name in def_dict:
|
|
372
|
+
opt.set(def_dict[name])
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
# Usage (example): Conf.console.console_enabled.get(True)
|
|
376
|
+
class Conf(conf.Configuration, metaclass=conf.ConfMeta):
|
|
377
|
+
"""Class defining DataLab configuration structure.
|
|
378
|
+
Each class attribute is a section (metaclass is automatically affecting
|
|
379
|
+
section names in .INI file based on class attribute names)."""
|
|
380
|
+
|
|
381
|
+
main = MainSection()
|
|
382
|
+
console = ConsoleSection()
|
|
383
|
+
view = ViewSection()
|
|
384
|
+
proc = ProcSection()
|
|
385
|
+
io = IOSection()
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
def get_old_log_fname(fname):
|
|
389
|
+
"""Return old log fname from current log fname"""
|
|
390
|
+
return osp.splitext(fname)[0] + ".1.log"
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def initialize():
|
|
394
|
+
"""Initialize application configuration"""
|
|
395
|
+
config_app_name = get_config_app_name()
|
|
396
|
+
Conf.initialize(config_app_name, CONF_VERSION, load=not DEBUG)
|
|
397
|
+
|
|
398
|
+
# Set default values:
|
|
399
|
+
# -------------------
|
|
400
|
+
# (do not use "set" method here to avoid overwriting user settings in .INI file)
|
|
401
|
+
# Setting here the default values only for the most critical options. The other
|
|
402
|
+
# options default values are set when used in the application code.
|
|
403
|
+
#
|
|
404
|
+
# Main section
|
|
405
|
+
Conf.main.color_mode.get("auto")
|
|
406
|
+
Conf.main.process_isolation_enabled.get(True)
|
|
407
|
+
Conf.main.rpc_server_enabled.get(True)
|
|
408
|
+
Conf.main.traceback_log_path.get(f".{APP_NAME}_traceback.log")
|
|
409
|
+
Conf.main.faulthandler_log_path.get(f".{APP_NAME}_faulthandler.log")
|
|
410
|
+
Conf.main.available_memory_threshold.get(500)
|
|
411
|
+
Conf.main.plugins_enabled.get(True)
|
|
412
|
+
Conf.main.plugins_path.get(Conf.get_path("plugins"))
|
|
413
|
+
Conf.main.tour_enabled.get(True)
|
|
414
|
+
Conf.main.v020_plugins_warning_ignore.get(False)
|
|
415
|
+
# Console section
|
|
416
|
+
Conf.console.console_enabled.get(True)
|
|
417
|
+
Conf.console.show_console_on_error.get(False)
|
|
418
|
+
Conf.console.external_editor_path.get("code")
|
|
419
|
+
Conf.console.external_editor_args.get("-g {path}:{line_number}")
|
|
420
|
+
# IO section
|
|
421
|
+
Conf.io.h5_clear_workspace.get(True) # Default to avoid objects UUID reset
|
|
422
|
+
Conf.io.h5_clear_workspace_ask.get(True)
|
|
423
|
+
Conf.io.h5_fullpath_in_title.get(False)
|
|
424
|
+
Conf.io.h5_fname_in_title.get(True)
|
|
425
|
+
iofmts = Conf.io.imageio_formats.get(())
|
|
426
|
+
if len(iofmts) > 0:
|
|
427
|
+
sigima_options.imageio_formats.set(iofmts) # Sync with sigima config
|
|
428
|
+
# Proc section
|
|
429
|
+
Conf.proc.operation_mode.get("single")
|
|
430
|
+
Conf.proc.use_signal_bounds.get(False)
|
|
431
|
+
Conf.proc.use_image_dims.get(True)
|
|
432
|
+
Conf.proc.fft_shift_enabled.get(True)
|
|
433
|
+
sigima_options.fft_shift_enabled.set(True) # Sync with sigima config
|
|
434
|
+
Conf.proc.auto_normalize_kernel.get(False)
|
|
435
|
+
sigima_options.auto_normalize_kernel.set(False) # Sync with sigima config
|
|
436
|
+
Conf.proc.extract_roi_singleobj.get(False)
|
|
437
|
+
Conf.proc.keep_results.get(False)
|
|
438
|
+
Conf.proc.show_result_dialog.get(True)
|
|
439
|
+
Conf.proc.ignore_warnings.get(False)
|
|
440
|
+
Conf.proc.xarray_compat_behavior.get("ask")
|
|
441
|
+
Conf.proc.small_mono_font.get((configtools.MONOSPACE, 8, False))
|
|
442
|
+
# View section
|
|
443
|
+
tb_pos = Conf.view.plot_toolbar_position.get("left")
|
|
444
|
+
assert tb_pos in ("top", "bottom", "left", "right")
|
|
445
|
+
Conf.view.ignore_title_insertion_msg.get(False)
|
|
446
|
+
Conf.view.sig_linewidth.get(1.0)
|
|
447
|
+
Conf.view.sig_linewidth_perfs_threshold.get(1000)
|
|
448
|
+
Conf.view.sig_autodownsampling.get(True)
|
|
449
|
+
Conf.view.sig_autodownsampling_maxpoints.get(100000)
|
|
450
|
+
Conf.view.sig_autoscale_margin_percent.get(2.0)
|
|
451
|
+
Conf.view.ima_autoscale_margin_percent.get(1.0)
|
|
452
|
+
Conf.view.ima_aspect_ratio_1_1.get(False)
|
|
453
|
+
Conf.view.ima_eliminate_outliers.get(0.1)
|
|
454
|
+
Conf.view.sig_def_shade.get(0.0)
|
|
455
|
+
Conf.view.sig_def_curvestyle.get("Lines")
|
|
456
|
+
Conf.view.sig_def_baseline.get(0.0)
|
|
457
|
+
Conf.view.ima_def_colormap.get("viridis")
|
|
458
|
+
Conf.view.ima_def_invert_colormap.get(False)
|
|
459
|
+
Conf.view.ima_def_interpolation.get(5)
|
|
460
|
+
Conf.view.ima_def_alpha.get(1.0)
|
|
461
|
+
Conf.view.ima_def_alpha_function.get(LUTAlpha.NONE.value)
|
|
462
|
+
|
|
463
|
+
# Datetime format strings: % must be escaped as %% for ConfigParser
|
|
464
|
+
Conf.view.sig_datetime_format_s.get("%%H:%%M:%%S")
|
|
465
|
+
Conf.view.sig_datetime_format_ms.get("%%H:%%M:%%S.%%f")
|
|
466
|
+
|
|
467
|
+
Conf.view.max_shapes_to_draw.get(1000)
|
|
468
|
+
Conf.view.max_cells_in_label.get(100)
|
|
469
|
+
Conf.view.max_cols_in_label.get(15)
|
|
470
|
+
Conf.view.show_result_label.get(True)
|
|
471
|
+
|
|
472
|
+
# Initialize PlotPy configuration with versioned app name
|
|
473
|
+
PLOTPY_CONF.set_application(
|
|
474
|
+
osp.join(config_app_name, "plotpy"), CONF_VERSION, load=False
|
|
475
|
+
)
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
def reset():
|
|
479
|
+
"""Reset application configuration"""
|
|
480
|
+
Conf.reset()
|
|
481
|
+
initialize()
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
initialize()
|
|
485
|
+
|
|
486
|
+
ROI_LINE_COLOR = "#5555ff"
|
|
487
|
+
ROI_SEL_LINE_COLOR = "#9393ff"
|
|
488
|
+
|
|
489
|
+
PLOTPY_DEFAULTS = {
|
|
490
|
+
"plot": {
|
|
491
|
+
#
|
|
492
|
+
# XXX: If needed in the future, add here the default settings for PlotPy:
|
|
493
|
+
# that will override the PlotPy settings.
|
|
494
|
+
# That is the right way to customize the PlotPy settings for shapes and
|
|
495
|
+
# annotations when they are added using tools from the DataLab application
|
|
496
|
+
# (see `BaseDataPanel.ANNOTATION_TOOLS`).
|
|
497
|
+
# For example, for shapes:
|
|
498
|
+
# "shape/drag/line/color": "#00ffff",
|
|
499
|
+
#
|
|
500
|
+
# Overriding default plot settings from PlotPy
|
|
501
|
+
"title/font/size": 11,
|
|
502
|
+
"title/font/bold": False,
|
|
503
|
+
"selected_curve_symbol/marker": "Ellipse",
|
|
504
|
+
"selected_curve_symbol/edgecolor": "#a0a0a4",
|
|
505
|
+
"selected_curve_symbol/facecolor": MAIN_FG_COLOR,
|
|
506
|
+
"selected_curve_symbol/alpha": 0.3,
|
|
507
|
+
"selected_curve_symbol/size": 5,
|
|
508
|
+
"marker/curve/text/textcolor": "black",
|
|
509
|
+
"marker/cross/text/textcolor": "black",
|
|
510
|
+
"marker/cross/text/background_alpha": 0.7,
|
|
511
|
+
# Cursor line and symbol style
|
|
512
|
+
"marker/cursor/line/style": "SolidLine",
|
|
513
|
+
"marker/cursor/line/color": "#A11818",
|
|
514
|
+
"marker/cursor/line/width": 1.0,
|
|
515
|
+
"marker/cursor/symbol/marker": "NoSymbol",
|
|
516
|
+
"marker/cursor/symbol/size": 11,
|
|
517
|
+
"marker/cursor/symbol/edgecolor": MAIN_BG_COLOR,
|
|
518
|
+
"marker/cursor/symbol/facecolor": "#ff9393",
|
|
519
|
+
"marker/cursor/symbol/alpha": 1.0,
|
|
520
|
+
"marker/cursor/sel_line/style": "SolidLine",
|
|
521
|
+
"marker/cursor/sel_line/color": "#A11818",
|
|
522
|
+
"marker/cursor/sel_line/width": 2.0,
|
|
523
|
+
"marker/cursor/sel_symbol/marker": "NoSymbol",
|
|
524
|
+
"marker/cursor/sel_symbol/size": 11,
|
|
525
|
+
"marker/cursor/sel_symbol/edgecolor": MAIN_BG_COLOR,
|
|
526
|
+
"marker/cursor/sel_symbol/facecolor": "#A11818",
|
|
527
|
+
"marker/cursor/sel_symbol/alpha": 0.8,
|
|
528
|
+
"marker/cursor/text/font/size": 9,
|
|
529
|
+
"marker/cursor/text/font/family": "default",
|
|
530
|
+
"marker/cursor/text/font/bold": False,
|
|
531
|
+
"marker/cursor/text/font/italic": False,
|
|
532
|
+
"marker/cursor/text/textcolor": "#440909",
|
|
533
|
+
"marker/cursor/text/background_color": "#ffffff",
|
|
534
|
+
"marker/cursor/text/background_alpha": 0.7,
|
|
535
|
+
"marker/cursor/sel_text/font/size": 9,
|
|
536
|
+
"marker/cursor/sel_text/font/family": "default",
|
|
537
|
+
"marker/cursor/sel_text/font/bold": False,
|
|
538
|
+
"marker/cursor/sel_text/font/italic": False,
|
|
539
|
+
"marker/cursor/sel_text/textcolor": "#440909",
|
|
540
|
+
"marker/cursor/sel_text/background_color": "#ffffff",
|
|
541
|
+
"marker/cursor/sel_text/background_alpha": 0.7,
|
|
542
|
+
},
|
|
543
|
+
"results": {
|
|
544
|
+
# Annotated shape style for result shapes:
|
|
545
|
+
# Signals:
|
|
546
|
+
"s/annotation/line/style": "SolidLine",
|
|
547
|
+
"s/annotation/line/color": MAIN_FG_COLOR,
|
|
548
|
+
"s/annotation/line/width": 1,
|
|
549
|
+
"s/annotation/fill/style": "SolidPattern",
|
|
550
|
+
"s/annotation/fill/color": MAIN_BG_COLOR,
|
|
551
|
+
"s/annotation/fill/alpha": 0.1,
|
|
552
|
+
"s/annotation/symbol/marker": "XCross",
|
|
553
|
+
"s/annotation/symbol/size": 7,
|
|
554
|
+
"s/annotation/symbol/edgecolor": MAIN_FG_COLOR,
|
|
555
|
+
"s/annotation/symbol/facecolor": MAIN_FG_COLOR,
|
|
556
|
+
"s/annotation/symbol/alpha": 1.0,
|
|
557
|
+
"s/annotation/sel_line/style": "DashLine",
|
|
558
|
+
"s/annotation/sel_line/color": "#00ff00",
|
|
559
|
+
"s/annotation/sel_line/width": 1,
|
|
560
|
+
"s/annotation/sel_fill/style": "SolidPattern",
|
|
561
|
+
"s/annotation/sel_fill/color": MAIN_BG_COLOR,
|
|
562
|
+
"s/annotation/sel_fill/alpha": 0.1,
|
|
563
|
+
"s/annotation/sel_symbol/marker": "Rect",
|
|
564
|
+
"s/annotation/sel_symbol/size": 9,
|
|
565
|
+
"s/annotation/sel_symbol/edgecolor": "#00aa00",
|
|
566
|
+
"s/annotation/sel_symbol/facecolor": "#00ff00",
|
|
567
|
+
"s/annotation/sel_symbol/alpha": 0.7,
|
|
568
|
+
# Images:
|
|
569
|
+
"i/annotation/line/style": "SolidLine",
|
|
570
|
+
"i/annotation/line/color": "#ffff00",
|
|
571
|
+
"i/annotation/line/width": 2,
|
|
572
|
+
"i/annotation/fill/style": "SolidPattern",
|
|
573
|
+
"i/annotation/fill/color": MAIN_BG_COLOR,
|
|
574
|
+
"i/annotation/fill/alpha": 0.1,
|
|
575
|
+
"i/annotation/symbol/marker": "Rect",
|
|
576
|
+
"i/annotation/symbol/size": 3,
|
|
577
|
+
"i/annotation/symbol/edgecolor": "#ffff00",
|
|
578
|
+
"i/annotation/symbol/facecolor": "#ffff00",
|
|
579
|
+
"i/annotation/symbol/alpha": 1.0,
|
|
580
|
+
"i/annotation/sel_line/style": "SolidLine",
|
|
581
|
+
"i/annotation/sel_line/color": "#00ff00",
|
|
582
|
+
"i/annotation/sel_line/width": 2,
|
|
583
|
+
"i/annotation/sel_fill/style": "SolidPattern",
|
|
584
|
+
"i/annotation/sel_fill/color": MAIN_BG_COLOR,
|
|
585
|
+
"i/annotation/sel_fill/alpha": 0.1,
|
|
586
|
+
"i/annotation/sel_symbol/marker": "Rect",
|
|
587
|
+
"i/annotation/sel_symbol/size": 9,
|
|
588
|
+
"i/annotation/sel_symbol/edgecolor": "#00aa00",
|
|
589
|
+
"i/annotation/sel_symbol/facecolor": "#00ff00",
|
|
590
|
+
"i/annotation/sel_symbol/alpha": 0.7,
|
|
591
|
+
# Marker styles for results:
|
|
592
|
+
# Signals:
|
|
593
|
+
"s/marker/cursor/line/style": "DashLine",
|
|
594
|
+
"s/marker/cursor/line/color": "#ffff00",
|
|
595
|
+
"s/marker/cursor/line/width": 1.0,
|
|
596
|
+
"s/marker/cursor/symbol/marker": "Ellipse",
|
|
597
|
+
"s/marker/cursor/symbol/size": 11,
|
|
598
|
+
"s/marker/cursor/symbol/edgecolor": MAIN_BG_COLOR,
|
|
599
|
+
"s/marker/cursor/symbol/facecolor": "#ffff00",
|
|
600
|
+
"s/marker/cursor/symbol/alpha": 0.7,
|
|
601
|
+
"s/marker/cursor/sel_line/style": "DashLine",
|
|
602
|
+
"s/marker/cursor/sel_line/color": "#ffff00",
|
|
603
|
+
"s/marker/cursor/sel_line/width": 2.0,
|
|
604
|
+
"s/marker/cursor/sel_symbol/marker": "Ellipse",
|
|
605
|
+
"s/marker/cursor/sel_symbol/size": 11,
|
|
606
|
+
"s/marker/cursor/sel_symbol/edgecolor": "#ffff00",
|
|
607
|
+
"s/marker/cursor/sel_symbol/facecolor": "#ffff00",
|
|
608
|
+
"s/marker/cursor/sel_symbol/alpha": 0.7,
|
|
609
|
+
"s/marker/cursor/text/font/size": 9,
|
|
610
|
+
"s/marker/cursor/text/font/family": "default",
|
|
611
|
+
"s/marker/cursor/text/font/bold": False,
|
|
612
|
+
"s/marker/cursor/text/font/italic": False,
|
|
613
|
+
"s/marker/cursor/text/textcolor": "#440909",
|
|
614
|
+
"s/marker/cursor/text/background_color": "#ffffff",
|
|
615
|
+
"s/marker/cursor/text/background_alpha": 0.7,
|
|
616
|
+
"s/marker/cursor/sel_text/font/size": 9,
|
|
617
|
+
"s/marker/cursor/sel_text/font/family": "default",
|
|
618
|
+
"s/marker/cursor/sel_text/font/bold": False,
|
|
619
|
+
"s/marker/cursor/sel_text/font/italic": False,
|
|
620
|
+
"s/marker/cursor/sel_text/textcolor": "#440909",
|
|
621
|
+
"s/marker/cursor/sel_text/background_color": "#ffffff",
|
|
622
|
+
"s/marker/cursor/sel_text/background_alpha": 0.7,
|
|
623
|
+
"s/marker/cursor/markerstyle": "Cross",
|
|
624
|
+
# Images:
|
|
625
|
+
"i/marker/cursor/line/style": "DashLine",
|
|
626
|
+
"i/marker/cursor/line/color": "#ffff00",
|
|
627
|
+
"i/marker/cursor/line/width": 1.0,
|
|
628
|
+
"i/marker/cursor/symbol/marker": "Diamond",
|
|
629
|
+
"i/marker/cursor/symbol/size": 11,
|
|
630
|
+
"i/marker/cursor/symbol/edgecolor": "#ffff00",
|
|
631
|
+
"i/marker/cursor/symbol/facecolor": "#ffff00",
|
|
632
|
+
"i/marker/cursor/symbol/alpha": 0.7,
|
|
633
|
+
"i/marker/cursor/sel_line/style": "DashLine",
|
|
634
|
+
"i/marker/cursor/sel_line/color": "#ffff00",
|
|
635
|
+
"i/marker/cursor/sel_line/width": 2.0,
|
|
636
|
+
"i/marker/cursor/sel_symbol/marker": "Diamond",
|
|
637
|
+
"i/marker/cursor/sel_symbol/size": 11,
|
|
638
|
+
"i/marker/cursor/sel_symbol/edgecolor": "#ffff00",
|
|
639
|
+
"i/marker/cursor/sel_symbol/facecolor": "#ffff00",
|
|
640
|
+
"i/marker/cursor/sel_symbol/alpha": 0.7,
|
|
641
|
+
"i/marker/cursor/text/font/size": 9,
|
|
642
|
+
"i/marker/cursor/text/font/family": "default",
|
|
643
|
+
"i/marker/cursor/text/font/bold": False,
|
|
644
|
+
"i/marker/cursor/text/font/italic": False,
|
|
645
|
+
"i/marker/cursor/text/textcolor": "#440909",
|
|
646
|
+
"i/marker/cursor/text/background_color": "#ffffff",
|
|
647
|
+
"i/marker/cursor/text/background_alpha": 0.7,
|
|
648
|
+
"i/marker/cursor/sel_text/font/size": 9,
|
|
649
|
+
"i/marker/cursor/sel_text/font/family": "default",
|
|
650
|
+
"i/marker/cursor/sel_text/font/bold": False,
|
|
651
|
+
"i/marker/cursor/sel_text/font/italic": False,
|
|
652
|
+
"i/marker/cursor/sel_text/textcolor": "#440909",
|
|
653
|
+
"i/marker/cursor/sel_text/background_color": "#ffffff",
|
|
654
|
+
"i/marker/cursor/sel_text/background_alpha": 0.7,
|
|
655
|
+
"i/marker/cursor/markerstyle": "Cross",
|
|
656
|
+
# Style for labels:
|
|
657
|
+
"label/symbol/marker": "NoSymbol",
|
|
658
|
+
"label/symbol/size": 0,
|
|
659
|
+
"label/symbol/edgecolor": MAIN_BG_COLOR,
|
|
660
|
+
"label/symbol/facecolor": MAIN_BG_COLOR,
|
|
661
|
+
"label/border/style": "SolidLine",
|
|
662
|
+
"label/border/color": "#cbcbcb",
|
|
663
|
+
"label/border/width": 1,
|
|
664
|
+
"label/font/size": 8,
|
|
665
|
+
"label/font/family/nt": ["Cascadia Code", "Consolas", "Courier New"],
|
|
666
|
+
"label/font/family/posix": "Bitstream Vera Sans Mono",
|
|
667
|
+
"label/font/family/mac": "Monaco",
|
|
668
|
+
"label/font/bold": False,
|
|
669
|
+
"label/font/italic": False,
|
|
670
|
+
"label/color": MAIN_FG_COLOR,
|
|
671
|
+
"label/bgcolor": MAIN_BG_COLOR,
|
|
672
|
+
"label/bgalpha": 0.8,
|
|
673
|
+
"label/anchor": "TL",
|
|
674
|
+
"label/xc": 10,
|
|
675
|
+
"label/yc": 10,
|
|
676
|
+
"label/abspos": True,
|
|
677
|
+
"label/absg": "TL",
|
|
678
|
+
"label/xg": 0.0,
|
|
679
|
+
"label/yg": 0.0,
|
|
680
|
+
},
|
|
681
|
+
"roi": { # Shape style for ROI
|
|
682
|
+
# Signals:
|
|
683
|
+
# - Editable ROI (ROI editor):
|
|
684
|
+
"s/editable/fill": "#ffff00",
|
|
685
|
+
"s/editable/shade": 0.10,
|
|
686
|
+
"s/editable/line/style": "SolidLine",
|
|
687
|
+
"s/editable/line/color": "#ffff00",
|
|
688
|
+
"s/editable/line/width": 1,
|
|
689
|
+
"s/editable/fill/style": "SolidPattern",
|
|
690
|
+
"s/editable/fill/color": MAIN_BG_COLOR,
|
|
691
|
+
"s/editable/fill/alpha": 0.1,
|
|
692
|
+
"s/editable/symbol/marker": "Rect",
|
|
693
|
+
"s/editable/symbol/size": 3,
|
|
694
|
+
"s/editable/symbol/edgecolor": "#ffff00",
|
|
695
|
+
"s/editable/symbol/facecolor": "#ffff00",
|
|
696
|
+
"s/editable/symbol/alpha": 1.0,
|
|
697
|
+
"s/editable/sel_line/style": "SolidLine",
|
|
698
|
+
"s/editable/sel_line/color": "#00ff00",
|
|
699
|
+
"s/editable/sel_line/width": 1,
|
|
700
|
+
"s/editable/sel_fill/style": "SolidPattern",
|
|
701
|
+
"s/editable/sel_fill/color": MAIN_BG_COLOR,
|
|
702
|
+
"s/editable/sel_fill/alpha": 0.1,
|
|
703
|
+
"s/editable/sel_symbol/marker": "Rect",
|
|
704
|
+
"s/editable/sel_symbol/size": 9,
|
|
705
|
+
"s/editable/sel_symbol/edgecolor": "#00aa00",
|
|
706
|
+
"s/editable/sel_symbol/facecolor": "#00ff00",
|
|
707
|
+
"s/editable/sel_symbol/alpha": 0.7,
|
|
708
|
+
# - Readonly ROI (plot):
|
|
709
|
+
"s/readonly/line/style": "SolidLine",
|
|
710
|
+
"s/readonly/line/color": ROI_LINE_COLOR,
|
|
711
|
+
"s/readonly/line/width": 1,
|
|
712
|
+
"s/readonly/sel_line/style": "SolidLine",
|
|
713
|
+
"s/readonly/sel_line/color": ROI_SEL_LINE_COLOR,
|
|
714
|
+
"s/readonly/sel_line/width": 2,
|
|
715
|
+
"s/readonly/fill": ROI_LINE_COLOR,
|
|
716
|
+
"s/readonly/shade": 0.10,
|
|
717
|
+
"s/readonly/symbol/marker": "Ellipse",
|
|
718
|
+
"s/readonly/symbol/size": 7,
|
|
719
|
+
"s/readonly/symbol/edgecolor": MAIN_BG_COLOR,
|
|
720
|
+
"s/readonly/symbol/facecolor": ROI_LINE_COLOR,
|
|
721
|
+
"s/readonly/symbol/alpha": 1.0,
|
|
722
|
+
"s/readonly/sel_symbol/marker": "Ellipse",
|
|
723
|
+
"s/readonly/sel_symbol/size": 9,
|
|
724
|
+
"s/readonly/sel_symbol/edgecolor": MAIN_BG_COLOR,
|
|
725
|
+
"s/readonly/sel_symbol/facecolor": ROI_SEL_LINE_COLOR,
|
|
726
|
+
"s/readonly/sel_symbol/alpha": 0.9,
|
|
727
|
+
"s/readonly/multi/color": "#806060",
|
|
728
|
+
# Images:
|
|
729
|
+
# - Editable ROI (ROI editor):
|
|
730
|
+
"i/editable/line/style": "SolidLine",
|
|
731
|
+
"i/editable/line/color": "#ffff00",
|
|
732
|
+
"i/editable/line/width": 1,
|
|
733
|
+
"i/editable/fill/style": "SolidPattern",
|
|
734
|
+
"i/editable/fill/color": MAIN_BG_COLOR,
|
|
735
|
+
"i/editable/fill/alpha": 0.1,
|
|
736
|
+
"i/editable/symbol/marker": "Rect",
|
|
737
|
+
"i/editable/symbol/size": 3,
|
|
738
|
+
"i/editable/symbol/edgecolor": "#ffff00",
|
|
739
|
+
"i/editable/symbol/facecolor": "#ffff00",
|
|
740
|
+
"i/editable/symbol/alpha": 1.0,
|
|
741
|
+
"i/editable/sel_line/style": "SolidLine",
|
|
742
|
+
"i/editable/sel_line/color": "#00ff00",
|
|
743
|
+
"i/editable/sel_line/width": 1,
|
|
744
|
+
"i/editable/sel_fill/style": "SolidPattern",
|
|
745
|
+
"i/editable/sel_fill/color": MAIN_BG_COLOR,
|
|
746
|
+
"i/editable/sel_fill/alpha": 0.1,
|
|
747
|
+
"i/editable/sel_symbol/marker": "Rect",
|
|
748
|
+
"i/editable/sel_symbol/size": 9,
|
|
749
|
+
"i/editable/sel_symbol/edgecolor": "#00aa00",
|
|
750
|
+
"i/editable/sel_symbol/facecolor": "#00ff00",
|
|
751
|
+
"i/editable/sel_symbol/alpha": 0.7,
|
|
752
|
+
# - Readonly ROI (plot):
|
|
753
|
+
"i/readonly/line/style": "DotLine",
|
|
754
|
+
"i/readonly/line/color": ROI_LINE_COLOR,
|
|
755
|
+
"i/readonly/line/width": 1,
|
|
756
|
+
"i/readonly/fill/style": "SolidPattern",
|
|
757
|
+
"i/readonly/fill/color": MAIN_BG_COLOR,
|
|
758
|
+
"i/readonly/fill/alpha": 0.1,
|
|
759
|
+
"i/readonly/symbol/marker": "NoSymbol",
|
|
760
|
+
"i/readonly/symbol/size": 5,
|
|
761
|
+
"i/readonly/symbol/edgecolor": ROI_LINE_COLOR,
|
|
762
|
+
"i/readonly/symbol/facecolor": ROI_LINE_COLOR,
|
|
763
|
+
"i/readonly/symbol/alpha": 0.6,
|
|
764
|
+
"i/readonly/sel_line/style": "DotLine",
|
|
765
|
+
"i/readonly/sel_line/color": "#0000ff",
|
|
766
|
+
"i/readonly/sel_line/width": 1,
|
|
767
|
+
"i/readonly/sel_fill/style": "SolidPattern",
|
|
768
|
+
"i/readonly/sel_fill/color": MAIN_BG_COLOR,
|
|
769
|
+
"i/readonly/sel_fill/alpha": 0.1,
|
|
770
|
+
"i/readonly/sel_symbol/marker": "Rect",
|
|
771
|
+
"i/readonly/sel_symbol/size": 8,
|
|
772
|
+
"i/readonly/sel_symbol/edgecolor": "#0000aa",
|
|
773
|
+
"i/readonly/sel_symbol/facecolor": "#0000ff",
|
|
774
|
+
"i/readonly/sel_symbol/alpha": 0.7,
|
|
775
|
+
},
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
# PlotPy configuration will be initialized in initialize() function
|
|
779
|
+
PLOTPY_CONF.update_defaults(PLOTPY_DEFAULTS)
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
class DataLabShapeParam(ShapeParam):
|
|
783
|
+
"""ShapeParam subclass with internal items hidden from settings dialog"""
|
|
784
|
+
|
|
785
|
+
def __init__(self):
|
|
786
|
+
super().__init__()
|
|
787
|
+
# Hide internal items that should not appear in settings dialog
|
|
788
|
+
for item in self._items:
|
|
789
|
+
if item._name in ("label", "readonly", "private"):
|
|
790
|
+
item.set_prop("display", hide=True)
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
def initialize_default_plotpy_instances():
|
|
794
|
+
"""Initialize default PlotPy instances for DataLab configuration options"""
|
|
795
|
+
# Initialize default instances for DataSetOptions now that PLOTPY_DEFAULTS exists
|
|
796
|
+
_sig_shapeparam = DataLabShapeParam()
|
|
797
|
+
_sig_shapeparam.read_config(PLOTPY_CONF, "results", "s/annotation")
|
|
798
|
+
Conf.view.sig_shape_param.set_default_instance(_sig_shapeparam)
|
|
799
|
+
Conf.view.sig_shape_param.get()
|
|
800
|
+
|
|
801
|
+
_sig_markerparam = MarkerParam()
|
|
802
|
+
_sig_markerparam.read_config(PLOTPY_CONF, "results", "s/marker/cursor")
|
|
803
|
+
Conf.view.sig_marker_param.set_default_instance(_sig_markerparam)
|
|
804
|
+
Conf.view.sig_marker_param.get()
|
|
805
|
+
|
|
806
|
+
_ima_shapeparam = DataLabShapeParam()
|
|
807
|
+
_ima_shapeparam.read_config(PLOTPY_CONF, "results", "i/annotation")
|
|
808
|
+
Conf.view.ima_shape_param.set_default_instance(_ima_shapeparam)
|
|
809
|
+
Conf.view.ima_shape_param.get()
|
|
810
|
+
|
|
811
|
+
_ima_markerparam = MarkerParam()
|
|
812
|
+
_ima_markerparam.read_config(PLOTPY_CONF, "results", "i/marker/cursor")
|
|
813
|
+
Conf.view.ima_marker_param.set_default_instance(_ima_markerparam)
|
|
814
|
+
Conf.view.ima_marker_param.get()
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
initialize_default_plotpy_instances()
|