java.lang.Object
org.bonej.wrapperPlugins.wrapperUtils.Common

public final class Common extends Object
Miscellaneous utility methods.
Author:
Richard Domander, Michael Doube
  • Constructor Details

    • Common

      public Common()
  • Method Details

    • makeFire

      public static ij.process.LUT makeFire()
      Generates the 'fire' look-up table (LUT) and returns it as an IJ1 LUT object
      Returns:
      fire LUT
    • make332RGB

      public static ij.process.LUT make332RGB()
      Generates the '3-3-2 RGB' look-up table (LUT) and returns it as an IJ1 LUT object
      Returns:
      3-3-2 RGB LUT
    • toBitTypeImgPlus

      Converts the ImgPlus to a new ImgPlus with BitType elements.

      Also copies ImgPlus metadata.

      Type Parameters:
      C - type of the elements in the input image.
      Parameters:
      ops - an OpService to find the necessary ops for conversion.
      imgPlus - an image.
      Returns:
      the image converted to bit type.
    • warnAnisotropy

      public static boolean warnAnisotropy(double anisotropy, org.scijava.ui.UIService uiService, org.scijava.log.LogService logService)
      Shows a warning dialog about image anisotropy, and asks if the user wants to continue. If the plugin is running in headless mode, execution continues anyway, and a warning is printed to the log.
      Parameters:
      anisotropy - the anisotropy as a value between 0 (isotropic) and infinity (totally anisotropic)
      uiService - used to display the warning dialog.
      logService - handles the warning text if the UI is headless
      Returns:
      true if user chose OK_OPTION, or execution is headless. False if user chose 'cancel' or they closed the dialog.
    • warnAnisotropy

      @Deprecated public static boolean warnAnisotropy(ij.ImagePlus image, org.scijava.ui.UIService uiService, org.scijava.log.LogService logService)
      Deprecated.
      Phase out this method because of the shift towards Datasets for IO and IO validation.
      Shows a warning dialog about image anisotropy, and asks if the user wants to continue. If the plugin is running in headless mode, execution continues anyway, and a warning is printed to the log.
      Parameters:
      image - the current image open in ImageJ.
      uiService - used to display the warning dialog.
      logService - handles the warning text if the UI is headless
      Returns:
      true if user chose OK_OPTION, or image is not anisotropic, or execution is headless. False if user chose 'cancel' or they closed the dialog.
    • cancelMacroSafe

      public static void cancelMacroSafe(org.scijava.command.ContextCommand command, String reason)
      Cancels a command so that it won't show a dialog if a macro is running

      When a macro is running, an error message is logged instead

      Parameters:
      command - Command that needs to be cancelled
      reason - A message that describes why the command is being cancelled
      See Also:
      • ContextCommand.cancel(String)