pymodaq 4.2.4__py3-none-any.whl → 5.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.
Potentially problematic release.
This version of pymodaq might be problematic. Click here for more details.
- pymodaq/__init__.py +30 -23
- pymodaq/control_modules/daq_move.py +27 -14
- pymodaq/control_modules/daq_move_ui.py +28 -12
- pymodaq/control_modules/daq_viewer.py +38 -28
- pymodaq/control_modules/daq_viewer_ui.py +6 -6
- pymodaq/control_modules/mocks.py +1 -1
- pymodaq/control_modules/move_utility_classes.py +19 -10
- pymodaq/control_modules/utils.py +18 -12
- pymodaq/control_modules/viewer_utility_classes.py +13 -4
- pymodaq/dashboard.py +164 -115
- pymodaq/examples/custom_app.py +13 -16
- pymodaq/examples/custom_viewer.py +6 -6
- pymodaq/examples/function_plotter.py +13 -12
- pymodaq/examples/parameter_ex.py +50 -25
- pymodaq/examples/tcp_client.py +1 -1
- pymodaq/extensions/__init__.py +1 -1
- pymodaq/extensions/bayesian/bayesian_optimisation.py +15 -12
- pymodaq/extensions/bayesian/utils.py +10 -10
- pymodaq/extensions/console.py +10 -13
- pymodaq/extensions/{daq_logger.py → daq_logger/daq_logger.py} +36 -56
- pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger.py +16 -15
- pymodaq/{utils/db/db_logger → extensions/daq_logger/db}/db_logger_models.py +2 -0
- pymodaq/{utils/h5modules → extensions/daq_logger}/h5logging.py +7 -8
- pymodaq/extensions/daq_scan.py +153 -247
- pymodaq/extensions/daq_scan_ui.py +11 -9
- pymodaq/extensions/h5browser.py +8 -8
- pymodaq/extensions/pid/__init__.py +6 -3
- pymodaq/extensions/pid/daq_move_PID.py +4 -2
- pymodaq/extensions/pid/pid_controller.py +15 -12
- pymodaq/extensions/pid/utils.py +10 -5
- pymodaq/extensions/utils.py +5 -3
- pymodaq/post_treatment/load_and_plot.py +10 -7
- pymodaq/resources/preset_default.xml +1 -1
- pymodaq/utils/array_manipulation.py +4 -384
- pymodaq/utils/calibration_camera.py +12 -9
- pymodaq/utils/chrono_timer.py +7 -5
- pymodaq/utils/config.py +3 -450
- pymodaq/utils/daq_utils.py +6 -708
- pymodaq/utils/data.py +9 -2774
- pymodaq/utils/exceptions.py +0 -4
- pymodaq/utils/gui_utils/__init__.py +8 -8
- pymodaq/utils/gui_utils/loader_utils.py +38 -0
- pymodaq/utils/gui_utils/utils.py +6 -138
- pymodaq/utils/h5modules/__init__.py +0 -4
- pymodaq/utils/h5modules/module_saving.py +15 -8
- pymodaq/utils/leco/__init__.py +2 -2
- pymodaq/utils/leco/daq_move_LECODirector.py +2 -2
- pymodaq/utils/leco/daq_xDviewer_LECODirector.py +2 -2
- pymodaq/utils/leco/director_utils.py +2 -2
- pymodaq/utils/leco/leco_director.py +3 -3
- pymodaq/utils/leco/pymodaq_listener.py +2 -2
- pymodaq/utils/leco/utils.py +1 -1
- pymodaq/utils/logger.py +4 -76
- pymodaq/utils/managers/batchscan_manager.py +16 -19
- pymodaq/utils/managers/modules_manager.py +10 -7
- pymodaq/utils/managers/overshoot_manager.py +3 -5
- pymodaq/utils/managers/preset_manager.py +37 -15
- pymodaq/utils/managers/preset_manager_utils.py +11 -9
- pymodaq/utils/managers/remote_manager.py +12 -10
- pymodaq/utils/math_utils.py +4 -572
- pymodaq/utils/parameter/__init__.py +4 -11
- pymodaq/utils/parameter/utils.py +4 -299
- pymodaq/utils/scanner/scan_config.py +1 -1
- pymodaq/utils/scanner/scan_factory.py +16 -12
- pymodaq/utils/{plotting → scanner}/scan_selector.py +19 -20
- pymodaq/utils/scanner/scanner.py +10 -8
- pymodaq/utils/scanner/scanners/_1d_scanners.py +8 -5
- pymodaq/utils/scanner/scanners/_2d_scanners.py +5 -5
- pymodaq/utils/scanner/scanners/sequential.py +8 -8
- pymodaq/utils/scanner/scanners/tabular.py +9 -9
- pymodaq/utils/scanner/utils.py +6 -4
- pymodaq/utils/svg/svg_viewer2D.py +3 -4
- pymodaq/utils/tcp_ip/serializer.py +64 -16
- pymodaq/utils/tcp_ip/tcp_server_client.py +10 -8
- {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/METADATA +5 -3
- pymodaq-5.0.0.dist-info/RECORD +123 -0
- pymodaq/post_treatment/process_to_scalar.py +0 -263
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/1d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/2d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/3d.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Add_Step.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Approve_All.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Browse_Dir_Path.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Calculator.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnGroup.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnNum.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnText.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnTime.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ChnWave.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Close3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/CollapseAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ColorPicker.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Contract.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Create.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/DeleteLayer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditOpen.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditRedo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EditUndo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Ellipse.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/EllipseFilled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ErrorMessage.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Error_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Exit.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Expand.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ExpandAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/FFT.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/HLM.ico +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Help_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Histogram.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/LUT_LookUpTable.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MagnifyingGlass_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Marker.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Math.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MeasurementStudio_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Move.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveDown.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/MoveUp.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Multiply.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewFile.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/NewLayer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_File.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/New_Folder.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_1D.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_2D.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_File_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Open_sim.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Options.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Oscilloscope_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Pass.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/RGB.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rectangle.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/RectangleFilled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Redo.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Refresh_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Region.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Rendezvous.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SELECT.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAll_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SaveAs_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Save_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Search.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/SelectPolygon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Select_24.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Settings.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snap&Save.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Snapshot2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Spreadsheet.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Statistics2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Status.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Subtract.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Vision.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Volts.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Wait2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_1_1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_in.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_out.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/Zoom_to_Selection.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/abort.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/advanced2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/autoscale.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/b_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/back.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/bg_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/camera_snap.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/cartesian.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/clear_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/close2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/cluster2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/color.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/color2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/continuous.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/data.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/delay.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/download.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/download2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/error2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ethernet.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/exit2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/fan.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/filter2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/g_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/gear2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/go_to_2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/grab.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/graph.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greenLight2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/green_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/grey_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/greyscale.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/help1_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/home2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/information2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/ini.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/integrator.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/joystick.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_green_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_red_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/light_yellow_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/limiter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/load_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meshPlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/meter_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_contour.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/move_straight_line.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/movie.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/multi_point.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/multiplexer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/new.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/openArrow.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/openTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/oscilloscope3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/overlay.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass2_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pass_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pause.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/permute.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/phase.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/play.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/polar.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/pole_zero.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerMeter.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/powerSwitch_16.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/print2_32.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/properties.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/r_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/radiocontrolbutton.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/read2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/red_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/remove.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/reset.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/rgb_icon.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/robot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/rotation2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/run_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/saturation.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/saveTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/save_ROI.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_horizontally.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/scale_vertically.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/search2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_all2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/select_none.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sequence2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/snap.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sort_ascend.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/spectrumAnalyzer.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/start.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/status_cancelled.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop3.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/stop_all.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/sum.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/surfacePlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/tree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/updateTree.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility2.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/utility_small.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/vector.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/verify.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/video.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/wait.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/waterfallPlot.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/watershed.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/yellow_light.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zip_file.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomAuto.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/Icon_Library/zoomReset.png +0 -0
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.bat +0 -2
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources.qrc +0 -234
- pymodaq/resources/QtDesigner_Ressources/QtDesigner_ressources_rc.py +0 -127150
- pymodaq/resources/QtDesigner_Ressources/icons.svg +0 -142
- pymodaq/resources/VERSION +0 -1
- pymodaq/resources/config_template.toml +0 -94
- pymodaq/resources/triangulation_data.npy +0 -0
- pymodaq/utils/abstract/__init__.py +0 -48
- pymodaq/utils/db/__init__.py +0 -0
- pymodaq/utils/db/db_logger/__init__.py +0 -0
- pymodaq/utils/enums.py +0 -76
- pymodaq/utils/factory.py +0 -82
- pymodaq/utils/gui_utils/custom_app.py +0 -133
- pymodaq/utils/gui_utils/dock.py +0 -107
- pymodaq/utils/gui_utils/file_io.py +0 -93
- pymodaq/utils/gui_utils/layout.py +0 -34
- pymodaq/utils/gui_utils/list_picker.py +0 -38
- pymodaq/utils/gui_utils/widgets/__init__.py +0 -5
- pymodaq/utils/gui_utils/widgets/label.py +0 -24
- pymodaq/utils/gui_utils/widgets/lcd.py +0 -111
- pymodaq/utils/gui_utils/widgets/push.py +0 -149
- pymodaq/utils/gui_utils/widgets/qled.py +0 -62
- pymodaq/utils/gui_utils/widgets/spinbox.py +0 -24
- pymodaq/utils/gui_utils/widgets/table.py +0 -263
- pymodaq/utils/gui_utils/widgets/tree_layout.py +0 -188
- pymodaq/utils/gui_utils/widgets/tree_toml.py +0 -102
- pymodaq/utils/h5modules/backends.py +0 -1022
- pymodaq/utils/h5modules/browsing.py +0 -625
- pymodaq/utils/h5modules/data_saving.py +0 -1105
- pymodaq/utils/h5modules/exporter.py +0 -119
- pymodaq/utils/h5modules/exporters/__init__.py +0 -0
- pymodaq/utils/h5modules/exporters/base.py +0 -111
- pymodaq/utils/h5modules/exporters/flimj.py +0 -63
- pymodaq/utils/h5modules/exporters/hyperspy.py +0 -143
- pymodaq/utils/h5modules/saving.py +0 -866
- pymodaq/utils/h5modules/utils.py +0 -115
- pymodaq/utils/managers/action_manager.py +0 -489
- pymodaq/utils/managers/parameter_manager.py +0 -282
- pymodaq/utils/managers/roi_manager.py +0 -726
- pymodaq/utils/messenger.py +0 -66
- pymodaq/utils/parameter/ioxml.py +0 -542
- pymodaq/utils/parameter/pymodaq_ptypes/__init__.py +0 -38
- pymodaq/utils/parameter/pymodaq_ptypes/bool.py +0 -31
- pymodaq/utils/parameter/pymodaq_ptypes/date.py +0 -126
- pymodaq/utils/parameter/pymodaq_ptypes/filedir.py +0 -143
- pymodaq/utils/parameter/pymodaq_ptypes/itemselect.py +0 -265
- pymodaq/utils/parameter/pymodaq_ptypes/led.py +0 -44
- pymodaq/utils/parameter/pymodaq_ptypes/list.py +0 -150
- pymodaq/utils/parameter/pymodaq_ptypes/numeric.py +0 -18
- pymodaq/utils/parameter/pymodaq_ptypes/pixmap.py +0 -175
- pymodaq/utils/parameter/pymodaq_ptypes/slide.py +0 -145
- pymodaq/utils/parameter/pymodaq_ptypes/table.py +0 -135
- pymodaq/utils/parameter/pymodaq_ptypes/tableview.py +0 -149
- pymodaq/utils/parameter/pymodaq_ptypes/text.py +0 -142
- pymodaq/utils/plotting/__init__.py +0 -0
- pymodaq/utils/plotting/data_viewers/__init__.py +0 -10
- pymodaq/utils/plotting/data_viewers/base.py +0 -286
- pymodaq/utils/plotting/data_viewers/viewer.py +0 -274
- pymodaq/utils/plotting/data_viewers/viewer0D.py +0 -298
- pymodaq/utils/plotting/data_viewers/viewer1D.py +0 -826
- pymodaq/utils/plotting/data_viewers/viewer1Dbasic.py +0 -231
- pymodaq/utils/plotting/data_viewers/viewer2D.py +0 -1118
- pymodaq/utils/plotting/data_viewers/viewer2D_basic.py +0 -146
- pymodaq/utils/plotting/data_viewers/viewerND.py +0 -800
- pymodaq/utils/plotting/gant_chart.py +0 -123
- pymodaq/utils/plotting/image_viewer.py +0 -97
- pymodaq/utils/plotting/items/__init__.py +0 -0
- pymodaq/utils/plotting/items/axis_scaled.py +0 -93
- pymodaq/utils/plotting/items/crosshair.py +0 -94
- pymodaq/utils/plotting/items/image.py +0 -388
- pymodaq/utils/plotting/navigator.py +0 -353
- pymodaq/utils/plotting/plotter/plotter.py +0 -94
- pymodaq/utils/plotting/plotter/plotters/__init__.py +0 -0
- pymodaq/utils/plotting/plotter/plotters/matplotlib_plotters.py +0 -134
- pymodaq/utils/plotting/plotter/plotters/qt_plotters.py +0 -78
- pymodaq/utils/plotting/utils/__init__.py +0 -0
- pymodaq/utils/plotting/utils/axes_viewer.py +0 -88
- pymodaq/utils/plotting/utils/filter.py +0 -585
- pymodaq/utils/plotting/utils/lineout.py +0 -226
- pymodaq/utils/plotting/utils/plot_utils.py +0 -579
- pymodaq/utils/plotting/utils/signalND.py +0 -1347
- pymodaq/utils/plotting/widgets.py +0 -76
- pymodaq/utils/qvariant.py +0 -12
- pymodaq/utils/slicing.py +0 -63
- pymodaq/utils/units.py +0 -216
- pymodaq-4.2.4.dist-info/RECORD +0 -438
- /pymodaq/{post_treatment/daq_analysis → extensions/daq_logger}/__init__.py +0 -0
- /pymodaq/{utils/abstract/logger.py → extensions/daq_logger/abstract.py} +0 -0
- /pymodaq/{resources/QtDesigner_Ressources → extensions/daq_logger/db}/__init__.py +0 -0
- {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/WHEEL +0 -0
- {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/entry_points.txt +0 -0
- {pymodaq-4.2.4.dist-info → pymodaq-5.0.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
import collections
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
import pyqtgraph as pg
|
|
5
|
-
from pymodaq.utils.plotting.utils.plot_utils import makeAlphaTriangles, makePolygons
|
|
6
|
-
from pyqtgraph import debug as debug, Point, functions as fn
|
|
7
|
-
from qtpy import QtCore, QtGui
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class PymodaqImage(pg.ImageItem):
|
|
11
|
-
def __init__(self, image=None, pen='r', **kargs):
|
|
12
|
-
super().__init__(image, **kargs)
|
|
13
|
-
self.flipud = False
|
|
14
|
-
self.fliplr = False
|
|
15
|
-
self.rotate90 = False
|
|
16
|
-
self.rescale = None
|
|
17
|
-
self.opts = {'pen': pen}
|
|
18
|
-
|
|
19
|
-
def get_val_at(self, xy):
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
Parameters
|
|
23
|
-
----------
|
|
24
|
-
xy: (tuple) containing x and y position of the point which you want the value
|
|
25
|
-
|
|
26
|
-
Returns
|
|
27
|
-
-------
|
|
28
|
-
float: the value at the given position in the image
|
|
29
|
-
"""
|
|
30
|
-
raise NotImplementedError
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class UniformImageItem(PymodaqImage):
|
|
34
|
-
def __init__(self, image=None, **kargs):
|
|
35
|
-
super().__init__(image, **kargs)
|
|
36
|
-
|
|
37
|
-
def get_val_at(self, xy):
|
|
38
|
-
"""
|
|
39
|
-
|
|
40
|
-
Parameters
|
|
41
|
-
----------
|
|
42
|
-
xy: (tuple) containing x and y position of the point which you want the value
|
|
43
|
-
|
|
44
|
-
Returns
|
|
45
|
-
-------
|
|
46
|
-
float: the value at the given position in the image
|
|
47
|
-
"""
|
|
48
|
-
return self.image[int(xy[1]), int(xy[0])]
|
|
49
|
-
|
|
50
|
-
# def setRect(self, rect):
|
|
51
|
-
# """Scale and translate the image to fit within rect (must be a QRect or QRectF)."""
|
|
52
|
-
# self.resetTransform()
|
|
53
|
-
# self._dataTransform.translate(rect.left(), rect.top())
|
|
54
|
-
# self._dataTransform.scale(rect.width() / self.width(), rect.height() / self.height())
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class SpreadImageItem(PymodaqImage):
|
|
58
|
-
"""
|
|
59
|
-
**Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>`
|
|
60
|
-
|
|
61
|
-
GraphicsObject displaying an image. Optimized for rapid update (ie video display).
|
|
62
|
-
This item displays either a 2D numpy array (height, width) or
|
|
63
|
-
a 3D array (height, width, RGBa). This array is optionally scaled (see
|
|
64
|
-
:func:`setLevels <pyqtgraph.ImageItem.setLevels>`) and/or colored
|
|
65
|
-
with a lookup table (see :func:`setLookupTable <pyqtgraph.ImageItem.setLookupTable>`)
|
|
66
|
-
before being displayed.
|
|
67
|
-
|
|
68
|
-
ImageItem is frequently used in conjunction with
|
|
69
|
-
:class:`HistogramLUTItem <pyqtgraph.HistogramLUTItem>` or
|
|
70
|
-
:class:`HistogramLUTWidget <pyqtgraph.HistogramLUTWidget>` to provide a GUI
|
|
71
|
-
for controlling the levels and lookup table used to display the image.
|
|
72
|
-
"""
|
|
73
|
-
|
|
74
|
-
def __init__(self, image=None, **kargs):
|
|
75
|
-
"""
|
|
76
|
-
See :func:`setImage <pyqtgraph.ImageItem.setImage>` for all allowed initialization arguments.
|
|
77
|
-
"""
|
|
78
|
-
super().__init__(image, **kargs)
|
|
79
|
-
|
|
80
|
-
self.qimage = None
|
|
81
|
-
self.triangulation = None
|
|
82
|
-
self.tri_data = None
|
|
83
|
-
self.mesh_pen = [255, 255, 255]
|
|
84
|
-
|
|
85
|
-
def width(self):
|
|
86
|
-
if self.image is None:
|
|
87
|
-
return None
|
|
88
|
-
return self.image[:, 0].max() - self.image[:, 0].min()
|
|
89
|
-
|
|
90
|
-
def height(self):
|
|
91
|
-
if self.image is None:
|
|
92
|
-
return None
|
|
93
|
-
return self.image[:, 1].max() - self.image[:, 1].min()
|
|
94
|
-
|
|
95
|
-
def boundingRect(self):
|
|
96
|
-
if self.image is None:
|
|
97
|
-
return QtCore.QRectF(0., 0., 0., 0.)
|
|
98
|
-
return QtCore.QRectF(self.image[:, 0].min(), self.image[:, 1].min(), float(self.width()), float(self.height()))
|
|
99
|
-
|
|
100
|
-
def setImage(self, image=None, autoLevels=None, **kargs):
|
|
101
|
-
"""
|
|
102
|
-
Update the image displayed by this item. For more information on how the image
|
|
103
|
-
is processed before displaying, see :func:`makeARGB <pyqtgraph.makeARGB>`
|
|
104
|
-
|
|
105
|
-
================= =========================================================================
|
|
106
|
-
**Arguments:**
|
|
107
|
-
image (numpy array) 2D array of: points coordinates (dim 0 is number of points)
|
|
108
|
-
(dim 1 is x, y coordinates and point value) image.shape = (N, 3)
|
|
109
|
-
|
|
110
|
-
Specifies the image data. May be 2D (width, height) or
|
|
111
|
-
3D (width, height, RGBa). The array dtype must be integer or floating
|
|
112
|
-
point of any bit depth. For 3D arrays, the third dimension must
|
|
113
|
-
be of length 3 (RGB) or 4 (RGBA). See *notes* below.
|
|
114
|
-
|
|
115
|
-
autoLevels (bool) If True, this forces the image to automatically select
|
|
116
|
-
levels based on the maximum and minimum values in the data.
|
|
117
|
-
By default, this argument is true unless the levels argument is
|
|
118
|
-
given.
|
|
119
|
-
lut (numpy array) The color lookup table to use when displaying the image.
|
|
120
|
-
See :func:`setLookupTable <pyqtgraph.ImageItem.setLookupTable>`.
|
|
121
|
-
levels (min, max) The minimum and maximum values to use when rescaling the image
|
|
122
|
-
data. By default, this will be set to the minimum and maximum values
|
|
123
|
-
in the image. If the image array has dtype uint8, no rescaling is necessary.
|
|
124
|
-
opacity (float 0.0-1.0)
|
|
125
|
-
compositionMode See :func:`setCompositionMode <pyqtgraph.ImageItem.setCompositionMode>`
|
|
126
|
-
border Sets the pen used when drawing the image border. Default is None.
|
|
127
|
-
autoDownsample (bool) If True, the image is automatically downsampled to match the
|
|
128
|
-
screen resolution. This improves performance for large images and
|
|
129
|
-
reduces aliasing.
|
|
130
|
-
================= =========================================================================
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
**Notes:**
|
|
134
|
-
|
|
135
|
-
For backward compatibility, image data is assumed to be in column-major order (column, row).
|
|
136
|
-
However, most image data is stored in row-major order (row, column) and will need to be
|
|
137
|
-
transposed before calling setImage()::
|
|
138
|
-
|
|
139
|
-
imageitem.setImage(imagedata.T)
|
|
140
|
-
|
|
141
|
-
This requirement can be changed by calling ``image.setOpts(axisOrder='row-major')`` or
|
|
142
|
-
by changing the ``imageAxisOrder`` :ref:`global configuration option <apiref_config>`.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
"""
|
|
146
|
-
|
|
147
|
-
profile = debug.Profiler()
|
|
148
|
-
|
|
149
|
-
gotNewData = False
|
|
150
|
-
if image is None:
|
|
151
|
-
if self.image is None:
|
|
152
|
-
return
|
|
153
|
-
else:
|
|
154
|
-
self._xp = np
|
|
155
|
-
gotNewData = True
|
|
156
|
-
shapeChanged = (self.image is None or image.shape != self.image.shape)
|
|
157
|
-
image = image.view(np.ndarray)
|
|
158
|
-
if self.image is None or image.dtype != self.image.dtype:
|
|
159
|
-
self._effectiveLut = None
|
|
160
|
-
self.image = image
|
|
161
|
-
if self.image.shape[0] > 2 ** 15 - 1:
|
|
162
|
-
if 'autoDownsample' not in kargs:
|
|
163
|
-
kargs['autoDownsample'] = True
|
|
164
|
-
if shapeChanged:
|
|
165
|
-
self.prepareGeometryChange()
|
|
166
|
-
self.informViewBoundsChanged()
|
|
167
|
-
|
|
168
|
-
profile()
|
|
169
|
-
|
|
170
|
-
if autoLevels is None:
|
|
171
|
-
if 'levels' in kargs:
|
|
172
|
-
autoLevels = False
|
|
173
|
-
else:
|
|
174
|
-
autoLevels = True
|
|
175
|
-
if autoLevels:
|
|
176
|
-
img = self.image
|
|
177
|
-
while img.size > 2 ** 16:
|
|
178
|
-
img = img[::2, ...]
|
|
179
|
-
mn, mx = img[:, 2].min(), img[:, 2].max()
|
|
180
|
-
if mn == mx:
|
|
181
|
-
mn = 0
|
|
182
|
-
mx = 255
|
|
183
|
-
kargs['levels'] = [mn, mx]
|
|
184
|
-
|
|
185
|
-
profile()
|
|
186
|
-
|
|
187
|
-
self.setOpts(update=False, **kargs)
|
|
188
|
-
|
|
189
|
-
profile()
|
|
190
|
-
|
|
191
|
-
self.qimage = None
|
|
192
|
-
self.update()
|
|
193
|
-
|
|
194
|
-
profile()
|
|
195
|
-
|
|
196
|
-
if gotNewData:
|
|
197
|
-
self.sigImageChanged.emit()
|
|
198
|
-
|
|
199
|
-
def get_val_at(self, xy):
|
|
200
|
-
"""
|
|
201
|
-
|
|
202
|
-
Parameters
|
|
203
|
-
----------
|
|
204
|
-
xy: (tuple) containing x and y position of the point which you want the value
|
|
205
|
-
|
|
206
|
-
Returns
|
|
207
|
-
-------
|
|
208
|
-
flaot: the mean value of the three points surrounding the point
|
|
209
|
-
"""
|
|
210
|
-
triangle_ind = self.triangulation.find_simplex(xy)
|
|
211
|
-
val = np.mean(self.image[self.triangulation.simplices[triangle_ind]], axis=0)[2]
|
|
212
|
-
return val
|
|
213
|
-
|
|
214
|
-
def render(self):
|
|
215
|
-
# Convert data to QImage for display.
|
|
216
|
-
|
|
217
|
-
profile = debug.Profiler()
|
|
218
|
-
if self.image is None or self.image.size == 0:
|
|
219
|
-
return
|
|
220
|
-
if isinstance(self.lut, collections.abc.Callable):
|
|
221
|
-
lut = self.lut(self.image)
|
|
222
|
-
else:
|
|
223
|
-
lut = self.lut
|
|
224
|
-
|
|
225
|
-
if self.autoDownsample:
|
|
226
|
-
# reduce dimensions of image based on screen resolution
|
|
227
|
-
o = self.mapToDevice(QtCore.QPointF(0, 0))
|
|
228
|
-
x = self.mapToDevice(QtCore.QPointF(1, 0))
|
|
229
|
-
y = self.mapToDevice(QtCore.QPointF(0, 1))
|
|
230
|
-
w = Point(x - o).length()
|
|
231
|
-
h = Point(y - o).length()
|
|
232
|
-
if w == 0 or h == 0:
|
|
233
|
-
self.qimage = None
|
|
234
|
-
return
|
|
235
|
-
xds = max(1, int(1.0 / w))
|
|
236
|
-
yds = max(1, int(1.0 / h))
|
|
237
|
-
axes = [1, 0] if self.axisOrder == 'row-major' else [0, 1]
|
|
238
|
-
# TODO adapt downsample
|
|
239
|
-
# image = fn.downsample(self.image, xds, axis=axes[0])
|
|
240
|
-
# image = fn.downsample(image, yds, axis=axes[1])
|
|
241
|
-
self._lastDownsample = (xds, yds)
|
|
242
|
-
else:
|
|
243
|
-
image = self.image
|
|
244
|
-
|
|
245
|
-
# if the image data is a small int, then we can combine levels + lut
|
|
246
|
-
# into a single lut for better performance
|
|
247
|
-
levels = self.levels
|
|
248
|
-
|
|
249
|
-
# Assume images are in column-major order for backward compatibility
|
|
250
|
-
# (most images are in row-major order)
|
|
251
|
-
|
|
252
|
-
self.triangulation, self.tri_data, rgba_values, alpha = makeAlphaTriangles(image, lut=lut, levels=levels,
|
|
253
|
-
useRGBA=True)
|
|
254
|
-
polygons = makePolygons(self.triangulation)
|
|
255
|
-
self.qimage = dict(polygons=polygons, values=rgba_values, alpha=alpha)
|
|
256
|
-
|
|
257
|
-
def get_points_at(self, axis='x', val=0):
|
|
258
|
-
"""
|
|
259
|
-
get all triangles values whose 'x' value is val or 'y' value is val
|
|
260
|
-
1) compute triangle centroids
|
|
261
|
-
2) set one of the coordinates as val
|
|
262
|
-
3) check if this new point is still in the corresponding triangle
|
|
263
|
-
4) if yes add point
|
|
264
|
-
Parameters
|
|
265
|
-
----------
|
|
266
|
-
axis: (str) either x or y if the set coordinates is x or y
|
|
267
|
-
val: (float) the value of the x or y axis
|
|
268
|
-
|
|
269
|
-
Returns
|
|
270
|
-
-------
|
|
271
|
-
ndarray: barycenter coordinates and triangles data values
|
|
272
|
-
"""
|
|
273
|
-
if self.triangulation is None:
|
|
274
|
-
self.render()
|
|
275
|
-
centroids = self.compute_centroids()
|
|
276
|
-
points_to_test = centroids.copy()
|
|
277
|
-
if axis == 'x':
|
|
278
|
-
points_to_test[:, 0] = val
|
|
279
|
-
elif axis == 'y':
|
|
280
|
-
points_to_test[:, 1] = val
|
|
281
|
-
|
|
282
|
-
simplex = self.triangulation.find_simplex(points_to_test)
|
|
283
|
-
good_indexes = np.where(simplex == np.linspace(0, len(simplex) - 1, len(simplex), dtype=int))
|
|
284
|
-
return centroids[good_indexes[0]], self.tri_data[good_indexes[0]]
|
|
285
|
-
|
|
286
|
-
def compute_centroids(self):
|
|
287
|
-
return np.mean(self.triangulation.points[self.triangulation.simplices], axis=1)
|
|
288
|
-
|
|
289
|
-
def dataTransform(self):
|
|
290
|
-
"""Return the transform that maps from this image's input array to its
|
|
291
|
-
local coordinate system.
|
|
292
|
-
|
|
293
|
-
This transform corrects for the transposition that occurs when image data
|
|
294
|
-
is interpreted in row-major order.
|
|
295
|
-
"""
|
|
296
|
-
# Might eventually need to account for downsampling / clipping here
|
|
297
|
-
tr = QtGui.QTransform()
|
|
298
|
-
if self.flipud:
|
|
299
|
-
tr.scale(1, -1)
|
|
300
|
-
if self.fliplr:
|
|
301
|
-
tr.scale(-1, 1)
|
|
302
|
-
if self.rotate90:
|
|
303
|
-
tr.rotate(-90)
|
|
304
|
-
return tr
|
|
305
|
-
|
|
306
|
-
def setLookupTable(self, lut, update=True):
|
|
307
|
-
super().setLookupTable(lut,update=update)
|
|
308
|
-
if self.lut is not None and self.image is not None:
|
|
309
|
-
lu = np.mean(self.lut(self.image), axis=0).astype(np.uint8)
|
|
310
|
-
lu[lu > 0] = 255
|
|
311
|
-
lu = list(lu)
|
|
312
|
-
else:
|
|
313
|
-
lu = [255, 255, 255]
|
|
314
|
-
self.mesh_pen = lu
|
|
315
|
-
|
|
316
|
-
def paint(self, p, *args):
|
|
317
|
-
profile = debug.Profiler()
|
|
318
|
-
if self.image is None:
|
|
319
|
-
return
|
|
320
|
-
if self.qimage is None:
|
|
321
|
-
self.render()
|
|
322
|
-
if self.qimage is None:
|
|
323
|
-
return
|
|
324
|
-
profile('render QImage')
|
|
325
|
-
if self.paintMode is not None:
|
|
326
|
-
p.setCompositionMode(self.paintMode)
|
|
327
|
-
profile('set comp mode')
|
|
328
|
-
|
|
329
|
-
self.setTransform(self.dataTransform())
|
|
330
|
-
|
|
331
|
-
for pol, color in zip(self.qimage['polygons'], self.qimage['values']):
|
|
332
|
-
|
|
333
|
-
p.setPen(fn.mkPen(*self.mesh_pen, 100, width=0.75))
|
|
334
|
-
p.setBrush(fn.mkBrush(*color))
|
|
335
|
-
p.drawPolygon(pol)
|
|
336
|
-
|
|
337
|
-
profile('p.drawImage')
|
|
338
|
-
if self.border is not None:
|
|
339
|
-
p.setPen(self.border)
|
|
340
|
-
p.drawRect(self.boundingRect())
|
|
341
|
-
|
|
342
|
-
def save(self, fileName, *args):
|
|
343
|
-
"""Save this image to file. Note that this saves the visible image (after scale/color changes), not the original data."""
|
|
344
|
-
pass
|
|
345
|
-
|
|
346
|
-
def getHistogram(self, bins='auto', step='auto', targetImageSize=200, targetHistogramSize=500, **kwds):
|
|
347
|
-
"""Returns x and y arrays containing the histogram values for the current image.
|
|
348
|
-
For an explanation of the return format, see numpy.histogram().
|
|
349
|
-
|
|
350
|
-
The *step* argument causes pixels to be skipped when computing the histogram to save time.
|
|
351
|
-
If *step* is 'auto', then a step is chosen such that the analyzed data has
|
|
352
|
-
dimensions roughly *targetImageSize* for each axis.
|
|
353
|
-
|
|
354
|
-
The *bins* argument and any extra keyword arguments are passed to
|
|
355
|
-
np.histogram(). If *bins* is 'auto', then a bin number is automatically
|
|
356
|
-
chosen based on the image characteristics:
|
|
357
|
-
|
|
358
|
-
* Integer images will have approximately *targetHistogramSize* bins,
|
|
359
|
-
with each bin having an integer width.
|
|
360
|
-
* All other types will have *targetHistogramSize* bins.
|
|
361
|
-
|
|
362
|
-
This method is also used when automatically computing levels.
|
|
363
|
-
"""
|
|
364
|
-
if self.image is None:
|
|
365
|
-
return None, None
|
|
366
|
-
if step == 'auto':
|
|
367
|
-
step = int(np.ceil(self.image.shape[0] / targetImageSize))
|
|
368
|
-
stepData = self.image[::step, 2:]
|
|
369
|
-
|
|
370
|
-
if bins == 'auto':
|
|
371
|
-
if stepData.dtype.kind in "ui":
|
|
372
|
-
mn = stepData.min()
|
|
373
|
-
mx = stepData.max()
|
|
374
|
-
step = np.ceil((mx - mn) / 500.)
|
|
375
|
-
bins = np.arange(mn, mx + 1.01 * step, step, dtype=np.int)
|
|
376
|
-
if len(bins) == 0:
|
|
377
|
-
bins = [mn, mx]
|
|
378
|
-
else:
|
|
379
|
-
bins = 500
|
|
380
|
-
|
|
381
|
-
kwds['bins'] = bins
|
|
382
|
-
stepData = stepData[np.isfinite(stepData)]
|
|
383
|
-
hist = np.histogram(stepData, **kwds)
|
|
384
|
-
|
|
385
|
-
return hist[1][:-1], hist[0]
|
|
386
|
-
|
|
387
|
-
def getPixmap(self):
|
|
388
|
-
pass
|