All ObjectJ Examples



Norbert Vischer
Bacterial Cell Biology
University of Amsterdam



Watch the Video
(4 min, 12 MB, with sound)

StampFishEggs is a project for manual classification of fish eggs.
It runs under ImageJ in combination with plugin ObjectJ.

In this marine research project, individual fish eggs need to be classified and marked with one of ~100 acronyms, such as her (= herring ), or mac-2 (= mackerel in development stage 2). For some species, the circular egg outline plus any internal oil droplets need to be marked. Other species are marked with a single point only.

StampFishEggs.ojj is software that focusses on optimal support for manual marking. The .ojj project file contains all needed embedded macro commands, a table of shortcuts and acronyms, and receives all marked regions of interest.

A. Installation of ImageJ and ObjectJ:

  1. If not done yet, install ImageJ from:

  2. If the ObjectJ plugin is already visible under menu Plugins, jump to (4).
    Otherwise, you can install ObjectJ as follows:
    Download objectj_.jar from
    Make sure objectj_.jar was not renamed (which can happen when an older version already exists in the download folder).

  3. Drag objectj_.jar onto ImageJ's main window (which contains the tools).
    Confirm when ImageJ asks to store this plugin in the plugins folder, and relaunch ImageJ.

  4. Optionally choose Plugins> ObjectJ to make the ObjectJ menu visible (see fig 2),
    but the ObjectJ menu will appear anyway the first time you open an .ojj project file.

B. Run the demo:

  1. Download and unpack the folder '', which contains two images.
    Download the StampFishEggs_xx.ojj project file and move it into the folder that contains the images to be marked
    Your project folder will now look similar to this:
  2. Open StampFishEggs_xx.ojj by dragging its file icon from the Finder/Explorer into the ImageJ's main window; alternatively, use ImageJ's File>Open... menu.

    The "ObjectJ" menu between "Analyze" and "Plugins" is visible now, and the project window StampFishEggs_xx.ojj with its "Linked Images" panel is shown.

  3. Populate the panel for linked images with the images to be analyzed. This can be done by dragging their icons from the Finder or Windows Explorer into the panel for linked images, or choose ObjectJ>Linked Images>Link>Link Image from Project Folder.
    Green bullets confirm that the image files are in the same folder as the project.

  4. Open the first linked image by double-clicking its name.

  5. Make sure the image scale is correct. In the "Linked Images" panel, right-click a field below "px/unit" and assign the correct value (for the demo images, use 177 pixels/mm). The scale can be propagated to all linked images, and is stored in the .ojj project file.

  6. Optinally choose ObjectJ> Show Code Table [T] to observe the available labels and their shortcuts. For example, *20 hom-0 means "Horse Mackerel egg in development stage 0", and shortcut keys are '20'. The leading asterisk (*) indicates that the egg contour should be marked, not its center.

  7. Before marking an egg, adjust the current preset: choose ObjectJ>Preset[P] and enter a label such as hom-0 for subsequent marking. A faster way would be to type directly 20 without invoking the menu. The preset appears in the images label field at the top left.

  8. Subsequently, eggs of type hom-0 can be marked by positioning the cursor at the top of a Horse Mackerel-0 egg and then matching the circular roi with the outer egg contour, as hom-0 has the astereisk and thus is of type "Shell". If the mouse is clicked inside an existing egg, this is interpreted as one of the cell's oil droplet. (If two cells overlap, keep alt key down to avoid oil marking).

  9. Table entries without asterisk (*) are of shape "Spot", i.e. marked with single points. For example, Herring (her) has code 4. Press key "4" and click on one or several herring eggs to mark them with a single point.

  10. You can rename an object by locating the cursor upon it and choose ObjectJ>Rename [R]

  11. You can kill an object by locating the cursor upon it and choose ObjectJ>Kill [K]

  12. Results can be shown via ObjectJ>Frequencies>Stage or ObjectJ>Frequencies>Species. You also can look at the entire results table via ObjectJ>Show Object Results

  13. Periodically, choose ObjectJ>Save Project to save markings in the .ojj project file.

C. ObjectJ Menu Commands

ObjectJ> Key Table [T]

This shows the available shortcut numbers (single or dual digits) and the connected labels. An asterisk (*) next to the key indicates that the egg is expected to be marked with a circular contour (which in turn can receive oil droplets), otherwise with a point only. In the demo, the first label is "dummy" with key 0 , which suggests that you change the label after marking (see "Rename").

ObjectJ> Preset [P]:

ObjectJ> Kill [K]

You can delete an entire object by placing the cursor either inside a contour or close to a spot, and press key "K" (= kill). This will update the ObjectJ results table. Alternatively, use the Pistol tool from ObjectJ> Show ObjectJ Tools, which also can be used in combination with the shift key to kill an oil droplet only

ObjectJ> Select [S]

Selects the object that is closest to the cursor either inside a contour or close to a spot, and press key "K" (= kill).

ObjectJ> Rename [R]

For renaming an object, place the cursor inside a contour or close to a point object, and press key "R" (= Rename). You can enter either an allowed numerical code, a predefined label like "hom-3", or a new label that was not defined yet.

ObjectJ> Batch Rename

Choose **ObjectJ>Batch Rename to rename all objects with a certain label. This also works if the corresponding images need not open.

ObjectJ> Key

"Key" menu should be ignored by the user, but it is necessary to accommodate 20 keystroke shortcuts (keys 0-9, and keys n0-n9 from the numerical keypad). You cannot choose such a key from the menu because the mouse location is used to locate the fish egg.

ObjectJ> Frequencies>Stage

Displays the frequency of individual egg labels, where different stages are counted separately.

ObjectJ> Frequencies>Species:

Displays the frequency of the species labels independent of their stages.

Note: you also can observe the linked results via ObjectJ>Show ObjectJ Results. Here, one egg occupies one row.

Egg Tool

The Egg Tool (E) in ObjectJ Tools is automatically activated when an egg type is "Preset" as preparation for marking eggs.

D. Screenshots:

Column Explanation
Keys: keyboard shotrcuts,
Label: Label used for overlay
* asterisk (*) asks for circular contour, otherwise single point marker

Key table with explanation

The ObjectJ Results table is linked to the image markers and shows one object per row

E. ObjectJ Result Columns

Column Explanation
File File name
Label Object label
Spec Species, part of label before the minus sign
Stage Development stage, digit after the minus sign
EggDia Diameter of egg if it was measured
nOil number of oil droplets
OilDia1 Diameter of oil droplet #1
OilDia2 Diameter of oil droplet #2
OilDia3 Diameter of oil droplet #3
OilDia4 Diameter of oil droplet #4