External Cell Segmentation (Optional)
DRAGEN StrataMap analysis software supports externally generated custom cell segmentation results (either nuclei or cell segmentation masks) for cell bin matrix generation. This input is optional.
To input a custom segmentation mask for analysis, make sure the segmentation files in the external_segmentation folder are in TIFF format, and the corresponding segmentation filename contains Sample_ID and ends with either:
'_nuclei_segmentation_mask.tif' (nuclei segmentation mask) or
'_cell_segmentation_mask.tif' (cell segmentation mask)
For nuclei segmentation mask input: DRAGEN StrataMap analysis software will perform border expansion to create the cell segmentation mask. The default 'expansion_um' parameter is 5 µm, but it can be modified. Both the nuclei bin matrix and cell bin matrix will be generated.
For custom cell segmentation mask input: DRAGEN StrataMap analysis software will not perform border expansion and will generate the cell bin matrix using the cell segmentation input. When using a cell segmentation mask, please make sure you have performed the expansion yourself.
When generating the segmentation mask TIFF files, please make sure they are instance segmentation masks, in which each nuclei/cell mask (and corresponding pixels) has its own unique object integer ID number.
If the segmentation mask is in binary format (1 for nuclei/cell mask, 0 for background), you can convert it into an instance segmentation:
By running a script—for example, Python functions such as 'skimage.measure.label', 'scipy.ndimage.label', or 'cv2.connectedComponents'. Here is an example script for this conversion:
import numpy as np
import tifffile as tiff
from scipy.ndimage import label
# Example usage
if __name__ == "__main__":
# load the binary segmentation mask file
binary_mask = tiff.imread("Sample1_binary_nuclei_segmentation_mask.tif")
# convert the binary segmentation mask into instance segmentation mask
instance_mask, num_features = label(binary_mask)
# Save labeled array as a TIFF file
tiff.imwrite("Sample1_instance_nuclei_segmentation_mask.tif", instance_mask.astype(np.uint32))By using image analysis software like ImageJ (Fiji): use 'Plugins' -> 'Process' -> 'Find_Connected_Regions' and set 'Regions for values over: ' to '0'.
Last updated
Was this helpful?

