Login  Register

Re: weka segmentation in batch mode

Posted by Aryeh Weiss on Mar 21, 2014; 6:11am
URL: http://imagej.273.s1.nabble.com/weka-segmentation-in-batch-mode-tp5007024p5007025.html

On 3/21/14, 7:52 AM, William Menegas wrote:

> Hello,
>
> I was wondering if anyone could give me some advice on using "Weka
> Segmentation" in headless mode or in a normal session of fiji in batch
> mode. I am using:
>
> ...
> run("Trainable Weka Segmentation");
> call("trainableSegmentation.Weka_Segmentation.loadClassifier",
> "/path/classifier.model");
> call("trainableSegmentation.Weka_Segmentation.getProbability");
> selectWindow("Probability maps");
> ...
>
> The problem is that fiji doesn't seem to want to wait for the
> classification. I tried inserting "wait(100000)" before
> "selectWindow("Probability maps"), but it didn't help and I don't think
> there was even a wait.
>
> Any help would be much appreciated!
> Will
>
> --
> ImageJ mailing list:http://imagej.nih.gov/ij/list.html
>
I had a similar problem with the EDF plugin. Here is a quote form that post:

> The problem I have is that the macro does not wait for EDF to finish,
> and EDF can take a while.
> My solution to this is based on the fact that EDF creates a window
> called "Output". so I did the following:
>
> initTime = getTime();
> while ( !isOpen("Output") ) {
>     elapsedTime = getTime() - initTime;
>     if (elapsedTime%10000 == 0) {
>         print(elapsedTime/1000, " seconds elapsed");
>         wait(10);
>     }
>
> which works (as  long as there is no other window called "Output"). I
> print an occasional reminder that the macro is still alive within this
> wait loop.

I posted this as a question, wondering if there is a better way to do
it. I did not receive any reply, so perhaps in a macro this is the way
to go. You should replace "Output" with "Probability maps".

--aryeh

--
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051


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