ZEISS Axioscan 7 czi files

Your place to discuss general handling of images and the CZI file format
Matthias Kirsch
Posts: 4
Joined: Thu Jun 02, 2022 1:46 pm

ZEISS Axioscan 7 czi files

Post by Matthias Kirsch »

Dear all,

we are faced with the following problem.
We obtained a ZEISS Axioscan 7 Slide Scanner and wanted to use it to scan slides of serial histological sections, aiming at using them for 3D reconstruction. Now, as the specimens are fairly large and we would like to do the reconstruction with a decent resolution, the resulting files are fairly large (as czi 0.5 GB, as tif >5 GB, ie. some 60.000x40.000 pixels in a typical image). I have found no application so far to handle images this size. We would need to register/align e.g. 100 of such images and then do 3D-reconstruction. While there are applications such as QuPath which can read the czi-format, they cannot be used for registration.
Lacking any programming skills, I would greatly appreciate if somebody could give me a hint or suggest a solution.

Thanks and best,
Matthias
CarlZeissMicroscopy3
Posts: 180
Joined: Wed May 20, 2020 10:10 am

Re: ZEISS Axioscan 7 czi files

Post by CarlZeissMicroscopy3 »

Hello Matthias Kirsch,

as far as I understand your situation, you need something to register/align/stitch (the latter in Zen blue) your images.
The 3D reconstruction etc. can be done by other software, as they can read and handle czi-files.

In the simple case of one single file, the file is e.g. opened (being the active image).
Then the macro

Code: Select all

image = Zen.Application.ActiveDocument
Zen.Processing.Transformation.Geometric.Stitching(image)
stitches all the tiles.

If there are many files in a directory a loop is needed

Code: Select all

from System.IO import File, Directory

path = 'C:\\Users\\....\\'

files = Directory.GetFiles(path,"*.czi")

for file in files:
    image = ZenImage()
    image.Load(file)
    Zen.Processing.Transformation.Geometric.Stitching(image)
    image.Save()
Note that just a 'simple stitching' has been demonstrated.
If specific stitching is needed it is possible to call Stitching with additional parameters.
Matthias Kirsch
Posts: 4
Joined: Thu Jun 02, 2022 1:46 pm

Re: ZEISS Axioscan 7 czi files

Post by Matthias Kirsch »

Dear CarlZeissMicroscopy3,

maybe I was not completely clear:
The czi-files produced by the Scanner are already stichted. They are some 500 MB big (as czi). When saved as tif, they are almost 8 GB in size. Registering/aligning them would have to be done outside ZEN (at least I am not be aware that Zen can do that).
This is the step, where I am stuck.

Best,
Matthias
CarlZeissMicroscopy3
Posts: 180
Joined: Wed May 20, 2020 10:10 am

Re: ZEISS Axioscan 7 czi files

Post by CarlZeissMicroscopy3 »

While there are applications ... which can read the czi-format
Hello Matthias Kirsch,

I just would like to add that the registration information is saved within the czi-format.

Therefore it sounds to me that reading may be not 100% correct.
Matthias Kirsch
Posts: 4
Joined: Thu Jun 02, 2022 1:46 pm

Re: ZEISS Axioscan 7 czi files

Post by Matthias Kirsch »

Dear CarlZeissMicroscopy3,

I do not understand why it is so difficult to get a helpful answer, but maybe I have not formulated the problem clearly, so I try again:
100 serial paraffin sections have been imaged with a Zeiss Slidescanner Axioscan7 at 20x
This yielded 100 czi-files, each about 500 MB in size
The task now: how do I assemble them into an aligned z-stack

Obviously, we have been sold with a Zen-package, which cannot do this. As far as I can tell the Zen-Connect version we have is not capable of doing this automatically. Using 3rd party tools is not really what we want. We were expecting Zen could do this for us. After all we invested quite some bucks in the system.

So I would really appreciate to get step-by-step instructions how do do what I have outlined above, even if we have to aquire additional software modules, training etc. We have many more series to produce z-stacks from.

Best,
Matthias
CarlZeissMicroscopy3
Posts: 180
Joined: Wed May 20, 2020 10:10 am

Re: ZEISS Axioscan 7 czi files

Post by CarlZeissMicroscopy3 »

Hello Matthias Kirsch,

ok, you want ot build a ZStack and finally register the ZStack.

Code: Select all

# Read files from directory
from System.IO import File, Directory
path = 'C:\\Users\\...\\Pictures\\ZStackAlignment\\'
files = Directory.GetFiles(path,"*.czi")

# Sort them alphabetically
fileList = []
for file in files:
    fileList.append(file)
fileList.sort()

# Build your ZStack
z = 0
ZStack=ZenImage()

for file in fileList:
    imageAdd = ZenImage()
    imageAdd.Load(file)
    ZStack.AddSubImage(imageAdd, 0,0, z)
    imageAdd.Close()
    z = z + 1

# Save your ZStack
ZStack.Save(path + 'ZStack\\ZStack.czi')
Zen.Application.Documents.Add(ZStack)

# Align your ZStack
ZStackAligned = Zen.Processing.Transformation.Geometric.ZStackAlignment(ZStack, ZenThirdProcessingDimension.None, ZenRegistrationMethod.Translation, ZenInterpolation.Linear, ZenRegistrationQuality.High, False)

# Save your aligned ZStack
ZStackAligned.Save(path + 'ZStack\\ZStackAligned.czi')
Zen.Application.Documents.Add(ZStackAligned)
Most probably you will have to adjust the parameters of
Zen.Processing.Transformation.Geometric.ZStackAlignment(...)
according to your needs.

This is a forum for OAD (Open Application Development) so I can just can give you some hints how you may solve your problem via a macro etc.

Especially in your case I must add that there is no experience in such huge amounts of data on my side as far as performace etc. is concerned.

Please contact ZEISS sales to obtain the Macro environment (OAD), which should run on your Zen blue, and get further information on other alternatives.
Matthias Kirsch
Posts: 4
Joined: Thu Jun 02, 2022 1:46 pm

Re: ZEISS Axioscan 7 czi files

Post by Matthias Kirsch »

Dear ...

Thank you! I will try.

Matthias
otis jame
Posts: 2
Joined: Mon Jan 16, 2023 5:59 am

Re: ZEISS Axioscan 7 czi files

Post by otis jame »

CarlZeissMicroscopy3 wrote: Fri Jun 03, 2022 10:30 am Hello Matthias Kirsch,

as far as I understand your situation, you need something to register/align/stitch (the latter in Zen blue) your images.
The 3D reconstruction etc. can be done by other software, as they can read and handle czi-files.

In the simple case of one single file, the file is e.g. opened (being the active image). wordle
Then the macro

Code: Select all

image = Zen.Application.ActiveDocument
Zen.Processing.Transformation.Geometric.Stitching(image)
stitches all the tiles.

If there are many files in a directory a loop is needed

Code: Select all

from System.IO import File, Directory

path = 'C:\\Users\\....\\'

files = Directory.GetFiles(path,"*.czi")

for file in files:
    image = ZenImage()
    image.Load(file)
    Zen.Processing.Transformation.Geometric.Stitching(image)
    image.Save()
Note that just a 'simple stitching' has been demonstrated.
If specific stitching is needed it is possible to call Stitching with additional parameters.
Very clearly, I have tried and it's work. Many thanks.
Charles Hollis
Posts: 1
Joined: Tue May 23, 2023 10:10 am

Re: ZEISS Axioscan 7 czi files

Post by Charles Hollis »

The images and graphics in the avatar game are great. You can refer to them.
helen dam
Posts: 2
Joined: Tue May 30, 2023 10:33 am

Re: ZEISS Axioscan 7 czi files

Post by helen dam »

Image Processing Software: Consider using professional image processing software such as ImageJ/Fiji, MATLAB, or Python libraries like OpenCV or scikit-image. These tools have powerful capabilities for ovo game handling large images, performing image registration/alignment, and carrying out 3D reconstruction.
Post Reply