User Tools

Site Tools


Sidebar

Top
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 @JFattaccioli: If you want to learn about image analysis with ImageJ, this MOOC from @EPFL opens soon : https://t.co/O3iJLvlMgJ It is co…
About 7 hours, 9 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @GoetzJacky: Amazing in vivo imaging 🤩 https://t.co/7Ce31i7cTa
About 10 hours, 17 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @perrinepgil: https://t.co/FV7xZCDF2j 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_)
blogtng:2011-03-07:testing_groovy_-_imagej

testing Groovy - ImageJ

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

ij-Groovy
http://ij-plugins.sourceforge.net/plugins/groovy/tutorials.html#RecordingScripts

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.
http://groovy.codehaus.org/Download

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("http://rsb.info.nih.gov/ij/images/gel.gif");
IJ.log(imp.getDimensions()[0].toString());
imp.show();

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.

Comments



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