Zen Blue 'Polygon Contour' Tile Region Setup in Macro

Discuss macros to control the hardware functions of your ZEISS microscope
Post Reply
user-4843
Posts: 11
Joined: Thu Jan 01, 1970 1:00 am

Zen Blue 'Polygon Contour' Tile Region Setup in Macro

Post by user-4843 »

I'm working on automatation for a Zeiss Axio Observer Z1 with motorized xy table. I record an overview image and automatically segment it into interesting regions which I then import into a python macro in the OAD environment of Zen Blue as a list of contour points for every segmented region.

I'd like to create a tiling setup using the freehand polygon with these contour points to let Zen do the tiling for me. I.e. as If I chose "Acquisition-->Tiles-->Advanced Setup -->Tile Region Setup--> Polygon contour" but I want to create the polygon from my contour point list.

Is this possible, and if so how can I do this?

Thanks a lot in advance,
Dominic
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

I'd like to create a tiling setup using the freehand polygon with these contour points
Hello Dominic,

sorry, but you cannot do these steps directly.

As I worked on a similar project there might exist an ‘alternative’:

Go to the ‘advanced setup’ and draw e.g. 2 polygon contours. Now you can export the whole ‘Tiles Experiment’ by selecting File/Tiles/Export Tiles Experiment. Open this file with the editor and you will discover that it is an xml file. Among other things you will find the <Points> of the <Contour Type="Polygon">. You most probably have seen that you can import these kind of files as well.

So my try would be to generate such a file form the existing contour points, import it into the experiment and finally start the experiment.

I hope this helps ...
user-4843
Posts: 11
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4843 »

dear Mr. moderator,

thank you for your suggestions, It is an interesting approach, however I have some follow up questions now.

I think this is the relevant part of the .czsh exportet tile experiment that you were refering to.

Code: Select all

    <TileRegion Name="generated TR1" Id="12345">
      <CenterPosition>4235.245,64.049</CenterPosition>
      <ContourSize>1425.092,8390.429</ContourSize>
      <Columns>1</Columns>
      <Rows>6</Rows>
      <Z>7000</Z>
      <TemplateShapeId></TemplateShapeId>
      <IsUsedForAcquisition>true</IsUsedForAcquisition>
      <IsProtected>false</IsProtected>
      <AreSupportPointsOutsideContourAllowed>false</AreSupportPointsOutsideContourAllowed>
      <PreferSupportPointsZ>false</PreferSupportPointsZ>
      <Contour Type="Polygon">
        <Points>-2081.595,-224.172 -1521.166,-1985.521 496.38,-2321.779</Points>
      </Contour>
      <SupportPoints />
    </TileRegion>
I generated a file where I generated two <TileRegion> tags based on the above template inside the <TileRegions> tag.
I replaced
-Name by some string
-Id by a random number
-Points by my point list

I didn't touch the other values like Center Position, Contour Size,...

Questions: what values am I supposed to change here? What Values get updated automatically within ZEN? How is "Id" used within the ZEN program? Can I generate an arbitrary numer of regions like this (worked with one or two so far)?

When I import it with "File --> Tiles --> Import Tiles Experiment", It looks Ok-ish:

Question: How can I automatically do this import from within the macro?

Rows, Columns and the Tiling seen to be updated acording to my new polygon outlines, depending on the selected objective. However, when I press "start Preview Scan", only the first region "generated TR2" gets recorded as shown in the screenshot. I develop on a simulated environment with an axiocam 105 color and a simulated stage, that's why every image looks the same.

The attachment zen_tile_exp1.jpg is no longer available
Questions: How Can I get Zen to record both regions? How can I trigger this from within the python macro?


Thanks for your time answering my Questions,

best,
Dominic
Attachments
zen_tile_exp1.jpg
zen_tile_exp1.jpg (16.83 KiB) Viewed 3557 times
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

Hello Dominic,

we investigated your case together with the development-team but could not reproduce it. We also copied your TileRegion that you posted into a czsh file and the Preview Scan worked from the start for all regions. We used ZEN 2.0.0.10 to test your case. The number means ZEN 2 with Hotfix 10 available at Download . Please let us know when you have checked your situation and you still have problems.

Your next question was how you can automatically use the regions that you have put in the czsh file. There is again no ‘direct way’ to do this but the workaround is not too complicated. As you import a ‘Tiles Experiment’ into your experiment the data from the czsh file is copied to the czexp xml-file of your Experiment. So please have a look at your experiment czexp file with an editor and you will find the <SampleHolder> element which corresponds with the <SampleHolder> element of your czsh file. Just replace this part and you get an experiment with your regions that you can execute from a macro.
Marsha Cox
Posts: 2
Joined: Mon Nov 06, 2023 9:20 am

Re: Zen Blue 'Polygon Contour' Tile Region Setup in Macro

Post by Marsha Cox »

nice XD
Post Reply