# Image QC

Image QC serves to evaluate the appropriateness of microscope images obtained from the Stereo-seq experiment for precise automated analysis within the Stereo-seq Analysis Workflow (SAW).

## Accessing Image QC

StereoMap's **Image QC** can be accessed from the **Tools** page.

<figure><img src="/files/3THa3VKNrEBps6YQdWxc" alt=""><figcaption></figcaption></figure>

## **Input Image Recommendation**

The acceptable types of images include nuclei-staining images (e.g., ssDNA or DAPI), a image set that has one nuclei-staining image (e.g. DAPI) and up to 6 immunofluorescence images (IF images), as well as color images (specifically H\&E images). The recommended file format for images is TIFF. Additionally, some microscope file formats such as CZI files from ZEISS or image tiles organized in a folder from Motic are also acceptable. If you are unsure whether your imaging system is suitable for the Stereo-seq experiment, please refer to the [**Microscope Assessment Guideline**](https://enfile.stomics.tech/STUM-PE001%20Microscope%20Assessment%20Guideline_ver%20C.pdf) to assess your imaging system. The guideline can be accessed from [STOmics ](https://en.stomics.tech/)> [Resources Documents](https://en.stomics.tech/resources/documents/list.html).

### Image Data Types

<table><thead><tr><th width="156">Image Type</th><th width="374">Data Types</th><th>File Format</th></tr></thead><tbody><tr><td>Nuclei-staining</td><td>8 or 16-bit grayscale image stores in a single single-page image file.<br><br><em>Highly recommended format.</em></td><td>TIFF file (<code>.tif</code> or <code>.tiff</code>)<br>CZI file (<code>.czi</code>)<br>Image tiles</td></tr><tr><td>Nuclei-staining + IF</td><td>8 or 16-bit grayscale images store in multiple single-page image files.</td><td>TIFF file (<code>.tif</code> or <code>.tiff</code>)</td></tr><tr><td>Nuclei-staining + IF</td><td>8 or 16-bit grayscale images store in a multi-page image file.<br><br><em>Only valid for the Zeiss microscope image.</em></td><td>CZI file (<code>.czi</code>)</td></tr><tr><td>H&#x26;E</td><td>24 or 48-bit colored image stored in a single image file.</td><td>TIFF file (<code>.tif</code> or <code>.tiff</code>)<br>CZI file (<code>.czi</code>)<br>Image tiles</td></tr></tbody></table>

### Image File Format

<table><thead><tr><th width="216">File Format</th><th width="490">Acceptable Microscope Model</th></tr></thead><tbody><tr><td><code>.tif</code> or <code>.tiff</code> file</td><td><ul><li>Any TIFF</li></ul></td></tr><tr><td><code>.tar.gz</code> QC output</td><td><ul><li>The output <code>.tar.gz</code> compressed file from <strong>Image QC</strong></li></ul></td></tr><tr><td><code>.tif</code> format image tiles</td><td><ul><li>Customized Motic</li><li>MGI STOmics Microscope Go Optical</li><li>Leica DM6 B</li></ul></td></tr><tr><td>Other format</td><td><ul><li><code>.czi</code> file from ZEISS Axio Scan.Z1</li><li><code>.czi</code> file from ZEISS Axioscan 7</li></ul></td></tr></tbody></table>

Visit [Image QC Navigation](#image-qc-navigation) for each staining type to get more examples.

## QC Criteria

The quality of an image is a direct reflection of both the stability of the microscope and the excellence of the imaging. The basic assessment includes detecting qualified tracklines and evaluating stitching. Depending on the specific scenarios, the image may also be assessed for calibration confidence. The specific combination and score threshold vary slightly depending on the image type.

The assessments include,

* **Trackline Detection:** The tracklines are fiducial markers etched on the surface of the Stereo-seq chip. They can be detected in the microscope image and the sequencing-based spatial feature expression density heatmap, linking the two data modalities. Reliable detection of tracklines from the image is crucial for aligning the image with the spatial feature expression density map.\
  A detection score combines several factors to evaluate the likelihood of successful image registration. The score takes into account the visibility of tracklines and a sufficient number of neighboring tracklines that qualified for deducing a periodic trackline grid, or trackline template. The inferred grid is the key to adjusting the scale, rotation, and position of the image.
* **Microscope Stitching Stability:** Microscope stitches image FOVs to get a panoramic image that reveals the entire tissue morphology. Stitching errors may happen due to several reasons, vibrations or movements of the microscope stage during image acquisition, external disturbances on the lab bench, or poor stitching algorithm. Stitching errors impact the accuracy and reliability of the resulting stitched image. The visible seams or misaligned features in the overlapped region will lead to misidentified features or boundaries which affect the result of image registration and segmentation. In **Image QC**, the assessed image is split into FOVs to measure the morphology feature similarity of adjacent overlapping regions.
* **Image Calibration:** In experiments involving the acquisition of multiple images of the same chip, the images necessarily have consistent stitching, registration, and tissue region. Due to the limitation of staining and imaging, the tracklines - critical for accurate image registration - are only visible in the nuclei-staining image. Therefore, the other images must first align with the nuclei-staining image and then be registered with the spatial feature expression density map using the same actions. The similarity and feature offset are computed to evaluate the confidence that the two images are aligned. This assessment is only applied in nuclei-staining + mIF scenarios and is only applied for single-channel images.

<table><thead><tr><th width="148">Assessment</th><th>Score</th><th>Example</th></tr></thead><tbody><tr><td><strong>Trackline Detection</strong></td><td><ul><li>≥ 60, sufficient amount of qualified tracklines is detected. The image can be automatically registered with the sequencing-based spatial feature expression matrix.</li><li>&#x3C; 60, lack or qualified tracklines to deduce a trackline template or the detected tracklines cannot overlap with the deduced trackline template. You may need to retake an image.</li></ul><p><em>Necessary assessment indicator to pass QC.</em></p></td><td><img src="/files/xRa1NovZjBT02rDlsIZ2" alt=""></td></tr><tr><td><strong>Microscope Stitching Stability</strong><br><strong>(Stitching Evaluation)</strong></td><td><ul><li>≥ 60, more than 30% of FOVs exhibit clearly similar morphology features in the adjacent overlapping regions, and the mean feature offset score of these FOVs is greater than 0.7.</li><li>&#x3C; 60, more than 30% of FOVs have blurry features in the adjacent overlapping regions and the mean feature offset score of these FOVs is less than 0.7.</li></ul><p><em>Conditional assessment indicator.</em></p></td><td><img src="/files/bmmA6HIQSeucXg0v4fkB" alt=""></td></tr><tr><td><strong>Image Calibration</strong></td><td><ul><li>Pass, the maximum feature offset between nuclei-staining image and another image ≤ 20 pixels and the feature morphology similarity ≥ 1%.</li><li>Fail, the maximum feature offset between nuclei-staining image and another image > 20 pixels or the feature morphology similarity &#x3C; 1%.</li></ul><p><em>Conditional assessment indicator.</em></p></td><td><img src="/files/IqFTRoHKJW6F4FpSiPEF" alt=""></td></tr></tbody></table>

Refer to **STOmics** [**Microscope Assessment Guideline**](https://enfile.stomics.tech/STUM-PE001%20Microscope%20Assessment%20Guideline_ver%20C.pdf) - **Chapter 4 Microscope Image Assessment** - **4.3. Image Examples** for more information about image quality.

## Image QC Navigation

Image QC interface components are shown here:

<figure><img src="/files/CUtLxrjKuoAaKhxaN3F4" alt=""><figcaption></figcaption></figure>

Open the image QC tool and drag the image to the window, the **Image Information** section will be automatically filled. Make sure at least the **Chip SN**, **Operator**, **Image Path**, and **Staining Types** have been accurately filled. The **Run** button will be available for clicking, allowing you to start a QC assessment.

<table><thead><tr><th width="185">Image information</th><th>Description and example</th></tr></thead><tbody><tr><td><strong>Chip SN</strong></td><td><em>Required</em>. Stereo-seq chip serial number. You can find SN from the bottom of the Stereo-seq chip.<br><br><em>E.g. S1 (1x1) chip: SS200000135TL_D1, C02533C</em><br><em>S0.5 (0.5x0.5) chip: FP200009107_E414, B03210C211</em><br><em>Large chip: SS200000108BR_A3A4, D02070C3D3</em><br><em>Please ensure that the SN and the image correspond accurately.</em></td></tr><tr><td><strong>Operator</strong></td><td><em>Required</em>. User information. Recommend to enter your email address.</td></tr><tr><td><strong>Image Path</strong></td><td><em>Required</em>. Path of your image which is prepared to be checked.<br>The path will be auto-filled in once you have dragged and dropped your image into the window.<br><br><em>To avoid any foreseeable errors, refrain from using any characters other than English letters, numbers, or underscores.</em></td></tr><tr><td><strong>Staining Types</strong></td><td><em>Required</em>. Image staining type. Valid options are ssDNA, DAPI, DAPI+mIF, and H&#x26;E.</td></tr><tr><td><strong>Upload</strong></td><td><p><em>Required</em>. Upload the image to <a href="https://cloud.stomics.tech/">STOmcis Cloud</a> or a customized path. Valid options:</p><ul><li>No: do not upload any image (default).</li><li>QC Input Files (Microscope image): upload the microscope image in its original format.</li><li>QC Output Files (TAR.GZ): upload the image that has been examined by image QC.</li><li>Select all: upload both input files and output files.</li></ul><p>See <a href="#uploading-settings">Uploading Settings</a> for details.</p></td></tr><tr><td><strong>Remark</strong></td><td><em>Optional</em>. Any comments to the image or this QC process.</td></tr></tbody></table>

If your image is in TIFF format, you will be prompted to provide additional microscope details. This information is crucial for accurately measuring the image scale and generating the trackline template. If you are unable to retrieve the specific microscope settings, you can use the default value. However, it is strongly recommended to input the precise information whenever possible.

<figure><img src="/files/ONTTLMWQa5TNzEtYErY4" alt=""><figcaption></figcaption></figure>

A comprehensive QC process involves two steps, **QC Index Evaluation** and **Image Compression**. Additionally, if you choose to **Upload** your QC files, successful completion of the image uploading becomes an integral part of your QC progression. The progression, result of each QC assessment, and overall QC conclusion along with further analysis suggestions will be displayed on the screen.

<figure><img src="/files/T38dga8rhszlXKbHVMg8" alt=""><figcaption></figcaption></figure>

Once the QC progression is successfully completed, the output directory will be displayed on the screen. You can locate the result file in your file system at **StereoMapWorkspace** -> **QC** folder, or you can click on the path to open the folder. The [saving path](/stereomap-user-manual-v4.1/download.md#saving-path) can be changed in [Setting](/stereomap-user-manual-v4.1/download.md#setting).

If you have multiple images and need to perform QC tasks on them, you can add separate tabs for each image. Then, fill in the necessary information and start running the task for each tab. The tasks will be executed sequentially in the background.

<figure><img src="/files/TlSaEi6m9jdxTvL30DnP" alt=""><figcaption></figcaption></figure>

If your image successfully passes the QC, the QC output `.tar.gz` can be transferred to the `SAW count` pipeline through the `--image-tar` argument. This will enable it to be automatically co-processed with the feature expression matrix. Conversely, if your image does not pass QC but you still want to co-visualize it with the feature density map, you will have to input your image file to the StereoMap [Image Processing](/stereomap-user-manual-v4.1/tutorials/navigation-for-image-processing.md) module and manually manipulate rectify the issue steps before transferring to SAW.

## QC Tips Specific for Image Types

### **Nuclei-staining Image: ssDNA or DAPI**

Input example:

<table><thead><tr><th width="243">File Format</th><th>Example</th></tr></thead><tbody><tr><td><code>.tif</code> or <code>.tiff</code> file</td><td><img src="/files/bccFAPsTdSWI84258Mo2" alt=""></td></tr><tr><td><code>.tar.gz</code> QC output</td><td><img src="/files/FDmHqqGkU2y4LxLjoJhR" alt="" data-size="original"></td></tr><tr><td><code>.tif</code> format image tiles</td><td><ul><li>Motic:</li></ul><p><img src="/files/4Fy62aBKTqMUIeo2gvRo" alt="" data-size="original"></p><ul><li>STOmics Microscope Go Optical:</li></ul><p><img src="/files/O9cFxVsVk6TNfXrBZpwO" alt="" data-size="original"></p><ul><li>Leica:</li></ul><p><img src="/files/TXCvHO1HMI9qGBMjhotD" alt="" data-size="original"></p></td></tr><tr><td>Other format</td><td><ul><li>Zeiss <code>.czi</code></li></ul><p><img src="/files/4HuwfcsyApZiucmrmNPW" alt="" data-size="original"></p></td></tr></tbody></table>

The nuclei-staining image undergoes assessment based on [**Trackline Detection**](#qc-criteria).

{% hint style="info" %}
A typical QC progression time for a nuclei-staining image (10X objective, 8-bit `.tif` file, \~20,000 px x 20,000 px for a 1 cm x 1 cm Stereo-seq Chip) is \~1 min.

Processing time will be longer with a larger image or a bit depth of 16.
{% endhint %}

### **Nuclei-staining & Immunofluorescence Image: DAPI + mIF**

Input example:

{% hint style="info" %}
Please rename your images or the image folders so that the software can read the staining name correctly. "<>" embraces the information that needs to be replaced.

* DAPI: < Chip SN>
* IF: < Chip SN>\_< IF name>\_IF
  {% endhint %}

<table><thead><tr><th width="258">File Format</th><th width="486">Example</th></tr></thead><tbody><tr><td><code>.tif</code> or <code>.tiff</code> file</td><td><img src="/files/oerss7Vngl2xNQqqmaCT" alt=""></td></tr><tr><td><code>.tar.gz</code> QC output</td><td><img src="/files/fsme17fA86kLG9QS8B2W" alt=""></td></tr><tr><td><code>.tif</code> format image tiles</td><td><ul><li>Motic:</li></ul><p><img src="/files/lLWbAHAk9A8wj5DCZlV8" alt="" data-size="original"></p><ul><li>STOmics Microscope Go Optical:</li></ul><p><img src="/files/9XmnMj2L8diEW3p9XQB2" alt="" data-size="original"></p></td></tr><tr><td>Other format</td><td><ul><li>Zeiss multi-page <code>.czi</code></li></ul><p><img src="/files/07vx3cHraQXGquPzwIRT" alt="" data-size="original"></p></td></tr></tbody></table>

The evaluation of a set of images, which includes a nuclei-staining image and multiple IF images, relies on three factors: [**Trackline Detection**](#qc-criteria), [**Stitching Evaluation**](#qc-criteria), and [**Image Calibration**](#qc-criteria).

{% hint style="info" %}
A typical QC progression time for a nuclei-staining image and 2 IF images (10X objective, 8-bit `.tif` file, \~20,000 px x 20,000 px for a 1 cm x 1 cm Stereo-seq Chip) is \~3 min.

If your input images are 16-bit images or image tiles, the expected time cost will be longer due to the longer parsing time and extra [**Stitching Evaluation**](#qc-criteria). The [**Stitching Evaluation**](#qc-criteria) takes approximately 2 min for each image.
{% endhint %}

### **Hematoxylin & Eosin Staining Image: H\&E**

Input example:

<table><thead><tr><th width="258">File Format</th><th width="489">Example</th></tr></thead><tbody><tr><td><code>.tif</code> or <code>.tiff</code> file</td><td><img src="/files/A20vXn4MhR3sqJkJD3xz" alt=""></td></tr><tr><td><code>.tar.gz</code> QC output</td><td><img src="/files/NfJ38UerFKvwHGaJYPqn" alt=""></td></tr><tr><td><code>.tif</code> format image tiles</td><td><ul><li>Motic:</li></ul><p><img src="/files/WBiyxKJjL3KUEd2I2d0e" alt="" data-size="original"></p><ul><li>STOmics Microscope Go Optical:</li></ul><p><img src="/files/cPHO1BvaYaT0vhmD3MlZ" alt="" data-size="original"></p></td></tr><tr><td>Other format</td><td><img src="/files/Mq57PjmsUeFKfDFCDpcJ" alt=""></td></tr></tbody></table>

The quality of the H\&E image is evaluated based on [**Trackline Detection**](#qc-criteria). Identifying tracklines in an H\&E image is more challenging than in a grayscale image, so it is important to ensure that the lines are as visible as possible under the microscope.

{% hint style="info" %}
A typical QC progression time for an H\&E image (10X objective, 48-bit `.tif` file, \~20,000 px x 20,000 px for a 1 cm x 1 cm Stereo-seq Chip) is \~4 min.

The H\&E image is a color image that is triple the size of the grayscale image, so the parsing time is longer. Also, if your input images are image tiles or a `.tar.gz` QC output, the expected time cost will be longer due to the longer stitching and parsing time.
{% endhint %}

## Uploading Settings

Uploading settings setup configurations for transferring image files to HPC or cloud. If you have any queries about which mode is most suitable for your situation, please don’t hesitate to reach out to the FAS.

### Built-in Upload Path

<div><figure><img src="/files/G2Ney7EYNvokkJSxSv7i" alt=""><figcaption></figcaption></figure> <figure><img src="/files/QeAolj7K77t7BslbRyEq" alt=""><figcaption></figcaption></figure> <figure><img src="/files/Bk4ueI2bqHp2OVevYZKd" alt=""><figcaption></figcaption></figure></div>

<table><thead><tr><th width="183">Upload path type</th><th>Description</th><th>Region</th></tr></thead><tbody><tr><td>ALICLOUD</td><td>ALICLOUD mode transfer image through <a href="https://www.alibabacloud.com/en?_p_lc=1">Alibaba Cloud</a>. This mode is ideal for users in regions where STOmics Cloud has been deployed on Alibaba Clous.<br>If there are newly established regions, please reach out to FAS to set up the necessary configurations.</td><td><ul><li>SINGAPORE, AP</li></ul></td></tr><tr><td>AWS</td><td>AWS mode allows for transferring image files via <a href="https://aws.amazon.com/en">Amazon Web Service (AWS)</a>. This mode is ideal for users in regions where STOmics Cloud has been deployed on AWS.<br>If there are newly established regions, please reach out to FAS to set up the necessary configurations.</td><td><ul><li>CALIFORNIA, US</li><li>RIGA, EU</li><li>SINGAPORE, AP</li></ul></td></tr><tr><td>HPC</td><td>HPC mode is a configuration used for the laboratory’s internal network, enables the uploading of image files to the local cluster. Please contact FAS to arrange the configuration in advance. Preferably used for STOmics Tech internal network.</td><td><ul><li>CHONGQING, CN</li><li>SHENZHEN, CN</li></ul></td></tr><tr><td>RAYSYNC</td><td>Transfer image file with <a href="https://www.raysync.io/">Raysync</a>. By connecting to internet, you can transfer files to the region's cluster without any additional setup.</td><td><ul><li>CHONGQING, CN</li><li>QINGDAO, CN</li><li>SHENZHEN, CN</li></ul></td></tr></tbody></table>

### Customize Upload Path

If you have purchased your own Alibaba Cloud or AWS cloud service, you can transfer your image to your personal cloud storage bucket by setting a customized upload path.

<figure><img src="/files/g9BEgM10ytndHHnlbkdC" alt=""><figcaption></figcaption></figure>

Select your cloud service type, which can be either **ALICLOUD.CUSTOM** or **AWS.CUSTOM**, and set the region to **OWNER**. Enter your remote path, keyID, password, and the name of your S3 bucket. If your cloud is Alibaba Cloud, you will need to fill in the domain information as well. Finally, click on **Confirm** to complete editing.

<div><figure><img src="/files/nm3d2K2LJ66Ousfn8x26" alt=""><figcaption></figcaption></figure> <figure><img src="/files/1gdhLCFTykso5FKkQTj4" alt=""><figcaption></figcaption></figure></div>

You will find your customized configuration in the **Upload information configuration** window.

<div><figure><img src="/files/eQvrnwK7THCA14c6i8eT" alt=""><figcaption></figcaption></figure> <figure><img src="/files/2fkG8KCKCYYyR36PZgnq" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions: 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:

```
GET https://stereotoolss-organization.gitbook.io/stereomap-user-manual-v4.1/tutorials/navigation-for-tools/stereo-seq-image-qc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
