Change active camera

Discuss macros to control the hardware functions of your ZEISS microscope
Post Reply
Antonin Riera
Posts: 1
Joined: Wed Oct 28, 2020 4:30 pm

Change active camera

Post by Antonin Riera »

Even after loading hardware settings, the active camera under the "Locate" doesn't change on the Imager Z2. How could it be changed through macro?

Edit:
My issue was due to the macro calling:
image = Zen.Acquisition.AcquireImage()

I solved the problem by modifying to:
experiment = ZenExperiment(r"$myexperiment$")
experiment.SetActive()
image = Zen.Acquisition.AcquireImage(experiment)

Now, instead of taking pictures under the Locate widget, it does it in Acquisition which doesn't care what the active camera set under the Locate widget is. I looked into the Macro ObjectModel Doc and I can only a getter for the ActiveCamera Property which suggests that it's something you can only change manually...
CarlZeissMicroscopy3
Posts: 180
Joined: Wed May 20, 2020 10:10 am

Re: Change active camera

Post by CarlZeissMicroscopy3 »

Hello Antonin Riera,

you can specify the camera in an experiment in the subwindow 'Channels'.
Save the experiment as 'MyExperiment'.

in the macro use:
myExperiment = Zen.Acquisition.Experiments.GetByName('MyExperiment')

myExperiment .SetActive()

image = Zen.Acquisition.AcquireImage(myExperiment)
I hope this works for you.
Odysay Schnapp
Posts: 1
Joined: Fri Apr 14, 2023 3:48 am

Re: Change active camera

Post by Odysay Schnapp »

I have a mistake somewhere. But dino game finally works
Post Reply