I received some very nice microscopes from you -two Axio Imagers and one Axio Observer- as well as licenses of Zen Blue ranging from version 3.3 to 3.6.
I would like to modify an existing Zen experiment from my macro such that it acquires 100 laterally adjacent individual fields of view with no overlap (10 along X by 10 along Y) centered around a given X,Y,Z position. For each field of view, an image based autofocus shall be executed. Further, I would like to save each field of view in a separate file. Finally, I would also be able to access their metadata like autofocus quality, autofocus duration and Z position to control whether the object was correctly found.
Current situation
At this point, I am simply running over all positions and at each position, I run tile_image = Zen.Acquisition.Execute(experiment). The experiment has "software autofocus" as autofocus strategy.
When manually defining a Zen Tile experiment of 100 tiles (with AF for every tile), I have remarked that the duration of the acquisition was reduced by around 40% with respect to my current macro.
1) Is that in line with your expectations? How does it come? What is the best way to speed up the scanning?
This is why I am investigating scanning with a dedicated scan experiment as a Tile Region experiment or a Position experiment.
Issue faced with Tile Region experiments
My attempt with Tile Region experiments looks as follow:
Code: Select all
exp = Zen.Acquisition.Experiments.GetByName("tiles.czexp")
exp.ClearTileRegionsAndPositions(0)
exp.AddRectangleTileRegion(0,
region_center[0],
region_center[1],
width,
height,
region_center[2])
tile_region = Zen.Acquisition.Execute(exp)
Zen.Application.Save(tile_region, tile_region_filename)
tile_region.Close()
The actual image is saved in temp folder of AutoSavePath of Saving tab of Tools/Options menu.
2) Can you help me properly saving a Tile region in the destination folder I choose?
When I open the image saved in the temp folder, I face another issue: I don't know how to split up the file in its individual tiles.
3) Can you help me saving the tiles of a tile region separately as individual files?
Issue faced with Positions experiments
My attempt with Positions experiments looks as follow:
Code: Select all
exp = Zen.Acquisition.Experiments.GetByName("tiles.czexp")
exp.ClearTileRegionsAndPositions(0)
for i in range(n_tiles):
exp.AddSinglePosition(0,
Zen.Devices.Stage.ActualPositionX,
Zen.Devices.Stage.ActualPositionY + i * width_field_of_view,
Zen.Devices.Focus.ActualPosition)
positions_image = Zen.Acquisition.Execute(exp)
Zen.Application.Save(positions_image, positions_image_filename)
positions_image.Close()
The actual images are saved in temp folder of AutoSavePath of Saving tab of Tools/Options menu.
4) Can you help me properly saving the individual field of view in the destination folder I choose?
5) Furthermore, is there a way to define a grid of positions with one single Zen function?
Accessing the metadata
As mentioned above, I would like to access the metadata of the individual fields of view for quality control.
At this point, it is based on next code line.
Code: Select all
xml_metadata = image.Metadata.Xml
Mit freundlichen Grüßen,
Adrien