Skip to content

Exporting results

Pete edited this page Jan 2, 2017 · 5 revisions

Exporting results tables

Results tables can be generated using the commands described in the Detecting objects section (e.g. here, using the Measure menu or Table toolbar button . These tables have an option to Save the contents of the table. This will produce a text file that can be imported into other applications, such as a spreadsheet.

Beware of exporting huge tables containing millions of measurements as text! The export can take a long time, and the resulting files can be huge. It is generally more useful to export summary measurements this way (e.g. annotations, TMA cores). If detections are needed, they could be exported more selectively or flexibly by writing a script.

Cell detection results table

Scripting export

Starting with v0.1.2, whenever you save measurements from a table in this way, this is logged in the command history and can be included in a script for batch processing.

The required script is only one line, depending up what you want to export and where, e.g.

saveAnnotationMeasurements('/path/to/export/My annotations.txt')
saveDetectionMeasurements('/path/to/export/My detections.txt')

If you want to use scripting export in v0.1.2, please read this.

Exporting TMA data

There is a special export command intended for [tissue microarray (TMA)](Tissue Microarrays) data, found under File → Export TMA data.

This will not only export a summary of the TMA results, but also (optionally) thumbnail images of each TMA core - with and without markup showing any detections, using whatever display settings are currently active.

The TMA export downsample factor* option under Preferences can be used to adjust the size of any exported TMA core images. Setting this value to anything < 0 will result in no cores being exported.

Upon running File → Export TMA data, the following will be exported:

  • A file with the extension .qptma, containing some basic information about the export
  • A folder containing any exported images, and a .txt file containing summary results

It is important to keep the .qptma file and the corresponding folder together, since they relate to one another (i.e. do not delete or remove one but not the other).

Viewing exported TMA data

The images saved by File → Export TMA data are simply standard JPEG images that can be viewed by a wide range of software, and the .txt file containing results can be opened in any spreadsheet application.

However, an alternative way to view the exported data is through QuPath's TMA data viewer. This can be opened from within QuPath under File → Launch TMA data viewer. Then simply drag a .qptma file onto the main window of the data viewer to open all the data found within that directory.

This can by very helpful to view data from multiple TMA slides within the same place, and to associate measurements with images of TMA cores.

TMA data viewer

TMA data viewer

Exporting snapshots

Snapshots are basically equivalent to screenshots, but cropped to only include all or part of the QuPath window. They are particularly useful for creating documentation (such as throughout this Wiki).

Window snapshot

File → Export snapshot... → Window snapshot will export a screenshot of the main QuPath window as it currently appears - including toolbar etc. if visible.

To copy the window snapshot to the system clipboard, rather than save it as a file, choose Edit → Copy window to clipboard instead.

Export window

Viewer snapshow

File → Export snapshot... → Viewer snapshot will export of a screenshot of whatever appears in the currently-active image viewer, but without all the other adornments of the Window snapshot.

To copy the viewer snapshot to the system clipboard, rather than save it as a file, choose Edit → Copy view to clipboard instead.

Export viewer

Exporting image regions

Exporting image regions provides a means to export (RGB) pixel data as a new image, with control over the resolution of the export. This is particularly useful for creating figures, or for extracting smaller regions from a whole slide image for use or analysis elsewhere.

Note: It is currently only possible to export small image regions, and without pixel calibration data (i.e. pixel size in microns). Also, it is not possible to export a full whole slide image using QuPath.

If pixel calibration information is needed in the exported image, or non-RGB pixel values, consider instead sending the image region to ImageJ, and then using ImageJ's save/export commands to create a TIFF file.

Export image dialog box

If you select File → Export image region, you will be presented with a dialog box to customize the export.

Export image dialog

  • Export format, which controls the output file format
    • JPEG - smaller file size, but with some loss in quality
    • PNG - larger file size, but with best quality
  • Downsample factor, which controls how much to scale the image down. Note that the output image size is estimated, and if the image is not scaled down then sometimes the resulting file may be too large (in which case QuPath will give a warning).
  • Include overlay, which controls whether objects are drawn on top of the exported image or not

Export image with overlay

Export image with overlay

Export image without overlay

Export image without overlay

Clone this wiki locally