Class PaletteOptions

java.lang.Object
sc.fiji.snt.gui.PaletteOptions

public final class PaletteOptions extends Object
Per-palette delegate that builds the "More »" pop-up menu and supplies supporting operations (LUT, MIP overlay, snapshot, etc.) shared by SNT's preview-wizard windows (SigmaPalette, and CostPalette).
Author:
Tiago Ferreira
See Also:
  • Constructor Details

    • PaletteOptions

      public PaletteOptions(ij.ImagePlus paletteImage, ij.ImagePlus sourceImage, String snapshotTitle, Runnable onDismiss)
      Parameters:
      paletteImage - the wizard's preview image (the one whose LUT, MIP, snapshot, etc. the menu operates on)
      sourceImage - the original image whose LUT is restored by the "Default" LUT entry; may be null
      snapshotTitle - title given to the duplicated image produced by the "Take Snapshot" entry
      onDismiss - called when the user picks the "Dismiss" item
  • Method Details

    • buildMoreButton

      public Button buildMoreButton(Component parent, String helpHtml, Consumer<PopupMenu> extras)
      Builds the standard "More »" button populated with help, LUT submenu, MIP toggle, optional wizard-specific items, snapshot, and dismiss.
      Parameters:
      parent - the AWT container the PopupMenu attaches to (typically the wizard window). PopupMenu instances must be added to a Component before show() can display them.
      helpHtml - HTML message displayed by the "Help" entry; pass null to omit the entry
      extras - callback that appends wizard-specific menu items between the MIP toggle and the snapshot entry; pass null for none. The callback receives the rin-progress popup menu and may add items / separators.
      Returns:
      the AWT Button that pops the menu on click
    • addHelpEntry

      public void addHelpEntry(PopupMenu pm, String htmlMessage, Component dialogParent)
    • addLutSubmenu

      public void addLutSubmenu(PopupMenu pm)
      Adds the standard LUT submenu (Default + 7 SNT favourites) to the supplied popup menu. The "Default" entry restores the source image's primary LUT if one is available.
    • applyLut

      public void applyLut(String lutName)
      Applies a named ImageJ LUT to the palette image. "reset" restores the source image's first LUT (preserving the palette image's current min/max). Other names are forwarded to LutLoader.getLut(String).
    • updateMip

      public void updateMip()
      Refreshes the MIP overlay (if currently shown) so it picks up LUT/min/max changes.