# How do I export results?

```{admonition} What will I learn?
1. How to export results from a single image.
2. How to export results from all images in a project.
```

## Viewing measurements (again)

After you've analyzed images with QuPath, you may want to export the results for analysis in suitable software.

In ["How do I count cells?"](../part3/how_do_i_count_positive_cells.md), we saw how to access the measurement tables for the various object types in the current image via {{ icon_table }} button.
This allowed us to view a table of annotation measurements or detection measurements.

QuPath makes it easy to copy and paste this table into other software.

```{admonition} What to do
1. Select {menuselection}`Measure --> Show annotation measurements`.
  :::{figure} ../../images/exporting/annotation_table.png
  The annotation measurement table
  :::
2. Select some annotations using {kbd}`Control/Command` or {kbd}`Shift`
3. Copy the data to the system clipboard by clicking {guilabel}`Copy` or pressing {kbd}`Control/Command+C`.
4. Paste the data into a text editor or spreadsheet program of your choice.
```

```{figure} ../../images/exporting/annotations_excel.png
Annotation measurements opened in a spreadsheet program
```

If you would prefer to export all annotations then you can select all entries in the table using {kbd}`Command/Control+A`.
To re-order the annotations based on a specific value, you can click on a column.


## Exporting measurements from multiple images

Returning to `OS-2.ndpi`, let's try to export measurements from multiple images.
To do this, QuPath includes a more comprehensive exporting tool.

But first, we need multiple images!
For convenience, we'll just duplicate the current one.

```{admonition} What to do
1. Open `OS-2.ndpi`.
2. Select {menuselection}`Duplicate image`.
3. Keep the {guilabel}`Also duplicate data files` checkbox selected.
4. Click {guilabel}`OK`.
```

Now, let's get exporting.

```{admonition} What to do
5. Open {menuselection}`Measure --> Export Measurements...`
6. In the resulting dialog, select one or multiple images within {guilabel}`Available` and click {guilabel}`>` to move images across into the {guilabel}`Selected` list.
  :::{figure} ../../images/exporting/export_measurements.png
  Export measurement window
  :::
  Alternatively, if all of the images are of interest then select {guilabel}`>>`.
7. Complete the remaining fields:

- `Output file`: Determine where your file is going and what its going to be called.
- `Export type`: Choose which objects you want to export.  
  Here, we'll select Detections.
- `Separator`: Controls the value separator, i.e., controls whether the output is csv or tsv.
- `Columns to include`: Define which measurements you want to export.
  Here we will be selecting them all.
  If you are choosing specific measurements, click {guilabel}`Populate` after selecting `Export type`.
  This may take a few seconds.
  :::{figure} ../../images/exporting/export_measurements_complete.png
  Export measurement window
  :::
  You can now choose a subset of the available measurements, rather than exporting everything.
8. Click {guilabel}`Export`. 
```
