Skip to content
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

Export docs: Add OME-Zarr note #281

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
21 changes: 16 additions & 5 deletions documentation/basics/export.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ weight: 5
---
# Exporting the Current View

The current composite view, exactly as shown in the ilastik viewer, can be exported using the "camera" button in the upper right corner of the image viewer.
The current composite view, exactly as shown in the ilastik viewer, can be exported using the "camera" button in the upper right corner of the image viewer.
<div style="float: right; width: 60%" markdown="1">
<a href="screenshots/ilastik_camera_export.png" data-toggle="lightbox"><img src="screenshots/ilastik_camera_export.png" class="img-responsive" /></a>
</div>
You can control exactly which layers are visible and their respective opacity in the layer widget in the lower left corner. This feature is especially useful to produce
videos of tracking or 3D segmentation results, overlayed with raw data. You can use the camera button in any applet of ilastik and export any view that is displayed.
videos of tracking or 3D segmentation results, overlayed with raw data. You can use the camera button in any applet of ilastik and export any view that is displayed.

# Exporting Output

Expand All @@ -30,7 +30,7 @@ In all workflows, there is a designated applet to export results (see, for examp
<a name="data-export-applet-ss" href="screenshots/export-applet.png" data-toggle="lightbox"><img src="screenshots/export_applet_with_source.png" class="img-responsive" /></a>
</div>

The export step is handled through the data export applet in ilastik. In [pixel classification]({{baseurl}}/documentation/pixelclassification/pixelclassification.html), for example, the applet is called "Prediction Export".
The export step is handled through the data export applet in ilastik. In [pixel classification]({{baseurl}}/documentation/pixelclassification/pixelclassification.html), for example, the applet is called "Prediction Export".
The GUI can be used to change export settings as well as to bulk export all of the data. The following controls are available in the panel:

* **Source:** offers a drop-down menu of layers which can be exported. For example, in [pixel classification]({{baseurl}}/documentation/pixelclassification/pixelclassification.html) you can export label probabilities or segmentations.
Expand All @@ -55,7 +55,7 @@ On the right you can see all your datasets listed by their nickname, as defined
- *Renormalize \[min,max\] from:* Use this setting to scale the range of your results. For example, prediction data is typically given a range of \[0.0,1.0\], but you can scale it to the range of \[0,255\] for easy viewing with other software.
- *Transpose to Axis Order:* This setting sets "outermost" and "innermost" axes (and so on). For some formats, this doesn't matter so much (e.g. hdf5). For others, you may care. For example, when exporting a stack of pngs across the Z dimension, make sure 'z' appears on the left (the outer dimension). If you aren't sure, tzyxc is typically a good choice.

**Note:** if you export probability maps (pixelwise prediction results) and want to view them in other software, **convert them to data type "integer 8-bit"** and check the "Renormalize" check box to change the range.
**Note:** if you export probability maps (pixelwise prediction results) and want to view them in other software, **convert them to data type "integer 8-bit"** and check the "Renormalize" check box to change the range.

- **Output File Info:** Use these controls to select an output file format and location. A few _"magic" placeholders_ can be used in these settings. These are useful when you are exporting multiple datasets:
- `{dataset_dir}` - the directory containing the original raw dataset
Expand All @@ -65,7 +65,7 @@ On the right you can see all your datasets listed by their nickname, as defined
- `{x_start}`, `{x_stop}`, `{y_start}`, `{y_stop}`, etc - Specific axis start/stop boundaries for the region-of-interest
- `{slice_index}` - The index of each slice in an exported image sequence (required for all image sequence formats, not allowed with any other format).

- **Exporting sequences:** When a 3D, 4D or 5D dataset is exported as a sequence, ilastik chooses the first axis as the slicing one. For example, if your dataset is 1001x1002x1003 pixels and you choose to export it as an image sequence, it will export 1001 images, 1002x1003 pixels each. This information is displayed in the dialogue if you select a "sequence" output format. To change the slicing axis, use the "Transpose to Axis Order" control to bring the axis you need to the front. Continuing on the 1001x1002x1003 example, assume it had "xyz" as axis order. Now if you want to slice on the z axis (of size 1003), type "zxy" in the "Transpose to Axis Order" control. Now ilastik will export 1003 images, 1001x1002 pixels each.
- **Exporting sequences:** When a 3D, 4D or 5D dataset is exported as a sequence, ilastik chooses the first axis as the slicing one. For example, if your dataset is 1001x1002x1003 pixels and you choose to export it as an image sequence, it will export 1001 images, 1002x1003 pixels each. This information is displayed in the dialogue if you select a "sequence" output format. To change the slicing axis, use the "Transpose to Axis Order" control to bring the axis you need to the front. Continuing on the 1001x1002x1003 example, assume it had "xyz" as axis order. Now if you want to slice on the z axis (of size 1003), type "zxy" in the "Transpose to Axis Order" control. Now ilastik will export 1003 images, 1001x1002 pixels each.

<div style="width: 95%; margin-left: 5%" markdown="1">
<div style="float: left; width: 50%" markdown="1">
Expand All @@ -88,3 +88,14 @@ Your export results can be previewed in the viewer. Typically, three layers are
## Exporting tracks and objects

Besides exporting the images you see in the viewer, ilastik allows to save the results of [tracking]({{site.baseurl}}/documentation/tracking/tracking#sec_Plugin) and [object classification]({{site.baseurl}}/documentation/objects/objects#export) in the form of csv tables or hdf5 files.

## Scaling and metadata carryover in OME-Zarr

While OME-Zarr is a multiscale image format, ilastik can currently only export a single scale to this format.
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.

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