java.lang.Object
org.bonej.wrapperPlugins.wrapperUtils.Common
Miscellaneous utility methods.
- Author:
- Richard Domander, Michael Doube
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcancelMacroSafe(org.scijava.command.ContextCommand command, String reason) Cancels a command so that it won't show a dialog if a macro is runningstatic ij.process.LUTGenerates the '3-3-2 RGB' look-up table (LUT) and returns it as an IJ1 LUT objectstatic ij.process.LUTmakeFire()Generates the 'fire' look-up table (LUT) and returns it as an IJ1 LUT objectstatic <C extends net.imglib2.type.numeric.ComplexType<C>>
net.imagej.ImgPlus<net.imglib2.type.logic.BitType> toBitTypeImgPlus(net.imagej.ops.OpEnvironment ops, net.imagej.ImgPlus<C> imgPlus) Converts theImgPlusto a new ImgPlus withBitTypeelements.static booleanwarnAnisotropy(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.static booleanwarnAnisotropy(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.
-
Constructor Details
-
Common
public Common()
-
-
Method Details
-
makeFire
Generates the 'fire' look-up table (LUT) and returns it as an IJ1 LUT object- Returns:
- fire 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
public static <C extends net.imglib2.type.numeric.ComplexType<C>> net.imagej.ImgPlus<net.imglib2.type.logic.BitType> toBitTypeImgPlus(net.imagej.ops.OpEnvironment ops, net.imagej.ImgPlus<C> imgPlus) Converts theImgPlusto a new ImgPlus withBitTypeelements.Also copies ImgPlus metadata.
- Type Parameters:
C- type of the elements in the input image.- Parameters:
ops- anOpServiceto 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
Cancels a command so that it won't show a dialog if a macro is runningWhen a macro is running, an error message is logged instead
- Parameters:
command- Command that needs to be cancelledreason- A message that describes why the command is being cancelled- See Also:
-