UU-cellbiology / ComDet

ImageJ plugin detecting and colocalizing particles of given size (vesicles, dots, etc on biological microscopy images)
GNU General Public License v3.0
13 stars 4 forks source link

Plugin not properly scriptable(?) #5

Closed nyaray closed 2 years ago

nyaray commented 2 years ago

While helping my girlfriend out with a few python scripting things from within FIJI and reading the source of your plugin I found that the run(String arg) function in the Detect_Particles class completely ignores the arguments given in the arg string. This prevents the plugin from being used in a script properly as one has to manually click through the dialogs to provide the plugin with the arguments required for it to run. Is this by design because you're supposed to script in some other way or just something you've not gotten around to implementing because you haven't needed it yourself yet?

https://github.com/ekatrukha/ComDet/blob/6ab9b177cd2372d5347ab9e4dbc979e9ea149a97/src/main/java/fiji/plugin/ComDet/Detect_Particles.java#L58

ekatrukha commented 2 years ago

Hi Emilio,

Since it is an implementation of ImageJ's Plugin class, it is automatically scripted. Do you write FIJI macro using Python (Jython)? Then try the following script:

from ij import IJ  
IJ.run("Detect Particles", "ch1i ch1l ch1a=4 ch1s=5 rois=Ovals add=Nothing summary=Append");

The specifics of the second line (which defines input parameters in the second string variable) you can get if you first activate macro recording (Plugins->Macros->Record...) and run ComDet on some example image. Macro recorder window will show you run("...") command with specific parameter names/values that later you can change and run in the script window. Hope it helps, let me know if it works for you.

Cheers, Eugene