Hi.
If I have a report module after an OAD module, how should I save my table/image or how should I make use of setoutputvalue/setdefaultoutputvalue in order to let the subsequent report module fetch the image/table?
Best regards
Fredrik Olsson
How to fetch image/table from OAD workflow module into a template report?
Hello Fredrik Olsson,
to supply the imput for the report you have to set the output of the OAD module like
To be able to link the image or table placeholders of the report to the output of the OAD-Module you have to run the workflow until the OAD module has set the values.
Now the output values are available in Zen Core and the report can be configured. After opening the report it should be possible to select the data in the placeholders so that the output parameters of the OAD module are linked to the placeholders.
to supply the imput for the report you have to set the output of the OAD module like
Code: Select all
## set result table as output
Zen.Application.ActiveWorkbench.SetOutputValue(table,'1')
## set org image as output
Zen.Application.ActiveWorkbench.SetOutputValue(image,'2')
Now the output values are available in Zen Core and the report can be configured. After opening the report it should be possible to select the data in the placeholders so that the output parameters of the OAD module are linked to the placeholders.
Hi,
It works as intended if I do something like:
ftable = ZenTable()
"add something into tabel"
Zen.Application.ActiveWorkbench.SetOutputValue(ftable,'1') #It shows up in report
image1 = ZenImage(2500,2200,ZenPixelType.Gray8,200)
Zen.Application.ActiveWorkbench.SetOutputValue(image1,'2') #It shows up in report
They will show up in the report. However I do not manage to see the image if it is "created" like:
image2 = Zen.Acquisition.AcquireImage()
Zen.Application.ActiveWorkbench.SetOutputValue(image2,'3') #It does not show up in report. I can not select it.
My solution is then to use an intermediate step:
image1 = Zen.Acquisition.AcquireImage()
image2 = ZenImage()
image2.AddSubImage(image1,0,0,0)
Zen.Application.ActiveWorkbench.SetOutputValue(image2,'4') #It shows up.
Kind regards
Fredrik Olsson
It works as intended if I do something like:
ftable = ZenTable()
"add something into tabel"
Zen.Application.ActiveWorkbench.SetOutputValue(ftable,'1') #It shows up in report
image1 = ZenImage(2500,2200,ZenPixelType.Gray8,200)
Zen.Application.ActiveWorkbench.SetOutputValue(image1,'2') #It shows up in report
They will show up in the report. However I do not manage to see the image if it is "created" like:
image2 = Zen.Acquisition.AcquireImage()
Zen.Application.ActiveWorkbench.SetOutputValue(image2,'3') #It does not show up in report. I can not select it.
My solution is then to use an intermediate step:
image1 = Zen.Acquisition.AcquireImage()
image2 = ZenImage()
image2.AddSubImage(image1,0,0,0)
Zen.Application.ActiveWorkbench.SetOutputValue(image2,'4') #It shows up.
Kind regards
Fredrik Olsson
Yes, we beed to fix that!
An alterantive would be to save the image first.
In many cases the image has to be saved anyway.
An alterantive would be to save the image first.
In many cases the image has to be saved anyway.
Code: Select all
## Define image file
docPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)
OADimage = 'OADimage.czi'
## Combine path and file
pathAndFile = Path.Combine(docPath,OADimage)
##
[B]imageA = Zen.Acquisition.AcquireImage()
imageA.Save(pathAndFile)
imageA = Zen.Application.LoadImage(pathAndFile)[/B]
##
## set image as output for report
Zen.Application.ActiveWorkbench.SetOutputValue(imageA,'1')