Login  Register

rename slices

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

rename slices

Martin Höhne
41 posts
Dear list,

I´m looking for a way to rename the slices of a stack (in a macro) but can´t find it.

What I mean is changing the info one gets with
getInfo("slice.label");

A work around would be to duplicate each slice separately with the new slice label as title and after each slice is duplicated recombine the images again into a stack with
run("Images to Stack", "name=newstackname title=[] use");

But is there an easier way to do this?

Thanks,
Martin
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: rename slices

Michael Schmid
2136 posts
Hi Martin,

did you try setMetadata("Label", string) ?

From: http://rsb.info.nih.gov/ij/developer/macro/functions.html#setMetadata

setMetadata("Label", string)
Sets string as the label of the current image or stack slice. The first 60 characters, or up to the first newline, of the label are displayed as part of the image subtitle. The labels are saved as part of the TIFF header.

(note that "Label" is a constant; your label goes into the 'string' variable)

Michael
________________________________________________________________
On Aug 14, 2012, at 11:00, Martin Höhne wrote:

> Dear list,
>
> I´m looking for a way to rename the slices of a stack (in a macro) but can´t
> find it.
>
> What I mean is changing the info one gets with
> getInfo("slice.label");
>
> A work around would be to duplicate each slice separately with the new slice
> label as title and after each slice is duplicated recombine the images again
> into a stack with
> run("Images to Stack", "name=newstackname title=[] use");
>
> But is there an easier way to do this?
>
> Thanks,
> Martin
>
>
>
>
> --
> View this message in context: http://imagej.1557.n6.nabble.com/rename-slices-tp4999754.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: rename slices

Martin Höhne
41 posts
Hi Michael,

thank you! Exactely what I was looking for. I did not find that because I was looking for a command containing "slice".

Martin