All ObjectJ Examples

StampFishEggs

06-jun-2024

Norbert Vischer
University of Amsterdam

History

Download


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: http://imagej.nih.gov/ij/

  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 https://sils.fnwi.uva.nl/bcb/objectj/download/current/
    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 'Demo_Images.zip', 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 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. Before marking an egg, choose ObjectJ> Key Table [T] , or press key T. This will show a the table with the avaliable species labels, and automatically activate the 'Egg tool' 'E' in ObjectJ Tools. Then select the desired row such as hom-0 for subsequent marking. Alternatively, simply type the corresponding code 20, which will adjust the table selection.

  7. Subsequently, eggs of type hom-0 can be marked by clicking-and- dragging from the top to the bottom of a Horse Mackerel-0 egg, which creates a circular egg contour. The astereisk in code "*20" indicates that the egg must be marked as contour ('shell') and not only as single point. If the mouse is clicked-and-dragged 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).

  8. Table entries without asterisk (*) are of shape "Spot", i.e. marked with single points.

  9. You can rename an object by locating the cursor upon it, press key S to select it, and choose ObjectJ> Rename [R]

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

  11. 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

  12. 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, and activates the "Egg" tool E in ObjectJ Tools. An asterisk (*) left of 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").

ing the mouse, the egg is labeled with hom-3. The the labels' font size can be changed under ObjectJ Tools>Sizes...

ObjectJ> Kill Object [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 Object [S]

Plase cursor inside a contour or close to a spot, and press key "S" to select it.

ObjectJ> Rename Selected Egg [R]

If a selected object is in front, you can enter either an allowed numerical code, a predefined label like "hom-3". After pressing 'return', you have the choice to focus on the next egg, see screenshot "Rename in slide show mode".

ObjectJ> Batch Rename

Renames all objects with a certain label. Supports wildcard characters * and ? in field 'Old Label'. The corresponding images need not to be 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> Navigate

Allows to navigate to previous/ curent/ next object in zoomed mode.

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.

ObjectJ> Create Stack From Marked Eggs

Isolates each marked egg as stack slice (e.g 300 x 300px), together with object number and optinally egg name.

ObjectJ> List Egg Labels:

Shows labels of all marked eggs in a table which can be saved in csv format.

ObjectJ> Avoid mouse wheel stack-scrolling

If you experience unwanted stack scrolling, e.g. by slightly moving your index finger on the surface of an Apple Magic Mouse, you can block this behaviour in ImageJ1.54j21.

Egg Tool

The Egg Tool (E) in ObjectJ Tools is automatically activated when an egg type is "ObjectJ> Key Table [T]" is selected.

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

F. Rename in 'slide-show' mode: