Module ij
Package ij

Class ImageJ

All Implemented Interfaces:
ActionListener, ItemListener, KeyListener, MouseListener, WindowListener, ImageObserver, MenuContainer, Serializable, Runnable, EventListener, Accessible

This frame is the main ImageJ class.

ImageJ is a work of the United States Government. It is in the public domain and open source. There is no copyright. You are free to do anything you want with this source but I like to get credit for my work and I would like you to offer your changes to me so I can possibly add them to the "official" version.

The following command line options are recognized by ImageJ:

  "file-name"
     Opens a file
     Example 1: blobs.tif
     Example 2: /Users/wayne/images/blobs.tif
     Example 3: e81*.tif

  -macro path [arg]
     Runs a macro or script (JavaScript, BeanShell or Python), passing an
     optional string argument, which the macro or script can be retrieve
     using the getArgument() function. The macro or script is assumed to 
     be in the ImageJ/macros folder if 'path' is not a full directory path.
     Example 1: -macro analyze.ijm
     Example 2: -macro script.js /Users/wayne/images/stack1
     Example 2: -macro script.py '1.2 2.4 3.8'

  -batch path [arg]
    Runs a macro or script (JavaScript, BeanShell or Python) in
    batch (no GUI) mode, passing an optional argument.
    ImageJ exits when the macro finishes.

  -eval "macro code"
     Evaluates macro code
     Example 1: -eval "print('Hello, world');"
     Example 2: -eval "return getVersion();"

  -run command
     Runs an ImageJ menu command
     Example: -run "About ImageJ..."
     
  -ijpath path
     Specifies the path to the directory containing the plugins directory
     Example: -ijpath /Applications/ImageJ

  -port
     Specifies the port ImageJ uses to determine if another instance is running
     Example 1: -port1 (use default port address + 1)
     Example 2: -port2 (use default port address + 2)
     Example 3: -port0 (don't check for another instance)

  -debug
     Runs ImageJ in debug mode
Author:
Wayne Rasband (rasband@gmail.com)
See Also:
  • Field Details

    • VERSION

      public static final String VERSION
      Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string.
      See Also:
    • BUILD

      public static final String BUILD
      See Also:
    • backgroundColor

      public static Color backgroundColor
    • SansSerif12

      public static final Font SansSerif12
      SansSerif, 12-point, plain font.
    • SansSerif14

      public static final Font SansSerif14
      SansSerif, 14-point, plain font.
    • DEFAULT_PORT

      public static final int DEFAULT_PORT
      Address of socket where Image accepts commands
      See Also:
    • STANDALONE

      public static final int STANDALONE
      Run as normal application.
      See Also:
    • EMBEDDED

      public static final int EMBEDDED
      Run embedded in another application.
      See Also:
    • NO_SHOW

      public static final int NO_SHOW
      Run embedded and invisible in another application.
      See Also:
    • IMAGEJ_APP

      public static final int IMAGEJ_APP
      Run as the ImageJ application.
      See Also:
    • DEBUG

      public static final int DEBUG
      Run ImageJ in debug mode.
      See Also:
  • Constructor Details

    • ImageJ

      public ImageJ()
      Creates a new ImageJ frame that runs as an application.
    • ImageJ

      public ImageJ(int mode)
      Creates a new ImageJ frame that runs as an application in the specified mode.
    • ImageJ

      public ImageJ(Applet applet)
      Creates a new ImageJ frame that runs as an applet.
    • ImageJ

      public ImageJ(Applet applet, int mode)
      If 'applet' is not null, creates a new ImageJ frame that runs as an applet. If 'mode' is ImageJ.EMBEDDED and 'applet is null, creates an embedded (non-standalone) version of ImageJ.
  • Method Details

    • getPreferredLocation

      public Point getPreferredLocation()
    • getProgressBar

      public ProgressBar getProgressBar()
    • getStatusBar

      public Panel getStatusBar()
    • getStatusBarText

      public static String getStatusBarText()
    • runFilterPlugIn

      public void runFilterPlugIn(Object theFilter, String cmd, String arg)
    • runUserPlugIn

      public Object runUserPlugIn(String commandName, String className, String arg, boolean createNewLoader)
    • modifiers

      public static String modifiers(int flags)
      Return the current list of modifier keys.
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Handle menu events.
      Specified by:
      actionPerformed in interface ActionListener
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Handles CheckboxMenuItem state changes.
      Specified by:
      itemStateChanged in interface ItemListener
    • mousePressed

      public void mousePressed(MouseEvent e)
      Specified by:
      mousePressed in interface MouseListener
    • getInfo

      public String getInfo()
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Specified by:
      mouseReleased in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent e)
      Specified by:
      mouseExited in interface MouseListener
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Specified by:
      mouseClicked in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Specified by:
      mouseEntered in interface MouseListener
    • keyPressed

      public void keyPressed(KeyEvent e)
      Specified by:
      keyPressed in interface KeyListener
    • keyTyped

      public void keyTyped(KeyEvent e)
      Specified by:
      keyTyped in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent e)
      Specified by:
      keyReleased in interface KeyListener
    • windowClosing

      public void windowClosing(WindowEvent e)
      Specified by:
      windowClosing in interface WindowListener
    • windowActivated

      public void windowActivated(WindowEvent e)
      Specified by:
      windowActivated in interface WindowListener
    • windowClosed

      public void windowClosed(WindowEvent e)
      Specified by:
      windowClosed in interface WindowListener
    • windowDeactivated

      public void windowDeactivated(WindowEvent e)
      Specified by:
      windowDeactivated in interface WindowListener
    • windowDeiconified

      public void windowDeiconified(WindowEvent e)
      Specified by:
      windowDeiconified in interface WindowListener
    • windowIconified

      public void windowIconified(WindowEvent e)
      Specified by:
      windowIconified in interface WindowListener
    • windowOpened

      public void windowOpened(WindowEvent e)
      Specified by:
      windowOpened in interface WindowListener
    • register

      public void register(Class c)
      Adds the specified class to a Vector to keep it from being garbage collected, causing static fields to be reset.
    • quit

      public void quit()
      Called by ImageJ when the user selects Quit.
    • quitting

      public boolean quitting()
      Returns true if ImageJ is exiting.
    • quittingViaMacro

      public boolean quittingViaMacro()
      Returns true if ImageJ is quitting as a result of a run("Quit") macro call.
    • savePreferences

      public void savePreferences(Properties prefs)
      Called once when ImageJ quits.
    • main

      public static void main(String[] args)
    • getPort

      public static int getPort()
      Returns the port that ImageJ checks on startup to see if another instance is running.
      See Also:
    • getArgs

      public static String[] getArgs()
      Returns the command line arguments passed to ImageJ.
    • exitWhenQuitting

      public void exitWhenQuitting(boolean ewq)
      ImageJ calls System.exit() when qutting when 'exitWhenQuitting' is true.
    • run

      public void run()
      Quit using a separate thread, hopefully avoiding thread deadlocks.
      Specified by:
      run in interface Runnable
    • getCommandName

      public static String getCommandName()
    • setCommandName

      public static void setCommandName(String name)
    • resize

      public void resize()