Using Blow/Lasso Tool in a macro

Hi everyone!

I am creating an ImageJ macro to help doctors segment medical images for an internal project in my lab. We want to use the Blow/Lasso Tool in the Segmentation plugin, but I have found impossible to set the only option that it has: ratio space/color.

I have tried to use macro options, macro recorder, run and call functions, but I can’t find this… I believe that if I find the Lasso class in the ImageJ API, then I should be able to use the method ‘setRatioSpaceColor’ to change this value…

Can anybody help me with this?
I’m using FIJI (v1.52o) on Fedora 28.
Thanks in advance :wink:

Hi @mancaldel,

Here’s the source, and here’s the api of the Lasso Tool.

I found the source by typing “lasso” into the fiji search bar, then clikcing the Source button. Don’t see the option you need, but I’m not familiar with the tool.

Hope this helps,
John

2 Likes

WoW! Thanks for the ultra-fast reply @bogovicj !! :smiley:

I didn’t notice there’s a different API for FIJI. Thanks a lot!!
However, I still get errors when I run the macro. I tried to use a method without arguments for simplicity:

call("fiji.plugin.Lasso_.getToolName");

which throws the following error:

Error:	Could not load class fiji.plugin.Lasso_ in line 1:
	var ; initializeSciJavaParameters ( ) ; call ( "fiji.plugin.Lasso_.getToolName" <)> ; 

I’ve tried different class methods using Lasso and Lasso_. I also tried using fiji or ij in the call… But nothing.
I’ll keep trying tomorrow, it’s already 22:50 and I should go home sometime… haha

1 Like

@mancaldel

Happy to help :slight_smile:

I’m not super savvy with the imagej macro language, but if you’re willing to try groovy or beanshell, the following should work:

success = ij.gui.Toolbar.getInstance().setTool("Lasso/Blow Tool");

I’m US east coast, so we’ll be out-of-phase, but now at least you have something to try in the morning.

John