Apply macro on selected images in Output area

In this subforum specific Topics concerning ZEN Core, e.g workbenches, are discussed
Post Reply
Fredrik Olsson
Posts: 9
Joined: Mon May 25, 2020 9:53 am

Apply macro on selected images in Output area

Post by Fredrik Olsson »

Hi,

I can apply a macro easily on all opened images in the output area by using Zen.Application.GetAllOutputParameters. However, if I use my mouse and select only a few images in the output area, is there then a way to get hold on only those images, so that I can apply my macro only on them?

Kind regards
Fredrik Olsson
CarlZeissMicroscopy3
Posts: 107
Joined: Wed May 20, 2020 10:10 am

Re: Apply macro on selected images in Output area

Post by CarlZeissMicroscopy3 »

Hello Fredrik Olsson,

sorry, but this is not possible as

Zen.Application.GetAllOutputParameters()

has no connection to the layer representing the images etc.

But it is certainly a good feature so I will put it up for internal discussion.
CarlZeissMicroscopy3
Posts: 107
Joined: Wed May 20, 2020 10:10 am

Re: Apply macro on selected images in Output area

Post by CarlZeissMicroscopy3 »

Hello Fredrik Olsson,

starting with Zen Core 3.4 the command

Zen.Application.GetFreeModeSelectedOutputParameters()

will be available.

So the following lines of code will handle all selected images:

Code: Select all

selectedOutputParameters = Zen.Application.GetFreeModeSelectedOutputParameters()

print OutputParameters.Count

for selectedOutputParameter in selectedOutputParameters:
    zenImage = selectedOutputParameter.Value
    print zenImage.Name
Zen Core 3.4 is planned to be released in February 2022.

Thank you for your contribution!
Fredrik Olsson
Posts: 9
Joined: Mon May 25, 2020 9:53 am

Re: Apply macro on selected images in Output area

Post by Fredrik Olsson »

Perfect!

BR
Fredrik Olsson
Post Reply