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...
Change active camera
-
- Posts: 180
- Joined: Wed May 20, 2020 10:10 am
Re: Change active camera
Hello Antonin Riera,
you can specify the camera in an experiment in the subwindow 'Channels'.
Save the experiment as 'MyExperiment'.
in the macro use:
you can specify the camera in an experiment in the subwindow 'Channels'.
Save the experiment as 'MyExperiment'.
in the macro use:
I hope this works for you.myExperiment = Zen.Acquisition.Experiments.GetByName('MyExperiment')
myExperiment .SetActive()
image = Zen.Acquisition.AcquireImage(myExperiment)
-
- Posts: 1
- Joined: Fri Apr 14, 2023 3:48 am