Login  Register

Re: IDE and plugin development

Posted by simon andrews (BI) on Aug 19, 2008; 8:17am
URL: http://imagej.273.s1.nabble.com/IDE-and-plugin-development-tp3695201p3695204.html

On 19 Aug 2008, at 08:51, Pål Baggethun wrote:

> Greetings!
>
> I am wondering if someone have any experience using Eclipse IDE for
> developing plugins for ImageJ. In that case, what is the most  
> convenient
> workspace configuration?

Yes, I've done this.

In the simplest form you just include ij.jar from ImageJ in your  
project build path and eclipse will then recognise all of the classes  
you'll need.  You don't need to import the actual jar into the  
project, just point eclipse at the copy in your ImageJ installation  
and it will work fine.  I have also tried importing classes from  
other plugins, but eclipse can get confused where included jars put  
classes into the default package (as most plugins do).

For actually running/testing your plugin I tended to add a main  
method to it to simulate being called from ImageJ.  It just loads an  
image to create an ImagePlus object and then passed that to the setup  
method.  How you do this will depend on what sort of a plugin you're  
writing.  You'll also need to remember to modify the VM arguments in  
the run settings to increase the amount of memory allocated as the  
default is usually too small.

It's also fairly easy to have a shell open with a command to copy the  
latest version of your plugin into a real ImageJ install so you can  
test it in-situ very quickly.

Simon.