Problems with getting trainableSegmentation to work in BeanShell

Hello,
I have been using the Trainable Weka Segmentation tool for a few months now. I have now begun attempting to write a script to automate segmentation. However, we have run into many problems. None of the example scripts work for us.

Here is our code:

import trainableSegmentation.*;
import ij.ij.FileSaver;
import ij.IJ;
import ij.ImagePlus;

input = IJ.openImage("test.tif");

segmentator = new WekaSegmentation( input );

We get the following warning:

[WARNING] Ignoring unsupported output: result [trainableSegmentation.WekaSegmentation]

Any help would be appreciated. Thanks.

-Kaz

Hello @kedmond and welcome to the ImageJ forum!

That bad? Where are you running them from? The Script Editor?

I see. I reproduced your script on my machine and got the same warning in the console. I believe it is completely harmless. It is only there because your script does not return any regular output, like an image.

Can you please tell me which problems you have with the scripts in the plugin documentation?

2 Likes

Thanks for the reply! I figured out how to run a Beanshell script, and control the Weka tool, more or less. I’m very new to Javascript, and programming in ImageJ.

Thanks again for replying, but I think I’ve got my issues sorted for now. It just took a lot of trial and error…and Googling.

1 Like

It’s good to hear. Let me know if you have any doubt!