The Create / edit mask window draws detector masks for calibration and integration. You can open the same wizard from:
The mask path is optional for calibration: leave it empty to use the automatic mask
(beam-stop + negative pixels). When you save a user mask, it is stored as a session path and
synced into the calibration form. After calibration, a new session mask is applied on each
integrate as auto_mask | user (using auto_mask.npy
from the integrator directory when present).

Left Set mask, or from Calibration: Configure mask (or left-click the loaded calibrant image when not zooming/panning).
Set Mode: to Polygon. Use Mask to add masked regions or Unmask to clear masking inside the polygon. Click vertices → double-click to finish. Undo / clear as needed.
Set Mode: to Rectangular, choose Mask or Unmask, then two clicks for corners.
Set Mode: to Pixel → click pixels to toggle (red = masked).
Set Mode: to Threshold. Drag the histogram handles to choose the keep band in
log(1+I) for non-negative pixels. Everything outside the band is masked — including
raw I < 0 (intensities are never shifted). Double-click the histogram to reset to
[0, max], then Apply threshold.
Confirm Mask path → Save mask → wizard commits the file and updates the left Mask panel and calibration form.
