Code: Select all
#######################################################
## M E A S U R E M E N T A N D A N A L Y S I S
##
## Macro name: Analyze several images and save data to file
## Required files: round1.czi, round2.czi, round.czias
##
## LOAD IMAGE ANALYSIS SETTING, LOAD IMAGE,
## Analyze THE IMAGE WITH DIRECT DATA STORAGE BUT WITHOUT DATA EMBEDDING,
## SHOW CUMULATED DATA LISTS
##
#######################################################
##
##
## Remove all open documents
Zen.Application.Documents.RemoveAll()
##
## Load measurement program
ias=ZenImageAnalysisSetting()
ias.Load("round.czias")
##
## activate IO library
from System.IO import File, Directory, FileInfo
##
## define path and file type
path = "C:\\OAD\\Input\\ZVI Images\\Round"
files = Directory.GetFiles(path,"*zvi")
##
## loop over all ZVI images in the folder
for i in range(0,files.Length):
file = files[i]
fileInfo = FileInfo(file)
PathAndFile = path + "\\" + fileInfo.Name
image = Zen.Application.LoadImage(PathAndFile,False)
# The following command has to be activated, if each image should be displayed
Zen.Application.Documents.Add(image)
## Measure automatically (Run Silent Large File) without data embedding
## Overwrite existing datalist for first image
if i == 0:
Zen.Analyzing.AnalyzeToFile(image,ias,'C:\\OAD\\Output\\CSV Tables','round',False)
else:
Zen.Analyzing.AnalyzeToFile(image,ias,'C:\\OAD\\Output\\CSV Tables','round',True)
## Close image (otherwise it cannot be deleted in explorer)
image.Close()
##
## show cumulated region data list
fldTable = Zen.Application.LoadTable('C:\\OAD\\Output\\CSV Tables\\roundClasses1.csv')
Zen.Application.Documents.Add(fldTable)
##
## show cumulated regions data list
regTable = Zen.Application.LoadTable('C:\\OAD\\Output\\CSV Tables\\roundClass1.csv')
Zen.Application.Documents.Add(regTable)
##
#######################################################