Change workbench by means of OAD

In this subforum specific Topics concerning ZEN Core, e.g workbenches, are discussed
user-6033
Posts: 89
Joined: Thu Jan 01, 1970 1:00 am

Post by user-6033 »

Hi,

I have tried : Zen.Application.ActiveWorkbench.SetDefaultOutputValue(Image)

But in my created job, which has the interactive workbench after an OAD workbench then there is no avaible image to work with. In free mode there is the activedocument workspace and on the right side there is the output workspace. However, when I am in a workflow there is only the activedocument area visible, there is no output area on the right side. Since the activedocument area gets cleared after an OAD workbench but not after a non-oad-workbench I found it difficult tp pass the image to a non-oad workbench such as interactive measurements.


Zen.Application.ActiveWorkbench.GetDefaultInputValue() - works fine when I have it in an OAD workbench.


Best regards

Fredrik Olsson
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

in my created job, which has the interactive workbench after an OAD workbench, there is no avaible image to work with
My first job consists of three workbenches

1 Load Image
2 Macro
3 Interactive Measurement

Code: Select all

image = Zen.Application.ActiveWorkbench.GetDefaultInputValue()

Zen.Application.Pause(image.Name)

Zen.Application.ActiveWorkbench.SetDefaultOutputValue(image)
My second job consists of two workbenches

1 Macro
2 Interactive Measurement

Code: Select all

image = ZenImage()

image.Load(r"C:\Users\MyName\Pictures\MyImage.czi")

Zen.Application.Pause(image.Name)

Zen.Application.ActiveWorkbench.SetDefaultOutputValue(image)
in both cases 'Interactive Measurement' shows an image!
user-6033
Posts: 89
Joined: Thu Jan 01, 1970 1:00 am

Post by user-6033 »

Hi,

We have Zen 2 Core v2.5 with hotfix 4.

With a similar workflow as below, there is no problem. Everything shows up fine, but then I have pre-set measurements which I used when I created my interactive workbench. The problems arises when I uses Events in redraw mode, which I find more interesting since normally I want to do the measurement at runtime of my workflow. Other features like line and markers behaves as usual but events is unstable. I can either set up my interactive workbench with an empty Events which forces me to use redraw and add the event markers. I can also use whatever I have in my interactive workbench and at runtime by myself add new elements so that I extend the set of elements with new ones. Lines and marker - no problems. New events may occasionally show up but not if they are picked last.

Workflow 1.
1 Load Image
2 Interactive Measurement ('Empty Events') #Forces me to redraw new events
3 Macro (MeasureToTable, SetDefaultOutputValue(table))

Workflow 2.
1 Load Image
2 Interactive Measurement (Line, Line, Events, Marker) - No problem. But try to add extra elements at runtime in the workflow, like Line followed by Events.

3 Macro (MeasureToTable, SetDefaultOutputValue(table))


Best regards
Fredrik Olsson
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

I think we can reproduce your case.

If you add Events 'at the end' in Run Mode the GUI expects that you give a sing so that the addition (collection) of Events is finished.

This is done by clicking the right mouse button. :)

... we will try to fix this ...
user-6033
Posts: 89
Joined: Thu Jan 01, 1970 1:00 am

Post by user-6033 »

Events works perfectly now. Thanks for the help!!!

Best regards
Fredrik Olsson
user-6033
Posts: 89
Joined: Thu Jan 01, 1970 1:00 am

Post by user-6033 »

Hi,

I have no problems either when passing the image to the next workbench if I first load it (in an ordinary workbench or in a macro) or if I snap it in an ordinary workbench. However, if I snap it within a macro and then try to pass it to the next workbench it fails. See the example below. One may use a save-load intermediate step but since I still do not have any workaround for applying a grid on a loaded image (without using the documents.add step) it would be better if I could pass an image which is snapped within a macro since there I can apply the grid.


For example:

1 .Macro
2. Interactive workbench


Code:

image = Zen.Acquisition.StartLive()
Zen.Application.ActiveDocument = image
snap = Zen.Acquisition.AcquireImage()
Zen.Application.Pause('Wait')
Zen.Application.ActiveWorkbench.SetDefaultOutputValue(snap)
Zen.Acquisition.StopLive()


Kind regards
Fredrik Olsson
user-6033
Posts: 89
Joined: Thu Jan 01, 1970 1:00 am

Post by user-6033 »

Any update on passing image from macro to subsequent workbench when image is acquired within the macro?

For example:

1 .Macro
2. Interactive workbench


Code:

image = Zen.Acquisition.StartLive()
Zen.Application.ActiveDocument = image
snap = Zen.Acquisition.AcquireImage()
Zen.Application.Pause('Wait')
Zen.Application.ActiveWorkbench.SetDefaultOutputVa lue(snap)
Zen.Acquisition.StopLive()


Best regards
Fredrik Olsson
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

Yes, this bug has been fixed!

The improvement will come with the next Hotfix ...
Post Reply