Re: Problem Macro Recording
Posted by
Michael Schmid on
Apr 11, 2017; 2:14pm
URL: http://imagej.273.s1.nabble.com/Problem-Macro-Recording-tp5018507p5018508.html
Hi Adrián,
you can use something like the following:
title = getTitle();
run("Split Channels");
selectWindow(title+" (blue)");
close();
selectWindow(title+" (red)");
close();
selectWindow(title+" (green)");
// process the green channel
Note that '+' serves as string concatenation operator in the macro
language (as it does in Java and Javascript).
For more info on macro programming, see
https://imagej.nih.gov/ij/developer/index.html https://imagej.nih.gov/ij/developer/macro/functions.htmlMichael
________________________________________________________________
On 11/04/2017 15:53, Adrián Villalba wrote:
> Dear all,
>
> I am very new to imageJ,
> I tried to record a Macro like that:
>
> run("Split Channels");
> close();
> selectWindow("IC_5.jpg (red)");
> close();
> selectWindow("IC_5.jpg (green)");
> setAutoThreshold("Moments dark");
> //run("Threshold...");
> setAutoThreshold("Moments dark");
> //setThreshold(82, 255);
> setOption("BlackBackground", false);
> run("Convert to Mask");
> run("Close");
> run("Erode");
> run("Analyze Particles...", "size=200-Infinity show=[Overlay Masks] display
> exclude clear summarize in_situ");
>
>
> But when i try to re-use again, it does not work with other pictures
> because of IC_5.jpg error name. I know this is a very basic question. Could
> anyone help me? Thank you in advance!
>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html