Nuclei-staining + Immunofluorescence Image

Why Nuclei-staining + Immunofluorescence Image?

Immunofluorescence (IF) is a widely used image-based technique to visualize the subcellular distribution of the proteome in cells. For instance, nuclei can be stained with DAPI, while T cells can be identified using CD3. Multiplex IF (mIF) can be tagged on the tissue section and scanned by the fluorescence microscope simultaneously. Stereo-seq experiments and bioinformatics analysis tools are compatible with DAPI and up to 6 user-defined IFs, enabling spatial discovery across a tissue sample.

Considerations for Nuclei-staining Images and Immunofluorescence Images

Since each of the selected IFs has a specific fluorescence spectrum and all of them are applied together on the same tissue slice, there are several challenges to consider, especially in the IF selection and imaging platform. Each IF has a specific fluorescence spectrum and it's essential to manage the degree of spectral overlap among the IFs you choose. Additionally, it is crucial to consider the available emission and excitation filters of your imaging platform.

The fluorescence microscope scans tissue areas with IF tags either by switching the filter at the same scan area until the whole tissue area has been reached or by switching the filter after scanning the entire tissue area. Both methods require keeping the chip in place without any movement between each scan to ensure the tissue position in the IF images remains consistent in terms of both scale and orientation.

Processing nuclei-staining + mIF images in StereoMap and SAW requires a set of individual acquisitions stored in a single-page grayscale file at 8 or 16-bit depth. (See Image Types and Format for more information)

Fluorescence Image
Data Type and File Format

Grayscale image

Multiple 8 or 16-bit grayscale single-page image files

Step 1: Upload Image

Click on Choose file in the drag-and-drop box to upload a compatible image file from your file system. You can also drag and drop your selected file(s) into the corresponding box. If your input image file is either a .tar.gz or a .stereo file, drag and drop it only once to the left-side box. However, if your input file format is .tif or .tiff, you need to drop your nuclei-staining DAPI image to the left-side box and select and drop all your IF images to the right-side box together.

Please visit Image Processing Input Files for detailed image file information.

Selecting a file triggers a file-parsing process that not only reads the image but also acquires necessary data from the input. Depending on the file type and image size, the parsing time can vary. Stereo-seq chip serial number (SN) and microscope setting provide important information in the image processing steps. The .tar.gz or .stereo the input file contains these data, so the parsing process will start directly.

However, if the input file format is .tif or .tiff, you need to enter the required information specified in this step and click Confirm to begin the image parsing and quality check. Specifically, you’ll be asked to input details about the microscope by choosing a microscope configuration. Refer to the Microscope Settings for additional details.

Step 2: Image Registration

In this step, you will need to adjust the orientation, position, and scale of the image to align each of them with the spatial feature expression matrix. StereoMap provides two registration approaches for aligning images in the context of Stereo-seq data analysis.

  1. Morphology Registration: Aligns image with matrix based on the similarity of their morphology.

  2. Feature Point Registration: Aligns image to the trackline template deduced from the Stereo-seq chip SN by marking a key point. There’s no need to bring in a spatial feature expression matrix generated by SAW, but some prerequisites should be taken into account.

Morphology Registration

If you upload the .stereo file in step 1, you can see the image and the spatial feature expression matrix once enter step 2. For .tar.gz or .tif/.tiff image file, you will need to add a .stereo file for specifying a spatial feature expression matrix as the reference. Click to select the .stereo file. Also, if your images are in the .stereo file, but you want to change the reference expression matrix, you can click the and load a new file. This action will reload the matrix, but use the images from step 1.

The registration process involves two stages, roughly matching the orientation of the image based on the morphology and finely adjusting the position and scale for exact overlap with the the spatial feature expression map. You can also choose "Chip tracklines" to display tracklines that are derived from the spatial feature expression matrix to help with fine alignment.

To roughly align the image, you need to match the microscope image and the feature density map in orientation.

  • Use the Flip tool to mirror the image.

  • Click on and use the Control knob to rotate the image in the same direction.

Once the orientation of the image and the spatial feature expression matrix have matched, you can move on to the fine-alignment steps.

In the fine-alignment stage, you will need to move the image to the place where the tissue can overlap.

  • Use the Move panel by setting the step size and pan move in four directions.

  • The dimension of the microscope image might differ from the spatial feature expression map, you can adjust scales using the Scale tool.

You can align the image by checking "Chip tracklines" to show the reference trackline template and let the tracklines fall directly overlapped. At this time, the chip trackline template is a representation of the matrix. If the tracklines are dim, the Normalization , Contrast , Brightness , and Opacity of the image can be adjusted manually. In the case of IF images, the tracklines might not be visible directly from the image. However, altering the matrix color could help to bring out some hidden patterns.

circle-info

The images are adjusted to optimize the visibility of tracklines.

Example of trackline overlapping
circle-info

Adjusting Saturation will not affect the grayscale image.

For IF images in which the tracklines cannot be seen, we assume that the IFs were taken in exactly the same orientation as the nuclei-staining image. Since StereoMap >=4.1, the parameters from the nuclei-staining image will be automatically applied to all the IFs.

circle-info

After the image has been aligned with the matrix, steps 3 and 4 can be bypassed. You can export the semi-processed .tar.gz image directly and feed this output to SAW for automatic segmentation.

In addition, a *regist.tif image file will be provided. This is a reoriented image that matches the shape and orientation of its corresponding feature expression matrix. This image serves as the starting point for tissue and cell segmentation. If you’re considering using other external segmentation tools or algorithms, it’s strongly advised to utilize this *regist.tif file as the input.

Feature Point Registration

Registration with feature points involves aligning images without the need for a feature expression matrix. It uses tracklines detected from the image and lines from the chip mask according to predefined rules.

circle-info

Prerequisite to accessing this approach:

  1. Image must pass QC: this ensures the tracklines are visible.

  2. Valid Stereo-seq chips that follow the predefined rules: Stereo-seq N FFPE V1.0, Stereo-seq T FF V1.3, or Stereo-CITE T V1.1 chips.

To ensure that the two sets of lines match, you must also identify a specific point to indicate the orientation of the image; otherwise, the auto-alignment may fail.

Requirements to select the correct feature point and get the correct registration result:

  1. The four chip edges/corners can be seen from the image.

  2. The imaging process has strictly followed the instructions specified in Microscope Assessment Guidelinearrow-up-right - Chapter 3 Microscope Imaging Guidelines - 3.2.2. Precautions for Experimental Operations. You can access it from STOmicsarrow-up-right -> Resources Documentsarrow-up-right.

circle-exclamation
circle-info

Feature point registration begins with an image that has been adjusted for rotation and scaling.

The process of feature point registration involves two stages: adjusting the image to ensure the chip's four edges/corners are visible, and selecting a point from a predefined set to serve as the reference location.

To ensure all four sides of the chip are visible, you can manually adjust the image's Normalization , Contrast , Brightness , and Opacity .

Once you can see the chip, you should identify a predetermined point inside the chip region that is nearest to the bottom left corner. Click on this point to select it, and then click Next to complete the registration.

After selection, the orientation of the image will be auto-adjusted. You will see the result in Step 3: Tissue Segmentation.

circle-info

After the image has been aligned with the matrix, steps 3 and 4 can be bypassed. You can export the semi-processed .tar.gz image directly and feed this output to SAW for automatic segmentation.

In addition, a *regist.tif image file will be provided. This is a reoriented image that matches the shape and orientation of its corresponding feature expression matrix. This image serves as the starting point for tissue and cell segmentation. If you’re considering using other external segmentation tools or algorithms, it’s strongly advised to utilize this *regist.tif file as the input. Other.tif file may fail to import due to the difference in image and matrix size.

Step 3: Tissue Segmentation

circle-info

Tissue Segmentation is a skippable step.

In this step, you will identify the tissue regions. Accurately identifying the boundaries of the tissue can significantly reduce the interference from the background in the clustering result. The image-based tissue segmentation result will be mapped onto the sequencing-based spatial feature expression matrix to create a feature density map of the tissue region. For IF images, it's more important to select the region with strong immunofluorescence intensity rather than outlining the tissue boundaries.

circle-info

If you upload the .stereo file in step 1, you can see a semi-transparent mask overlapped on the registered microscope image.

For .tar.gz or .tif/.tiff image file, you will need to use tools to draw the tissue region.

Segmentation of the Nuclei-staining image

In the Tissue Segmentation step, you have the option to edit the mask that was previously recorded or create a new one. The panel of tissue identification for the nuclei-staining image is under the Tissue Seg tag. The tissue mask that was recorded in the .tar.gz or .stereo the file will be labeled as "RECORD" in the Segmentation mask dropdown menu, while the mask created by drawing or importing will be labeled as "CUSTOM". To change the active mask displayed in the canvas, simply select from the Segmentation mask dropdown.

To select or edit the tissue region, use a combination of Lasso , Brush , and Eraser tools. Lasso is typically used for selecting or deselecting large areas, while the Brush and Eraser tools are more suitable for smaller areas, such as regions around tissue or small holes in the tissue.

Lasso
Brush
Eraser

If you have created a .tif format binary mask file using a third-party tool, you can import it by clicking on the Segmentation mask dropdown on the right panel and then clicking . If the imported result is unsatisfactory, you can replace it by clicking to import a new mask.

Import tissue mask
Show the file name of the imported mask
Replace the mask

Segmentation of the IF images

To identify regions where the protein is actively expressed from the IF images, go to the Gray Scale tag. First, select the active IF image from the Immunofluorescence image dropdown.

Then, adjust the sliders for the Fluorescence intensity threshold. The pixels in the image whose values fall within the selected range will be kept as the region of the IF.

Step 4: Cell Segmentation

circle-info

Cell Segmentation is a skippable step.

Cell identification and segmentation are the core steps in generating single-cell spatial resolved feature expression data.

circle-info

In the current version, cell segmentation is only performed on the nuclei-staining image.

If you upload the .stereo file in step 1, you can see the red outlines of the cells/nuclei on the registered microscope image.

For .tar.gz or .tif/.tiff image file, you will need to use tools to label cells.

Cell segmentation is applicable only within the tissue region. Therefore, the areas not encompassed in the Step 3 Tissue Segmentation will appear as a black background.

Similar to Tissue Segmentation, you have the option to edit the mask that was previously recorded (tagged with "RECORD") or create a new one (tagged with "CUSTOM"). Change the active mask by selecting from the Segmentation mask dropdown.

Use the Lasso , Brush , and Eraser tools to select or edit cells. Lasso is best for use in deselecting large areas such as background, while the Brush and Eraser tools are more suitable for smaller areas, such as marking cells or separating cell clusters.

Lasso to select a cell
Lasso to deselect some cells
Brush
Eraser

It is recommended to import a.tif format cell mask file created from the registered image by any third-party tools. You can import it by clicking on the Segmentation mask dropdown and then accessing your file system by clicking . If the imported result is unsatisfactory, you can replace it by clicking to import a new mask.

Import cell mask
Show the file name of the imported mask
Replace the mask

Step 5: Export

The final step is to export the results of image registration, tissue segmentation, and cell segmentation. Click Export image processing record to generate a .tar.gz file.

Click on the export will open your file system, and you will be allowed to select a saving path.

If you have manually adjusted the image alignment with the matrix, you will also find a *regist.tif file in your output folder. Alternatively, this TIFF file can be located in the SAW output directory under the /outs/ folder.

The .tar.gz file contains the original images and records of the manual process. This file will be used in SAW to analyze sequencing data and images together. The internal structure of the .tar.gz is fixed and modification of the structure or any of the files in it is not recommended.

The *regist.tif file is a registered image that has been cropped and resized to match the dimension of the feature expression matrix. It can be utilized in any third-party tool, and the resulting data can be re-imported to StereoMap.

Pass the TAR.GZ to SAW Pipeline

There are two options for transferring the output of Image Processing to SAW.

One option is to use the --image-tar argument to feed the .tar.gz file into the SAW count pipeline. This will process the image together with the Stereo-seq FASTQ files and produce the HTML summary report.

Another choice is to use the --realigned-image-tar argument to input the .tar.gz file into the SAW realign pipeline. SAW realign will bypass the CID mapping and genome alignment steps, and re-generate aligned images, obtain the feature expression matrix at tissue and cell level, and produce an updated HTML report.

Last updated