User Tools

Site Tools


Courses -2016
Courses 2018-
Downloads (-2016)
Downloads (2016-)
RSS aggregates

EMBL BioImage Data Analysis



—- Contact
CMCI Alumni
EMBL Heidelberg
EMBL Intranet

Popularity Ranking

Timeline of @cmci_

cmci_ avatar

RT @JFattaccioli: If you want to learn about image analysis with ImageJ, this MOOC from @EPFL opens soon : It is co…
About 7 hours, 9 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @GoetzJacky: Amazing in vivo imaging 🤩
About 10 hours, 17 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @perrinepgil: Deadline for application tomorrow ! “A practical approach to CLEM “ : With an access to a light m…
About 22 hours, 26 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @joachimgoedhart: A brand new shiny app by Olivier Pertz and colleagues for mining time-series datasets and cluster analysis: https://t.…
About 3 days, 1 hour ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @haesleinhuepf: @cmci_ Indeed! 😅 The video is made with a jython script. I think it could be a ImageJ macro as well but two commands ar…
About 3 days, 3 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

We call it “Baysian Bioimage Analysis Workflow” assisted by CLIJ
About 3 days, 3 hours ago by: Kota Miura (@cmci_)

testing Groovy - ImageJ

There is a new ImageJ plugin that allows you to fo scripting with Groovy.


so I became interested in how it would be like using it. GroovyConsole seems to be an handy Editor, so instead of installing the plugin to ImageJ, I made a trial to use ImageJ as a libray, accessing directly from Groovy. It was pretty simple to do this task, but I note down how I installed mainly because I will forget what I did.

1. Go to the groovy site, and download the zipped binary.

I downloaded Groovy 1.7.8 and unzipped the folder groovy-1.7.8 under C:\dev.

2. Add path C:\dev\groovy-1.7.8 as a new environmental variable “GROOVY_HOME” .

3. Add path %GROOVY_HOME%\bin to the system path.

4. Launch the console by clicking %GROOVY_HOME%\bin\GroovyConsole.bat

5. set path to ij.jar by [Script > Add Jar to Classpath]

Following is the code I tested, which worked fine without opening ImageJ main menu.

import ij.*

imp = IJ.openImage("");

Running this code, an image window pops sup and also the width of the image is printed in the output field of the console. IJ.log command which normally should print out the string argument in log window seems to be diverted to the console output.
Interpreter runs with a speed comparable to Javascript and Jython running with ImageJ jar.

Good point about this console is that referencing to a jar file could be easily be done, by [scripts > add jar to classpath] This affords a good simple interface for test assembling several Java libraries.


142 +9 = 
blogtng/2011-03-07/testing_groovy_-_imagej.txt · Last modified: 2016/05/24 05:46 (external edit)