8.5.5.4.4. pymodaq_gui.plotting.utils.plot_utils module
- class pymodaq_gui.plotting.utils.plot_utils.Data0DWithHistory(Nsamples=200)[source]
Bases:
objectObject to store scalar values and keep a history of a given length to them
- Attributes:
- datas
- length
- size
- xaxis
Methods
add_datas
clear_data
- add_datas
Dispatch methods based on type signature
See also
Dispatcher
- property datas
- property length
- property size
- property xaxis
- class pymodaq_gui.plotting.utils.plot_utils.Point(*elt)[source]
Bases:
object- Attributes:
- coordinates
Methods
copy
- property coordinates
- class pymodaq_gui.plotting.utils.plot_utils.QVector(*elt)[source]
Bases:
QLineFMethods
dot(qvect)scalar product
prod(qvect)vectoriel product length along z
copy
norm
normalVector_not_vectorized
translate_to
vectorize
- class pymodaq_gui.plotting.utils.plot_utils.RoiInfo(origin, size, angle=None, centered=False, color=(255, 0, 0), roi_class=None, index=0)[source]
Bases:
objectDataClass holding info about a given ROI
- Parameters:
- Attributes:
- angle
- roi_class
Methods
from_slices(slices)Return a ROIInfo instance from a list of slices
Get slices to be used directly to slice DataWithAxes
center_origin
info_from_linear_roi
info_from_rect_roi
- classmethod from_slices(slices)[source]
Return a ROIInfo instance from a list of slices
- Return type:
- class pymodaq_gui.plotting.utils.plot_utils.Vector(coordinates, origin=None)[source]
Bases:
object- Attributes:
- coordinates
- origin
Methods
copy
cross
dot
norm
unit_vector
- property coordinates
- property origin
- class pymodaq_gui.plotting.utils.plot_utils.View_cust(parent=None, border=None, lockAspect=False, enableMouse=True, invertY=False, enableMenu=True, name=None, invertX=False)[source]
Bases:
ViewBoxCustom ViewBox used to enable other properties compared to parent class: pg.ViewBox
Methods
mouseClickEvent
sig_double_clicked
- pymodaq_gui.plotting.utils.plot_utils.get_sub_segmented_positions(spacing, points)[source]
Get Points coordinates spaced in between subsequent Points
- pymodaq_gui.plotting.utils.plot_utils.makeAlphaTriangles(data, lut=None, levels=None, scale=None, useRGBA=False)[source]
Convert an array of values into an ARGB array suitable for building QImages, OpenGL textures, etc.
Returns the ARGB array (unsigned byte) and a boolean indicating whether there is alpha channel data. This is a two stage process:
compute the polygons (triangles) from triangulation of the points
Rescale the data based on the values in the levels argument (min, max).
Determine the final output by passing the rescaled values through a lookup table.
Both stages are optional.
Arguments:
data
numpy array of int/float types. If
levels
List [min, max]; optionally rescale data before converting through the lookup table. The data is rescaled such that min->0 and max->*scale*:
rescaled = (clip(data, min, max) - min) * (*scale* / (max - min))
It is also possible to use a 2D (N,2) array of values for levels. In this case, it is assumed that each pair of min,max values in the levels array should be applied to a different subset of the input data (for example, the input data may already have RGB values and the levels are used to independently scale each channel). The use of this feature requires that levels.shape[0] == data.shape[-1].
scale
The maximum value to which data will be rescaled before being passed through the lookup table (or returned if there is no lookup table). By default this will be set to the length of the lookup table, or 255 if no lookup table is provided.
lut
Optional lookup table (array with dtype=ubyte). Values in data will be converted to color by indexing directly from lut. The output data shape will be input.shape + lut.shape[1:]. Lookup tables can be built using ColorMap or GradientWidget.
useRGBA
If True, the data is returned in RGBA order (useful for building OpenGL textures). The default is False, which returns in ARGB order for use with QImage (Note that ‘ARGB’ is a term used by the Qt documentation; the actual order is BGRA).