Login  Register

Re: Problem Macro Recording

Posted by CARL Philippe (LBP) on Apr 11, 2017; 2:12pm
URL: http://imagej.273.s1.nabble.com/Problem-Macro-Recording-tp5018507p5018509.html

Dear Adrián,
Your code applies only to the specific picture named "IC_5.jpg" (i.e. the one open while you were using the recorder).
Thus in order to generalize your code, just add a:
pictureName = getTitle();
to get the opened picture name and then later use:
selectWindow(pictureName + " (green)");
selectWindow(pictureName + " (red)");
My best regards,
Philippe

Philippe CARL
Laboratoire de Biophotonique et Pharmacologie
UMR 7213 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

-----Message d'origine-----
De : ImageJ Interest Group [mailto:[hidden email]] De la part de Adrián Villalba
Envoyé : mardi 11 avril 2017 15:54
À : [hidden email]
Objet : Problem Macro Recording

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!

--

   - Adrián Villalba Felipe.
   https://es.linkedin.com/in/adrianvillalba

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

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