Mask editor window#

The mask editor window allows to create or edit a mask with drawing tools or threshold values.

../../../_images/mask_editor_overview.png

The main elements in the Mask editor window are

  • Reference file selection:

    Loading or editing a mask first requires a reference data file to be imported. Use the Filename Parameter to select a file and the Open selected image file button to import the selected file.

  • Mask editor tools:

    These tools allow to modify the mask and will be explained in detail below.

  • Reference and mask visualization:

    This widget allows to view the reference data file in the selected colormap. The mask will also be shown in a color which is complementary to the selected colormap.

../../../_images/mask_editor_tools.png

Mask editor tools#

The mask editor tools are a silx MaskToolsWidget and can be used to modify the mask. The individual control elements are listed below.







Mask#

The Mask box includes the following control elements (listed from left to right):

../../../_images/mask_load.png

Load mask

Load a mask from a file.

../../../_images/mask_save.png

Save mask

Save the current mask to file as binary image.

../../../_images/mask_undo.png

Undo

Undo the last change to the mask. (Shortcut: Ctrl + Z)

../../../_images/mask_redo.png

Redo

Redo the last change to the mask. (Shortcut: Ctrl + Y)

../../../_images/mask_invert.png

Invert

Invert the mask and mask all un-masked pixels and vice versa. (Shortcut Ctrl + I)

../../../_images/mask_clear.png

Clear mask

Clear the current mask and reset it to an empty mask. (Shortcut: Del)

In addition, the Display slider allows to control the transparency of the mask overlay on the reference image.

Draw tools#

The draw tools allow to add or remove regions to/from the mask, based on geometric shapes.

../../../_images/draw_pan.png

Pan

Pan the image (and mask) in the plot.

../../../_images/draw_rect.png

Draw rectangle

Draw a rectangle to mask/unmask a region. The operation (mask or unmask) is controlled by the radio buttons below the button.

../../../_images/draw_ellipse.png

Draw ellipse

Draw an ellipse to mask/unmask a region. The operation (mask or unmask) is controlled by the radio buttons below the button.

../../../_images/draw_polygon.png

Draw polygon

Draw a polygon to mask/unmask a region. The operation (mask or unmask) is controlled by the radio buttons below the button. To add points to the polygon, left-click on the position to add. To close the polygon, right-click and select Close the polygon. (Shortcut S)

../../../_images/draw_pencil.png

Pencil

Mask or unmask areas with a pencil. The operation (mask or unmask) is controlled by the radio buttons below the button. The pencil size can be edited by either entering a number for the Pencil size or using the slider to modify the number. (Shortcut P)

Threshold#

The threshold group allows to mask pixels based on their value in the reference image.

../../../_images/thresh_min.png

Min threshold

Mask all pixels with a value below the minimum. Upon selecting this threshold, a field to set the minimum value will be shown.

../../../_images/thresh_range.png

Range threshold

Mask all pixels within the range between min and max. Upon selecting this threshold, a field to set the minimum and maximum values will be shown.

../../../_images/thresh_max.png

Max threshold

Mask all pixels with a value higher than the max threshold. Upon selecting this threshold, a field to set the maximum value will be shown.

../../../_images/thresh_cb.png

Get values from colormap

Get the values for minimum and maximum from the colormap range.

To apply the selected threshold, simply click the Mask below, Mask between, or Mask above button, depending on the selected threshold.

Mask not finite values#

This button will mask all pixels in the image which have not finite values, i.e. NaN, inf or -inf.

Data display#

Pydidas 2D plot#

The PydidasPlot2d is a subclassed silx Plot2d with additional features useful in pydidas.

../../../_images/standard_plot2d.png
  • The menu

    The menu bar allows access to all generic silx and additional pydidas functionality. The detailed menu icons and actions are described below in the menu entries description.

  • The image display

    This widget shows the image data. Depending on the zoom level, this is either the full image or a sub-region.

  • The colorbar

    The colorbar shows the reference for the used colormap to map data levels to colors.

  • The position information

    This widget displays the coordinates and data values of the data under the mouse cursor.

Two-dimensional plots are presented in a silx Plot2D widget. The toolbar options will be explained in detail below. Moving the mouse over the canvas will update the labels for x/y position and data value at the bottom of the canvas. Note that the x and y axis positions for each pixel are defined at the pixel center and the given values must be treated carefully with respect to the pixel shape, especially for coarse pixels.

Tip

The scaling of the results can be achieved by modifying the colormap settings.