Posted by
Maurice Oscarson on
Apr 16, 2014; 5:04pm
URL: http://imagej.273.s1.nabble.com/weka-trainable-segmentation-in-java-code-tp5007325.html
Hello,
I've used the GUI-based Trainable Weka Segmentation plugin in ImageJ (Fiji)
to train a classifier. I've then saved the model and would like to apply
that classifier to other data sets in a non-GUI environment. There was a
posting on this list that showed how to run the classifier using a
beanshell script that I've followed to create Java code. This code works,
in that I can apply the classifier to other data sets in a non-GUI
environment and get output, but I don't get output that matches the output
I get if I load and apply the model within the GUI plugin. The code I'm
using is
ImagePlus image = IJ.openImage("image-file-to-be-classified.tif");
WekaSegmentation ws = new WekaSegmentation(image);
ws.loadClassifier("saved-model-file.model");
ImagePlus output = ws.applyClassifier(image, 0, false);
IJ.save(output, "output.tif");
output.close();
image.close();
It is my understanding that the model should contain the features, etc.
used on the training set. Are there other settings or configurations that I
need to account for in the Java code so the output matches the output from
the GUI?
Thanks!
Maurice
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html