I want to set an image label using the GUI but can't find any obvious way to do it.
It is easy to set an image label via the macro language using the command setMetadata("Label", "My Image Label"); But how can I do the same via the GUI, using the built in menus? Besides adding a new label, I would like to edit it if there is already a label present. There is already a menu choice Stack - Tools - Set Label... which does exactly what I want, but that works only for stacks. Perhaps this could be generalized to work on single images too? It seems that there is no difference behind setting a label to an image or a stack slice since the same macro command is used in both cases. In a macro, if you add a label to a single image, and then add a new slice; the original image label becomes the slice label of slice 1. This is already the expected behaviour, so I just miss the ability to do this (add the single image label) via the GUI. As the following macro shows, there is no difference in the result if you use setMetadata("Label", ...) or run("Set Label...", ...) but the latter does not work for images, only stacks. newImage("New Image", "8-bit white", 400, 400, 1); setMetadata("Label", "My Label for Slice 1"); run("Add Slice"); setMetadata("Label", "My Label for Slice 2"); newImage("New Stack", "8-bit white", 400, 400, 2); setSlice(1); run("Set Label...", "label=[My Label for Slice 1]"); setSlice(2); run("Set Label...", "label=[My Label for Slice 2]"); newImage("New Image", "8-bit white", 400, 400, 1); run("Set Label...", "label=[My Label for Slice 1]"); //does not work run("Add Slice"); run("Set Label...", "label=[My Label for Slice 2]"); My suggested solution is to allow the run("Set Label..." command work on single images too, not only stacks. As the above example shows, the result will be the same. Then the "Set Label..." menu choice will work via the GUI too. Stein -------------------------------------------------------------------------------- -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
With the HAND tool selected do a right click onto the image and select
RENAME... from the context menu On 13.02.2019 14:16, Stein Rørvik wrote: > I want to set an image label using the GUI but can't find any obvious way to do it. > It is easy to set an image label via the macro language using the command > setMetadata("Label", "My Image Label"); > > But how can I do the same via the GUI, using the built in menus? Besides adding a new label, I would like to edit it if there is already a label present. > > There is already a menu choice Stack - Tools - Set Label... which does exactly what I want, but that works only for stacks. Perhaps this could be generalized to work on single images too? > > It seems that there is no difference behind setting a label to an image or a stack slice since the same macro command is used in both cases. In a macro, if you add a label to a single image, and then add a new slice; the original image label becomes the slice label of slice 1. This is already the expected behaviour, so I just miss the ability to do this (add the single image label) via the GUI. > > As the following macro shows, there is no difference in the result if you use setMetadata("Label", ...) or run("Set Label...", ...) but the latter does not work for images, only stacks. > > newImage("New Image", "8-bit white", 400, 400, 1); > setMetadata("Label", "My Label for Slice 1"); > run("Add Slice"); > setMetadata("Label", "My Label for Slice 2"); > > newImage("New Stack", "8-bit white", 400, 400, 2); > setSlice(1); > run("Set Label...", "label=[My Label for Slice 1]"); > setSlice(2); > run("Set Label...", "label=[My Label for Slice 2]"); > > newImage("New Image", "8-bit white", 400, 400, 1); > run("Set Label...", "label=[My Label for Slice 1]"); //does not work > run("Add Slice"); > run("Set Label...", "label=[My Label for Slice 2]"); > > My suggested solution is to allow the run("Set Label..." command work on single images too, not only stacks. > As the above example shows, the result will be the same. > Then the "Set Label..." menu choice will work via the GUI too. > > Stein > > -------------------------------------------------------------------------------- > > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
That renames the image, not the label.
-----Original Message----- From: ImageJ Interest Group <[hidden email]> On Behalf Of Peter Haub Sent: 13. februar 2019 14:32 To: [hidden email] Subject: Re: How to set and edit the image label via GUI With the HAND tool selected do a right click onto the image and select RENAME... from the context menu On 13.02.2019 14:16, Stein Rørvik wrote: > I want to set an image label using the GUI but can't find any obvious way to do it. > It is easy to set an image label via the macro language using the > command setMetadata("Label", "My Image Label"); > > But how can I do the same via the GUI, using the built in menus? Besides adding a new label, I would like to edit it if there is already a label present. > > There is already a menu choice Stack - Tools - Set Label... which does exactly what I want, but that works only for stacks. Perhaps this could be generalized to work on single images too? > > It seems that there is no difference behind setting a label to an image or a stack slice since the same macro command is used in both cases. In a macro, if you add a label to a single image, and then add a new slice; the original image label becomes the slice label of slice 1. This is already the expected behaviour, so I just miss the ability to do this (add the single image label) via the GUI. > > As the following macro shows, there is no difference in the result if you use setMetadata("Label", ...) or run("Set Label...", ...) but the latter does not work for images, only stacks. > > newImage("New Image", "8-bit white", 400, 400, 1); > setMetadata("Label", "My Label for Slice 1"); run("Add Slice"); > setMetadata("Label", "My Label for Slice 2"); > > newImage("New Stack", "8-bit white", 400, 400, 2); setSlice(1); > run("Set Label...", "label=[My Label for Slice 1]"); setSlice(2); > run("Set Label...", "label=[My Label for Slice 2]"); > > newImage("New Image", "8-bit white", 400, 400, 1); > run("Set Label...", "label=[My Label for Slice 1]"); //does not work > run("Add Slice"); > run("Set Label...", "label=[My Label for Slice 2]"); > > My suggested solution is to allow the run("Set Label..." command work on single images too, not only stacks. > As the above example shows, the result will be the same. > Then the "Set Label..." menu choice will work via the GUI too. > > Stein > > ---------------------------------------------------------------------- > ---------- > > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Sorry! You are right.
On 13.02.2019 15:16, Stein Rørvik wrote: > That renames the image, not the label. > > -----Original Message----- > From: ImageJ Interest Group <[hidden email]> On Behalf Of Peter Haub > Sent: 13. februar 2019 14:32 > To: [hidden email] > Subject: Re: How to set and edit the image label via GUI > > With the HAND tool selected do a right click onto the image and select RENAME... from the context menu > > On 13.02.2019 14:16, Stein Rørvik wrote: >> I want to set an image label using the GUI but can't find any obvious way to do it. >> It is easy to set an image label via the macro language using the >> command setMetadata("Label", "My Image Label"); >> >> But how can I do the same via the GUI, using the built in menus? Besides adding a new label, I would like to edit it if there is already a label present. >> >> There is already a menu choice Stack - Tools - Set Label... which does exactly what I want, but that works only for stacks. Perhaps this could be generalized to work on single images too? >> >> It seems that there is no difference behind setting a label to an image or a stack slice since the same macro command is used in both cases. In a macro, if you add a label to a single image, and then add a new slice; the original image label becomes the slice label of slice 1. This is already the expected behaviour, so I just miss the ability to do this (add the single image label) via the GUI. >> >> As the following macro shows, there is no difference in the result if you use setMetadata("Label", ...) or run("Set Label...", ...) but the latter does not work for images, only stacks. >> >> newImage("New Image", "8-bit white", 400, 400, 1); >> setMetadata("Label", "My Label for Slice 1"); run("Add Slice"); >> setMetadata("Label", "My Label for Slice 2"); >> >> newImage("New Stack", "8-bit white", 400, 400, 2); setSlice(1); >> run("Set Label...", "label=[My Label for Slice 1]"); setSlice(2); >> run("Set Label...", "label=[My Label for Slice 2]"); >> >> newImage("New Image", "8-bit white", 400, 400, 1); >> run("Set Label...", "label=[My Label for Slice 1]"); //does not work >> run("Add Slice"); >> run("Set Label...", "label=[My Label for Slice 2]"); >> >> My suggested solution is to allow the run("Set Label..." command work on single images too, not only stacks. >> As the above example shows, the result will be the same. >> Then the "Set Label..." menu choice will work via the GUI too. >> >> Stein >> >> ---------------------------------------------------------------------- >> ---------- >> >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Stein Rørvik
> On Feb 13, 2019, at 8:16 AM, Stein Rørvik <[hidden email]> wrote:
> > I want to set an image label using the GUI but can't find any obvious way to do it. > It is easy to set an image label via the macro language using the command > setMetadata("Label", "My Image Label"); > > But how can I do the same via the GUI, using the built in menus? Besides adding a new label, I would like to edit it if there is already a label present. > > There is already a menu choice Stack - Tools - Set Label... which does exactly what I want, but that works only for stacks. Perhaps this could be generalized to work on single images too? With the latest daily build (1.52m17), the Image>Stacks>Tools>Set Label and Image>Stacks>Tools>Remove Slice Labels commands work with single images. Also, with single images, the slice label is now shown in the subtitle. -wayne > It seems that there is no difference behind setting a label to an image or a stack slice since the same macro command is used in both cases. In a macro, if you add a label to a single image, and then add a new slice; the original image label becomes the slice label of slice 1. This is already the expected behaviour, so I just miss the ability to do this (add the single image label) via the GUI. > > As the following macro shows, there is no difference in the result if you use setMetadata("Label", ...) or run("Set Label...", ...) but the latter does not work for images, only stacks. > > newImage("New Image", "8-bit white", 400, 400, 1); > setMetadata("Label", "My Label for Slice 1"); > run("Add Slice"); > setMetadata("Label", "My Label for Slice 2"); > > newImage("New Stack", "8-bit white", 400, 400, 2); > setSlice(1); > run("Set Label...", "label=[My Label for Slice 1]"); > setSlice(2); > run("Set Label...", "label=[My Label for Slice 2]"); > > newImage("New Image", "8-bit white", 400, 400, 1); > run("Set Label...", "label=[My Label for Slice 1]"); //does not work > run("Add Slice"); > run("Set Label...", "label=[My Label for Slice 2]"); > > My suggested solution is to allow the run("Set Label..." command work on single images too, not only stacks. > As the above example shows, the result will be the same. > Then the "Set Label..." menu choice will work via the GUI too. > > Stein -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |