erlab.interactive.imagetool

Interactive data browser.

Modules

core

Provides core functionality of imagetool.

slicer

Helper functions for fast slicing xarray.DataArray objects.

fastbinning

Fast parallelized averaging for multidimensional arrays.

controls

Widgets for controlling ImageSlicerArea.

Functions

itool(data[, link, link_colors, execute])

Create and display an ImageTool window.

Classes

BaseImageTool([data, parent])

ImageTool([data])

ItoolMenuBar(slicer_area, parent)

class erlab.interactive.imagetool.ImageTool(data=None, **kwargs)[source]

Bases: BaseImageTool

update_title()[source]
erlab.interactive.imagetool.itool(data, link=False, link_colors=True, execute=None, **kwargs)[source]

Create and display an ImageTool window.

Parameters:
  • data (Collection[xr.DataArray | npt.NDArray] | xr.DataArray | npt.NDArray | xr.Dataset) – Array-like object or a sequence of such object with 2 to 4 dimensions. See notes.

  • link (bool) – Whether to enable linking between multiple ImageTool windows, by default False.

  • link_colors (bool) – Whether to link the color maps between multiple linked ImageTool windows, by default True.

  • execute (bool | None) – Whether to execute the Qt event loop and display the window, by default None. If None, the execution is determined based on the current IPython shell.

  • **kwargs – Additional keyword arguments to be passed onto the underlying slicer area. For a full list of supported arguments, see the erlab.interactive.imagetool.core.ImageSlicerArea documentation.

Returns:

The created ImageTool window(s).

Return type:

ImageTool or list of ImageTool

Notes

  • If data is a sequence of valid data, multiple ImageTool windows will be created and displayed.

  • If data is a Dataset, each DataArray in the Dataset will be displayed in a separate ImageTool window. Data variables with 2 to 4 dimensions are considered as valid. Other variables are ignored.

  • If link is True, the ImageTool windows will be synchronized.

Examples

>>> itool(data, cmap="gray", gamma=0.5)
>>> itool(data_list, link=True)