Action Bar Plugin

Action Bar


Jerome Mutterer (email) , Johannes Schindelin , Stephan Saalfeld , Michael Schmid , Serge Mazères , Olivier Burri , Simon Roussel , Gabriel Landini


Please cite ActionBar like this:

Mutterer, Jerome (2016): Custom toolbars and mini applications with Action Bar. figshare. Retrieved: 08 49, May 24, 2016 (GMT)


This plugin extends ImageJ's graphical user interface. It's purpose is to provide one or many easy to use button bar(s). This type of bars is called 'ActionBar'. It will be a good place to install frequently used items like macros, built-in commands, or user plugins. It can turn a series of plugins into a good looking user interface (see examples).


Each button can have a name, an icon, and can do one of three actions type:

  • run a macro string
  • hide or show the ImageJ window
  • close the current bar

Of course with the macro language you can run other macros, user or builtin plugins, javascripts, etc.

How to add a line of buttons

Each line of buttons should be included between line tags like this:

// add buttons here


How to add buttons

All buttons are simply described in a basic configuration file. You can edit this file manually with ImageJ's built-in text editor. Simply add new buttons there with 5 descriptors for each button :

<button> Declares a new button in your ActionBar.
label The button's name, display in a tooltip.
icon The button's icon file which should be in the 'icons' folder.
bgcolor The button's background color 1-8 preset colors
or RGB value in the form of #RRGGBB
arg Is the argument to the button's action

Creating an empty config file canvas with icons

Choose “Action Bar” alone from the plugins menu, and you'll be invited to create your first Action Bar. After that, you can edit the config file to do real things.

Customizing your ActionBar(s)

You can customize the default ActionBarConf.txt as you like, but you can also have more than one Action Bar (an idea by Gabriel Landini). To achieve that, simply call Action Bar with the reference to the configuration file of your choice. Here are two ways of doing this:

  • from a macro:
run("Action Bar", "/plugins/Morphology/ActionBarMorphoset.txt");

see also the example macro provided that starts 3 ActionBars.

  • by installing the Action Bar plugin with different arguments. This will make your custom action bar available through a standard menu command. You can do this from Plugins/Shortcuts/Install Plugin…, or from a macro :
run("Install Plugin...", "plugin=Action_Bar menu=Plugins command=sampleActionBar
shortcut=F1 argument=/plugins/ActionBar/sampleActionBar.txt");
  • PATH to the configuration files must be relative to ImageJ startup directory (see example)
  • icons should be in the plugins/ActionBar/icons/ folder.

How to have one or more Action Bars showing at Startup time?

Include an AutoRun macro in StartupMacros.txt:

macro "AutoRun" {
  run("Action Bar", "/plugins/Morphology/ActionBarMorphoset.txt");

Tip : One Action Bar can start others…

Sticky ActionBars

Defining your Action Bar 'sticky' with the <sticky> property, will allow you to always have your favorite functions next to the active image window. The following screenshot shows you what it looks like :

Follow this link for a screencast. Available soon.

The Adobe Flash Plugin is needed to display this content. The Adobe Flash Plugin is needed to display this content.


First download latest version from Download section it in an ActionBar folder inside the plugins folder. Restart ImageJ.

ImageJ/plugins/action_bar201d.jar               Action Bar plugin
ImageJ/plugins/ActionBar/		        ActionBar folder for your bars
ImageJ/plugins/ActionBar/icons/			..icons folder 
ImageJ/plugins/test_bar.jar                     a standalone actionbar file

Advanced usage tips

  • Rainer M. Engel wrote a macro that can be used to update an ActionBar in a comfortable way. Another macro makes it easy to add/remove rows/columns or for example switch button positions.
  • The “Close AB” command is meant to be called from a macro, to programmatically close an action bar. A 'name' should be passed as an argument.


No licence associated. Citing Action Bar will be apreciated.


Contact Jerome if you find any bugs or if you'd like to see a feature appear in a new release.


August 2014 action_bar202.jar

  • Worked around a Fiji change that prevented button icons to be shown.

January 2014 action_bar201d.jar

  • Michael Schmid added code to keep IJ menus alive on Macintosh when the Action Bar is activated, and fixed several bugs.
  • use the new <hideMenus> feature to block IJ menus from being restored.

March 2013 version action_bar201a.jar

  • Thanks to Olivier Burri, ActionBars can be distributed as single jar files, so that they can be served through Fiji update sites (see test_bar.jar for an example jar file).
The jar file should contain:
* the action bar config file
* a plugins.config file referencing the config file like this:
   Plugins>Test, "Test AB with icons in jar", Action_Bar("jar:file:test_bar.jar!/test.txt")
* an icons/ folder with the icons.
  • Suggested by Stephan Saalfeld and Johannes Schindelin, action bars can carry Beanshell code that will be executed in a single Beanshell interpreter, so that you can share variables across buttons.


print (i);


May 2012 version

  • thanks to Simon Roussel, works with the new toolbar new tool positionning to the last free or last slot for IJ version >= 1.46d

November 2011 version

  • icon attribute is now optional (defaults to noicon)
  • Thanks to Serge Mazères (IBPS, FR), added the optional button background color attribute.

→ either use one of 8 preset colors


→ or specify RGB color code


March 2011 version

  • Included bug fixes by Johannes Schindelin (package everything in a jar file, load example bars from jar file, include editor paster and function finder in the same class)
  • Included improved Magic Montage, Code Bar, and several examples.
  • Works in Fiji : save your custom bars in Fiji/plugins/ActionBar/ as a *.ijm file with an underscore, and refresh menus. Example: the Fiji/plugins/ActionBar/1_pixel.ijm should stat like this:
run("Action Bar","/plugins/ActionBar/1_pixel.ijm");
  • Some new features :
  • drag and drop actions processes files dropped on the bars
  • Sticky bars buttons can be contextually disabled
<button> <enabled>if (bitDepth==8) return '1';
arg=run("Show Info...");

previous version
Contains <sticky> feature, and Alt-click actionbar removal.

ImageJ Luxembourg 2008 Workshop support material : mutterer_workshop.pdf

Extra Downloads

  • Annotation toolbar to be used with FigureJ Included in FigureJ after version 1.01a3


plugin/utilities/action_bar/start.txt · Last modified: 2016/05/24 11:51 by mutterer
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0