Importing ImageJ plugins from an ImageJ script

Posted by haider on
URL: http://imagej.273.s1.nabble.com/Importing-ImageJ-plugins-from-an-ImageJ-script-tp5009079.html

I have been working on an ImageJ plugin in Eclipse (the plugin is based on a Matlab 3D denoting software) + simultaneously working on another copy in the Fiji script editor. The scripting is done in Jython. Up until now for my plugin, I have been using pretty basic ImageJ functionality and plugins that are included in the “imagej-1.47.jar” that I have added as a library to the project (they also come included with Fiji). The problem arises when dealing with plugins that are not already part of the “imagej-1.47.jar”.

For example, getting the jar file for the plugin Fractional Splines Wavelets and putting them in the plugin folder makes them appear in the Plugins menu of the Fiji gui on restarting. But when trying to import them from my plugin script in the Fiji editor by typing the command:

Macro_Runner.run("Fractional Splines Wavelets" ,"Transform")

Or

Macro_Runner.runMacroFromJar("Fractional_Splines_Wavelets.jar" , "Transform")

I get a message saying "TypeError: run(): self arg can't be coerced to ij.plugin.Macro_Runner". When trying to import the plugins from my eclipse Jython script, I have to add the two jar files as independent libraries to my project (and thus they can not be imported from the ij.plugin package). I was successful in importing the packages inside “Fractional_Splines_Wavelets.jar” by using the commands:

import fractsplinewavelets_gui    
import  imageware
import fractsplinewavelets

But I am unable to run the whole plugin like you can from the Fiji gui. I am hoping that someone would be able to shed some light on how to import and run these external plugins that are not an intrinsic part of the ImageJ plugins package from a script. Thanks

Haider