data zone

In this subforum specific Topics concerning ZEN Core, e.g workbenches, are discussed
Post Reply
Julien Toquant
Posts: 23
Joined: Fri May 29, 2020 1:54 pm

data zone

Post by Julien Toquant »

Hi,

I would like to export a multi-position image as single scene images, with burnt-in annotations and data zone.
I have 2 issues I cannot fix:
- I don't know how to keep the comment in the data zone of the multi-scene image and don't know how to export the data zone with the image
- annotations are not kept after splitting scenes (I can insert a new scalebar automatically but I cannot keep/find the annotations drawn in the multi-scene image)

Can you help me please?
Thanks.

Here my code:

Code: Select all

from System.IO import File, Directory, FileInfo

# read active image
image = Zen.Application.ActiveWorkbench.GetDefaultInputValue()
# split scenes and save files in temp folder
path = 'C:\\Temp\\'
Zen.Processing.Utilities.SplitScenes(image,path,ZenCompressionMethod.None,True,True)
# define export path
window = ZenWindow()
Images = Zen.Application.Environment.GetFolderPath(ZenSpecialFolder.Images)
window.AddFolderBrowser('exportfolder','Export folder                    ',Images)
result=window.Show()
exportpath = str(result.GetValue('exportfolder'))

# export all scenes with data zone
files = Directory.GetFiles(path,'*.czi') 
for i in range(0,files.Length): 
    file = files[i] 
    fileInfo = FileInfo(file) 
    pathAndFile = path + "\\" + fileInfo.Name
    image = Zen.Application.LoadImage(pathAndFile,False)
    # insert scalebar
    image.InsertDefaultScaleBarGraphic()
    # burn-in graphics
    newimage = image.BurnInGraphics()
    # fetch image name from splitted scenes
    imagename = exportpath + "\\" + image.NameWithoutExtension + ".jpg"
    # save single scenes
    newimage.Save(imagename, 100,ZenSaveCompressionMode.AsIs,ZenCompressionMethod.None)
    image.Close()
    newimage.Close()
    
    
Steven Byers
Posts: 1
Joined: Fri Jan 12, 2024 11:19 am
Contact:

Re: data zone

Post by Steven Byers »

Sorry, but I'm not very knowledgeable about exporting images from multiple locations as a single scene image. Maybe you should ask the experts about this
Post Reply