Saturday, July 20, 2013

ImageJ: Import source code into Eclipse and git version control

ImageJ is a public domain Java image processing program inspired by NIH Image for the Macintosh. It runs, either as an online applet or as a downloadable application, on any computer with a Java 1.4 or later virtual machine. Downloadable distributions are available for Windows, Mac OS, Mac OS X and Linux.
Since it is open sourced it can be modified and extended. It normally comes with ant build.xml but I usually work with Eclipse and Git, thus I wanted to work with the source files in this environment.

I will show how to add ImageJ source code into Eclipse and with Git support. The steps below where executed in Xubuntu 13.04.

1. Download the source code and unpack

The ImageJ source code is here. At the moment of writing, the latest version is ij147v-src.zip I usually download to ~/Downloads folder. To unpack it use the following:cd ~/Downloads/
unzip ij147v-src.zip
This will create a folder named source in ~/Downloads.

2. Create new Java Project in Eclipse

Create new Java Project in your default workspace. Usually the folder is set by Eclipse as ~/workspace. Its important to select "Use project folder as root for sources and class files" because in a moment we will import the ImageJ source into it.