From bfa4dba15485b4192f8bbe13345e9658c97ecf76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= Date: Sat, 7 Oct 2017 07:59:01 +0200 Subject: New upstream version 0.6.0+dfsg --- .../modules/gui/data/img/ArrayTableWidget.png | Bin 0 -> 29088 bytes doc/source/modules/gui/fit/backgroundwidget.rst | 7 - .../modules/gui/fit/img/BackgroundDialog.png | Bin 0 -> 52076 bytes doc/source/modules/gui/fit/img/FitWidget.png | Bin 0 -> 43479 bytes doc/source/modules/gui/fit/img/bgwidget.png | Bin 68544 -> 0 bytes doc/source/modules/gui/fit/index.rst | 4 +- doc/source/modules/gui/gallery.rst | 273 +++++++++++++++++++++ doc/source/modules/gui/icons.rst | 54 +++- doc/source/modules/gui/img/IPythonDockWidget.png | Bin 0 -> 27683 bytes doc/source/modules/gui/img/IPythonWidget.png | Bin 0 -> 28980 bytes doc/source/modules/gui/index.rst | 8 + doc/source/modules/gui/plot/actions/control.rst | 5 + doc/source/modules/gui/plot/actions/examples.rst | 93 +++++++ doc/source/modules/gui/plot/actions/fit.rst | 5 + doc/source/modules/gui/plot/actions/histogram.rst | 5 + .../modules/gui/plot/actions/img/fftAction0.png | Bin 0 -> 91165 bytes .../modules/gui/plot/actions/img/fftAction1.png | Bin 0 -> 38847 bytes .../modules/gui/plot/actions/img/shiftAction0.png | Bin 0 -> 29092 bytes .../modules/gui/plot/actions/img/shiftAction3.png | Bin 0 -> 25949 bytes doc/source/modules/gui/plot/actions/index.rst | 30 +++ doc/source/modules/gui/plot/actions/io.rst | 6 + doc/source/modules/gui/plot/actions/medfilt.rst | 5 + doc/source/modules/gui/plot/colormap.rst | 16 ++ doc/source/modules/gui/plot/compleximageview.rst | 19 ++ doc/source/modules/gui/plot/dev.rst | 20 +- doc/source/modules/gui/plot/getting_started.rst | 52 ++-- doc/source/modules/gui/plot/imageview.rst | 6 +- .../modules/gui/plot/img/ComplexImageView.png | Bin 0 -> 72268 bytes doc/source/modules/gui/plot/img/fftAction0.png | Bin 91165 -> 0 bytes doc/source/modules/gui/plot/img/fftAction1.png | Bin 38847 -> 0 bytes .../modules/gui/plot/img/printPreviewMultiPlot.png | Bin 0 -> 25948 bytes doc/source/modules/gui/plot/img/shiftAction0.png | Bin 29092 -> 0 bytes doc/source/modules/gui/plot/img/shiftAction3.png | Bin 25949 -> 0 bytes doc/source/modules/gui/plot/index.rst | 92 +------ doc/source/modules/gui/plot/items.rst | 83 +++++-- doc/source/modules/gui/plot/plot.rst | 16 -- doc/source/modules/gui/plot/plotactions.rst | 20 -- .../modules/gui/plot/plotactions_examples.rst | 93 ------- doc/source/modules/gui/plot/plotwidget.rst | 138 ++++++----- .../modules/gui/plot/printpreviewtoolbutton.rst | 8 + doc/source/modules/gui/plot/stackview.rst | 4 +- doc/source/modules/gui/plot3d/actions.rst | 17 +- doc/source/modules/gui/plot3d/dev.rst | 8 +- doc/source/modules/gui/plot3d/index.rst | 39 +-- doc/source/modules/gui/plot3d/scalarfieldview.rst | 7 - doc/source/modules/gui/plot3d/toolbars.rst | 29 --- doc/source/modules/gui/plot3d/tools.rst | 40 +++ .../modules/gui/widgets/img/FrameBrowser.png | Bin 0 -> 3731 bytes .../widgets/img/HorizontalSliderWithBrowser.png | Bin 0 -> 4215 bytes .../modules/gui/widgets/img/PeriodicCombo.png | Bin 0 -> 3464 bytes .../modules/gui/widgets/img/PeriodicList.png | Bin 0 -> 12035 bytes .../modules/gui/widgets/img/PeriodicTable.png | Bin 0 -> 35124 bytes doc/source/modules/gui/widgets/img/TableWidget.png | Bin 0 -> 4058 bytes .../gui/widgets/img/ThreadPoolPushButton.png | Bin 0 -> 2729 bytes .../modules/gui/widgets/img/WaitingPushButton.png | Bin 0 -> 1962 bytes doc/source/modules/gui/widgets/index.rst | 1 + doc/source/modules/gui/widgets/printpreview.rst | 60 +++++ doc/source/modules/image/backprojection.rst | 8 + doc/source/modules/image/index.rst | 1 + doc/source/modules/image/projection.rst | 15 ++ doc/source/modules/image/reconstruction.rst | 14 ++ doc/source/modules/io/convert.rst | 8 + doc/source/modules/io/index.rst | 7 +- doc/source/modules/io/spech5.rst | 36 ++- doc/source/modules/io/spectoh5.rst | 8 - doc/source/modules/utils/decorators.rst | 6 +- 66 files changed, 921 insertions(+), 445 deletions(-) create mode 100644 doc/source/modules/gui/data/img/ArrayTableWidget.png create mode 100644 doc/source/modules/gui/fit/img/BackgroundDialog.png create mode 100644 doc/source/modules/gui/fit/img/FitWidget.png delete mode 100644 doc/source/modules/gui/fit/img/bgwidget.png create mode 100644 doc/source/modules/gui/gallery.rst create mode 100644 doc/source/modules/gui/img/IPythonDockWidget.png create mode 100644 doc/source/modules/gui/img/IPythonWidget.png create mode 100644 doc/source/modules/gui/plot/actions/control.rst create mode 100644 doc/source/modules/gui/plot/actions/examples.rst create mode 100644 doc/source/modules/gui/plot/actions/fit.rst create mode 100644 doc/source/modules/gui/plot/actions/histogram.rst create mode 100644 doc/source/modules/gui/plot/actions/img/fftAction0.png create mode 100644 doc/source/modules/gui/plot/actions/img/fftAction1.png create mode 100644 doc/source/modules/gui/plot/actions/img/shiftAction0.png create mode 100644 doc/source/modules/gui/plot/actions/img/shiftAction3.png create mode 100644 doc/source/modules/gui/plot/actions/index.rst create mode 100644 doc/source/modules/gui/plot/actions/io.rst create mode 100644 doc/source/modules/gui/plot/actions/medfilt.rst create mode 100644 doc/source/modules/gui/plot/colormap.rst create mode 100644 doc/source/modules/gui/plot/compleximageview.rst create mode 100644 doc/source/modules/gui/plot/img/ComplexImageView.png delete mode 100644 doc/source/modules/gui/plot/img/fftAction0.png delete mode 100644 doc/source/modules/gui/plot/img/fftAction1.png create mode 100644 doc/source/modules/gui/plot/img/printPreviewMultiPlot.png delete mode 100644 doc/source/modules/gui/plot/img/shiftAction0.png delete mode 100644 doc/source/modules/gui/plot/img/shiftAction3.png delete mode 100644 doc/source/modules/gui/plot/plot.rst delete mode 100644 doc/source/modules/gui/plot/plotactions.rst delete mode 100644 doc/source/modules/gui/plot/plotactions_examples.rst create mode 100644 doc/source/modules/gui/plot/printpreviewtoolbutton.rst delete mode 100644 doc/source/modules/gui/plot3d/toolbars.rst create mode 100644 doc/source/modules/gui/plot3d/tools.rst create mode 100644 doc/source/modules/gui/widgets/img/FrameBrowser.png create mode 100644 doc/source/modules/gui/widgets/img/HorizontalSliderWithBrowser.png create mode 100644 doc/source/modules/gui/widgets/img/PeriodicCombo.png create mode 100644 doc/source/modules/gui/widgets/img/PeriodicList.png create mode 100644 doc/source/modules/gui/widgets/img/PeriodicTable.png create mode 100644 doc/source/modules/gui/widgets/img/TableWidget.png create mode 100644 doc/source/modules/gui/widgets/img/ThreadPoolPushButton.png create mode 100644 doc/source/modules/gui/widgets/img/WaitingPushButton.png create mode 100644 doc/source/modules/gui/widgets/printpreview.rst create mode 100644 doc/source/modules/image/backprojection.rst create mode 100644 doc/source/modules/image/projection.rst create mode 100644 doc/source/modules/image/reconstruction.rst create mode 100644 doc/source/modules/io/convert.rst delete mode 100644 doc/source/modules/io/spectoh5.rst (limited to 'doc/source/modules') diff --git a/doc/source/modules/gui/data/img/ArrayTableWidget.png b/doc/source/modules/gui/data/img/ArrayTableWidget.png new file mode 100644 index 0000000..7c81d02 Binary files /dev/null and b/doc/source/modules/gui/data/img/ArrayTableWidget.png differ diff --git a/doc/source/modules/gui/fit/backgroundwidget.rst b/doc/source/modules/gui/fit/backgroundwidget.rst index eea2052..a34c639 100644 --- a/doc/source/modules/gui/fit/backgroundwidget.rst +++ b/doc/source/modules/gui/fit/backgroundwidget.rst @@ -7,13 +7,6 @@ .. automodule:: silx.gui.fit.BackgroundWidget -.. |imgBGWidget| image:: ./img/bgwidget.png - :height: 300px - :align: middle - -|imgBGWidget| - - API --- diff --git a/doc/source/modules/gui/fit/img/BackgroundDialog.png b/doc/source/modules/gui/fit/img/BackgroundDialog.png new file mode 100644 index 0000000..c6b8c03 Binary files /dev/null and b/doc/source/modules/gui/fit/img/BackgroundDialog.png differ diff --git a/doc/source/modules/gui/fit/img/FitWidget.png b/doc/source/modules/gui/fit/img/FitWidget.png new file mode 100644 index 0000000..73a80b4 Binary files /dev/null and b/doc/source/modules/gui/fit/img/FitWidget.png differ diff --git a/doc/source/modules/gui/fit/img/bgwidget.png b/doc/source/modules/gui/fit/img/bgwidget.png deleted file mode 100644 index 724eadb..0000000 Binary files a/doc/source/modules/gui/fit/img/bgwidget.png and /dev/null differ diff --git a/doc/source/modules/gui/fit/index.rst b/doc/source/modules/gui/fit/index.rst index 67c22a1..d9581ed 100644 --- a/doc/source/modules/gui/fit/index.rst +++ b/doc/source/modules/gui/fit/index.rst @@ -9,11 +9,11 @@ Snapshot of the widgets: -.. |imgFitWidget| image:: ../../../Tutorials/img/fitwidget4.png +.. |imgFitWidget| image:: ./img/FitWidget.png :height: 150px :align: middle -.. |imgBGWidget| image:: ./img/bgwidget.png +.. |imgBGWidget| image:: ./img/BackgroundDialog.png :height: 150px :align: middle diff --git a/doc/source/modules/gui/gallery.rst b/doc/source/modules/gui/gallery.rst new file mode 100644 index 0000000..4ae83d6 --- /dev/null +++ b/doc/source/modules/gui/gallery.rst @@ -0,0 +1,273 @@ + +Widgets gallery +=============== + + +:mod:`silx.gui.console` Widgets ++++++++++++++++++++++++++++++++ + +.. currentmodule:: silx.gui.console + +.. list-table:: + :widths: 1 4 + :header-rows: 1 + + * - Widget + - Description + * - .. image:: img/IPythonWidget.png + :height: 150px + :align: center + - :class:`IPythonWidget` is an interactive console widget running a + :class`QtInProcessKernelManager`. This allows to push variables to the + interactive console, and interact with your application (e.g. adding + curves to a plot) + * - .. image:: img/IPythonDockWidget.png + :height: 150px + :align: center + - :class:`IPythonDockWidget` is an :class:`IPythonWidget` embedded in + a :class:`QDockWidget`. + + +:mod:`silx.gui.data` Widgets +++++++++++++++++++++++++++++ + +.. currentmodule:: silx.gui.data + +.. list-table:: + :widths: 1 4 + :header-rows: 1 + + * - Widget + - Description + * - .. image:: data/img/ArrayTableWidget.png + :height: 150px + :align: center + - :class:`ArrayTableWidget` is a table widget with browsers designed to + display the content of multi-dimensional data arrays. + * - .. image:: data/img/DataViewer.png + :height: 150px + :align: center + - :class:`DataViewer` is a widget designed to display data using the most + adapted view. + * - .. image:: data/img/DataViewerFrame.png + :height: 150px + :align: center + - :class:`DataViewerFrame` is a :class:`DataViewer` with a view selector + that lets you view the data using any compatible view. + * - .. image:: data/img/NumpyAxesSelector.png + :height: 50px + :align: center + - :class:`NumpyAxesSelector` is a widget designed to select a subarray in a + n-dimensional array, by fixing the index on some of the dimensions. + + +:mod:`silx.gui.fit` Widgets ++++++++++++++++++++++++++++ + +.. currentmodule:: silx.gui.fit + +.. list-table:: + :widths: 1 4 + :header-rows: 1 + + * - Widget + - Description + * - .. image:: fit/img/FitWidget.png + :height: 150px + :align: center + - :class:`FitWidget` is a widget designed to configure and run a fitting process, + with constraints on parameters. + * - .. image:: fit/img/BackgroundDialog.png + :height: 150px + :align: center + - :class:`BackgroundWidget.BackgroundDialog` is a widget designed to adjust + the parameters and preview the results of a *snip* or *strip* background + filter. + + +:mod:`silx.gui.hdf5` Widgets +++++++++++++++++++++++++++++ + +.. currentmodule:: silx.gui.hdf5 + +.. list-table:: + :widths: 1 4 + :header-rows: 1 + + * - Widget + - Description + * - .. image:: hdf5/img/Hdf5TreeView.png + :height: 150px + :align: center + - :class:`Hdf5TreeView` is a tree view desiged to browse an HDF5 + file structure. + +.. _plot-gallery: + +:mod:`silx.gui.plot` Widgets +++++++++++++++++++++++++++++ + +.. currentmodule:: silx.gui.plot + +Plotting widgets: + +.. list-table:: + :widths: 1 4 + :header-rows: 1 + + * - Widget + - Description + * - .. image:: plot/img/PlotWidget.png + :height: 150px + :align: center + - :class:`PlotWidget` is the base Qt widget providing a plot area. + Other plot widgets are based on this one and provides the same API. + * - .. image:: plot/img/PlotWindow.png + :height: 150px + :align: center + - :class:`PlotWindow` adds a toolbar to :class:`PlotWidget`. + The content of this toolbar can be configured from the + :class:`PlotWindow` constructor or by hiding its content afterward. + * - .. image:: plot/img/Plot1D.png + :height: 150px + :align: center + - :class:`.Plot1D` is a :class:`PlotWindow` configured with tools useful + for curves. + * - .. image:: plot/img/Plot2D.png + :height: 150px + :align: center + - :class:`.Plot2D` is a :class:`PlotWindow` configured with tools useful + for images. + * - .. image:: plot/img/ImageView.png + :height: 150px + :align: center + - :class:`ImageView` adds side histograms to a :class:`.Plot2D` widget. + * - .. image:: plot/img/StackView.png + :height: 150px + :align: center + - :class:`StackView` is a widget designed to display an image from a + stack of images in a :class:`PlotWindow` widget, with a frame browser + to navigate in the stack. The profile tool can do a 2D profile on the + stack of images. + * - .. image:: plot/img/ComplexImageView.png + :height: 150px + :align: center + - :class:`ComplexImageView` is a widget dedicated to visualize a single + 2D dataset of complex data. + It allows to switch between viewing amplitude, phase, real, imaginary, + colored phase with amplitude or log10(amplitude) as brightness. + + +Additional widgets: + +.. list-table:: + :widths: 1 4 + :header-rows: 1 + + * - Widget + - Description + * - .. image:: plot/img/PositionInfo.png + :width: 300px + :align: center + - :class:`.PlotTools.PositionInfo` is a widget displaying mouse position and + information of a :class:`PlotWidget` associated to the mouse position. + * - .. image:: plot/img/LimitsToolBar.png + :width: 300px + :align: center + - :class:`.PlotTools.LimitsToolBar` is a QToolBar displaying and + controlling the limits of a :class:`PlotWidget`. + * - .. image:: plot/img/logColorbar.png + :height: 150px + :align: center + - :class:`.ColorBar.ColorBarWidget` display colormap gradient and can be linked with a plot + to display the colormap + +.. _plot3d-gallery: + +:mod:`silx.gui.plot3d` Widgets +++++++++++++++++++++++++++++++ + +.. currentmodule:: silx.gui.plot3d + +.. list-table:: + :widths: 1 4 + :header-rows: 1 + + * - Widget + - Description + * - .. image:: plot3d/img/ScalarFieldView.png + :height: 150px + :align: center + - :class:`ScalarFieldView` is a :class:`Plot3DWindow` dedicated to display 3D scalar field. + It can display iso-surfaces and an interactive cutting plane. + Sample code: :doc:`plot3d/viewer3dvolume_example`. + * - .. image:: plot3d/img/Plot3DWindow.png + :height: 150px + :align: center + - :class:`Plot3DWindow` is a :class:`QMainWindow` with a :class:`Plot3DWidget` as central widget + and toolbars. + * - .. image:: plot3d/img/Plot3DWidget.png + :height: 150px + :align: center + - :class:`Plot3DWidget` is the base Qt widget providing an OpenGL 3D scene. + Other widgets are using this widget as the OpenGL scene canvas. + * - .. image:: plot3d/img/SFViewParamTree.png + :height: 150px + :align: center + - :class:`SFViewParamTree` is a :class:`QTreeView` widget that can be attached to a :class:`ScalarFieldView`. + It displays current parameters of the :class:`ScalarFieldView` and allows to modify it. + Sample code: :doc:`plot3d/viewer3dvolume_example`. + + +:mod:`silx.gui.widgets` Widgets ++++++++++++++++++++++++++++++++ + +.. currentmodule:: silx.gui.widgets + +.. list-table:: + :widths: 1 4 + :header-rows: 1 + + * - Widget + - Description + * - .. image:: widgets/img/FrameBrowser.png + :width: 110px + :align: center + - :class:`FrameBrowser.FrameBrowser` is a browser widget designed to + browse through a sequence of integers (e.g. the indices of an array) + * - .. image:: widgets/img/HorizontalSliderWithBrowser.png + :width: 150px + :align: center + - :class:`FrameBrowser.HorizontalSliderWithBrowser` is a :class:`FrameBrowser` + with an additional slider. + * - .. image:: widgets/img/PeriodicCombo.png + :width: 150px + :align: center + - :class:`PeriodicTable.PeriodicCombo` is a :class:`QComboBox` widget designed to + select a single atomic element. + * - .. image:: widgets/img/PeriodicList.png + :height: 150px + :align: center + - :class:`PeriodicTable.PeriodicList` is a :class:`QTreeWidget` designed to select one + or more atomic elements. + * - .. image:: widgets/img/PeriodicTable.png + :height: 150px + :align: center + - :class:`PeriodicTable.PeriodicTable` is a periodic table widget designed to select one + or more atomic elements. + * - .. image:: widgets/img/TableWidget.png + :height: 150px + :align: center + - :class:`TableWidget.TableWidget` and :class:`TableWidget.TableView` inherit respectively + :class:`QTableWidget` and :class:`QTableView`, and add a context menu with *cut/copy/paste* + actions. + * - .. image:: widgets/img/WaitingPushButton.png + :width: 60px + :align: center + - :class:`WaitingPushButton` is a :class:`QPushButton` that can be graphically disabled, + for example to wait for a callback function to finish computing. + * - .. image:: widgets/img/ThreadPoolPushButton.png + :width: 100px + :align: center + - :class:`ThreadPoolPushButton` is a :class:`WaitingPushButton` that executes a + callback in a thread. diff --git a/doc/source/modules/gui/icons.rst b/doc/source/modules/gui/icons.rst index 61ea71d..c3fefd8 100644 --- a/doc/source/modules/gui/icons.rst +++ b/doc/source/modules/gui/icons.rst @@ -25,16 +25,22 @@ Available icons - 3d-plane-normal-y * - |3d-plane-normal-z| - 3d-plane-normal-z + * - |3d-plane-pan| + - 3d-plane-pan * - |3d-plane| - 3d-plane * - |arrow-keys| - arrow-keys + * - |axis| + - axis * - |camera| - camera * - |clipboard| - clipboard * - |close| - close + * - |colorbar| + - colorbar * - |colormap| - colormap * - |crop| @@ -97,10 +103,14 @@ Available icons - item-3dim * - |item-ndim| - item-ndim + * - |item-none| + - item-none * - |item-object| - item-object * - |last| - last + * - |math-amplitude| + - math-amplitude * - |math-average| - math-average * - |math-derive| @@ -109,6 +119,8 @@ Available icons - math-energy * - |math-fit| - math-fit + * - |math-imaginary| + - math-imaginary * - |math-normalize| - math-normalize * - |math-peak-reset| @@ -117,6 +129,14 @@ Available icons - math-peak-search * - |math-peak| - math-peak + * - |math-phase-color-log| + - math-phase-color-log + * - |math-phase-color| + - math-phase-color + * - |math-phase| + - math-phase + * - |math-real| + - math-real * - |math-sigma| - math-sigma * - |math-smooth| @@ -127,10 +147,14 @@ Available icons - math-swap-sign * - |math-ymin-to-zero| - math-ymin-to-zero + * - |median-filter| + - median-filter * - |next| - next * - |normal| - normal + * - |pan| + - pan * - |pixel-intensities| - pixel-intensities * - |plot-grid| @@ -167,12 +191,16 @@ Available icons - plot-yup * - |previous| - previous + * - |profile-clear| + - profile-clear * - |profile1D| - profile1D * - |profile2D| - profile2D * - |remove| - remove + * - |rotate-3d| + - rotate-3d * - |rudder| - rudder * - |selected| @@ -205,8 +233,6 @@ Available icons - sliders-on * - |spec| - spec - * - |test-png| - - test-png * - |view-1d| - view-1d * - |view-2d-stack| @@ -217,6 +243,10 @@ Available icons - view-3d * - |view-fullscreen| - view-fullscreen + * - |view-hdf5| + - view-hdf5 + * - |view-nexus| + - view-nexus * - |view-nofullscreen| - view-nofullscreen * - |view-raw| @@ -227,6 +257,8 @@ Available icons - view-text * - |window-new| - window-new + * - |zoom-back| + - zoom-back * - |zoom-in| - zoom-in * - |zoom-original| @@ -239,11 +271,14 @@ Available icons .. |3d-plane-normal-x| image:: ../../../../silx/resources/gui/icons/3d-plane-normal-x.png .. |3d-plane-normal-y| image:: ../../../../silx/resources/gui/icons/3d-plane-normal-y.png .. |3d-plane-normal-z| image:: ../../../../silx/resources/gui/icons/3d-plane-normal-z.png +.. |3d-plane-pan| image:: ../../../../silx/resources/gui/icons/3d-plane-pan.png .. |3d-plane| image:: ../../../../silx/resources/gui/icons/3d-plane.png .. |arrow-keys| image:: ../../../../silx/resources/gui/icons/arrow-keys.png +.. |axis| image:: ../../../../silx/resources/gui/icons/axis.png .. |camera| image:: ../../../../silx/resources/gui/icons/camera.png .. |clipboard| image:: ../../../../silx/resources/gui/icons/clipboard.png .. |close| image:: ../../../../silx/resources/gui/icons/close.png +.. |colorbar| image:: ../../../../silx/resources/gui/icons/colorbar.png .. |colormap| image:: ../../../../silx/resources/gui/icons/colormap.png .. |crop| image:: ../../../../silx/resources/gui/icons/crop.png .. |crosshair| image:: ../../../../silx/resources/gui/icons/crosshair.png @@ -275,23 +310,32 @@ Available icons .. |item-2dim| image:: ../../../../silx/resources/gui/icons/item-2dim.png .. |item-3dim| image:: ../../../../silx/resources/gui/icons/item-3dim.png .. |item-ndim| image:: ../../../../silx/resources/gui/icons/item-ndim.png +.. |item-none| image:: ../../../../silx/resources/gui/icons/item-none.png .. |item-object| image:: ../../../../silx/resources/gui/icons/item-object.png .. |last| image:: ../../../../silx/resources/gui/icons/last.png +.. |math-amplitude| image:: ../../../../silx/resources/gui/icons/math-amplitude.png .. |math-average| image:: ../../../../silx/resources/gui/icons/math-average.png .. |math-derive| image:: ../../../../silx/resources/gui/icons/math-derive.png .. |math-energy| image:: ../../../../silx/resources/gui/icons/math-energy.png .. |math-fit| image:: ../../../../silx/resources/gui/icons/math-fit.png +.. |math-imaginary| image:: ../../../../silx/resources/gui/icons/math-imaginary.png .. |math-normalize| image:: ../../../../silx/resources/gui/icons/math-normalize.png .. |math-peak-reset| image:: ../../../../silx/resources/gui/icons/math-peak-reset.png .. |math-peak-search| image:: ../../../../silx/resources/gui/icons/math-peak-search.png .. |math-peak| image:: ../../../../silx/resources/gui/icons/math-peak.png +.. |math-phase-color-log| image:: ../../../../silx/resources/gui/icons/math-phase-color-log.png +.. |math-phase-color| image:: ../../../../silx/resources/gui/icons/math-phase-color.png +.. |math-phase| image:: ../../../../silx/resources/gui/icons/math-phase.png +.. |math-real| image:: ../../../../silx/resources/gui/icons/math-real.png .. |math-sigma| image:: ../../../../silx/resources/gui/icons/math-sigma.png .. |math-smooth| image:: ../../../../silx/resources/gui/icons/math-smooth.png .. |math-substract| image:: ../../../../silx/resources/gui/icons/math-substract.png .. |math-swap-sign| image:: ../../../../silx/resources/gui/icons/math-swap-sign.png .. |math-ymin-to-zero| image:: ../../../../silx/resources/gui/icons/math-ymin-to-zero.png +.. |median-filter| image:: ../../../../silx/resources/gui/icons/median-filter.png .. |next| image:: ../../../../silx/resources/gui/icons/next.png .. |normal| image:: ../../../../silx/resources/gui/icons/normal.png +.. |pan| image:: ../../../../silx/resources/gui/icons/pan.png .. |pixel-intensities| image:: ../../../../silx/resources/gui/icons/pixel-intensities.png .. |plot-grid| image:: ../../../../silx/resources/gui/icons/plot-grid.png .. |plot-roi-above| image:: ../../../../silx/resources/gui/icons/plot-roi-above.png @@ -310,9 +354,11 @@ Available icons .. |plot-ylog| image:: ../../../../silx/resources/gui/icons/plot-ylog.png .. |plot-yup| image:: ../../../../silx/resources/gui/icons/plot-yup.png .. |previous| image:: ../../../../silx/resources/gui/icons/previous.png +.. |profile-clear| image:: ../../../../silx/resources/gui/icons/profile-clear.png .. |profile1D| image:: ../../../../silx/resources/gui/icons/profile1D.png .. |profile2D| image:: ../../../../silx/resources/gui/icons/profile2D.png .. |remove| image:: ../../../../silx/resources/gui/icons/remove.png +.. |rotate-3d| image:: ../../../../silx/resources/gui/icons/rotate-3d.png .. |rudder| image:: ../../../../silx/resources/gui/icons/rudder.png .. |selected| image:: ../../../../silx/resources/gui/icons/selected.png .. |shape-circle-solid| image:: ../../../../silx/resources/gui/icons/shape-circle-solid.png @@ -329,17 +375,19 @@ Available icons .. |sliders-off| image:: ../../../../silx/resources/gui/icons/sliders-off.png .. |sliders-on| image:: ../../../../silx/resources/gui/icons/sliders-on.png .. |spec| image:: ../../../../silx/resources/gui/icons/spec.png -.. |test-png| image:: ../../../../silx/resources/gui/icons/test-png.png .. |view-1d| image:: ../../../../silx/resources/gui/icons/view-1d.png .. |view-2d-stack| image:: ../../../../silx/resources/gui/icons/view-2d-stack.png .. |view-2d| image:: ../../../../silx/resources/gui/icons/view-2d.png .. |view-3d| image:: ../../../../silx/resources/gui/icons/view-3d.png .. |view-fullscreen| image:: ../../../../silx/resources/gui/icons/view-fullscreen.png +.. |view-hdf5| image:: ../../../../silx/resources/gui/icons/view-hdf5.png +.. |view-nexus| image:: ../../../../silx/resources/gui/icons/view-nexus.png .. |view-nofullscreen| image:: ../../../../silx/resources/gui/icons/view-nofullscreen.png .. |view-raw| image:: ../../../../silx/resources/gui/icons/view-raw.png .. |view-refresh| image:: ../../../../silx/resources/gui/icons/view-refresh.png .. |view-text| image:: ../../../../silx/resources/gui/icons/view-text.png .. |window-new| image:: ../../../../silx/resources/gui/icons/window-new.png +.. |zoom-back| image:: ../../../../silx/resources/gui/icons/zoom-back.png .. |zoom-in| image:: ../../../../silx/resources/gui/icons/zoom-in.png .. |zoom-original| image:: ../../../../silx/resources/gui/icons/zoom-original.png .. |zoom-out| image:: ../../../../silx/resources/gui/icons/zoom-out.png diff --git a/doc/source/modules/gui/img/IPythonDockWidget.png b/doc/source/modules/gui/img/IPythonDockWidget.png new file mode 100644 index 0000000..111a926 Binary files /dev/null and b/doc/source/modules/gui/img/IPythonDockWidget.png differ diff --git a/doc/source/modules/gui/img/IPythonWidget.png b/doc/source/modules/gui/img/IPythonWidget.png new file mode 100644 index 0000000..18b44e0 Binary files /dev/null and b/doc/source/modules/gui/img/IPythonWidget.png differ diff --git a/doc/source/modules/gui/index.rst b/doc/source/modules/gui/index.rst index eecd124..0b7f433 100644 --- a/doc/source/modules/gui/index.rst +++ b/doc/source/modules/gui/index.rst @@ -19,3 +19,11 @@ The ``silx.gui`` package provides a set of PyQt widgets. plot3d/index.rst qt.rst widgets/index.rst + + +.. toctree:: + :hidden: + + gallery.rst + +See the :doc:`gallery` page for an overview of all available widgets. diff --git a/doc/source/modules/gui/plot/actions/control.rst b/doc/source/modules/gui/plot/actions/control.rst new file mode 100644 index 0000000..b35986d --- /dev/null +++ b/doc/source/modules/gui/plot/actions/control.rst @@ -0,0 +1,5 @@ +:mod:`silx.gui.plot.actions.control` +```````````````````````````````````` + +.. automodule:: silx.gui.plot.actions.control + :members: diff --git a/doc/source/modules/gui/plot/actions/examples.rst b/doc/source/modules/gui/plot/actions/examples.rst new file mode 100644 index 0000000..125e9c5 --- /dev/null +++ b/doc/source/modules/gui/plot/actions/examples.rst @@ -0,0 +1,93 @@ +.. currentmodule:: silx.gui + +Adding custom plot actions +========================== + +A :class:`PlotWindow` defines a number of standard plot actions that can be executed +by clicking on toolbar icons. + +Developers can design additional plot actions to be added as toolbar icons or as menu entries, +to be added to a :class:`PlotWindow` or to design their own plot window based on +:class:`PlotWidget`. + +This documentation pages provides examples on how to do this. + +Simple example: Shift a curve +----------------------------- + +The following script is a simplistic example to show the basic required steps: + + - create a new class inheriting from :class:`silx.gui.plot.actions.PlotAction` + - define basic parameters such as the icon, the tooltip... + - write a method that will be triggered by the action + - initialize the new plot action by passing a reference to a plot window + - add the action to a toolbar or a menu + +The method implemented in this action interacts with the plot in a basic way. It gets the active curve, +then it creates a new data array based on the curve data, and finally it replaces the original curve +with a new one using the modified data array. + +.. literalinclude:: ../../../../../../examples/shiftPlotAction.py + :lines: 36- + +.. |imgShiftAction0| image:: img/shiftAction0.png + :height: 300px + :align: middle + +.. |imgShiftAction3| image:: img/shiftAction3.png + :height: 300px + :align: middle + +.. list-table:: + :widths: 1 2 + + * - |imgShiftAction0| + - Initial state + * - |imgShiftAction3| + - After triggering the action 3 times, the selected triangle shaped curve + is shifted up by 3 units + +Advanced example: Display amplitude spectrum +-------------------------------------------- + +This more advanced example shows additional ways of interacting with the plot, by changing +labels, storing additional data array along with the curve data. + +This action is *checkable*, meaning that is has two states. When clicking the toolbar icon +or the menu item, it remains in a *pushed* state until it is clicked again. + +In one state (*un-checked*), the original data is displayed. In the other state, the amplitude +spectrum of the original signal is displayed. When the state is changed, the triggered action +computes either the Fast Fourier Transform (FFT), or the reverse FFT. + +This example also illustrates how to store additional data, along with a curve. +The FFT computation returns complex values, but we want to display real data, so we compute +the amplitude spectrum. However, the inverse FFT requires the complete FFT data as input. +We are therefore required to store the complex array of FFT data as curve metadata, +in order to be able to reverse the process when the action is unchecked. + +.. literalinclude:: ../../../../../../examples/fftPlotAction.py + :lines: 44- + +.. |imgFftAction0| image:: img/fftAction0.png + :height: 300px + :align: middle + +.. |imgFftAction1| image:: img/fftAction1.png + :height: 300px + :align: middle + +.. list-table:: + :widths: 1 2 + + * - |imgFftAction0| + - Original signals (zoom applied). In red, a cosine wave at 7 Hz. + In black, a sum of sines with frequencies of 3, 20 and 42 Hz. + In green, a square wave with a fundamental frequency of 0.5 Hz + (wavelength of 2 seconds). + * - |imgFftAction1| + - Amplitude spectra (zoom applied), with peaks visible at + the expected frequencies of 3, 7, 20 and 42 Hz for the sine and cosine + signals. In green, we see the complete series of peaks related to the square wave, + with a fundamental frequency at 0.5 Hz and harmonic frequencies at every + odd multiple of the fundamental. diff --git a/doc/source/modules/gui/plot/actions/fit.rst b/doc/source/modules/gui/plot/actions/fit.rst new file mode 100644 index 0000000..8b06908 --- /dev/null +++ b/doc/source/modules/gui/plot/actions/fit.rst @@ -0,0 +1,5 @@ +:mod:`silx.gui.plot.actions.fit` +```````````````````````````````` + +.. automodule:: silx.gui.plot.actions.fit + :members: diff --git a/doc/source/modules/gui/plot/actions/histogram.rst b/doc/source/modules/gui/plot/actions/histogram.rst new file mode 100644 index 0000000..6a31236 --- /dev/null +++ b/doc/source/modules/gui/plot/actions/histogram.rst @@ -0,0 +1,5 @@ +:mod:`silx.gui.plot.actions.histogram` +`````````````````````````````````````` + +.. automodule:: silx.gui.plot.actions.histogram + :members: diff --git a/doc/source/modules/gui/plot/actions/img/fftAction0.png b/doc/source/modules/gui/plot/actions/img/fftAction0.png new file mode 100644 index 0000000..5bd8061 Binary files /dev/null and b/doc/source/modules/gui/plot/actions/img/fftAction0.png differ diff --git a/doc/source/modules/gui/plot/actions/img/fftAction1.png b/doc/source/modules/gui/plot/actions/img/fftAction1.png new file mode 100644 index 0000000..e4b20d7 Binary files /dev/null and b/doc/source/modules/gui/plot/actions/img/fftAction1.png differ diff --git a/doc/source/modules/gui/plot/actions/img/shiftAction0.png b/doc/source/modules/gui/plot/actions/img/shiftAction0.png new file mode 100644 index 0000000..2d5837a Binary files /dev/null and b/doc/source/modules/gui/plot/actions/img/shiftAction0.png differ diff --git a/doc/source/modules/gui/plot/actions/img/shiftAction3.png b/doc/source/modules/gui/plot/actions/img/shiftAction3.png new file mode 100644 index 0000000..a2187b8 Binary files /dev/null and b/doc/source/modules/gui/plot/actions/img/shiftAction3.png differ diff --git a/doc/source/modules/gui/plot/actions/index.rst b/doc/source/modules/gui/plot/actions/index.rst new file mode 100644 index 0000000..f95b1f8 --- /dev/null +++ b/doc/source/modules/gui/plot/actions/index.rst @@ -0,0 +1,30 @@ +.. currentmodule:: silx.gui.plot + +:mod:`actions`: Actions for PlotWidget +=========================================== + +.. currentmodule:: silx.gui.plot.actions + +The :class:`PlotAction` is a base class used to define plot actions. + +Plot actions serve to add menu items or toolbar items that are associated with a method +that can interact with the associated :class:`.PlotWidget`. + +For an introduction to creating custom plot actions, see :doc:`examples`. + +actions API +----------- + +Actions are divided into the following sub-modules: + + +.. toctree:: + :maxdepth: 1 + + control.rst + medfilt.rst + fit.rst + histogram.rst + io.rst + +.. autoclass:: silx.gui.plot.actions.PlotAction diff --git a/doc/source/modules/gui/plot/actions/io.rst b/doc/source/modules/gui/plot/actions/io.rst new file mode 100644 index 0000000..98f1808 --- /dev/null +++ b/doc/source/modules/gui/plot/actions/io.rst @@ -0,0 +1,6 @@ +:mod:`silx.gui.plot.actions.io` +``````````````````````````````` + +.. automodule:: silx.gui.plot.actions.io + :members: + diff --git a/doc/source/modules/gui/plot/actions/medfilt.rst b/doc/source/modules/gui/plot/actions/medfilt.rst new file mode 100644 index 0000000..25f5af1 --- /dev/null +++ b/doc/source/modules/gui/plot/actions/medfilt.rst @@ -0,0 +1,5 @@ +:mod:`silx.gui.plot.actions.medfilt` +```````````````````````````````````` + +.. automodule:: silx.gui.plot.actions.medfilt + :members: diff --git a/doc/source/modules/gui/plot/colormap.rst b/doc/source/modules/gui/plot/colormap.rst new file mode 100644 index 0000000..a492605 --- /dev/null +++ b/doc/source/modules/gui/plot/colormap.rst @@ -0,0 +1,16 @@ + +.. currentmodule:: silx.gui.plot.Colormap + +:mod:`Colormap`: Colormap API +============================= + +.. automodule:: silx.gui.plot.Colormap + +.. currentmodule:: silx.gui.plot.Colormap + +:class:`Colormap` class +----------------------- + +.. autoclass:: Colormap + :show-inheritance: + :members: diff --git a/doc/source/modules/gui/plot/compleximageview.rst b/doc/source/modules/gui/plot/compleximageview.rst new file mode 100644 index 0000000..d9009eb --- /dev/null +++ b/doc/source/modules/gui/plot/compleximageview.rst @@ -0,0 +1,19 @@ + +.. currentmodule:: silx.gui.plot + +:mod:`ComplexImageView`: Plot a 2D array of complex +=================================================== + +.. automodule:: silx.gui.plot.ComplexImageView + +.. currentmodule:: silx.gui.plot.ComplexImageView + +.. image:: img/ComplexImageView.png + :height: 400px + :align: center + +:class:`ComplexImageView` class +------------------------------- + +.. autoclass:: ComplexImageView + :members: diff --git a/doc/source/modules/gui/plot/dev.rst b/doc/source/modules/gui/plot/dev.rst index 707d215..b793b01 100644 --- a/doc/source/modules/gui/plot/dev.rst +++ b/doc/source/modules/gui/plot/dev.rst @@ -10,7 +10,7 @@ This package is structured as follows. :class:`PlotWidget` is a Qt widget (actually a :class:`QMainWindow`) displaying a 1D, 2D plot area. It provides different interaction modes. :class:`PlotWindow` is a Qt widget (actually a :class:`QMainWindow`) which adds a set of toolbar buttons and associated functionalities to :class:`PlotWidget`. -The toolbar QActions are implemented in :mod:`.PlotActions`. +The toolbar QActions are implemented in :mod:`.actions`. :mod:`.Plot`, :mod:`.PlotEvents` and :mod:`.PlotInteraction` implement the plotting API regardless of the rendering backend and regardless of its integration in Qt. The plotting API in defined in :mod:`.Plot`. @@ -40,7 +40,6 @@ The :class:`PlotWindow` uses additional widgets: The widgets also use the following miscellaneous modules: - :mod:`.Colors` to convert colors from name to RGB(A) -- :mod:`.MPLColormap` to embed recent matplotlib colormaps: 'magma', 'inferno', 'plasma' and 'viridis'. - :mod:`._utils`: utility functions The :mod:`backends` package provide the implementation of the rendering used by the :class:`Plot`. @@ -89,15 +88,6 @@ The following modules are the modules used internally by the plot package. .. automodule:: silx.gui.plot.backends.BackendMatplotlib :members: -:mod:`backends.ModestImage` -+++++++++++++++++++++++++++ - -.. currentmodule:: silx.gui.plot.backends.ModestImage - -.. automodule:: silx.gui.plot.backends.ModestImage - :members: - :undoc-members: - :mod:`ColormapDialog` +++++++++++++++++++++ @@ -164,14 +154,6 @@ The following modules are the modules used internally by the plot package. :members: :show-inheritance: -:mod:`MPLColormap` -++++++++++++++++++ - -.. currentmodule:: silx.gui.plot.MPLColormap - -.. automodule:: silx.gui.plot.MPLColormap - :members: - :mod:`PlotEvents` +++++++++++++++++ diff --git a/doc/source/modules/gui/plot/getting_started.rst b/doc/source/modules/gui/plot/getting_started.rst index 9e45b70..484d3f7 100644 --- a/doc/source/modules/gui/plot/getting_started.rst +++ b/doc/source/modules/gui/plot/getting_started.rst @@ -157,6 +157,7 @@ a module from :mod:`silx.gui`: .. warning:: + :mod:`silx.gui.plot` widgets are not thread-safe. All calls to :mod:`silx.gui.plot` widgets must be made from the main thread. @@ -342,17 +343,15 @@ When updating an image, if ``origin`` and ``scale`` are not provided, the previo Colormap ++++++++ -A ``colormap`` is described with a :class:`dict` as follows (See :mod:`silx.gui.plot.Plot` for full documentation of the colormap): +A ``colormap`` is described with a :class:`.Colormap` class as follows: .. code-block:: python - colormap = { - 'name': 'gray', # Name of the colormap - 'normalization': 'linear', # Either 'linear' or 'log' - 'autoscale': True, # True to autoscale colormap to data range, False to use [vmin, vmax] - 'vmin': 0.0, # If not autoscale, data value to bind to min of colormap - 'vmax': 1.0 # If not autoscale, data value to bind to max of colormap - } + colormap = Colormap(name='gray', # Name of the colormap + normalization='linear', # Either 'linear' or 'log' + vmin=0.0, # If not autoscale, data value to bind to min of colormap + vmax=1.0 # If not autoscale, data value to bind to max of colormap + ) At least the following colormap names are guaranteed to be available, but any colormap name from `matplotlib `_ (see `Choosing Colormaps `_) should work: @@ -372,19 +371,23 @@ It is possible to change the default colormap of :meth:`.PlotWidget.addImage` fo .. code-block:: python - colormap = {'name': 'viridis', 'normalization': 'linear', - 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0} + colormap = Colormap(name='viridis', + normalization='linear', + vmin=0.0, + vmax=1.0) plot.setDefaultColormap(colormap) data = numpy.arange(512 * 512.).reshape(512, -1) plot.addImage(data) # Rendered with the default colormap set before -It is also possible to provide a ``colormap`` to :meth:`.PlotWidget.addImage` to override this default for an image: +It is also possible to provide a :class:`.Colormap` to :meth:`.PlotWidget.addImage` to override this default for an image: .. code-block:: python - colormap = {'name': 'magma', 'normalization': 'log', - 'autoscale': False, 'vmin': 1.2, 'vmax': 1.8} + colormap = Colormap(name='magma', + normalization='log', + vmin=1.2, + vmax=1.8) data = numpy.random.random(512 * 512).reshape(512, -1) + 1. plot.addImage(data, colormap=colormap) @@ -432,18 +435,19 @@ Control plot axes ----------------- The following examples illustrate the API to control the plot axes. +:meth:`.PlotWidget.getXAxis` and :meth:`.PlotWidget.getYAxis` give access to each plot axis (:class:`.items.Axis`) in order to control them. Labels and title ++++++++++++++++ Use :meth:`.PlotWidget.setGraphTitle` to set the plot main title. -Use :meth:`.PlotWidget.setGraphXLabel` and :meth:`.PlotWidget.setGraphYLabel` to set the axes text labels: +Use :meth:`.PlotWidget.getXAxis` and :meth:`.PlotWidget.getYAxis` to get the axes and set their text label with :meth:`.items.Axis.setLabel`: .. code-block:: python plot.setGraphTitle('My plot') - plot.setGraphXLabel('X') - plot.setGraphYLabel('Y') + plot.getXAxis().setLabel('X') + plot.getYAxis().setLabel('Y') Axes limits @@ -455,9 +459,9 @@ The following code moves the visible plot area to the right: .. code-block:: python - xmin, xmax = plot.getGraphXLimits() + xmin, xmax = plot.getXAxis().getLimits() offset = 0.1 * (xmax - xmin) - plot.setGraphXLimits(xmin + offset, xmax + offset) + plot.getXAxis().setLimits(xmin + offset, xmax + offset) :meth:`.PlotWidget.resetZoom` set the plot limits to the bounds of the data: @@ -465,7 +469,7 @@ The following code moves the visible plot area to the right: plot.resetZoom() -See :meth:`.PlotWidget.resetZoom`, :meth:`.PlotWidget.setLimits`, :meth:`.PlotWidget.getGraphXLimits`, :meth:`.PlotWidget.setGraphXLimits`, :meth:`.PlotWidget.getGraphYLimits`, :meth:`.PlotWidget.setGraphYLimits` for details. +See :meth:`.PlotWidget.resetZoom`, :meth:`.PlotWidget.setLimits`, :meth:`.PlotWidget.getXAxis`, :meth:`.PlotWidget.getYAxis` and :class:`.items.Axis` for details. Axes @@ -475,17 +479,17 @@ Different methods allow plot axes modifications: .. code-block:: python - plot.setYAxisInverted(True) # Makes the Y axis pointing downward + plot.getYAxis().setInverted(True) # Makes the Y axis pointing downward plot.setKeepDataAspectRatio(True) # To keep aspect ratio between X and Y axes -See :meth:`.PlotWidget.setYAxisInverted`, :meth:`.PlotWidget.setKeepDataAspectRatio` for details. +See :meth:`.PlotWidget.getYAxis`, :meth:`.PlotWidget.setKeepDataAspectRatio` for details. .. code-block:: python plot.setGraphGrid(which='both') # To show a grid for both minor and major axes ticks # Use logarithmic axes - plot.setXAxisLogarithmic(True) - plot.setYAxisLogarithmic(True) + plot.getXAxis().setScale("log") + plot.getYAxis().setScale("log") -See :meth:`.PlotWidget.setGraphGrid`, :meth:`.PlotWidget.setXAxisLogarithmic`, :meth:`.PlotWidget.setYAxisLogarithmic` for details. +See :meth:`.PlotWidget.setGraphGrid`, :meth:`.PlotWidget.getXAxis`, :meth:`.PlotWidget.getXAxis` and :class:`.items.Axis` for details. diff --git a/doc/source/modules/gui/plot/imageview.rst b/doc/source/modules/gui/plot/imageview.rst index c2663c7..f03868b 100644 --- a/doc/source/modules/gui/plot/imageview.rst +++ b/doc/source/modules/gui/plot/imageview.rst @@ -6,10 +6,12 @@ .. automodule:: silx.gui.plot.ImageView -.. currentmodule:: silx.gui.plot.ImageView +.. image:: img/ImageView.png + :height: 400 + :align: center :class:`ImageView` class ------------------------ .. autoclass:: ImageView - :members: valueChanged, profile, setImage, getColormap, setColormap, getHistogram, setGraphTitle, setGraphXLabel, setGraphYLabel + :members: valueChanged, setImage, getColormap, setColormap, getHistogram, setGraphTitle, getXAxis, getYAxis diff --git a/doc/source/modules/gui/plot/img/ComplexImageView.png b/doc/source/modules/gui/plot/img/ComplexImageView.png new file mode 100644 index 0000000..3f8b502 Binary files /dev/null and b/doc/source/modules/gui/plot/img/ComplexImageView.png differ diff --git a/doc/source/modules/gui/plot/img/fftAction0.png b/doc/source/modules/gui/plot/img/fftAction0.png deleted file mode 100644 index 5bd8061..0000000 Binary files a/doc/source/modules/gui/plot/img/fftAction0.png and /dev/null differ diff --git a/doc/source/modules/gui/plot/img/fftAction1.png b/doc/source/modules/gui/plot/img/fftAction1.png deleted file mode 100644 index e4b20d7..0000000 Binary files a/doc/source/modules/gui/plot/img/fftAction1.png and /dev/null differ diff --git a/doc/source/modules/gui/plot/img/printPreviewMultiPlot.png b/doc/source/modules/gui/plot/img/printPreviewMultiPlot.png new file mode 100644 index 0000000..4ce42b3 Binary files /dev/null and b/doc/source/modules/gui/plot/img/printPreviewMultiPlot.png differ diff --git a/doc/source/modules/gui/plot/img/shiftAction0.png b/doc/source/modules/gui/plot/img/shiftAction0.png deleted file mode 100644 index 2d5837a..0000000 Binary files a/doc/source/modules/gui/plot/img/shiftAction0.png and /dev/null differ diff --git a/doc/source/modules/gui/plot/img/shiftAction3.png b/doc/source/modules/gui/plot/img/shiftAction3.png deleted file mode 100644 index a2187b8..0000000 Binary files a/doc/source/modules/gui/plot/img/shiftAction3.png and /dev/null differ diff --git a/doc/source/modules/gui/plot/index.rst b/doc/source/modules/gui/plot/index.rst index 143b85b..b77bbcc 100644 --- a/doc/source/modules/gui/plot/index.rst +++ b/doc/source/modules/gui/plot/index.rst @@ -15,94 +15,12 @@ For an introduction to the widgets of this package, see :doc:`getting_started`. -For examples of custom plot actions, see :doc:`plotactions_examples`. +For examples of custom plot actions, see :doc:`actions/examples`. Widgets gallery --------------- -The :mod:`silx.gui.plot` package provides the following plotting widgets: - -.. |imgPlotWidget| image:: img/PlotWidget.png - :height: 150px - :align: middle - -.. |imgPlotWindow| image:: img/PlotWindow.png - :height: 150px - :align: middle - -.. |imgPlot1D| image:: img/Plot1D.png - :height: 150px - :align: middle - -.. |imgPlot2D| image:: img/Plot2D.png - :height: 150px - :align: middle - -.. |imgImageView| image:: img/ImageView.png - :height: 150px - :align: middle - -.. |imgStackView| image:: img/StackView.png - :height: 150px - :align: middle - -.. list-table:: - :widths: 1 4 - :header-rows: 1 - - * - Widget - - Description - * - |imgPlotWidget| - - :class:`PlotWidget` is the base Qt widget providing a plot area. - Other plot widgets are based on this one and provides the same API. - * - |imgPlotWindow| - - :class:`PlotWindow` adds a toolbar to :class:`PlotWidget`. - The content of this toolbar can be configured from the - :class:`PlotWindow` constructor or by hiding its content afterward. - * - |imgPlot1D| - - :class:`.Plot1D` is a :class:`PlotWindow` configured with tools useful - for curves. - * - |imgPlot2D| - - :class:`.Plot2D` is a :class:`PlotWindow` configured with tools useful - for images. - * - |imgImageView| - - :class:`ImageView` adds side histograms to a :class:`.Plot2D` widget. - * - |imgStackView| - - :class:`StackView` is a widget designed to display an image from a - stack of images in a :class:`PlotWindow` widget, with a frame browser - to navigate in the stack. The profile tool can do a 2D profile on the - stack of images. - -It also provides (and uses) widgets that can be attached to a :class:`PlotWidget`: - -.. |imgPositionInfo| image:: img/PositionInfo.png - :width: 300px - :align: middle - -.. |imgLimitsToolBar| image:: img/LimitsToolBar.png - :width: 300px - :align: middle - -.. |imgColorbar| image:: img/logColorbar.png - :height: 150px - :align: middle - - -.. list-table:: - :widths: 1 4 - :header-rows: 1 - - * - Widget - - Description - * - |imgPositionInfo| - - :class:`.PlotTools.PositionInfo` is a widget displaying mouse position and - information of a :class:`PlotWidget` associated to the mouse position. - * - |imgLimitsToolBar| - - :class:`.PlotTools.LimitsToolBar` is a QToolBar displaying and - controlling the limits of a :class:`PlotWidget`. - * - |imgColorbar| - - :class:`.ColorBar.ColorBarWidget` display colormap gradient and can be linked with a plot - to display the colormap +See :ref:`plot-gallery` gallery. Public modules -------------- @@ -114,12 +32,14 @@ Public modules plotwindow.rst imageview.rst stackview.rst - plot.rst + compleximageview.rst + colormap.rst items.rst - plotactions.rst + actions/index.rst plottools.rst profile.rst roi.rst + printpreviewtoolbutton.rst Internals --------- diff --git a/doc/source/modules/gui/plot/items.rst b/doc/source/modules/gui/plot/items.rst index beba3a1..3cdcf17 100644 --- a/doc/source/modules/gui/plot/items.rst +++ b/doc/source/modules/gui/plot/items.rst @@ -8,56 +8,103 @@ .. currentmodule:: silx.gui.plot.items +Item +---- + +All plot primitives inherits from :class:`Item` as a common ground: + +.. autoclass:: Item + :show-inheritance: + :members: + Curve ----- .. autoclass:: Curve - :members: - :inherited-members: + :members: getData, getXData, getYData, getXErrorData, getYErrorData, setData, + getSymbol, setSymbol, getSymbolSize, setSymbolSize, + getAlpha, setAlpha, + getColor, setColor, + getYAxis, setYAxis, + isFill, setFill, + getXLabel, getYLabel, + getLineWidth, setLineWidth, getLineStyle, setLineStyle, + isHighlighted, setHighlighted, getHighlightedColor, setHighlightedColor, + getCurrentColor Images ------ .. autoclass:: ImageData - :members: - :inherited-members: + :members: getData, getRgbaImageData, + getOrigin, setOrigin, + getScale, setScale, + isDraggable, + getAlpha, setAlpha, + getColormap, setColormap, + getAlternativeImageData .. autoclass:: ImageRgba - :members: - :inherited-members: + :members: getData, getRgbaImageData, + getOrigin, setOrigin, + getScale, setScale, + isDraggable, + getAlpha, setAlpha Scatter ------- .. autoclass:: Scatter - :members: - :inherited-members: + :members: getValueData, + getData, getXData, getYData, getXErrorData, getYErrorData, setData, + getSymbol, setSymbol, getSymbolSize, setSymbolSize, + getAlpha, setAlpha, + getColormap, setColormap Histogram --------- .. autoclass:: Histogram - :members: - :inherited-members: + :members: getValueData, getBinEdgesData, getData, setData, + getAlpha, setAlpha, + getColor, setColor, + getYAxis, setYAxis, + isFill, setFill, + getLineWidth, setLineWidth, getLineStyle, setLineStyle Markers ------- .. autoclass:: Marker - :members: - :inherited-members: + :members: getText, setText, getXPosition, getYPosition, getPosition, setPosition, getConstraint, + getSymbol, setSymbol, getSymbolSize, setSymbolSize .. autoclass:: XMarker - :members: - :inherited-members: + :members: getText, setText, getXPosition, getYPosition, getPosition, setPosition, getConstraint .. autoclass:: YMarker + :members: getText, setText, getXPosition, getYPosition, getPosition, setPosition, getConstraint + +Shapes +------ + +.. autoclass:: Shape + :members: setOverlay, + getColor, setColor, + isFill, setFill, + getType, getPoints, setPoints + +Item changed signal +------------------- + +Plot items emit a :attr:`Item.sigItemChanged` signal when their values are updated. +This signal provides a flag in the following enumeration describing the modified value: + +.. autoclass:: ItemChangedType :members: - :inherited-members: -Item +Axis ---- -.. autoclass:: Shape +.. autoclass:: Axis :members: - :inherited-members: diff --git a/doc/source/modules/gui/plot/plot.rst b/doc/source/modules/gui/plot/plot.rst deleted file mode 100644 index 2b8e096..0000000 --- a/doc/source/modules/gui/plot/plot.rst +++ /dev/null @@ -1,16 +0,0 @@ - -.. currentmodule:: silx.gui.plot - -:mod:`Plot`: Full plot API -========================== - -.. automodule:: silx.gui.plot.Plot - -.. currentmodule:: silx.gui.plot.Plot - -:class:`Plot` class -------------------- - -.. autoclass:: Plot - :show-inheritance: - :members: diff --git a/doc/source/modules/gui/plot/plotactions.rst b/doc/source/modules/gui/plot/plotactions.rst deleted file mode 100644 index 29a3656..0000000 --- a/doc/source/modules/gui/plot/plotactions.rst +++ /dev/null @@ -1,20 +0,0 @@ - -.. currentmodule:: silx.gui.plot - -:mod:`PlotActions`: Actions for PlotWidget -=========================================== - -.. currentmodule:: silx.gui.plot.PlotActions - -The :class:`PlotAction` is a base class used to define plot actions. - -Plot actions serve to add menu items or toolbar items that are associated with a method -that can interact with the associated :class:`PlotWidget`. - -For an introduction to creating custom plot actions, see :doc:`plotactions_examples`. - -PlotActions API ---------------- - -.. automodule:: silx.gui.plot.PlotActions - :members: diff --git a/doc/source/modules/gui/plot/plotactions_examples.rst b/doc/source/modules/gui/plot/plotactions_examples.rst deleted file mode 100644 index f14a42a..0000000 --- a/doc/source/modules/gui/plot/plotactions_examples.rst +++ /dev/null @@ -1,93 +0,0 @@ -.. currentmodule:: silx.gui - -Adding custom plot actions -========================== - -A :class:`PlotWindow` defines a number of standard plot actions that can be executed -by clicking on toolbar icons. - -Developers can design additional plot actions to be added as toolbar icons or as menu entries, -to be added to a :class:`PlotWindow` or to design their own plot window based on -:class:`PlotWidget`. - -This documentation pages provides examples on how to do this. - -Simple example: Shift a curve ------------------------------ - -The following script is a simplistic example to show the basic required steps: - - - create a new class inheriting from :class:`silx.gui.plot.PlotActions.PlotAction` - - define basic parameters such as the icon, the tooltip... - - write a method that will be triggered by the action - - initialize the new plot action by passing a reference to a plot window - - add the action to a toolbar or a menu - -The method implemented in this action interacts with the plot in a basic way. It gets the active curve, -then it creates a new data array based on the curve data, and finally it replaces the original curve -with a new one using the modified data array. - -.. literalinclude:: ../../../../../examples/shiftPlotAction.py - :lines: 36- - -.. |imgShiftAction0| image:: img/shiftAction0.png - :height: 300px - :align: middle - -.. |imgShiftAction3| image:: img/shiftAction3.png - :height: 300px - :align: middle - -.. list-table:: - :widths: 1 2 - - * - |imgShiftAction0| - - Initial state - * - |imgShiftAction3| - - After triggering the action 3 times, the selected triangle shaped curve - is shifted up by 3 units - -Advanced example: Display amplitude spectrum --------------------------------------------- - -This more advanced example shows additional ways of interacting with the plot, by changing -labels, storing additional data array along with the curve data. - -This action is *checkable*, meaning that is has two states. When clicking the toolbar icon -or the menu item, it remains in a *pushed* state until it is clicked again. - -In one state (*un-checked*), the original data is displayed. In the other state, the amplitude -spectrum of the original signal is displayed. When the state is changed, the triggered action -computes either the Fast Fourier Transform (FFT), or the reverse FFT. - -This example also illustrates how to store additional data, along with a curve. -The FFT computation returns complex values, but we want to display real data, so we compute -the amplitude spectrum. However, the inverse FFT requires the complete FFT data as input. -We are therefore required to store the complex array of FFT data as curve metadata, -in order to be able to reverse the process when the action is unchecked. - -.. literalinclude:: ../../../../../examples/fftPlotAction.py - :lines: 44- - -.. |imgFftAction0| image:: img/fftAction0.png - :height: 300px - :align: middle - -.. |imgFftAction1| image:: img/fftAction1.png - :height: 300px - :align: middle - -.. list-table:: - :widths: 1 2 - - * - |imgFftAction0| - - Original signals (zoom applied). In red, a cosine wave at 7 Hz. - In black, a sum of sines with frequencies of 3, 20 and 42 Hz. - In green, a square wave with a fundamental frequency of 0.5 Hz - (wavelength of 2 seconds). - * - |imgFftAction1| - - Amplitude spectra (zoom applied), with peaks visible at - the expected frequencies of 3, 7, 20 and 42 Hz for the sine and cosine - signals. In green, we see the complete series of peaks related to the square wave, - with a fundamental frequency at 0.5 Hz and harmonic frequencies at every - odd multiple of the fundamental. diff --git a/doc/source/modules/gui/plot/plotwidget.rst b/doc/source/modules/gui/plot/plotwidget.rst index df576fc..a8e7831 100644 --- a/doc/source/modules/gui/plot/plotwidget.rst +++ b/doc/source/modules/gui/plot/plotwidget.rst @@ -14,13 +14,8 @@ It is the basis of other plot widget, thus all plot widgets share the same API. For an introduction and examples of the plot API, see :doc:`getting_started`. -Plot API --------- - -.. currentmodule:: silx.gui.plot.Plot - -This is a choosen subset of the complete plot API, the full API is -documented in :class:`silx.gui.plot.Plot`. +:class:`PlotWidget` +------------------- .. currentmodule:: silx.gui.plot.PlotWidget @@ -37,6 +32,20 @@ Those methods allow to add and update plotted data: .. automethod:: PlotWidget.addScatter .. automethod:: PlotWidget.addHistogram +Get data +........ + +Those methods return objects providing access to plotted data: + +.. automethod:: PlotWidget.getCurve +.. automethod:: PlotWidget.getImage +.. automethod:: PlotWidget.getScatter +.. automethod:: PlotWidget.getHistogram + +.. automethod:: PlotWidget.getAllCurves +.. automethod:: PlotWidget.getAllImages + + Plot markers ............ @@ -52,59 +61,40 @@ Remove data from the plot .. automethod:: PlotWidget.clear .. automethod:: PlotWidget.remove -Title and labels -................ +Title +..... -Those methods handle the text labels of the axes and the plot title: +Those methods handle the plot title: .. automethod:: PlotWidget.getGraphTitle .. automethod:: PlotWidget.setGraphTitle -.. automethod:: PlotWidget.getGraphXLabel -.. automethod:: PlotWidget.setGraphXLabel -.. automethod:: PlotWidget.getGraphYLabel -.. automethod:: PlotWidget.setGraphYLabel - -Axes limits -........... - -Those methods change the range of data values displayed on each axis. - -.. automethod:: PlotWidget.getGraphXLimits -.. automethod:: PlotWidget.setGraphXLimits -.. automethod:: PlotWidget.getGraphYLimits -.. automethod:: PlotWidget.setGraphYLimits -.. automethod:: PlotWidget.setLimits Axes .... -The following methods handle the display properties of the axes: +Those two methods give access to :class:`.items.Axis` which handle the limits, scales and labels of axis: -.. automethod:: PlotWidget.isXAxisLogarithmic -.. automethod:: PlotWidget.setXAxisLogarithmic -.. automethod:: PlotWidget.isYAxisLogarithmic -.. automethod:: PlotWidget.setYAxisLogarithmic +.. automethod:: PlotWidget.getXAxis +.. automethod:: PlotWidget.getYAxis -.. automethod:: PlotWidget.isYAxisInverted -.. automethod:: PlotWidget.setYAxisInverted +The following methods handle plot limits, aspect ratio, grid and axes display: + +.. automethod:: PlotWidget.setLimits .. automethod:: PlotWidget.isKeepDataAspectRatio .. automethod:: PlotWidget.setKeepDataAspectRatio .. automethod:: PlotWidget.getGraphGrid .. automethod:: PlotWidget.setGraphGrid +.. automethod:: PlotWidget.setAxesDisplayed Reset zoom .......... .. automethod:: PlotWidget.resetZoom -Those methods change the behavior of :meth:`PlotWidget.resetZoom`. +The following methods allow to add margins around the data when performing a zoom reset: .. automethod:: PlotWidget.getDataMargins .. automethod:: PlotWidget.setDataMargins -.. automethod:: PlotWidget.isXAxisAutoScale -.. automethod:: PlotWidget.setXAxisAutoScale -.. automethod:: PlotWidget.isYAxisAutoScale -.. automethod:: PlotWidget.setYAxisAutoScale Defaults ........ @@ -130,10 +120,35 @@ of the plot and to toggle the use of a crosshair cursor: .. automethod:: PlotWidget.getGraphCursor .. automethod:: PlotWidget.setGraphCursor +.. automethod:: PlotWidget.isPanWithArrowKeys +.. automethod:: PlotWidget.setPanWithArrowKeys + +Coordinates conversion +...................... + +.. automethod:: PlotWidget.getDataRange +.. automethod:: PlotWidget.getPlotBoundsInPixels +.. automethod:: PlotWidget.dataToPixel +.. automethod:: PlotWidget.pixelToData + +Active Item +........... + +.. automethod:: PlotWidget.isActiveCurveHandling +.. automethod:: PlotWidget.setActiveCurveHandling +.. automethod:: PlotWidget.getActiveCurveColor +.. automethod:: PlotWidget.setActiveCurveColor +.. automethod:: PlotWidget.getActiveCurve +.. automethod:: PlotWidget.setActiveCurve +.. automethod:: PlotWidget.getActiveImage +.. automethod:: PlotWidget.setActiveImage + Misc. ..... +.. automethod:: PlotWidget.getWidgetHandle .. automethod:: PlotWidget.saveGraph +.. automethod:: PlotWidget.setDefaultBackend Signals ....... @@ -141,11 +156,6 @@ Signals The :class:`PlotWidget` provides the following Qt signals: .. autoattribute:: PlotWidget.sigPlotSignal -.. autoattribute:: PlotWidget.sigSetYAxisInverted -.. autoattribute:: PlotWidget.sigSetXAxisLogarithmic -.. autoattribute:: PlotWidget.sigSetYAxisLogarithmic -.. autoattribute:: PlotWidget.sigSetXAxisAutoScale -.. autoattribute:: PlotWidget.sigSetYAxisAutoScale .. autoattribute:: PlotWidget.sigSetKeepDataAspectRatio .. autoattribute:: PlotWidget.sigSetGraphGrid .. autoattribute:: PlotWidget.sigSetGraphCursor @@ -153,21 +163,33 @@ The :class:`PlotWidget` provides the following Qt signals: .. autoattribute:: PlotWidget.sigContentChanged .. autoattribute:: PlotWidget.sigActiveCurveChanged .. autoattribute:: PlotWidget.sigActiveImageChanged +.. autoattribute:: PlotWidget.sigActiveScatterChanged .. autoattribute:: PlotWidget.sigInteractiveModeChanged -.. Not documented: - addItem, removeItem, clearItems - isActiveCurveHandling, enableActiveCurveHandling, - getActiveCurveColor, setActiveCurveColor, - getActiveCurve, setActiveCurve, - isCurveHidden, hideCurve, - getActiveImage, setActiveImage, - getAllCurves, getCurve, getImage, getAllImages, - getScatter, getHistogram, - setDefaultPlotPoints, setDefaultPlotLines, - getWidgetHandle, notify, setCallback, graphCallback, - dataToPixel, pixelToData, getPlotBoundsInPixels, - setGraphCursorShape, pickMarker, moveMarker, pickImageOrCurve, moveImage, - onMousePress, onMouseMove, onMouseRelease, onMouseWheel, - isDrawModeEnabled, setDrawModeEnabled, getDrawMode, - isZoomModeEnabled, setZoomModeEnabled, +.. PlotWidget public API that is not documented: + Could be added: + - addItem + - pan + - getLimitsHistory + - isDefaultPlotPoints + - isDefaultPlotLines + - setGraphCursorShape + - getAutoReplot, setAutoReplot, replot + Should not be added: + * Should be private: + - notify, setCallback, graphCallback + * Use remove instead: + - removeCurve, removeImage, removeItem, removeMarker + - clearCurves, clearImages, clearItems, clearMarkers + * Use items instead: + - isCurveHidden, hideCurve + * Use items.axis instead: + - getGraphXLimits, setGraphXLimits + - getGraphYLimits, setGraphYLimits + - getGraphXLabel, setGraphXLabel + - getGraphYLabel, setGraphYLabel + - isXAxisLogarithmic, setXAxisLogarithmic + - isYAxisLogarithmic, setXAxisLogarithmic + - isXAxisAutoScale, setXAxisAutoScale + - isYAxisAutoScale, setYAxisAutoScale + - setYAxisInverted, isYAxisInverted diff --git a/doc/source/modules/gui/plot/printpreviewtoolbutton.rst b/doc/source/modules/gui/plot/printpreviewtoolbutton.rst new file mode 100644 index 0000000..42b3832 --- /dev/null +++ b/doc/source/modules/gui/plot/printpreviewtoolbutton.rst @@ -0,0 +1,8 @@ + +.. currentmodule:: silx.gui.plot + +:mod:`PrintPreviewToolButton`: Print preview buttons +==================================================== + +.. automodule:: silx.gui.plot.PrintPreviewToolButton + :members: diff --git a/doc/source/modules/gui/plot/stackview.rst b/doc/source/modules/gui/plot/stackview.rst index 7f2442a..11c7828 100644 --- a/doc/source/modules/gui/plot/stackview.rst +++ b/doc/source/modules/gui/plot/stackview.rst @@ -13,7 +13,9 @@ .. autoclass:: StackView :members: - :exclude-members: remove, setInteractiveMode, addItem + :exclude-members: remove, setInteractiveMode, addItem, getActiveImage, + resetZoom, setYAxisInverted, isYAxisInverted, getSupportedColormaps, + isKeepDataAspectRatio, setKeepDataAspectRatio :class:`StackViewMainWindow` class ---------------------------------- diff --git a/doc/source/modules/gui/plot3d/actions.rst b/doc/source/modules/gui/plot3d/actions.rst index a2fde68..c9e3af2 100644 --- a/doc/source/modules/gui/plot3d/actions.rst +++ b/doc/source/modules/gui/plot3d/actions.rst @@ -1,10 +1,15 @@ -Actions -======= +:mod:`actions` +============== -:mod:`Plot3DActions` --------------------- +.. currentmodule:: silx.gui.plot3d.actions -.. currentmodule:: silx.gui.plot3d.Plot3DActions +.. automodule:: silx.gui.plot3d.actions + :members: + +.. automodule:: silx.gui.plot3d.actions.io + :members: -.. automodule:: silx.gui.plot3d.Plot3DActions +.. automodule:: silx.gui.plot3d.actions.mode :members: + +.. autoclass:: Plot3DAction diff --git a/doc/source/modules/gui/plot3d/dev.rst b/doc/source/modules/gui/plot3d/dev.rst index 757240e..96704f8 100644 --- a/doc/source/modules/gui/plot3d/dev.rst +++ b/doc/source/modules/gui/plot3d/dev.rst @@ -12,10 +12,10 @@ Widget-level API Widgets are available as modules of the :mod:`silx.gui.plot3d` packages. The :mod:`.Plot3DWidget` module provides the OpenGL canvas where the scene is rendered. -The :mod:`.Plot3DWindow` module provides a :class:`QMainWindow` with a :class:`Plot3DWindow` as its central widget -and toolbars: :class:`ViewpointToolBar` and :class:`Plot3DToolBar`. -:class:`QAction` that can be associated with a :class:`Plot3DWidget` are defined in the :mod:`.Plot3DActions` module. -Those actions are used by the :class:`Plot3DToolBar` toolbar. +The :mod:`.Plot3DWindow` module provides a :class:`QMainWindow` with a :class:`Plot3DWindow` as its central widget, +toolbars (:class:`InteractiveModeToolBar` and :class:`OutputToolBar`) and a :class:`ViewpointToolButton` in a toolbar. +:class:`QAction` that can be associated with a :class:`Plot3DWidget` are defined in the :mod:`.actions` module. +Those actions are used by the :class:`OutputToolBar` and the :class:`InteractiveModeToolBar` toolbars. The :mod:`.ScalarFieldView` module defines the :class:`ScalarFieldView` widget that displays iso-surfaces of a 3D scalar data set and the associated classes. The :mod:`.SFViewParamTree` module defines a :class:`SFViewParamTree.TreeView` widget that can be attached to a :class:`ScalarFieldView` to control the display. diff --git a/doc/source/modules/gui/plot3d/index.rst b/doc/source/modules/gui/plot3d/index.rst index 8941403..38b8f02 100644 --- a/doc/source/modules/gui/plot3d/index.rst +++ b/doc/source/modules/gui/plot3d/index.rst @@ -11,42 +11,7 @@ Widgets gallery --------------- -.. |imgPlot3DWidget| image:: img/Plot3DWidget.png - :height: 150px - :align: middle - -.. |imgPlot3DWindow| image:: img/Plot3DWindow.png - :height: 150px - :align: middle - -.. |imgScalarFieldView| image:: img/ScalarFieldView.png - :height: 150px - :align: middle - -.. |imgSFViewParamTree| image:: img/SFViewParamTree.png - :height: 150px - :align: middle - -.. list-table:: - :widths: 1 4 - :header-rows: 1 - - * - Widget - - Description - * - |imgScalarFieldView| - - :class:`ScalarFieldView` is a :class:`Plot3DWindow` dedicated to display 3D scalar field. - It can display iso-surfaces and an interactive cutting plane. - Sample code: :doc:`viewer3dvolume_example`. - * - |imgPlot3DWindow| - - :class:`Plot3DWindow` is a :class:`QMainWindow` with a :class:`Plot3DWidget` as central widget - and toolbars. - * - |imgPlot3DWidget| - - :class:`Plot3DWidget` is the base Qt widget providing an OpenGL 3D scene. - Other widgets are using this widget as the OpenGL scene canvas. - * - |imgSFViewParamTree| - - :class:`SFViewParamTree` is a :class:`QTreeView` widget that can be attached to a :class:`ScalarFieldView`. - It displays current parameters of the :class:`ScalarFieldView` and allows to modify it. - Sample code: :doc:`viewer3dvolume_example`. +See :ref:`plot3d-gallery` gallery. Public modules -------------- @@ -60,7 +25,7 @@ The following sub-modules are available: plot3dwindow.rst scalarfieldview.rst sfviewparamtree.rst - toolbars.rst + tools.rst actions.rst diff --git a/doc/source/modules/gui/plot3d/scalarfieldview.rst b/doc/source/modules/gui/plot3d/scalarfieldview.rst index 763c18e..80127ea 100644 --- a/doc/source/modules/gui/plot3d/scalarfieldview.rst +++ b/doc/source/modules/gui/plot3d/scalarfieldview.rst @@ -21,13 +21,6 @@ Helper classes Those classes are used by :class:`ScalarFieldView`. -:class:`Colormap` -+++++++++++++++++ - -.. autoclass:: Colormap - :show-inheritance: - :members: - :class:`CutPlane` +++++++++++++++++ diff --git a/doc/source/modules/gui/plot3d/toolbars.rst b/doc/source/modules/gui/plot3d/toolbars.rst deleted file mode 100644 index df4b4ef..0000000 --- a/doc/source/modules/gui/plot3d/toolbars.rst +++ /dev/null @@ -1,29 +0,0 @@ -Toolbars -======== - - -:mod:`ViewpointToolbar` ------------------------ - -.. currentmodule:: silx.gui.plot3d.ViewpointToolBar - -.. automodule:: silx.gui.plot3d.ViewpointToolBar - -.. autoclass:: ViewpointActionGroup - :show-inheritance: - :members: - -.. autoclass:: ViewpointToolBar - :show-inheritance: - :members: - -:mod:`Plot3DToolbar` --------------------- - -.. currentmodule:: silx.gui.plot3d.Plot3DToolBar - -.. automodule:: silx.gui.plot3d.Plot3DToolBar - -.. autoclass:: Plot3DToolBar - :show-inheritance: - :members: diff --git a/doc/source/modules/gui/plot3d/tools.rst b/doc/source/modules/gui/plot3d/tools.rst new file mode 100644 index 0000000..6cd433b --- /dev/null +++ b/doc/source/modules/gui/plot3d/tools.rst @@ -0,0 +1,40 @@ +:mod:`tools` +============ + +.. currentmodule:: silx.gui.plot3d.tools + +.. automodule:: silx.gui.plot3d.tools + +Toolbars +-------- + +:class:`InteractiveModeToolbar` ++++++++++++++++++++++++++++++++ + +.. autoclass:: InteractiveModeToolBar + :show-inheritance: + :members: + +:class:`OutputToolBar` +++++++++++++++++++++++ + +.. autoclass:: OutputToolBar + :show-inheritance: + :members: + +:class:`ViewpointToolbar` ++++++++++++++++++++++++++ + +.. autoclass:: ViewpointToolBar + :show-inheritance: + :members: + +Tool Buttons +------------ + +:class:`ViewpointToolButton` +++++++++++++++++++++++++++++ + +.. autoclass:: ViewpointToolButton + :show-inheritance: + :members: diff --git a/doc/source/modules/gui/widgets/img/FrameBrowser.png b/doc/source/modules/gui/widgets/img/FrameBrowser.png new file mode 100644 index 0000000..c5624f7 Binary files /dev/null and b/doc/source/modules/gui/widgets/img/FrameBrowser.png differ diff --git a/doc/source/modules/gui/widgets/img/HorizontalSliderWithBrowser.png b/doc/source/modules/gui/widgets/img/HorizontalSliderWithBrowser.png new file mode 100644 index 0000000..d64b2df Binary files /dev/null and b/doc/source/modules/gui/widgets/img/HorizontalSliderWithBrowser.png differ diff --git a/doc/source/modules/gui/widgets/img/PeriodicCombo.png b/doc/source/modules/gui/widgets/img/PeriodicCombo.png new file mode 100644 index 0000000..e0b40c2 Binary files /dev/null and b/doc/source/modules/gui/widgets/img/PeriodicCombo.png differ diff --git a/doc/source/modules/gui/widgets/img/PeriodicList.png b/doc/source/modules/gui/widgets/img/PeriodicList.png new file mode 100644 index 0000000..d1e540b Binary files /dev/null and b/doc/source/modules/gui/widgets/img/PeriodicList.png differ diff --git a/doc/source/modules/gui/widgets/img/PeriodicTable.png b/doc/source/modules/gui/widgets/img/PeriodicTable.png new file mode 100644 index 0000000..c06dded Binary files /dev/null and b/doc/source/modules/gui/widgets/img/PeriodicTable.png differ diff --git a/doc/source/modules/gui/widgets/img/TableWidget.png b/doc/source/modules/gui/widgets/img/TableWidget.png new file mode 100644 index 0000000..a0f819f Binary files /dev/null and b/doc/source/modules/gui/widgets/img/TableWidget.png differ diff --git a/doc/source/modules/gui/widgets/img/ThreadPoolPushButton.png b/doc/source/modules/gui/widgets/img/ThreadPoolPushButton.png new file mode 100644 index 0000000..4710d16 Binary files /dev/null and b/doc/source/modules/gui/widgets/img/ThreadPoolPushButton.png differ diff --git a/doc/source/modules/gui/widgets/img/WaitingPushButton.png b/doc/source/modules/gui/widgets/img/WaitingPushButton.png new file mode 100644 index 0000000..fa1d51a Binary files /dev/null and b/doc/source/modules/gui/widgets/img/WaitingPushButton.png differ diff --git a/doc/source/modules/gui/widgets/index.rst b/doc/source/modules/gui/widgets/index.rst index 2284f22..72f89a8 100644 --- a/doc/source/modules/gui/widgets/index.rst +++ b/doc/source/modules/gui/widgets/index.rst @@ -14,6 +14,7 @@ Public modules: framebrowser.rst periodictable.rst + printpreview.rst tablewidget.rst threadpoolpushbutton.rst waitingpushbutton.rst diff --git a/doc/source/modules/gui/widgets/printpreview.rst b/doc/source/modules/gui/widgets/printpreview.rst new file mode 100644 index 0000000..d0b7999 --- /dev/null +++ b/doc/source/modules/gui/widgets/printpreview.rst @@ -0,0 +1,60 @@ + +.. currentmodule:: silx.gui.widgets + +:mod:`PrintPreview`: Print preview dialog +----------------------------------------- + +.. automodule:: silx.gui.widgets.PrintPreview + +Widgets ++++++++ + +.. autoclass:: silx.gui.widgets.PrintPreview.PrintPreviewDialog + :members: + :exclude-members: printDialog, showEvent + :show-inheritance: + + +.. autoclass:: silx.gui.widgets.PrintPreview.SingletonPrintPreviewDialog + :show-inheritance: + +Example ++++++++ + +.. code-block:: python + + import sys + from silx.gui import qt + from silx.gui.widgets import PrintPreviewDialog + + a = qt.QApplication(sys.argv) + + if len(sys.argv) < 2: + print("give an image file as parameter please.") + sys.exit(1) + + if len(sys.argv) > 2: + print("only one parameter please.") + sys.exit(1) + + filename = sys.argv[1] + w = PrintPreviewDialog() + w.resize(400, 500) + + comment = "" + for i in range(20): + comment += "Line number %d: En un lugar de La Mancha de cuyo nombre ...\n" + + if filename[-3:] == "svg": + item = qt.QSvgRenderer(filename, w.page) + w.addSvgItem(item, title=filename, + comment=comment, commentPosition="CENTER") + else: + w.addPixmap(qt.QPixmap.fromImage(qt.QImage(filename)), + title=filename, + comment=comment, + commentPosition="CENTER") + w.addImage(qt.QImage(filename), comment=comment, commentPosition="LEFT") + + w.exec_() + a.exec_() diff --git a/doc/source/modules/image/backprojection.rst b/doc/source/modules/image/backprojection.rst new file mode 100644 index 0000000..c45f670 --- /dev/null +++ b/doc/source/modules/image/backprojection.rst @@ -0,0 +1,8 @@ + +.. currentmodule:: silx.image + +:mod:`backprojection`: backprojection algorithm +----------------------------------------------- + +.. automodule:: silx.image.backprojection + :members: Backprojection diff --git a/doc/source/modules/image/index.rst b/doc/source/modules/image/index.rst index abdeb64..89c5642 100644 --- a/doc/source/modules/image/index.rst +++ b/doc/source/modules/image/index.rst @@ -11,3 +11,4 @@ medianfilter.rst shapes.rst sift.rst + backprojection.rst diff --git a/doc/source/modules/image/projection.rst b/doc/source/modules/image/projection.rst new file mode 100644 index 0000000..f5f4815 --- /dev/null +++ b/doc/source/modules/image/projection.rst @@ -0,0 +1,15 @@ + +.. currentmodule:: silx.image + +:mod:`projection`: projection algorithm +--------------------------------------- + +.. warning:: + + This module is known to be buggy in version 0.6: + Do NOT use it without having checked it provides + proper results + +.. automodule:: silx.image.projection + :members: Projection + diff --git a/doc/source/modules/image/reconstruction.rst b/doc/source/modules/image/reconstruction.rst new file mode 100644 index 0000000..d288581 --- /dev/null +++ b/doc/source/modules/image/reconstruction.rst @@ -0,0 +1,14 @@ + +.. currentmodule:: silx.image + +:mod:`reconstruction`: reconstruction algorithm +----------------------------------------------- + +.. warning:: + + This module is known to be buggy in version 0.6: + Do NOT use it without having checked it provides + proper results + +.. automodule:: silx.image.reconstruction + :members: ReconstructionAlgorithm, SIRT, TV diff --git a/doc/source/modules/io/convert.rst b/doc/source/modules/io/convert.rst new file mode 100644 index 0000000..4d3abdc --- /dev/null +++ b/doc/source/modules/io/convert.rst @@ -0,0 +1,8 @@ + +.. currentmodule:: silx.io + +:mod:`convert`: HDF5 conversion +------------------------------- + +.. automodule:: silx.io.convert + :members: write_to_h5, convert diff --git a/doc/source/modules/io/index.rst b/doc/source/modules/io/index.rst index 1538a74..815a094 100644 --- a/doc/source/modules/io/index.rst +++ b/doc/source/modules/io/index.rst @@ -9,13 +9,13 @@ :maxdepth: 1 configdict.rst + convert.rst dictdump.rst nxdata.rst octaveh5.rst specfile.rst specfilewrapper.rst spech5.rst - spectoh5.rst utils.rst Top-level functions @@ -23,3 +23,8 @@ Top-level functions .. autofunction:: silx.io.open .. autofunction:: silx.io.save1D + +.. autofunction:: silx.io.is_dataset +.. autofunction:: silx.io.is_group +.. autofunction:: silx.io.is_file +.. autofunction:: silx.io.is_softlink diff --git a/doc/source/modules/io/spech5.rst b/doc/source/modules/io/spech5.rst index 143d3bb..61e0083 100644 --- a/doc/source/modules/io/spech5.rst +++ b/doc/source/modules/io/spech5.rst @@ -5,7 +5,41 @@ ----------------------------------------- .. automodule:: silx.io.spech5 + + +Classes ++++++++ + +- :class:`SpecH5` +- :class:`SpecH5Group` +- :class:`SpecH5Dataset` + +.. autoclass:: SpecH5 + :members: + :show-inheritance: + :undoc-members: + :inherited-members: name, basename, attrs, h5py_class, parent, + get, keys, values, items, + :special-members: __getitem__, __len__, __contains__, __enter__, __exit__, __iter__ + :exclude-members: add_node + +.. autoclass:: SpecH5Group + :show-inheritance: + +.. autoclass:: silx.io.commonh5.Group + :show-inheritance: + :undoc-members: + :members: name, basename, file, attrs, h5py_class, parent, + get, keys, values, items, visit, visititems + :special-members: __getitem__, __len__, __contains__, __iter__ + :exclude-members: add_node + +.. autoclass:: SpecH5Dataset + :show-inheritance: + +.. autoclass:: SpecH5NodeDataset :members: :show-inheritance: :undoc-members: - :special-members: __getitem__, __len__, __contains__ + :inherited-members: + :special-members: __getitem__, __len__, __iter__, __getattr__ diff --git a/doc/source/modules/io/spectoh5.rst b/doc/source/modules/io/spectoh5.rst deleted file mode 100644 index 05fc768..0000000 --- a/doc/source/modules/io/spectoh5.rst +++ /dev/null @@ -1,8 +0,0 @@ - -.. currentmodule:: silx.io - -:mod:`spectoh5`: SpecFile to HDF5 conversion ---------------------------------------------- - -.. automodule:: silx.io.spectoh5 - :members: write_spec_to_h5, convert diff --git a/doc/source/modules/utils/decorators.rst b/doc/source/modules/utils/decorators.rst index 1da0f44..c181220 100644 --- a/doc/source/modules/utils/decorators.rst +++ b/doc/source/modules/utils/decorators.rst @@ -1,7 +1,7 @@ .. currentmodule:: silx.utils -:mod:`decorators` +:mod:`deprecation` ------------------ -.. automodule:: silx.utils.decorators - :members: +.. automodule:: silx.utils.deprecation + :members: deprecated -- cgit v1.2.3