Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
IJ Class Reference

Static Public Member Functions

static ImageJ getInstance ()
 
static Object runPlugIn (String className, String arg)
 
static void doCommand (String command)
 
static void run (String command)
 
static void run (String command, String options)
 
static boolean macroRunning ()
 
static java.applet.Applet getApplet ()
 
static void showStatus (String s)
 
static void write (String s)
 
static synchronized void log (String s)
 
static void setColumnHeadings (String headings)
 
static boolean isResultsWindow ()
 
static TextPanel getTextPanel ()
 
static void setTextPanel (TextPanel tp)
 
static void noImage ()
 
static void outOfMemory (String name)
 
static void showProgress (double progress)
 
static void showProgress (int currentIndex, int finalIndex)
 
static void showMessage (String title, String msg)
 
static void showMessage (String msg)
 
static void error (String msg)
 
static boolean showMessageWithCancel (String title, String msg)
 
static double getNumber (String prompt, double defaultValue)
 
static String getString (String prompt, String defaultString)
 
static synchronized void wait (int msecs)
 
static void beep ()
 
static String freeMemory ()
 
static long maxMemory ()
 
static void showTime (ImagePlus imp, long start, String str)
 
static String d2s (double n)
 
static String d2s (double n, int decimalPlaces)
 
static void register (Class c)
 
static boolean spaceBarDown ()
 
static boolean altKeyDown ()
 
static boolean shiftKeyDown ()
 
static void setKeyDown (int key)
 
static void setKeyUp (int key)
 
static void setInputEvent (InputEvent e)
 
static boolean isMacintosh ()
 
static boolean isMacOSX ()
 
static boolean isWindows ()
 
static boolean isJava2 ()
 
static boolean isJava14 ()
 
static boolean versionLessThan (String version)
 
static int setupDialog (ImagePlus imp, int flags)
 
static void makeRectangle (int x, int y, int width, int height)
 
static void makeOval (int x, int y, int width, int height)
 
static void makeLine (int x1, int y1, int x2, int y2)
 
static void setMinAndMax (double min, double max)
 
static void resetMinAndMax ()
 
static void setThreshold (double lowerThreshold, double upperThresold)
 
static void resetThreshold ()
 
static void selectWindow (int id)
 
static void setForegroundColor (int red, int green, int blue)
 
static void setBackgroundColor (int red, int green, int blue)
 
static void setTool (int id)
 
static int doWand (int x, int y)
 
static void setPasteMode (String mode)
 
static ImagePlus getImage ()
 
static String getVersion ()
 
static String getDirectory (String title)
 

Static Public Attributes

static boolean debugMode = false
 
static final char micronSymbol = (char)181
 
static final char angstromSymbol = (char)197
 
static final char degreeSymbol = (char)176
 
static final int CANCELED = Integer.MIN_VALUE
 

Detailed Description

This class consists of static utility methods.

Definition at line 20 of file IJ.java.

Member Function Documentation

static boolean altKeyDown ( )
inlinestatic

Returns true if the alt key is down.

Definition at line 524 of file IJ.java.

static void beep ( )
inlinestatic

Emits an audio beep.

Definition at line 424 of file IJ.java.

static String d2s ( double  n)
inlinestatic

Converts a number to a formatted string using 2 digits to the right of the decimal point.

Definition at line 475 of file IJ.java.

static String d2s ( double  n,
int  decimalPlaces 
)
inlinestatic

Converts a number to a rounded formatted string. The 'decimalPlaces' argument specifies the number of digits to the right of the decimal point.

Definition at line 486 of file IJ.java.

static void doCommand ( String  command)
inlinestatic

Starts executing a menu command in a separete thread and returns immediately.

Definition at line 200 of file IJ.java.

static int doWand ( int  x,
int  y 
)
inlinestatic

Equivalent to clicking on the current image at (x,y) with the wand tool. Returns the number of points in the resulting ROI.

Definition at line 692 of file IJ.java.

static void error ( String  msg)
inlinestatic

Displays a message in a dialog box titled "ImageJ". Writes to the Java console if the ImageJ window is not present.

Definition at line 369 of file IJ.java.

static java.applet.Applet getApplet ( )
inlinestatic

Returns the Applet that created this ImageJ or null if running as an application.

Definition at line 247 of file IJ.java.

static String getDirectory ( String  title)
inlinestatic

Returns the path to the plugins, macros, temp or image directory if title is "plugins", "macros", "temp" or "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.

Definition at line 760 of file IJ.java.

static ImagePlus getImage ( )
inlinestatic

Returns a reference to the active image. Displays an error message and aborts the macro if no images are open.

Definition at line 740 of file IJ.java.

static ImageJ getInstance ( )
inlinestatic

Returns a reference to the "ImageJ" frame.

Definition at line 59 of file IJ.java.

static double getNumber ( String  prompt,
double  defaultValue 
)
inlinestatic

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.

Definition at line 392 of file IJ.java.

static String getString ( String  prompt,
String  defaultString 
)
inlinestatic

Allows the user to enter a string in a dialog box. Returns "" if the user cancels the dialog box.

Definition at line 408 of file IJ.java.

static TextPanel getTextPanel ( )
inlinestatic

Returns a reference to the "Results" window TextPanel. Opens the "Results" window if it is currently not open.

Definition at line 296 of file IJ.java.

static String getVersion ( )
inlinestatic

Returns the ImageJ version number as a string.

Definition at line 750 of file IJ.java.

static boolean isJava14 ( )
inlinestatic

Returns true if ImageJ is running on a Java 1.4 or greater JVM.

Definition at line 577 of file IJ.java.

static boolean isJava2 ( )
inlinestatic

Returns true if ImageJ is running on Java 2.

Definition at line 572 of file IJ.java.

static boolean isMacintosh ( )
inlinestatic

Returns true if this machine is a Macintosh.

Definition at line 557 of file IJ.java.

static boolean isMacOSX ( )
inlinestatic

Returns true if this machine is a Macintosh running OS X.

Definition at line 562 of file IJ.java.

static boolean isResultsWindow ( )
inlinestatic

Returns true if the "Results" window is open.

Definition at line 290 of file IJ.java.

static boolean isWindows ( )
inlinestatic

Returns true if this machine is running Windows.

Definition at line 567 of file IJ.java.

static synchronized void log ( String  s)
inlinestatic

Displays a line of text in the "Log" window. Uses System.out.println if ImageJ is not present.

Definition at line 276 of file IJ.java.

static boolean macroRunning ( )
inlinestatic

Returns true if either of the IJ.run() methods is executing.

Definition at line 242 of file IJ.java.

static void makeLine ( int  x1,
int  y1,
int  x2,
int  y2 
)
inlinestatic

Creates a straight line selection.

Definition at line 618 of file IJ.java.

static void makeOval ( int  x,
int  y,
int  width,
int  height 
)
inlinestatic

Creates an elliptical selection. Removes any existing selection if width or height are less than 1.

Definition at line 610 of file IJ.java.

static void makeRectangle ( int  x,
int  y,
int  width,
int  height 
)
inlinestatic

Creates a rectangular selection. Removes any existing selection if width or height are less than 1.

Definition at line 601 of file IJ.java.

static long maxMemory ( )
inlinestatic

Returns the maximum amount of memory available to ImageJ or zero if ImageJ is unable to determine this limit.

Definition at line 445 of file IJ.java.

static void noImage ( )
inlinestatic

Displays a "no images are open" dialog box.

Definition at line 308 of file IJ.java.

static void outOfMemory ( String  name)
inlinestatic

Displays an "out of memory" message to the "Log" window.

Definition at line 313 of file IJ.java.

static void register ( Class  c)
inlinestatic
Adds the specified class to a Vector to keep it from being garbage

collected, which would cause the classes static fields to be reset.

Definition at line 514 of file IJ.java.

static void resetMinAndMax ( )
inlinestatic

Resets the minimum and maximum displayed pixel values to be the same as the min and max pixel values.

Definition at line 632 of file IJ.java.

static void resetThreshold ( )
inlinestatic

Disables thresholding.

Definition at line 646 of file IJ.java.

static void run ( String  command)
inlinestatic

Runs an ImageJ command. Does not return until the command has finished executing.

Definition at line 207 of file IJ.java.

static void run ( String  command,
String  options 
)
inlinestatic

Runs an ImageJ command, with options that are passed to the GenericDialog and OpenDialog classes. Does not return until the command has finished executing.

Definition at line 214 of file IJ.java.

static Object runPlugIn ( String  className,
String  arg 
)
inlinestatic

Runs the specified plugin and returns a reference to it.

Definition at line 64 of file IJ.java.

static void selectWindow ( int  id)
inlinestatic

For IDs less than zero, activates the image with the specified ID. For IDs greater than zero, activates the Nth image.

Definition at line 654 of file IJ.java.

static void setBackgroundColor ( int  red,
int  green,
int  blue 
)
inlinestatic

Sets the background color.

Definition at line 667 of file IJ.java.

static void setColumnHeadings ( String  headings)
inlinestatic

Clears the "Results" window and sets the column headings to those in the tab-delimited 'headings' String.

Definition at line 282 of file IJ.java.

static void setForegroundColor ( int  red,
int  green,
int  blue 
)
inlinestatic

Sets the foreground color.

Definition at line 662 of file IJ.java.

static void setMinAndMax ( double  min,
double  max 
)
inlinestatic

Sets the minimum and maximum displayed pixel values.

Definition at line 624 of file IJ.java.

static void setPasteMode ( String  mode)
inlinestatic

Sets the transfer mode used by the Edit/Paste command, where mode is "Copy", "Blend", "Average", "Difference", "Transparent", "AND", "OR", "XOR", "Add", "Subtract", "Multiply", or "Divide".

Definition at line 712 of file IJ.java.

static void setTextPanel ( TextPanel  tp)
inlinestatic

TextWindow calls this method with a null argument when the "Results" window is closed.

Definition at line 303 of file IJ.java.

static void setThreshold ( double  lowerThreshold,
double  upperThresold 
)
inlinestatic

Sets the lower and upper threshold levels.

Definition at line 639 of file IJ.java.

static void setTool ( int  id)
inlinestatic

Switches to the specified tool, where id = Toolbar.RECTANGLE (0), Toolbar.OVAL (1), etc.

Definition at line 686 of file IJ.java.

static int setupDialog ( ImagePlus  imp,
int  flags 
)
inlinestatic

Displays a "Process all slices?" 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".

Definition at line 595 of file IJ.java.

static boolean shiftKeyDown ( )
inlinestatic

Returns true if the shift key is down.

Definition at line 529 of file IJ.java.

static void showMessage ( String  title,
String  msg 
)
inlinestatic

Displays a message in a dialog box with the specified title. Writes the Java console if ImageJ is not present.

Definition at line 348 of file IJ.java.

static void showMessage ( String  msg)
inlinestatic

Displays a message in a dialog box titled "Message". Writes the Java console if ImageJ is not present.

Definition at line 363 of file IJ.java.

static boolean showMessageWithCancel ( String  title,
String  msg 
)
inlinestatic

Displays a message in a dialog box with the specified title. Returns false if the user pressed "Cancel".

Definition at line 380 of file IJ.java.

static void showProgress ( double  progress)
inlinestatic
Updates the progress bar, where 0<=progress<=1.0. The progress bar is 

not displayed if the time between the first and second calls to this method is less than 30 milliseconds. It is erased if progress>=1.0. Does nothing if the ImageJ window is not present.

Definition at line 335 of file IJ.java.

static void showProgress ( int  currentIndex,
int  finalIndex 
)
inlinestatic
Updates the progress bar, where bar-length = (currentIndex/finalIndex)*total-length.

The bar is erased if currentIndex>=finalIndex. Does nothing if the ImageJ window is not present.

Definition at line 342 of file IJ.java.

static void showStatus ( String  s)
inlinestatic

Displays a message in the ImageJ status bar.

Definition at line 252 of file IJ.java.

static boolean spaceBarDown ( )
inlinestatic

Returns true if the space bar is down.

Definition at line 519 of file IJ.java.

static boolean versionLessThan ( String  version)
inlinestatic

Displays an error message and returns false if the ImageJ version is less than the one specified.

Definition at line 583 of file IJ.java.

static synchronized void wait ( int  msecs)
inlinestatic

Delays 'msecs' milliseconds.

Definition at line 418 of file IJ.java.

static void write ( String  s)
inlinestatic

Displays a line of text in the "Results" window. Uses System.out.println if ImageJ is not present.

Definition at line 258 of file IJ.java.


The documentation for this class was generated from the following file: