#######################################################
## A C Q U I S I T I O N
##
## SNAP IMAGE, SAVE IMAGE
##
#######################################################
##
##
## Remove all open documents
Zen.Application.Documents.RemoveAll()
##
## Show live image
Zen.Acquisition.StartLive()
## Set exposure time (AutoExposure)
Zen.Acquisition.AutoExposure()
Zen.Application.Pause("Search field of interest and focus image!")
## Snap image
image = Zen.Acquisition.AcquireImage()
Zen.Application.Documents.Add(image)
## Close live image
Zen.Acquisition.StopLive()
##
## Save the image interactively with Save as dialog (File menu)
Zen.Application.Save(image)
##
#######################################################
#######################################################
## SOME ALTERNATIVES TO SAVE AN IMAGE
##
#######################################################
##
## Save an image in a certain folder automatically
#Zen.Application.Save(image,'C:\\OAD\\Output\\CZI Images\\MyImage.czi')
##
## Save an image in a certain folder interactively
#Zen.Application.Save(image,'C:\\OAD\\Output\\CZI Images\\MyImage.czi',True)
##
#######################################################
sorry, but you cannot call the python script directly and there is no API to get the image from the camera. ZEN 'in between' is always needed and ZEN itself relies on other mechanisms 'underneath'.
When I use this to save tiff files, they are 8bit tiffs. However the camera (and software) is acquiring 16bit images. Is there another function call or option to specify the image output resolution?
# Generate a container for the SingleFileExportSetting
functionsetting = Zen.Processing.Utilities.Settings.SingleFileExportSetting()
# Load the SingleFileExportSetting that has been saved before by the user via ZEN-GUI
functionsetting.Load(‘MySeting”,ZenSettingDirectory.User)
# Prepare Filename
fileName = image.Name.Substring(0,image.Name.Length-4)
# Execute the Export-Function for an Image with a given SingleFileExportSetting
Zen.Processing.Utilities.ExportSingleFile(image,functionsetting,fileName,newPath)
I would like to automatically repeat the 1-3) processes below:
1) Acquire an image
2) Save the image
3) Close the image
I tested
###
while i < nRepeat:
image = Zen.Acquisition.Execute(exp)
Zen.Application.Save(image)
Zen.Application.Documents.RemoveAll()
image.Close()
i = i + 1
###
, but it seems that the memory usage by ZEN gradually increases with repeating. This results in a significant delay in the system after hundreds of repeats. I suspect that the memory is not completely released after the image is closed. Do you have any solutions? Thanks.