User Tools

Site Tools


Sidebar

Top
Profile
Seminar
Courses -2016
Courses 2018-
Textbooks
Documents
Downloads (-2016)
Downloads (2016-)
Weblog
RSS aggregates
Discussions
Archives
日本語


EMBL BioImage Data Analysis

EuBIAS

NEUBIAS

—- Contact
CMCI Alumni
ALMF
EMBL Heidelberg
EMBL Intranet


Popularity Ranking


Timeline of @cmci_

cmci_ avatar

RT @KuglerElisabeth: One question I often get is "How do I assess my segmentation?" Together with Andrik Bin Rampun, .@Timchico, and Paul…
About 3 hours, 24 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @clairebrown514: @cmci_ We use https://t.co/J9y0625zRl . People still need to be convinced and reminded to put the #RRID in the acknowled…
About 4 hours, 23 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @Coronin: Wonderful historical perspective from Tom Pollard: Landmarks in the discovery of a role for actin in cell locomotion https://t…
About 13 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @IAMichaelNelson: @cmci_ @CCI_liv I recommended to my old core https://t.co/mOai5Zez5b . A "how to use our core facility" protocol and ma…
About 18 hours, 23 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @cmci_: @CCI_liv It’s an idea. What would you say? There are journals that allows versioning, so it can be updated every time when there…
About 18 hours, 41 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

@CCI_liv It’s an idea. What would you say? There are journals that allows versioning, so it can be updated every ti… https://t.co/xz3xKR243j
About 18 hours, 50 mins ago by: Kota Miura (@cmci_)
documents:200720ijmacro_headless

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.

https://github.com/imagej/imagej-legacy/issues/153

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.

documents/200720ijmacro_headless.txt · Last modified: 2020/07/20 23:39 by kota