magmap.gui.pixel_display module¶
Customize values displayed in Matplotlib figure footers.
- class magmap.gui.pixel_display.PixelDisplay(imgs, ax_imgs, shapes=None, offset=None, cmap_labels=None)[source]¶
Bases:
objectCustom image intensity display in :attr:
Axes.format_coord.Translates pixel coordinates from the axes space to the coordinates of the corresponding original images, accounting for any image manipulations such as downsampling images or resizing overlaid images to the main image. Also translates offset images and colormap transformations.
- Variables:
imgs (List[
np.ndarray]) – Sequence of 2D images whose intensity values will be displayed. Assumes that images are given in the order,(main_image[, labels_image[, next_image, ...]]).ax_imgs (List[
matplotlib.image.AxesImage]) – Nested sequence of Matplotlib images corresponding toimgs.shapes (List[int]) – Original 2D image shapes to translate downsampled and/or resized
imgsto the original image space, given as either a single sequence or nested sequence corresponding toimgs; defaults to None.offset (List[int], List[List[int]]) – Coordinates offset in the original image space given as
(y, x)or a nested sequence of offsets corresponding to``imgs``; defaults to None.cmap_labels (
colormaps.DiscreteColormap) – Labels colormap to find the corresponding RGB value; defaults to None, in which case the corresponding colormap inax_imgswill be used for the labels (index 1) will be used instead.
- get_msg(event)[source]¶
Get the pixel display message from a Matplotlib event.
- Parameters:
event (
matplotlib.backend_bases.Event) – Matplotlib event.- Returns:
The message based on the data coordinates within the first axes in
ax_imgs. None if event is not within these axes.- Return type: