Viewer Class

Viewer – a graphical tool to display and interact with Series objects.

class imagedata.viewer.Viewer(images, fig=None, ax=None, follow=False, colormap='Greys_r', norm='linear', colorbar=None, window=None, level=None, link=False, onselect=None)[source]

Viewer – a graphical tool to display and interact with Series objects.

Parameters:
  • images (imagedata.Series or list) – Series object or list of Series objects to view.

  • fig (Figure) – matplotlib.plt.figure if already exist (optional).

  • ax (Axes) – matplotlib axis if already exist (optional).

  • follow (bool) – Copy ROI to next tag. Default: False.

  • colormap (str) – Colour map for display. Default: Greys_r.

  • norm (str or matplotlib.colors.Normalize) – Normalization method. Either linear/log, or the .Normalize instance used to scale scalar data to the [0, 1] range before mapping to colors using colormap.

  • colorbar (bool) – Display colorbar with image. Default: None: determine colorbar based on colormap and norm. range before mapping to colors using colormap.

  • window (number) – Window width of signal intensities. Default: DICOM Window Width.

  • level (number) – Window level of signal intensities. Default: DICOM Window Center.

  • link (bool) – Whether scrolling is linked between displayed objects. Default: False.

  • onselect (function) – call function when roi changes. Default: None. When a polygon is completed or modified after completion, the onselect function is called and passed idx, tag and a list of the vertices as (xdata, ydata) tuples.

advance_data(inaxes, increment)[source]

Advance display to next/previous tag value

get_roi()[source]

Return drawn ROI.

Returns:

Dict of slices, index as [tag,slice] or [slice], each is list of (x,y) pairs.

set_default_viewport(axes)[source]

View as many Series as there are axes

toggle_hide(inaxes)[source]

Toggle the display of text on images

upper_left_text(im)[source]

Update upper left text

upper_right_text(im)[source]

Update upper right text

viewport_advance(increment)[source]

Advance viewport by given increment

viewport_set(position)[source]

Set viewport to image position