Skip to content

Multiscale export docs #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion documentation/basics/dataselection.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ This must be a full URL including protocol.
When you click "Check", ilastik will try to obtain image metadata from the given address, and display the results of the request.
If the dataset is stored on the local filesystem, you can paste the path into the address field, e.g. `C:\Users\me\Downloads\tissue-gfp.zarr`.
The "Check" button will test whether the path exists on the filesystem and automatically convert it to a `file:///` URL if successful.
Note that this has to be the path to the root of the dataset, i.e. the folder containing the `.zattrs` file, and the folder name has to contain ".zarr".
Note that the folder name has to contain ".zarr".

_Note: ilastik will freeze while waiting for a response. If the server is slow or the connection is bad, it may take a while and your computer might warn that ilastik is not responding._

Expand Down
27 changes: 23 additions & 4 deletions documentation/basics/export.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,31 @@ Besides exporting the images you see in the viewer, ilastik allows to save the r

## Scaling and metadata carryover in OME-Zarr

Since version 1.4.1b22, ilastik can export to the OME-Zarr format.
While OME-Zarr is a multiscale image format, ilastik can only export a single scale for now.
Since version 1.4.1, ilastik can export to the OME-Zarr format, and since version 1.4.2b1, ilastik can scale exports to produce multiscale OME-Zarr datasets.

### Multiscale

When choosing the multiscale export option, the export dialog previews the sizes of the individual scales that will be generated.
The sizes depend on the input dataset and the data type.
Generally, ilastik will generate downscales by a factor of 2 along x, y and z.
The smallest scale is aimed to be roughly 500kB in size before compression (i.e. the entire image fits into one zarr chunk file, with a chunk size aimed at being roughly 500kB).

### Input-matching and metadata carryover

When exporting to OME-Zarr, ilastik will carry over all metadata from the source dataset to the exported dataset.

ilastik will do its best to maintain compatibility with multiscale workflows by matching properties of the exported dataset to the source dataset where possible.

If the source dataset was multiscale (Neuroglancer Precomputed or OME-Zarr), behind the scenes ilastik will match the internal names of the exported scales to the names of the corresponding scales in the input dataset.
This means that if you continue using the exported data in other workflows, the scale names will remain consistent across all exports.
When you take these results into other tools, they may be able to match the data from ilastik to the corresponding scale of the source dataset.
When exporting in multiscale OME-Zarr, the scale sizes will match the input dataset's scales.
If you export only a subregion in multiscale using the "Cutout Subregion" settings, the cutout will be scaled by the same factors as the input dataset.

This means that if you continue using the exported data in other workflows, the scale names and proportions will remain consistent across all exports.
When you take these results into other tools, they may be able to match the data from ilastik to the corresponding scale(s) of the source dataset.

Additionally, if the source dataset was OME-Zarr, ilastik will carry over all pixel resolution metadata from the source dataset to the exported dataset.

### Interpolation

By default, downscaling is done using antialiasing and linear interpolation.
For certain export types where the exact pixel values need to be maintained, nearest-neighbor interpolation is used instead (e.g. for segmentations and labels).
4 changes: 2 additions & 2 deletions documentation/basics/headless.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ To use an OME-Zarr dataset in headless mode, you have to provide the full path t
--project=MyProject.ilp \
https://s3.embl.de/i2k-2020/platy-raw.ome.zarr/s6

If you don't know the scale name, you can use the Input Data set of any ilastik workflow in the GUI to access the "Add multiscale" dialog.
If you don't know the scale name, you can use the Input Data step of any ilastik workflow in the GUI to access the "Add multiscale" dialog.
Paste the root address and click "Check" to see the available scales.
Alternatively, the specific dataset path for each scale is documented in the metadata found in the `.zattrs` file at the multiscale root.
In the above example, this is at `https://s3.embl.de/i2k-2020/platy-raw.ome.zarr/.zattrs`.
If there is no `.zattrs` file in your case, the dataset may be OME-Zarr version 0.5.
In this case, the file is called `zarr.json` instead. OME-Zarr stores in this version are currently not supported by ilastik, however.
This version of the format is not supported in ilastik yet, unfortunately.

## Output Options

Expand Down