Login  Register

Re: Is it normal to use a wait() instruction after a command

Posted by ERIC on Feb 11, 2015; 3:13pm
URL: http://imagej.273.s1.nabble.com/Is-it-normal-to-use-a-wait-instruction-after-a-command-tp5011551p5011568.html

It works : Specifing the name of the image that the LoG plugin produces
makes the wait()  unnecessary.

Thank you all for your suggestion.

a=getTitle();
run("Gaussian Blur...", "sigma=1 stack");
run("LoG 3D", "sigmax=3 sigmay=3 sigmaz=0 displaykernel=0 volume=0");
selectWindow("LoG of "+a);
run("8-bit");





Eric Denarier
Grenoble Institut des Neurosciences
Inserm U836
Chemin Fortuné Ferrini
38700 La Tronche
France


Tél :33 (0)4 56 52 05 38
Fax :33 (0)4 56 52 06 57

http://neurosciences.ujf-grenoble.fr/

Le 11/02/2015 12:14, Gabriel Landini a écrit :

> On Wednesday 11 Feb 2015 09:42:41 Eric Denarier wrote:
>> Hi John and Gabriel,
>> Thank you for your answers. Here is an example of the macro that behaves
>> differently if wait(1000) is removed.
>> It runs on the original image instead of running on the LoG of the Image.
>> Enclosed a stack to run the macro.
> Not sure what this macro should do, but I think that the difference in result
> has to do with the program assuming that is processing the right image, while
> it is not doing so.
> If you specify what is the result of the LoG3 and select that as the current
> image then I think it behaves as without the "wait":
>  
> a=getTitle();
> run("Gaussian Blur...", "sigma=1 stack");
> run("LoG 3D", "sigmax=3 sigmay=3 sigmaz=0 displaykernel=0 volume=0");
> selectWindow("LoG of "+a);
> run("8-bit");
> run("Invert", "stack");
> setOption("BlackBackground", true);
> run("Convert to Mask", "method=Intermodes background=Dark black stack");
> selectWindow("LoG of "+a);  // this line might no be necessary now
> run("Duplicate...", "title=Avant duplicate range=nSlices");
> run("Duplicate...", "title=Apres duplicate range=nSlices");
> run("Delete Slice");
> run("Divide...", "value=255 stack");
>
>
> Perhaps IJ is not getting the current image correctly, or the LoG3 plugin is
> not returning the image on time. Not sure, but I think the above resolves it.
>
> Cheers
> Gabriel
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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