Hematoxylin & Eosin Staining Image
Why Hematoxylin & Eosin Staining Image?
Hematoxylin and eosin stain (H&E stain) is a widely used tissue stain that provides histologic information for medical diagnosis and is considered the gold standard. Hematoxylin mainly stains cell nuclei in purplish blue, and eosin colors cytoplasm and extracellular matrix in different shades of pink. By integrating spatially resolved sequencing-based feature data generated from Stereo-seq with the H&E staining image, the morphology of cells can be linked with spatially localized feature expression. The combined use of histology images and feature expression co-representation increases the amount of information that a tissue slice can provide.
Considerations for H&E Staining Images
Stereo-seq chip is a non-transparent silicon chip, so the H&E stained image should be scanned by a bright-field microscope using reflective light. The background color of the H&E image is close to white, and the representation of tracklines is lighter white. Different from fluorescence images, which only illustrate relatively simple information with shades of gray, H&E staining images provide sophisticated histopathology information by combining R-G-B colors. Therefore, the file size of an RGB image is much larger than a grayscale image in the same dimensions, and the required computing resources are much higher. Currently, StereoMap requires a minimum of 16GB RAM, which is only sufficient for processing a 24-bit color, 10X objective image for a 1 cm x 1 cm chip.
Processing H&E images in StereoMap and SAW requires an individual acquisition stored in a single-page color file at 24-bit depth. (See Image Types and Format for more information)
Color image
One 24-bit color single-page image file
Step 1: Upload Image

Click on Choose file in the drag-and-drop box to select a compatible image file from your file system. You can also drag your selected file and drop it in the box. Only one image file is allowed for this image type.
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. However, if the input file format is .tif or .tiff, you need to enter the required information specified in this step 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 it with the spatial feature expression matrix.

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 image is in the .stereo file, but you need to change the reference expression matrix, you can click the
and load a new file. This action will reload the matrix, but use the image 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
, Opacity
, and Saturation
of the image can be adjusted manually.

The images are adjusted to optimize the visibility of tracklines.

The image that has been adjusted will be marked as complete by
.
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.
Step 3: Tissue Segmentation
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.

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.
In the Tissue Segmentation step, you have the option to edit the mask that was previously recorded or create a new one. Tissue mask that was recorded in the .tar.gz or .stereo 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.



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.



Step 4: Cell Segmentation
Cell Segmentation is a skippable step.
Cell identification and segmentation are the fundamental steps in generating spatially resolved single-cell feature expression data. For H&E images, segmentation can be performed on either nucleus regions or cell regions.

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 white 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.




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.



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.

This output file can be located in your file system, specifically under the StereoMapWorkspace -> Processing folder, which is in your designated saving path. The saving path can be modified in Setting. 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 image 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