Re: Labeling stacks
Posted by
Rasband, Wayne (NIH/NIMH) [E] on
Jan 12, 2013; 6:00am
URL: http://imagej.273.s1.nabble.com/Labeling-stacks-tp5001374p5001383.html
On Jan 11, 2013, at 11:02 AM, Julien Vaubourgeix wrote:
> Hi,
>
> I have a movie, for which I would like to add labels that differ from stack to the other -- For example, from stack 1 to 10, label "A", from stack 11 to 20, label "B", etc...it seems that the Image>Stacks>Label command does not support such an editing process.
Here is macro that non-destructively labels images 1-10 of a stack with "A", images 11-20 with "B" etc.
start = 1;
index = 0;
while (start<=nSlices) {
range = ""+start+"-"+(start+9);
label = fromCharCode(charCodeAt("A",0)+index);
run("Label...", "format=Text x=50 y=100 font=80 text=&label range=&range use");
start += 10;
index++;
}
It requires the ImageJ 1.47i daily build. It will work (drawing destructive labels) with earlier versions of ImageJ if you remove the 'use' ("Use overlay") option in the 6th line. Staring with the 1.47i daily build, the Image>Stacks>Label command no longer deletes any existing overlay when the "Use overlay" option is enabled.
-wayne
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html