Login  Register

Re: Antwort: Extended Depth of Field (EDF) plugin with batch mode

Posted by Aryeh Weiss on Oct 02, 2014; 7:49pm
URL: http://imagej.273.s1.nabble.com/Extended-Depth-of-Field-EDF-plugin-with-batch-mode-tp3700708p5009878.html

On 10/2/14, 10:16 PM, Pulceblue wrote:
> I'm interested in doing the same, however, the macro recorder only outputs
> the string "Run("Easy mode...")" which does not let you to tune the
> parameters of the plugin for the projection.
> Any idea as how to do that?
>
>
>
>

This is an  example of something that worked for me:

       run("Extended Depth of Field (Easy mode)...", "quality='0'
topology='0' show-topology='off' show-view='off'");

I think that I found it documented in the EDF documentation.

I needed a way to force the macro to wait for EDF to finish and return an image.

Here is the entire code segment that does this:

// the following block is executed if the Extended Depth of Focus plugin
is selected
if (matches(processingMethod, "EDF")) {
     run("Extended Depth of Field (Easy mode)...", "quality='0'
topology='0' show-topology='off' show-view='off'");
// The following code is required in order to wait for the the EDF
plugin to finish, and open the expected image.
// We must wait for a window called "Output" . Batch mode cannot be
true, because if so the window will not open.
     initTime = getTime();
     oldTime = initTime;
     while (!isOpen("Output")) {
         elapsedTime = getTime() - initTime;
         newTime = getTime() - oldTime;
// print something every 10 seconds so that we will know it is still alive
         if (newTime > 10000) {
             oldTime = getTime();
             newTime = 0;
             print(elapsedTime/1000, " seconds elapsed");
         }
     }
wait(1000); // let's really make sure that window is open -- give it
another second
selectImage("Output");
rename("edfImage");
edfTitle = getTitle();
}

--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