Login  Register

Re: how can I call/execute/run a trained weka classifier from an ImageJ macro?

Posted by Ignacio Arganda-Carreras on Feb 05, 2013; 4:58pm
URL: http://imagej.273.s1.nabble.com/how-can-I-call-execute-run-a-trained-weka-classifier-from-an-ImageJ-macro-tp5001668p5001675.html

Hello Dionysios,

Have you tried running that command in a terminal? Did that work?

ignacio

On Tue, Feb 5, 2013 at 6:42 AM, Kota Miura <[hidden email]> wrote:

> Hi Dionysios,
>
> there is a detailed documentation on usages of call(...) function in macro
> for Advanced Weka Segmentation plugin.
>
>
> http://fiji.sc/wiki/index.php/Advanced_Weka_Segmentation#Macro_language_compatibility
>
> HTH,
>
> Cheers.
> Kota
>
> On Tue, Feb 5, 2013 at 12:01 PM, Dionysios Lefkaditis
> <[hidden email]>wrote:
>
> > Hi everybody!
> >
> > What I am trying to do is to classify an image using a trained WEKA
> model.
> > I am well aware of the existence of the Advanced Weka Segmentation plugin
> > of ImageJ/Fiji, but I am using a custom-made feature vector, which will
> not
> > work with it.
> >
> > Anyway, within an ImageJ macro I am trying to execute:
> >
> > exec("java", "-cp", "/home/dionysis/weka-3-7-7/weka.jar",
> > "weka.classifiers.trees.RandomForest",  "-T",
> > "/home/dionysis/Desktop/CNH/cnh-data/2class-deffeat-data-20121218.arff",
> > "-l",
> >
> "/home/dionysis/Desktop/CNH/cnh-data/2class-deffeat-ranfor-classifier-20121218.model.model",
> > "-p", "0", ">", "/home/dionysis/Desktop/testrun-data.out");
> >
> > which in essence is running the terminal command for weka. In the linux
> > terminal this is running fine, however, calling it within the macro it
> > doesn't do anything. It does not even produce an error.
> >
> > In the beginning, I thought the problem was that I was trying to run a
> > java program on the system's JVM called from a java program running on a
> > different JVM (ImageJ/Fiji are bundled with their own JVM). For this
> > reason, I tried running ImageJ/Fiji using the system's JVM, but no luck.
> >
> > I am also considering using the embedded weka of the Advanced Weka
> > Segmentation plugin through the call() macro function, but I do not know
> > how to proceed.
> >
> > Does anybody have any hints on this? I would greatly appreciate it...
> > Thanks!
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
>
>
> --
>
> -------------------------------------------------------------*Dr. Kota
> Miura*
>
> Scientist & IT Engineer
> Centre for Molecular and Cellular Imaging,
> European Molecular Biology Laboratory
> Meyerhofstr. 1
> 69117 Heidelberg
> GERMANY
>
> Tel +49 6221 387 404
>
> Mobile +49 160 95001177
>
> Fax +49 6221 387 512
>
> http://cmci.embl.de
> -------------------------------------------------------------
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Ignacio Arganda-Carreras, Ph.D.
Seung's lab, 46-5065
Department of Brain and Cognitive Sciences
Massachusetts Institute of Technology
43 Vassar St.
Cambridge, MA 02139
USA

Phone: (001) 617-324-3747
Website: http://bioweb.cnb.csic.es/~iarganda/index_EN.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html