How can I extract a binary mask from the image analysis wizard in Zen 2?

Share your programming ideas for various measurement and analysis tasks here
Post Reply
user-14
Posts: 3
Joined: Thu Jan 01, 1970 1:00 am

How can I extract a binary mask from the image analysis wizard in Zen 2?

Post by user-14 »

Hi OAD/Analysis forum,

Regarding Zen 2 Image analysis.

I see we have all the tools to do segmentations as single processing steps and here we have the option to create a binary mask.
However, I do not see the analogous function possible from within the analysis wizard.

In other forum posts- I see that we can accept an external mask images into a analysis scipt, so I assume we can extract our binary
mask quite easily in a script or after the fact on files that have been analyzed.

1.) Idea 1 make a macro that starts an analysis scrip and captures the binary mask from that run- saving it independently.

2.) Idea 2 -Actually feature request #1. Make a check box to create the binary mask after the final segmentation steps.
It seems that the binary mask is actually on the final image but it will only work as long as no text is output from the measure features on the image. Since that text seems to become part of the graphic as well. See the next related feature request below

3.) Feature request #2 - I am hoping there is a way for customize the output font for text labels from measured "Feature" paramters that are drawn on the image For example "field level" counts that come out with the final segmented image appaear as a white font that is hard to read
apepars to be locked together with the semented areas in this final output image.

Thanks for any input.

Tim Pratt
user-3185
Posts: 3
Joined: Thu Jan 01, 1970 1:00 am

Extract mask from image analysis wizard

Post by user-3185 »

Since the question above was first posted, has it become possible to extract the binary mask generated by the image analysis wizard? This would be an extremely useful tool for selecting objects based on parameters other than size so they could be further processed and analyzed.
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

Hello,

have you tried something like

Code: Select all

ias=ZenImageAnalysisSetting()
ias.Load("MyImageAnalysisSetting")

im0 = Zen.Application.Documents.ActiveDocument

im1=ZenImage()
im2=ZenImage()
im3=ZenImage()

Zen.Analyzing.AnalyzeToImage(im0, im1,ias,ZenAnalyzerLabelImageMode.RegionClass,ZenAnalyzerLabelImageInitMode.Default)
Zen.Analyzing.AnalyzeToImage(im0, im2,ias,ZenAnalyzerLabelImageMode.RegionClassColor,ZenAnalyzerLabelImageInitMode.Default)
Zen.Analyzing.AnalyzeToImage(im0, im3,ias,ZenAnalyzerLabelImageMode.RegionMaximum,ZenAnalyzerLabelImageInitMode.Default)

Zen.Application.Documents.Add(im1)
Zen.Application.Documents.Add(im2)
Zen.Application.Documents.Add(im3)
I hope that 'playing' with the parameters gives you the result needed.
Post Reply