# Bioimage Analysis Wiki

### Sidebar

EMBL BioImage Data Analysis

EuBIAS

NEUBIAS

Popularity Ranking

 The field for bioimage analyst expanding. British museum! https://t.co/KClNvxP948 About 2 days, 6 hours ago by: Kota Miura (@cmci_) RT @dgaboriau: Panel session: should I aim to become a bioimage analyst? With Robert Hasse @haesleinhuepf , Kota Miura @cmci_ and Arianne B… About 3 days, 20 hours ago by: Kota Miura (@cmci_) RT @martinjones78: Shoutout by @cmci_ for @clathrin's book https://t.co/x6d2OmfdxR as a great resource, here at #CBIAS2022 in the panel ses… About 3 days, 20 hours ago by: Kota Miura (@cmci_) RT @alex_paynedwyer: The one and only Kota Miura @cmci_ calling out all those dodgy contrast-mismatched figures #ethics in classic humorou… About 4 days, 4 hours ago by: Kota Miura (@cmci_) RT @RekadZeinab: Kicking the last session of #CBIAS2022 with the great master @cmci_ on the challenges of doing image analysis at the inter… About 4 days, 4 hours ago by: Kota Miura (@cmci_) RT @MaKaefer: Fear not: there is something that can be done! Abide by the guidelines or report everything that has been done - whether it i… About 4 days, 4 hours ago by: Kota Miura (@cmci_)

# ImaegJ Macro Headless Limitations

There are two ways to run ImageJ “Headless”ly.

1. Real-Headless: running ImageJ without any display. 2. Pseudo-Headless: running ImageJ without physical display, but with a virtual display that is hidden - virtual frame buffer. xvfb-run command is often used for this purpose.

With the second method, you can run ImageJ macro just like you do with GUI. The speed of processing is similar to that you experience with normal GUI. With the first method, as there is no GUI drawing involved, the processing becomes much faster - but there are some problems. As some of the windows often used in ImageJ macro, such as ROI Manager and Results table cause “headlessexception” error and you will fail in the successful execution of that macro. (If you use xvfb-run, this does not happen).

There is some workaround as shown below.

### ROI Manager

Don't use ROI Manager in a pure-headless environment. Instead, use Overlay function like the example below.

run("Blobs (25K)");
setAutoThreshold("Default");
run("Analyze Particles...", "  show=Overlay");
Overlay.copy
newImage("Untitled", "8-bit ramp", 256, 254, 1);
Overlay.paste
for (i=0; i<Overlay.size; i++) {
Overlay.activateSelection(i);
List.setMeasurements;
mean = List.getValue("Mean");
print(i+"  "+mean);
}


## Results Table

You can see the results table by saveAs(“Results”, path) command, but the renaming of the results table becomes impossible in the pure-headless environment. Avoid renaming, and instead, try to save the results table as soon as the results are filled in the table with a specific file name.