Change in .czi tile info metadata after upgrade to Zeiss Lightsheet 7

Dear @OMETeam,

our Zeiss Lightsheet Z1 has been upgraded to the new Zeiss Lightsheet 7, and with it came some changes in the Zen software. One such change addressed how the Zen software handles a tiled acquisition, which also leads to a change in the metadata of the czi that concerns the tiles, and hence Bio-Formats (tested v.6.6.0) does not recognize the tiles as individual series anymore.
As a consequence, our downstream processing (BigStitcher) that relies on Bio-Formats fails.

I have uploaded a small (~1.8 GB) .czi dataset (ID 165676) to your web server here:
https://demo.openmicroscopy.org/webclient/?show=image-165676

and for temporary direct download here (valid until 2021-03-17):
https://filesender.switch.ch/filesender/?vid=1f1bcf93-359d-57a9-0b6d-0000161937c2

It contains: 4 tiles, 16 z, 2 channels, 2 illuminations, 1 time point and 1 angle.

I also contacted Zeiss and have asked for more information about where exactly the tile info and stage coordinates can now be found in the czi, but its also likely that I might not fully understand the details.
However, let me know in case there are specific questions that you have, and I’ll be happy to relay them to Zeiss in case you don’t have a direct contact.

On that note, tagging in @sebi06 from Zeiss, in case there is something that he can chip in on (thanks Sebi!)

Thank you for your help!

Hi @CellKai,

I’m also interested in this issue, but I can’t download the dataset. Should I create an account to download the file ?

Best,

Nico

hi @NicoKiaru ,
thank you for your interest. I have edited the original post and added a direct download link

1 Like

Hi all,

did you try to deactivate the CZI Autostitch option inside the BF Plugin configuration for CZI and also deactivated the Stitch Tile inside the BF Options dialog?

In BigSticher, are you using the Bio-Formats loader or the czi loader ?

Not that I know the answer, but was is the CZI Loader vs. BioFormats (CZIReader)?

Hi both @sebi06 @NicoKiaru,

thank you for your quick answers and comments!

When the option “Autostitch” in the Bio-Formats plugin configuration for Zeiss czi is UNticked, then Bio-Formats can indeed access the tiles as individual series, and the ome-xml also notes different stage coordinates for each series.

However, during dataset definition in BigStitcher when using the “Zeiss Lightsheet Z.1 Dataset loader (Bioformats)”, it still only “sees” 1 tile instead of 4. It is also this loader that I have used previously. Is this the “CZI loader” @NicoKiaru, mentioned, or is there another one that I am missing?
I also now tested with the Automatic Loader (Bioformats based), but its the same issue, it recognizes only 1 tile instead of 4.

Hi all,

I just open your image in ZEN Blue 3.3 and in Fiji (up-to-date) and it looks OK to me.

I can reproduce this as well. I didn’t know Bio-Formats could autostitch.

And yes, you’re using the CZI image loader which internally uses Bio-Formats, but it adds additional metadata for positioning multi angle datasets.

I guess this could be solved either by Zeiss (I don’t know how), or also in BigStitcher by disabling the autostitching property after instantiating a ZeissCZIReader.

Maybe relevant : bioformats/ZeissCZIReader.java at 783707e56e3f6609f5e7c8a4e5d07e0164a0c949 · ome/bioformats · GitHub

@OMETeam

If you look for the method serReaderOptions you can see an example code how to set those options for the bioformats reader.

So those changes must be done inside the BigStitcher code.

2 Likes

You may try instead to replace this line:

by the following:

ZeissCZIReader r = new ZeissCZIReader();
		MetadataOptions options = r.getMetadataOptions();
		if (options instanceof DynamicMetadataOptions) {
			((DynamicMetadataOptions) options).setBoolean(
					ZeissCZIReader.ALLOW_AUTOSTITCHING_KEY, false);
		} else {
			System.out.println("What's wrong?");
		}
		return new ChannelSeparator(r);// new ZeissCZIReader();

My attempt was unsuccessful:

I get this error:

Using spimdata version: 0.9-revision
Using multiview-reconstruction version: reconstruction-0.10.3-SNAPSHOT
3
Investigating file 'C:\Users\nico\Downloads\SmalltileandZ.czi'.
Querying information for angle/tile #0
Missing key Information|Image|V|View|SizeZ #1 in LZ1 metadata
Missing key Information|Image|V|View|SizeZ #1 in LZ1 metadata
Missing key SizeZ|View|V|Image|Information #1 in LZ1 metadata
Missing key SizeZ|View|V|Image|Information #1 in LZ1 metadata
An error occured parsing the main meta data: java.lang.RuntimeException: Could not read stack size for angle 0, stopping.. Stopping.
Failed to analyze file.
Defining multi-view dataset failed.

I’m not sure I’m going in the right direction. I give up for now.

Maybe @StephanPreibisch or @hoerldavid have an idea ?

Hmmm…

It looks the software expects some keys inside the metadata which cannot be found? Is this the same CZI from the download above?

Because there BioFormats did correctly recognize everything.

Hi @NicoKiaru

I changed your code suggestion a little bit, using the ZeissCZIReader.

The issue however persists and I get the same log error. Only one tile instead of four tiles is recognized.

code line 368:

	public static IFormatReader instantiateImageReader()
	{
		// should I use the ZeissCZIReader here directly?
		ZeissCZIReader r = new ZeissCZIReader();
		MetadataOptions options = r.getMetadataOptions();
		if (options instanceof DynamicMetadataOptions) {
			((DynamicMetadataOptions) options).setBoolean(
					ZeissCZIReader.ALLOW_AUTOSTITCHING_KEY, false);
		} else {
			System.out.println("What's wrong?");
		}
		r.setMetadataOptions(options);
		
		return r; //new ChannelSeparator(r);
	}

log:

3
Investigating file '/home/kai/Downloads/SmalltileandZ.czi'.
Querying information for angle/tile #0
Missing key Information|Image|V|View|SizeZ #1 in LZ1 metadata
Missing key Information|Image|V|View|SizeZ #1 in LZ1 metadata
Missing key SizeZ|View|V|Image|Information #1 in LZ1 metadata
Missing key SizeZ|View|V|Image|Information #1 in LZ1 metadata
An error occured parsing the main meta data: java.lang.RuntimeException: Could not read stack size for angle 0, stopping.. Stopping.
Failed to analyze file.
Defining multi-view dataset failed.

Edit #1:
I saw that in the Fiji consol, a lot of metadata from the .czi is printed, including the correct tiling setup:

'Experiment|AcquisitionBlock|TilesSetup|PositionGroup|TileAcquisitionMode #1': CenteredGrid
'Experiment|AcquisitionBlock|TilesSetup|PositionGroup|TileAcquisitionOverlap #1': 0.10000000000000001
'Experiment|AcquisitionBlock|TilesSetup|PositionGroup|TilesX #1': 2
'Experiment|AcquisitionBlock|TilesSetup|PositionGroup|TilesY #1': 2

Edit #2:
Explicitly set the setMetadataOptions and return the ZeissCZIReader with options

Too bad.
Do you need multi angle position ? I can try something in case you don’t care about multi angle positions.

thank you for offering :),
But actually, the problem is only about the tiles.
Dataset definition is working fine for different angles, already without any changes to the code.