new IJ()
Members
(static, constant) ALL_KEYS :int
Type:
- int
(static, constant) angstromSymbol :char
Type:
- char
(static, constant) CANCELED :int
Type:
- int
(static, constant) COLOR :int
Image display modes
Type:
- int
(static, constant) COMPOSITE :int
Image display modes
Type:
- int
(static, constant) debugMode :boolean
Use setDebugMode(boolean) to enable/disable debug mode.
Type:
- boolean
(static, constant) degreeSymbol :char
Type:
- char
(static, constant) GRAYSCALE :int
Image display modes
Type:
- int
(static, constant) hideProcessStackDialog :boolean
Type:
- boolean
(static, constant) micronSymbol :char
Type:
- char
(static, constant) URL :java.lang.String
Type:
- java.lang.String
Methods
(static) addEventListener(listener)
Parameters:
Name | Type | Description |
---|---|---|
listener |
IJEventListener | - |
(static) altKeyDown()
Returns true if the alt key is down.
Returns:
boolean
(static) append(string, path)
Appends a string to the end of a file. A newline character ("\n") is added to the end of the string before it is written. Returns an error message if there is an exception, otherwise returns null.
Parameters:
Name | Type | Description |
---|---|---|
string |
java.lang.String | - |
path |
java.lang.String | - |
Returns:
java.lang.String
(static) beep()
Emits an audio beep.
(static) controlKeyDown()
Returns true if the control key is down.
Returns:
boolean
(static) createHyperStack(title, width, height, channels, slices, frames, bitdepth)
Creates a new hyperstack.
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
width |
int | - |
height |
int | - |
channels |
int | - |
slices |
int | - |
frames |
int | - |
bitdepth |
int | - |
Returns:
ImagePlus
(static) createImage(title, type, width, height, channels, slices, frames)
Creates a new hyperstack.
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
type |
java.lang.String | - |
width |
int | - |
height |
int | - |
channels |
int | - |
slices |
int | - |
frames |
int | - |
Returns:
ImagePlus
(static) createImage(title, type, width, height, depth)
Creates a new imagePlus. Type
should contain "8-bit", "16-bit", "32-bit" or "RGB".
In addition, it can contain "white", "black" or "ramp". Width
and height
specify the width and height of the image in pixels.
Depth
specifies the number of stack slices.
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
type |
java.lang.String | - |
width |
int | - |
height |
int | - |
depth |
int | - |
Returns:
ImagePlus
(static) createImage(title, width, height, depth, bitdepth)
Creates a new image.
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
width |
int | - |
height |
int | - |
depth |
int | - |
bitdepth |
int | - |
Returns:
ImagePlus
(static) currentMemory()
Returns the amount of memory currently being used by ImageJ.
Returns:
long
(static) d2s(n, decimalPlaces)
Converts a number to a rounded formatted string. The 'decimalPlaces' argument specifies the number of digits to the right of the decimal point (0-9). Uses scientific notation if 'decimalPlaces is negative.
Parameters:
Name | Type | Description |
---|---|---|
n |
double | - |
decimalPlaces |
int | - |
Returns:
java.lang.String
(static) d2s(n)
Converts a number to a formatted string using 2 digits to the right of the decimal point.
Parameters:
Name | Type | Description |
---|---|---|
n |
double | - |
Returns:
java.lang.String
(static) d2s(x, significantDigits, maxDigits)
Converts a number to a rounded formatted string. The 'significantDigits' argument specifies the minimum number of significant digits, which is also the preferred number of digits behind the decimal. Fewer decimals are shown if the number would have more than 'maxDigits'. Exponential notation is used if more than 'maxDigits' would be needed.
Parameters:
Name | Type | Description |
---|---|---|
x |
double | - |
significantDigits |
int | - |
maxDigits |
int | - |
Returns:
java.lang.String
(static) deleteRows(row1, row2)
Deletes 'row1' through 'row2' of the "Results" window. Arguments must be in the range 0-Analyzer.getCounter()-1.
Parameters:
Name | Type | Description |
---|---|---|
row1 |
int | - |
row2 |
int | - |
(static) doCommand(command)
Runs a menu command on a separete thread and returns immediately.
Parameters:
Name | Type | Description |
---|---|---|
command |
java.lang.String | - |
(static) doCommand(imp, command)
Runs a menu command on a separete thread, using the specified image.
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
command |
java.lang.String | - |
(static) doWand(x, y, tolerance, mode)
Traces the boundary of the area with pixel values within 'tolerance' of the value of the pixel at the starting location. 'tolerance' is in uncalibrated units. 'mode' can be "4-connected", "8-connected" or "Legacy". "Legacy" is for compatibility with previous versions of ImageJ; it is ignored if 'tolerance' > 0.
Parameters:
Name | Type | Description |
---|---|---|
x |
int | - |
y |
int | - |
tolerance |
double | - |
mode |
java.lang.String | - |
Returns:
int
(static) doWand(img, x, y, tolerance, mode)
This version of doWand adds an ImagePlus argument.
Parameters:
Name | Type | Description |
---|---|---|
img |
ImagePlus | - |
x |
int | - |
y |
int | - |
tolerance |
double | - |
mode |
java.lang.String | - |
Returns:
int
(static) doWand(x, y)
Equivalent to clicking on the current image at (x,y) with the wand tool. Returns the number of points in the resulting ROI.
Parameters:
Name | Type | Description |
---|---|---|
x |
int | - |
y |
int | - |
Returns:
int
(static) error(msg)
Displays a message in a dialog box titled "ImageJ". If a macro is running, it is aborted. Writes to the Java console if the ImageJ window is not present.
Parameters:
Name | Type | Description |
---|---|---|
msg |
java.lang.String | - |
(static) error(title, msg)
Displays a message in a dialog box with the specified title. If a macro is running, it is aborted. Writes to the Java console if ImageJ is not present.
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
msg |
java.lang.String | - |
(static) escapePressed()
Returns true if the Esc
key was pressed since the
last ImageJ command started to execute or since resetEscape() was called.
Returns:
boolean
(static) freeMemory()
Runs the garbage collector and returns a string something like "64K of 256MB (25%)" that shows how much of the available memory is in use. This is the string displayed when the user clicks in the status bar.
Returns:
java.lang.String
(static) getApplet()
Returns the Applet that created this ImageJ or null if running as an application.
Returns:
java.applet.Applet
(static) getClassLoader()
Returns the class loader ImageJ uses to run plugins or the system class loader if Menus.getPlugInsPath() returns null.
Returns:
java.lang.ClassLoader
(static) getDir(title)
Alias for getDirectory().
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
Returns:
java.lang.String
(static) getDirectory(title)
Returns the path to the home ("user.home"), startup, ImageJ, plugins, macros,
luts, temp, current or image directory if title
is "home", "startup",
"imagej", "plugins", "macros", "luts", "temp", "current", "default", "image", otherwise,
displays a dialog and returns the path to the directory selected by the user.
Returns null if the specified directory is not found or the user
cancels the dialog box. Also aborts the macro if the user cancels
the dialog box.
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
Returns:
java.lang.String
(static) getErrorMessage()
Returns the last error message written by IJ.error() or null if there was no error since the last time this method was called.
Returns:
java.lang.String
(static) getFilePath(dialogTitle)
Displays an open file dialog and returns the path to the choosen file, or returns null if the dialog is canceled.
Parameters:
Name | Type | Description |
---|---|---|
dialogTitle |
java.lang.String | - |
Returns:
java.lang.String
(static) getFullVersion()
Returns the ImageJ version and build number as a String, for example "1.46n05", or 1.46n99 if there is no build number.
Returns:
java.lang.String
(static) getImage()
Returns a reference to the active image, or displays an error message and aborts the plugin or macro if no images are open.
Returns:
ImagePlus
(static) getInstance()
Returns a reference to the "ImageJ" frame.
Returns:
ImageJ
(static) getLog()
Returns the contents of the Log window or null if the Log window is not open.
Returns:
java.lang.String
(static) getLuts()
Returns, as an array of strings, a list of the LUTs in the Image/Lookup Tables menu.
Returns:
java.lang.String[]
(static) getNumber(prompt, defaultValue)
Allows the user to enter a number in a dialog box. Returns the value IJ.CANCELED (-2,147,483,648) if the user cancels the dialog box. Returns 'defaultValue' if the user enters an invalid number.
Parameters:
Name | Type | Description |
---|---|---|
prompt |
java.lang.String | - |
defaultValue |
double | - |
Returns:
double
(static) getProcessor()
Returns the active image or stack slice as an ImageProcessor, or displays an error message and aborts the plugin or macro if no images are open.
Returns:
ImageProcessor
(static) getProperty(key)
Returns the object in IJ.properties associated with 'key', or null if 'key' is not found.
Parameters:
Name | Type | Description |
---|---|---|
key |
java.lang.String | - |
Returns:
java.lang.Object
(static) getScreenSize()
Returns the size, in pixels, of the primary display.
Returns:
java.awt.Dimension
(static) getString(prompt, defaultString)
Allows the user to enter a string in a dialog box. Returns "" if the user cancels the dialog box.
Parameters:
Name | Type | Description |
---|---|---|
prompt |
java.lang.String | - |
defaultString |
java.lang.String | - |
Returns:
java.lang.String
(static) getTextPanel()
Returns a reference to the "Results" window TextPanel. Opens the "Results" window if it is currently not open. Returns null if the "ImageJ" window is not open.
Returns:
TextPanel
(static) getToolName()
Returns the name of the current tool.
Returns:
java.lang.String
(static) getVersion()
Returns the ImageJ version number as a string.
Returns:
java.lang.String
(static) handleException(e)
Displays a stack trace. Use the setExceptionHandler method() to override with a custom exception handler.
Parameters:
Name | Type | Description |
---|---|---|
e |
java.lang.Throwable | - |
(static) is64Bit()
Returns true if ImageJ is running a 64-bit version of Java.
Returns:
boolean
(static) isJava2()
Always returns true.
Returns:
boolean
(static) isJava14()
Always returns true.
Returns:
boolean
(static) isJava15()
Always returns true.
Returns:
boolean
(static) isJava16()
Returns true if ImageJ is running on a Java 1.6 or greater JVM.
Returns:
boolean
(static) isJava17()
Returns true if ImageJ is running on a Java 1.7 or greater JVM.
Returns:
boolean
(static) isJava18()
Returns true if ImageJ is running on a Java 1.8 or greater JVM.
Returns:
boolean
(static) isJava19()
Returns true if ImageJ is running on a Java 1.9 or greater JVM.
Returns:
boolean
(static) isLinux()
Returns true if ImageJ is running on Linux.
Returns:
boolean
(static) isMacintosh()
Returns true if this machine is a Macintosh.
Returns:
boolean
(static) isMacOSX()
Returns true if this machine is a Macintosh running OS X.
Returns:
boolean
(static) isMacro()
Returns true if a macro is running, or if the run(), open() or newImage() method is executing.
Returns:
boolean
(static) isResultsWindow()
Returns true if the "Results" window is open.
Returns:
boolean
(static) isVista()
Obsolete; always returns false.
Returns:
boolean
(static) isWindows()
Returns true if this machine is running Windows.
Returns:
boolean
(static) log(s)
Parameters:
Name | Type | Description |
---|---|---|
s |
java.lang.String | - |
(static) macroRunning()
Returns true if the run(), open() or newImage() method is executing.
Returns:
boolean
(static) makeLine(x1, y1, x2, y2)
Creates a straight line selection.
Parameters:
Name | Type | Description |
---|---|---|
x1 |
int | - |
y1 |
int | - |
x2 |
int | - |
y2 |
int | - |
(static) makeLine(x1, y1, x2, y2)
Creates a straight line selection using floating point coordinates.
Parameters:
Name | Type | Description |
---|---|---|
x1 |
double | - |
y1 |
double | - |
x2 |
double | - |
y2 |
double | - |
(static) makeOval(x, y, width, height)
Creates an oval selection. Removes any existing selection if width or height are less than 1.
Parameters:
Name | Type | Description |
---|---|---|
x |
int | - |
y |
int | - |
width |
int | - |
height |
int | - |
(static) makeOval(x, y, width, height)
Creates an subpixel resolution oval selection.
Parameters:
Name | Type | Description |
---|---|---|
x |
double | - |
y |
double | - |
width |
double | - |
height |
double | - |
(static) makePoint(x, y)
Creates a point selection using floating point coordinates.
Parameters:
Name | Type | Description |
---|---|---|
x |
double | - |
y |
double | - |
(static) makePoint(x, y)
Creates a point selection using integer coordinates..
Parameters:
Name | Type | Description |
---|---|---|
x |
int | - |
y |
int | - |
(static) makeRectangle(x, y, width, height)
Creates a rectangular selection. Removes any existing selection if width or height are less than 1.
Parameters:
Name | Type | Description |
---|---|---|
x |
int | - |
y |
int | - |
width |
int | - |
height |
int | - |
(static) makeRectangle(x, y, width, height)
Creates a subpixel resolution rectangular selection.
Parameters:
Name | Type | Description |
---|---|---|
x |
double | - |
y |
double | - |
width |
double | - |
height |
double | - |
(static) maxMemory()
Returns the maximum amount of memory available to ImageJ or zero if ImageJ is unable to determine this limit.
Returns:
long
(static) newImage(title, type, width, height, depth)
Opens a new image. Type
should contain "8-bit", "16-bit", "32-bit" or "RGB".
In addition, it can contain "white", "black" or "ramp". Width
and height
specify the width and height of the image in pixels.
Depth
specifies the number of stack slices.
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
type |
java.lang.String | - |
width |
int | - |
height |
int | - |
depth |
int | - |
(static) noImage()
Displays a "no images are open" dialog box.
(static) notifyEventListeners(eventID)
Parameters:
Name | Type | Description |
---|---|---|
eventID |
int | - |
(static) open(path)
Opens and displays a tiff, dicom, fits, pgm, jpeg, bmp, gif, lut, roi, or text file. Displays an error message if the specified file is not in one of the supported formats, or if it is not found. With 1.41k or later, opens images specified by a URL.
Parameters:
Name | Type | Description |
---|---|---|
path |
java.lang.String | - |
(static) open(path, n)
Opens and displays the nth image in the specified tiff stack.
Parameters:
Name | Type | Description |
---|---|---|
path |
java.lang.String | - |
n |
int | - |
(static) open()
Displays a file open dialog box and then opens the tiff, dicom, fits, pgm, jpeg, bmp, gif, lut, roi, or text file selected by the user. Displays an error message if the selected file is not in one of the supported formats, or if it is not found.
(static) openAsString(path)
Opens a text file as a string. Displays a file open dialog if path is null or blank. Returns null if the user cancels the file open dialog. If there is an error, returns a message in the form "Error: message".
Parameters:
Name | Type | Description |
---|---|---|
path |
java.lang.String | - |
Returns:
java.lang.String
(static) openImage(path)
Opens the specified file as a tiff, bmp, dicom, fits, pgm, gif, jpeg or text image and returns an ImagePlus object if successful. Calls HandleExtraFileTypes plugin if the file type is not recognised. Displays a file open dialog if 'path' is null or an empty string. Note that 'path' can also be a URL. Some reader plugins, including the Bio-Formats plugin, display the image and return null. Use IJ.open() to display a file open dialog box.
Parameters:
Name | Type | Description |
---|---|---|
path |
java.lang.String | - |
Returns:
ImagePlus
(static) openImage()
Opens an image using a file open dialog and returns it as an ImagePlus object.
Returns:
ImagePlus
(static) openImage(path, n)
Opens the nth image of the specified tiff stack.
Parameters:
Name | Type | Description |
---|---|---|
path |
java.lang.String | - |
n |
int | - |
Returns:
ImagePlus
(static) openUrlAsString(url)
Opens a URL and returns the contents as a string.
Returns "
Parameters:
Name | Type | Description |
---|---|---|
url |
java.lang.String | - |
Returns:
java.lang.String
(static) openVirtual(path)
Opens the specified tiff file as a virtual stack.
Parameters:
Name | Type | Description |
---|---|---|
path |
java.lang.String | - |
Returns:
ImagePlus
(static) outOfMemory(name)
Displays an "out of memory" message to the "Log" window.
Parameters:
Name | Type | Description |
---|---|---|
name |
java.lang.String | - |
(static) pad(n, digits)
Pad 'n' with leading zeros to the specified number of digits.
Parameters:
Name | Type | Description |
---|---|---|
n |
int | - |
digits |
int | - |
Returns:
java.lang.String
(static) redirectErrorMessages(redirect)
Set 'true' and IJ.error() output will be temporarily redirected to the "Log" window.
Parameters:
Name | Type | Description |
---|---|---|
redirect |
boolean | - |
(static) redirectErrorMessages()
Causes IJ.error() output to be temporarily redirected to the "Log" window.
(static) redirectingErrorMessages()
Returns the state of the 'redirectErrorMessages' flag, which is set by File/Import/Image Sequence.
Returns:
boolean
(static) register(c)
Adds the specified class to a Vector to keep it from being garbage collected, which would cause the classes static fields to be reset. Probably not needed with Java 1.2 or later.
Parameters:
Name | Type | Description |
---|---|---|
c |
java.lang.Class | - |
(static) removeEventListener(listener)
Parameters:
Name | Type | Description |
---|---|---|
listener |
IJEventListener | - |
(static) renameResults(oldTitle, newTitle)
Changes the name of a results window from 'oldTitle' to 'newTitle'.
Parameters:
Name | Type | Description |
---|---|---|
oldTitle |
java.lang.String | - |
newTitle |
java.lang.String | - |
(static) renameResults(title)
Renames a results window.
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
(static) resetClassLoader()
(static) resetEscape()
This method sets the Esc
key to the "up" position.
The Executer class calls this method when it runs
an ImageJ command in a separate thread.
(static) resetMinAndMax()
Resets the minimum and maximum displayed pixel values of the current image to be the same as the min and max pixel values.
(static) resetMinAndMax(img)
Resets the minimum and maximum displayed pixel values of the specified image to be the same as the min and max pixel values.
Parameters:
Name | Type | Description |
---|---|---|
img |
ImagePlus | - |
(static) resetThreshold()
Disables thresholding on the current image.
(static) resetThreshold(img)
Disables thresholding on the specified image.
Parameters:
Name | Type | Description |
---|---|---|
img |
ImagePlus | - |
(static) run(command)
Runs an ImageJ command. Does not return until the command has finished executing. To avoid "image locked", errors, plugins that call this method should implement the PlugIn interface instead of PlugInFilter.
Parameters:
Name | Type | Description |
---|---|---|
command |
java.lang.String | - |
(static) run(imp, command, options)
Runs an ImageJ command using the specified image and options. To generate run() calls, start the recorder (Plugins/Macro/Record) and run commands from the ImageJ menu bar.
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
command |
java.lang.String | - |
options |
java.lang.String | - |
(static) run(command, options)
Runs an ImageJ command, with options that are passed to the GenericDialog and OpenDialog classes. Does not return until the command has finished executing. To generate run() calls, start the recorder (Plugins/Macro/Record) and run commands from the ImageJ menu bar.
Parameters:
Name | Type | Description |
---|---|---|
command |
java.lang.String | - |
options |
java.lang.String | - |
(static) runMacro(macro)
Runs the macro contained in the string macro
.
Returns any string value returned by the macro, null if the macro
does not return a value, or "[aborted]" if the macro was aborted
due to an error. The equivalent macro function is eval().
Parameters:
Name | Type | Description |
---|---|---|
macro |
java.lang.String | - |
Returns:
java.lang.String
(static) runMacro(macro, arg)
Runs the macro contained in the string macro
.
The optional string argument can be retrieved in the
called macro using the getArgument() macro function.
Returns any string value returned by the macro, null if the macro
does not return a value, or "[aborted]" if the macro was aborted
due to an error.
Parameters:
Name | Type | Description |
---|---|---|
macro |
java.lang.String | - |
arg |
java.lang.String | - |
Returns:
java.lang.String
(static) runMacroFile(name, arg)
Runs the specified macro or script file in the current thread.
The file is assumed to be in the macros folder
unless name
is a full path.
The optional string argument (arg
) can be retrieved in the called
macro or script (v1.42k or later) using the getArgument() function.
Returns any string value returned by the macro, or null. Scripts always return null.
The equivalent macro function is runMacro().
Parameters:
Name | Type | Description |
---|---|---|
name |
java.lang.String | - |
arg |
java.lang.String | - |
Returns:
java.lang.String
(static) runMacroFile(name)
Runs the specified macro file.
Parameters:
Name | Type | Description |
---|---|---|
name |
java.lang.String | - |
Returns:
java.lang.String
(static) runPlugIn(className, arg)
Runs the specified plugin and returns a reference to it.
Parameters:
Name | Type | Description |
---|---|---|
className |
java.lang.String | - |
arg |
java.lang.String | - |
Returns:
java.lang.Object
(static) runPlugIn(imp, className, arg)
Runs the specified plugin using the specified image.
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
className |
java.lang.String | - |
arg |
java.lang.String | - |
Returns:
java.lang.Object
(static) runPlugIn(commandName, className, arg)
Runs the specified plugin and returns a reference to it.
Parameters:
Name | Type | Description |
---|---|---|
commandName |
java.lang.String | - |
className |
java.lang.String | - |
arg |
java.lang.String | - |
Returns:
java.lang.Object
(static) save(imp, path)
Saves the specified image, lookup table or selection to the specified file path. The file path should end with ".tif", ".jpg", ".gif", ".zip", ".raw", ".avi", ".bmp", ".fits", ".pgm", ".png", ".lut", ".roi" or ".txt". The specified image is saved in TIFF format if there is no extension.
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
path |
java.lang.String | - |
(static) save(path)
Saves the current image, lookup table, selection or text window to the specified file path. The path must end in ".tif", ".jpg", ".gif", ".zip", ".raw", ".avi", ".bmp", ".fits", ".pgm", ".png", ".lut", ".roi" or ".txt".
Parameters:
Name | Type | Description |
---|---|---|
path |
java.lang.String | - |
(static) saveAs(imp, format, path)
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
format |
java.lang.String | - |
path |
java.lang.String | - |
(static) saveAs(format, path)
Parameters:
Name | Type | Description |
---|---|---|
format |
java.lang.String | - |
path |
java.lang.String | - |
(static) saveAsTiff(imp, path)
Saves the specified image in TIFF format. Displays a file save dialog if 'path' is null or an empty string. Returns 'false' if there is an error or if the user selects "Cancel" in the file save dialog.
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
path |
java.lang.String | - |
Returns:
boolean
(static) saveString(string, path)
Saves a string as a file. Displays a file save dialog if 'path' is null or blank. Returns an error message if there is an exception, otherwise returns null.
Parameters:
Name | Type | Description |
---|---|---|
string |
java.lang.String | - |
path |
java.lang.String | - |
Returns:
java.lang.String
(static) selectWindow(title)
Activates the window with the specified title.
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
(static) selectWindow(id)
For IDs less than zero, activates the image with the specified ID. For IDs greater than zero, activates the Nth image.
Parameters:
Name | Type | Description |
---|---|---|
id |
int | - |
(static) setAutoThreshold(imp, method)
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
method |
java.lang.String | - |
(static) setBackgroundColor(red, green, blue)
Sets the background color.
Parameters:
Name | Type | Description |
---|---|---|
red |
int | - |
green |
int | - |
blue |
int | - |
(static) setColumnHeadings(headings)
Clears the "Results" window and sets the column headings to those in the tab-delimited 'headings' String. Writes to System.out.println if the "ImageJ" frame is not present.
Parameters:
Name | Type | Description |
---|---|---|
headings |
java.lang.String | - |
(static) setDebugMode(b)
Enable/disable debug mode.
Parameters:
Name | Type | Description |
---|---|---|
b |
boolean | - |
(static) setExceptionHandler(handler)
Installs a custom exception handler that overrides the handleException() method.
Parameters:
Name | Type | Description |
---|---|---|
handler |
IJ.ExceptionHandler | - |
(static) setForegroundColor(red, green, blue)
Sets the foreground color.
Parameters:
Name | Type | Description |
---|---|---|
red |
int | - |
green |
int | - |
blue |
int | - |
(static) setInputEvent(e)
Parameters:
Name | Type | Description |
---|---|---|
e |
java.awt.event.InputEvent | - |
(static) setKeyDown(key)
Parameters:
Name | Type | Description |
---|---|---|
key |
int | - |
(static) setKeyUp(key)
Parameters:
Name | Type | Description |
---|---|---|
key |
int | - |
(static) setMinAndMax(min, max, channels)
Sets the minimum and maximum displayed pixel values on the specified RGB channels, where 4=red, 2=green and 1=blue.
Parameters:
Name | Type | Description |
---|---|---|
min |
double | - |
max |
double | - |
channels |
int | - |
(static) setMinAndMax(img, min, max)
Sets the display range (minimum and maximum displayed pixel values) of the specified image.
Parameters:
Name | Type | Description |
---|---|---|
img |
ImagePlus | - |
min |
double | - |
max |
double | - |
(static) setMinAndMax(min, max)
Sets the display range (minimum and maximum displayed pixel values) of the current image.
Parameters:
Name | Type | Description |
---|---|---|
min |
double | - |
max |
double | - |
(static) setPasteMode(mode)
Sets the transfer mode used by the Edit/Paste command, where mode is "Copy", "Blend", "Average", "Difference", "Transparent", "Transparent2", "AND", "OR", "XOR", "Add", "Subtract", "Multiply", or "Divide".
Parameters:
Name | Type | Description |
---|---|---|
mode |
java.lang.String | - |
(static) setProperty(key, value)
Adds a key-value pair to IJ.properties. The key and value are removed if 'value' is null.
Parameters:
Name | Type | Description |
---|---|---|
key |
java.lang.String | - |
value |
java.lang.Object | - |
(static) setRawThreshold(img, lowerThreshold, upperThreshold, displayMode)
This is a version of setThreshold() that always uses raw (uncalibrated) values in the range 0-255 for 8-bit images and 0-65535 for 16-bit images.
Parameters:
Name | Type | Description |
---|---|---|
img |
ImagePlus | - |
lowerThreshold |
double | - |
upperThreshold |
double | - |
displayMode |
java.lang.String | - |
(static) setSlice(slice)
Switches to the specified stack slice, where 1 <='slice'<=stack-size.
Parameters:
Name | Type | Description |
---|---|---|
slice |
int | - |
(static) setTextPanel(tp)
TextWindow calls this method with a null argument when the "Results" window is closed.
Parameters:
Name | Type | Description |
---|---|---|
tp |
TextPanel | - |
(static) setThreshold(lowerThreshold, upperThreshold, displayMode)
Sets the lower and upper threshold levels and displays the image using
the specified displayMode
("Red", "Black & White", "Over/Under" or "No Update").
Parameters:
Name | Type | Description |
---|---|---|
lowerThreshold |
double | - |
upperThreshold |
double | - |
displayMode |
java.lang.String | - |
(static) setThreshold(img, lowerThreshold, upperThreshold)
Sets the lower and upper threshold levels of the specified image.
Parameters:
Name | Type | Description |
---|---|---|
img |
ImagePlus | - |
lowerThreshold |
double | - |
upperThreshold |
double | - |
(static) setThreshold(img, lowerThreshold, upperThreshold, displayMode)
Sets the lower and upper threshold levels of the specified image and updates the display using
the specified displayMode
("Red", "Black & White", "Over/Under" or "No Update").
With calibrated images, 'lowerThreshold' and 'upperThreshold' must be density calibrated values.
Use setRawThreshold() to set the threshold using raw (uncalibrated) values.
Parameters:
Name | Type | Description |
---|---|---|
img |
ImagePlus | - |
lowerThreshold |
double | - |
upperThreshold |
double | - |
displayMode |
java.lang.String | - |
(static) setThreshold(lowerThreshold, upperThresold)
Sets the lower and upper threshold levels and displays the image using red to highlight thresholded pixels. May not work correctly on 16 and 32 bit images unless the display range has been reset using IJ.resetMinAndMax().
Parameters:
Name | Type | Description |
---|---|---|
lowerThreshold |
double | - |
upperThresold |
double | - |
(static) setTool(name)
Switches to the specified tool, where 'name' is "rect", "elliptical", "brush", etc. Returns 'false' if the name is not recognized.
Parameters:
Name | Type | Description |
---|---|---|
name |
java.lang.String | - |
Returns:
boolean
(static) setTool(id)
Switches to the specified tool, where id = Toolbar.RECTANGLE (0), Toolbar.OVAL (1), etc.
Parameters:
Name | Type | Description |
---|---|---|
id |
int | - |
(static) setupDialog(imp, flags)
Displays a "Process all images?" dialog. Returns 'flags'+PlugInFilter.DOES_STACKS if the user selects "Yes", 'flags' if the user selects "No" and PlugInFilter.DONE if the user selects "Cancel".
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
flags |
int | - |
Returns:
int
(static) shiftKeyDown()
Returns true if the shift key is down.
Returns:
boolean
(static) showMessage(title, msg)
Displays a message in a dialog box with the specified title. Displays HTML formatted text if 'msg' starts with "". There are examples at "http://imagej.nih.gov/ij/macros/HtmlDialogDemo.txt". Writes to the Java console if ImageJ is not present.
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
msg |
java.lang.String | - |
(static) showMessage(msg)
Displays a message in a dialog box titled "Message". Writes the Java console if ImageJ is not present.
Parameters:
Name | Type | Description |
---|---|---|
msg |
java.lang.String | - |
(static) showMessageWithCancel(title, msg)
Displays a message in a dialog box with the specified title. Returns false if the user pressed "Cancel".
Parameters:
Name | Type | Description |
---|---|---|
title |
java.lang.String | - |
msg |
java.lang.String | - |
Returns:
boolean
(static) showProgress(progress)
Updates the progress bar, where 0<=progress<=1.0. The progress bar is not shown in BatchMode and erased if progress>=1.0. The progress bar is updated only if more than 90 ms have passes since the last call. Does nothing if the ImageJ window is not present.
Parameters:
Name | Type | Description |
---|---|---|
progress |
double | - |
(static) showProgress(currentIndex, finalIndex)
Updates the progress bar, where the length of the bar is set to
(currentValue+1)/finalValue
of the maximum bar length.
The bar is erased if currentValue>=finalValue
.
The bar is updated only if more than 90 ms have passed since the last call.
Does nothing if the ImageJ window is not present.
Parameters:
Name | Type | Description |
---|---|---|
currentIndex |
int | - |
finalIndex |
int | - |
(static) showStatus(s)
Displays a message in the ImageJ status bar.
Parameters:
Name | Type | Description |
---|---|---|
s |
java.lang.String | - |
(static) showTime(imp, start, str, nslices)
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
start |
long | - |
str |
java.lang.String | - |
nslices |
int | - |
(static) showTime(imp, start, str)
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
start |
long | - |
str |
java.lang.String | - |
(static) spaceBarDown()
Returns true if the space bar is down.
Returns:
boolean
(static) suppressPluginNotFoundError()
Temporarily suppress "plugin not found" errors.
(static) time(imp, startNanoTime)
Experimental
Parameters:
Name | Type | Description |
---|---|---|
imp |
ImagePlus | - |
startNanoTime |
long | - |
Returns:
java.lang.String
(static) versionLessThan(version)
Displays an error message and returns true if the ImageJ version is less than the one specified.
Parameters:
Name | Type | Description |
---|---|---|
version |
java.lang.String | - |
Returns:
boolean
(static) wait(msecs)
Delays 'msecs' milliseconds.
Parameters:
Name | Type | Description |
---|---|---|
msecs |
int | - |
(static) write(s)
Deprecated. replaced by IJ.log(), ResultsTable.setResult() and TextWindow.append(). There are examples at http://imagej.nih.gov/ij/plugins/sine-cosine.html
Parameters:
Name | Type | Description |
---|---|---|
s |
java.lang.String | - |
- Deprecated:
- . replaced by IJ.log(), ResultsTable.setResult() and TextWindow.append(). There are examples at http://imagej.nih.gov/ij/plugins/sine-cosine.html