> For the complete documentation index, see [llms.txt](https://help.connected.illumina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.connected.illumina.com/dragen-stratamap/dragen-spatial-transcriptome/illumina-spatial-cell-segmentation-tool.md).

# Illumina Spatial Cell Segmentation Tool

**The Illumina Spatial Cell Segmentation Tool is a standalone tool in ICA that allows for cell segmentation independently of the full DRAGEN Spatial Transcriptome pipeline. The tool uses images that have been processed with the Illumina Spatial Image Tool (ISIT) and uses the same cell segmentation algorithm as the full pipeline.**

{% hint style="info" %}
The cell segmentation algorithm used in this tool is identical to the algorithm used in the full pipeline, and it allows you to view and assess the results of the cell segmentation algorithm on your tissue sample images without running the full pipeline. Sequencing data and some other input files, such as a sample sheet, are not required for the standalone tool.
{% endhint %}

The tool is used:

* as a part of the [Tissue Target Test](/dragen-stratamap/illumina-spatial-image-tool/tissue-target-test.md)
* to preview the success of cell segmentation while performing the full assay, for example as a part of early evaluation and troubleshooting for tissue sectioning, staining, or imaging.
  * *If you are planning to use the same images in the full pipeline, the nuclei and cell boundary files can be input to skip that portion of the analysis and use the pre-generated files.*

#### Segmentation Model

The Illumina Spatial Cell Segmentation tool uses a StarDist-based deep learning model trained from scratch on large-scale, high-quality nuclei annotations. The training dataset includes approximately 1.5 million annotated nuclei spanning diverse tissue types across human and mouse samples, including bladder, brain, breast, colon, heart, kidney, liver, lung, prostate, testes, and blood vessels. This dataset is further complemented by the PanNuke dataset, which contains more than 200,000 annotated nuclei across 19 human tissue types. This extensive and diverse training enables robust and generalizable nuclei segmentation across a wide range of sample types.

### **Inputs**

The Illumina Spatial Cell Segmentation Tool requires the following inputs:

* **OME-TIFF image(s)** generated by the Illumina Spatial Image Tool (ISIT)
* **A cell boundary expansion distance** (default: 5 µm)

For more details about nuclei segmentation and cell expansion, see [Cell Segmentation in Analysis Methods](/dragen-stratamap/dragen-spatial-transcriptome/analysis-methods.md#g-cell-segmentation).

### **Instructions for Launch**

To launch the Illumina Spatial Cell Segmentation Tool:

1. Navigate to ICA
2. Select **Analyses**
3. Click **Start**
4. Select the pipeline **Illumina Spatial Cell Segmentation Tool**
5. Enter a **User reference** (a name for the analysis)
6. *Optional: Change any other desired settings within the **General** section as needed*
7. In the **Input files** section, select the ISIT-processed image(s) you would like to use

{% hint style="info" %}
The default upload location for ISIT-exported images is within **Data** > **spatial** > **images** > **folder named with slide ID**
{% endhint %}

8. *Optional: Set an alternate **Cell Boundary Expansion** distance (default is 5 μm).*
9. Click **Start analysis**.

### **Outputs**

The Illumina Spatial Cell Segmentation Tool saves outputs using the user-specified reference name. This general directory structure mirrors the DRAGEN Spatial Transcriptome cell segmentation execution and contains:

* **Segmentation Statistics Summary CSV files** for each sample ending with "*stats.csv*": This file provides metrics summarizing the segmentation outcomes for each sample. The file includes details on the segmentation method used, expansion range (in µm), cell counts, and statistics on nucleus/cell size (mean and median, in µm<sup>2</sup>), as well as mean and median segmentation detection probabilities.
* Three main sub-folders within the **cell\_segmentation** folder:
  * Folder: `nuclei_segmentation` – nuclei segmentation results. Contains:
    * **Nucleus Masks TIFF**: A TIFF image where each detected nucleus is represented by a unique integer pixel value (instance mask). Background pixels have a value of 0.
    * **Nucleus Contour CSV**: A CSV table listing the contour (boundary) coordinates of each nucleus mask. Columns: cell\_id, vertex\_x, vertex\_y.
    * **Nucleus Information CSV**: A CSV table providing morphological properties of each detected nucleus. Columns: Label, centroid\_y, centroid\_x, nuclei\_area, equivalent\_diameter, major\_axis\_length, minor\_axis\_length, eccentricity, prob (segmentation detection probability).
    * **Image With Nuclei Contours PNG**: A PNG image displaying nuclei contour lines overlaid on the tissue image.
  * Folder: `cell_border_expansionXum` – cell segmentation results, where X corresponds to the selected expansion distance.
    * **Cell Masks TIFF**: A TIFF image where each estimated cell region is represented by a unique integer pixel value (instance mask), derived from expanding nuclei masks by {X} micrometres.
    * **Cell Contour CSV**: A CSV table listing the contour (boundary) coordinates of each cell mask. Columns: cell\_id, vertex\_x, vertex\_y.
    * **Cell Information CSV**: A CSV table providing morphological properties of each detected cell. Columns: Label, centroid\_y, centroid\_x, cell\_area, equivalent\_diameter, major\_axis\_length, minor\_axis\_length, eccentricity, prob (segmentation detection probability).
    * **Image With Cell Contours PNG**: A PNG image displaying cell contour lines overlaid on the tissue image. Generated when the --show\_segmentation option is enabled.
  * Folder: `nuclei_segmentation_preview` – Provides a quick visual QC of cell segmentation performance on your tissue. A diverse set of ROIs is automatically selected from across the tissue so you can easily see how well the cell segmentation model performs on your sample without opening the full-resolution mask. Contains:
    * **Tile Locations PNG:** A whole-tissue overview image with green boxes indicating the locations of the automatically selected ROI tiles.
    * **Segmentation Preview Grid PNG:** A grid figure showing each ROI image tile side-by-side with its nuclei contour overlay for quick visual QC.
    * **Individual Tile PNGs**: Individual ROI tile images with nuclei contour overlays, saved in the `preview_tiles` subfolder (one PNG per selected ROI).

### Output Interpretation

Cell segmentation performance can be influenced by multiple factors, including tissue type and cell morphology, tissue sectioning quality, staining consistency, and overall image quality.

To evaluate cell segmentation performance on your tissue images, we recommend starting with the `nuclei_segmentation_preview` folder. The **Segmentation Preview Grid PNG** and the individual tile PNGs in `preview_tiles/` show nuclei contours overlaid on a diverse set of automatically selected ROIs from across the tissue, giving you a quick visual QC of how well the cell segmentation model performs on your sample. The **Tile Locations PNG** shows where those ROIs were taken from, so you can confirm they are representative of your tissue.

For a more complete assessment, visually inspect the **\<your file name>\_cell\_Segmentation\_mask.tif** file, which is found in the `cell_border_expansionXum` folder. This file provides a direct view of how well nuclei and cell boundaries have been identified across the full tissue.

{% hint style="success" %}
*Success of cell segmentation is a qualitative assessment and is based on your individual needs. If you have questions about interpreting the quality of your cell segmentation results, reach out to your Illumina representative.*
{% endhint %}

Advanced users may further assess segmentation quality by overlaying the cell segmentation mask on the full-resolution tissue image using Python, enabling more detailed inspection and troubleshooting. For more information, see these instructions: [view contour file over microscope image](/dragen-stratamap/dragen-spatial-transcriptome/outputs/results-folder/cell-and-nuclei-contours-csvs.md#view-contour-file-over-microscope-image).

#### Usage in DRAGEN Spatial Transcriptome

When using the standalone tool with the full assay, once you are satisfied with the cell segmentation results, the output files generated by the Illumina Spatial Cell Segmentation Tool can be imported into DRAGEN Spatial Transcriptome.\
Specify the generated files in the **External Segmentation Image Files** input field during DRAGEN Spatial Transcriptome setup and follow the on-screen prompts to select the appropriate TIFF files from the segmentation tool output directory.

{% hint style="info" %}
The output files must conform to the required file names and formats as specified in [External Cell Segmentation (Optional)](/dragen-stratamap/dragen-spatial-transcriptome/analysis-inputs/external-cell-segmentation-optional.md) to ensure compatibility with the DRAGEN Spatial Transcriptome pipeline.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.connected.illumina.com/dragen-stratamap/dragen-spatial-transcriptome/illumina-spatial-cell-segmentation-tool.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
