Install a plugin from source



I am trying to install the Frangi filter plugin:

It appears to be available only as source on Github. Inside the .zip are .java files.
The plugins documentation ( says:

“If the file suffix is .java then you typically must execute the Compile and Run command on the file to first compile it to a .class.”

When I select “Plugins->Compile and Run” in FIJI (ImageJ 1.52h), it tells me:
“The ‘Compile and Run’ command is not currently supported. We recommend using the Script Editor or an IDE such as Eclipse for plugin development.”

So I open the plugin editor, and open the .java file, and try a few things to get it to run from there. Run->Compile and Run doesn’t work. Neither does File->Export as Jar.

The error messages look like this:
“java.lang.RuntimeException: javax.script.ScriptException: Class fiji.features.Frangi_ in invalid directory: C:\Users\edward.siefker\Downloads\\plugins\”

At this point I’m stumped. What’s the right way to do this? Thanks


Hello Ed -

I haven’t looked at the specific Frangi plugin you reference, so
I can’t answer your specific question.

However, ImageJ (at least the Fijji distribution) ships with a
Frangi plugin:

Plugins > Process > Frangi Vesselness (imglib, experimental)

Is there any chance that this plugin will do what you want?

(As an aside, if you have a .java file that implements a plugin,
you need to compile it into a class. The “simplest” way to do
this is to run javac, the java compiler, but many people
prefer to run javac indirectly from an IDE such as eclipse.
When you compile your java class, any other java classes that
the class you’re compiling depends on must be available. In the
java world you do this by adding directories containing (jars
that contain) those dependency classes to the CLASS_PATH
used by javac. An ImageJ plugin generally depends on a lot
of ImageJ classes; I generally add the “jars” directory of my
ImageJ installation to my CLASS_PATH. For most of what I
do with ImageJ, this is enough. You then copy the .class file
produced by javac (or a jar containing it) into the “plugins”
directory of your ImageJ installation. Of course, this will only
work for the Frangi plugin you mentioned if it plays by the
ordinary (and up to date) ImageJ plugin rules.)

Thanks, mm