Writing macros
Posted by sm2300 on Jul 29, 2011; 2:41pm
URL: http://imagej.273.s1.nabble.com/Writing-macros-tp3683693.html
I got this handy macro from the listserve for overlaying plot profiles
// ---------- Start Macro --------------
// Three Color Overlay Plot of a Line
run("Fluorescent Cells (400K)");
run("Profile Plot Options...", "width=450 height=200 minimum=0
maximum=255 fixed interpolate draw");
makeLine(226, 166, 327, 464);
run("Plot Profile");
run("Invert");
rename("red");
selectWindow("FluorescentCells.tif");
setSlice(2);
run("Plot Profile");
run("Invert");
rename("green");
selectWindow("FluorescentCells.tif");
setSlice(3);
run("Plot Profile");
run("Invert");
rename("blue");
run("Merge Channels...", "red=red green=green blue=blue gray=*None*
create keep");
// ---------- End Macro --------------
But how do I write the macro so that I can do the same thing on multiple image files. So here its opening the sample image FluorescentCells. I know I can just create the macro to start after I've opened the image I want to work on but then what about the line 'selectWindow("FluorescentCells.tif")?
Thanks
Sonya