Plot3d#

Plotting routines based on qt.

Note

This module is based on the pyqtgraph package.

class PlotPanel(images: str | Path | ndarray | ClearMap.IO.source.Source | Sequence[str | Path | ndarray | ClearMap.IO.source.Source] | Sequence[Sequence[str | Path | ndarray | ClearMap.IO.source.Source]], title: str | None = None, lut: str | None = None, min_max: Tuple[float, float] | List[Tuple[float, float]] | None = None, max_projection: int | List[int] | None = None)[source]#

Bases: object

One window in multi_plot.

imagesPath | str | np.ndarray | Source | List[Any] | List[List[Any]] (overlays)

Typically, any that Plot3d already accepts

images: str | Path | ndarray | ClearMap.IO.source.Source | Sequence[str | Path | ndarray | ClearMap.IO.source.Source] | Sequence[Sequence[str | Path | ndarray | ClearMap.IO.source.Source]]#
lut: str | None = None#
max_projection: int | List[int] | None = None#
min_max: Tuple[float, float] | List[Tuple[float, float]] | None = None#
title: str | None = None#
arrange_plots(plots, screen=None, screen_percent=90)[source]#
bring_to_front(plots)[source]#
close(plots='all')[source]#
multi_plot(sources, axis=None, scale=None, title=None, invert_y=True, min_max=None, max_projection=None, arrange=True, screen=None, lut='flame', screen_percent=90, parent=None, sync=True, to_front=True)[source]#

Plot a source as 2d slices.

Arguments

sourceslist of sources

The sources to plot.If an element in the list is a list of sources those are overlayed in different colors in that window.

axisint or None

The axis along which to slice the data.

scaletuple of float

A spatial scale for each axis used for the spatial cursor position.

titlestr or None

The title of the window.

invert_ybool

If True invert the y axis (as typically done for images).

min_maxtuple or None

The minimal and maximal values for each source. If None, determine them from the source.

screenint or None

Specify on which screen to open the window.

Returns

plotslist of DataViewers

A list of viewer classes.

multi_plot_from_panels(panels: Sequence[PlotPanel], *, axis: int | None = None, scale: Tuple[float, float, float] | None = None, invert_y: bool = True, arrange: bool = True, sync: bool = True, screen: int | None = None, to_front: bool = True, parent=None)[source]#

Thin wrapper that converts a list of Panels into a call to multi_plot(). (same Path->str normalization as Plot3d.plot()).

plot(source, axis=None, scale=None, title=None, invert_y=True, min_max=None, screen=None, arrange=True, lut=None, max_projection=None, to_front=True, parent=None, sync=True)[source]#

Plot a source as 2d slices.

Arguments

sourceSource, pathlib.Path, list or dict

The source to plot. If a list is given several synchronized windows are generated. If an element in the list is a list of sources those are overlayed in different colors in that window.

axisint or None

The axis along which to slice the data.

scaletuple of float

A spatial scale for each axis used for the spatial cursor position.

titlestr or None

The title of the window.

invert_ybool

If True invert the y axis (as typically done for images).

min_maxtuple or None

The minimal and maximal values for each source. If None, determine them from the source.

screenint or None

Specify on which screen to open the window.

Returns

plotDataViewer

A data viewer class.

set_source(viewer, source)[source]#

Set the source data in a viewer.

Arguments

viewerDataViewer

The viewer to set a new source for.

sourceSource

The source to use in the viewer.

Returns

viewerDataViewer

The viewer.

synchronize(viewer1, viewer2)[source]#

Synchronize scrolling between two data viewers