Skip to content

Commit 0d86013

Browse files
committed
Add short description of example
1 parent 5186833 commit 0d86013

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

doc/source/api_reference/graphicsItems/imageitem.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ individual :python:`[R,G,B]` or :python:`[R,G,B,A]` channels/components.
2424
Notes
2525
-----
2626

27+
:class:`~pyqtgraph.ImageItem` is frequently used in conjunction with
28+
:class:`~pyqtgraph.ColorBarItem` to provide a color map display and interactive level
29+
adjustments, or with :class:`~pyqtgraph.HistogramLUTItem` or
30+
:class:`~pyqtgraph.HistogramLUTWidget` for a full GUI to control the levels and lookup
31+
table used to display the image.
32+
2733
An image can be placed into a plot area of a given extent directly through the
2834
:meth:`ImageItem.setRect <pyqtgraph.ImageItem.setRect>` method or the ``rect`` keyword.
2935
This is internally realized through assigning a :class:`QTransform`. For other
3036
translation, scaling or rotations effects that persist for all later image data, the
3137
user can also directly define and assign such a transform, as shown in the example
3238
below.
3339

34-
:class:`~pyqtgraph.ImageItem` is frequently used in conjunction with
35-
:class:`~pyqtgraph.ColorBarItem` to provide a color map display and interactive level
36-
adjustments, or with :class:`~pyqtgraph.HistogramLUTItem` or
37-
:class:`~pyqtgraph.HistogramLUTWidget` for a full GUI to control the levels and lookup
38-
table used to display the image.
39-
4040
Performance
4141
-----------
4242

@@ -53,8 +53,8 @@ The following guidance should be observed if performance is an important factor
5353
:python:`pyqtgraph.setConfigOption('imageAxisOrder', 'row-major')`
5454

5555
* Use C-contiguous image data.
56-
* For 1 or 3 channel data, use `uint8`, `uint16`, `float32`, or `float64`
57-
``image`` dtype.
56+
* For 1 or 3 channel data, use `uint8`, `uint16`, `float32`, or `float64` ``image``
57+
dtype.
5858
* For 4-channel data, use `uint8` or `uint16` with :python:`levels=None`.
5959
* ``levels`` should be set to (even if to ``None``) to avoid autoLevels sampling.
6060
* ``levels`` should be single channel or ``None``.
@@ -65,8 +65,8 @@ The following guidance should be observed if performance is an important factor
6565
* :func:`ImageItem.setLookupTable <pyqtgraph.ImageItem.setLookupTable>` with
6666
:python:`ColorMap.getLookupTable(nPts=256)` (default is :python:`nPts=512`)
6767

68-
* For floating point ``image`` arrays, prefer `float32` dtype to `float64`
69-
and avoid ``NaN`` values.
68+
* For floating point ``image`` arrays, prefer `float32` dtype to `float64` and avoid
69+
``NaN`` values.
7070
* Enable Numba with :python:`pyqtgraph.setConfigOption('useNumba', True)`
7171

7272
* JIT compilation will only accelerate repeated image display.
@@ -89,6 +89,10 @@ do not call :func:`~pyqtgraph.functions.makeARGB`.
8989
Examples
9090
--------
9191

92+
In the following example, it is demonstrated how a user scale and translate a
93+
:class:`~pyqtgraph.ImageItem` within a :class:`~pyqtgraph.ViewBox` to occupy a specific
94+
position and size.
95+
9296
.. literalinclude:: /images/gen_example_imageitem_transform.py
9397
:lines: 19-28
9498
:dedent: 8

0 commit comments

Comments
 (0)