Exporting data II: Human-readable

Explains how to export data into a human-readable formats


Tutorial: Exporting data II (Human-readable)

small size
simple
tutorial
Accompanying data and project for the tutorial 'Exporting data II: Human-readable'.
This guide was written for JIPipe version 1.74.0 or newer
Illustration of the tutorial step

Step 1

Open the example project and navigate to the Export compartment (red arrow 1).

Update the cache using the output node’s Cache intermediate results option (red arrow 2).

Illustration of the tutorial step

Step 2

In the Cache browser switch to the Import/Export tab (red arrow 1). Here you can manually export data into a list of files based on the existing annotations.

Click the As files button in the Data category.

Illustration of the tutorial step

Step 3

We recommend to create an empty directory for the storage of the exported data (red arrows 1 and 2).

Then choose the directory and click Open.

Illustration of the tutorial step

Step 4

Now JIPipe will give you options that determine how the file names should be generated. This is required, as JIPipe does not know anymore the name of the original input file unless it is stored in the annotations.

The most important setting is the File name expression that defaults to

SUMMARIZE_ANNOTATIONS_MAP(annotations, "#")

The expression is applied for each exported data item and returns the file name that should be used. The default method will take all known annotations that are marked with a # and form a filename based on the following pattern:

[Annotation 1 name]=[Annotation 1 value]

If you want to know more about SUMMARIZE_ANNOTATIONS_MAP, please click Edit and search for the function in the function list.

In this case, you can leave the setting as-is.

You can build your custom filenames based on annotations. For example, if you just type in #Filename, the #Filename annotation will be utilized.

You can also create complex filenames by utilizing expression functions. For example, if you want a text overlay_ in front of all filenames, just type in

"overlay_" + #FileName

Illustration of the tutorial step

Step 5

Open the directory after the export. You see that the exporter stored the data into an appropriate format.

You can also clearly see the pattern [Annotation 1 name]=[Annotation 1 value] as determined by the expression.

Illustration of the tutorial step

Step 6

JIPipe offers various nodes for the export of data that are even outside the scope of the exporter implemented in the cache browser.

You can find them in the Export menu or via the search bar.

Proceed to add and connect the following nodes:

  1. Add Export data and connect it to AVG density
  2. Add Export image and connect it to Overlay image
  3. Add Export table as XLSX and connect it to All measurements
  4. Add Export ROI and connect it to ROI

In the following steps, we will show how to configure these nodes for the export into a single directory.

Illustration of the tutorial step

Step 7

We begin with the Export data node. It encapsulates the same functionality as the cache browser’s data exporter.

Here we will export the AVG density table into a directory ExampleExports/ViaNodes relative to the project file. Begin by selecting the node and changing the following parameters:

  • Output directory to ExampleExports/ViaNodes (red arrow 1)
  • Enable Output relative to project directory. If this is not done, the files will be stored in a temporary directory (red arrow 2)

Output relative to project directory only works if you loaded the project from a *.jip file or have saved it at least once.

It is common that the type of the output is stored within the filename. To to this in JIPipe, modify the File name property as follows:

"density_" + #Filename

The exporter will use the expression to determine the filename of each exported data item. As the images are annotated with a #Filename annotation, we can combine it with a custom text "density_" to generate files with that pattern.

Illustration of the tutorial step

Step 8

Run the Export data node via Update cache.

Now navigate to the ExampleExports/ViaNodes directory that should have appeared next to the project file. It contains a file density_blobs.csv according to the pattern defined by the File name expression:

"density_" plus #Filename, where #Filename is blobs, because the table was annotated with the original filename (blobs)

Illustration of the tutorial step

Step 9

Select the Export image node and navigate to its parameters. Unlike the generic data exporter Export data, it allows you to change the output type of the generated file from TIFF to PNG or other formats.

Again, set the Output directory to ExampleExports/ViaNodes with Output relative to project directory enabled.

The filename expression set to

"overlay_" + #Filename

This would yield a file that is for example named overlay_blobs.png.

Illustration of the tutorial step

Step 10

Move on to the Export table as XLSX node. While Export data will always export CSV files, this node will instead Excel files. It can even be configured to export multiple tables into one XLSX file.

Again, set the Output directory to ExampleExports/ViaNodes with Output relative to project directory enabled.

The filename expression set to

"measurements_" + #Filename

This would yield a file that is for example named measurements_blobs.xlsx.

Illustration of the tutorial step

Step 11

Finally, edit the parameters of Export ROI node. Export data will export a *.roi file if only one ROI is present and otherwise compress all ROIs into a *.zip file. This node can optionally turn off this export behavior and export all ROIs into an individual *.roi file.

Again, set the Output directory to ExampleExports/ViaNodes with Output relative to project directory enabled.

The filename expression set to

"rois_" + #Filename

This would yield a file that is for example named rois_blobs.zip or rois_blobs.roi depending on whether one or multiple ROIs are present.

Illustration of the tutorial step

Step 12

Run all the exporter nodes via Update cache and navigate into the ExampleExports/ViaNodes/ directory.

Observe the generated files.