Access more of the information about the segmented cells

Hello everyone,

I’ve been trying to access some of the properties about the cells that are segmented in my pipeline for ISS data. The output data is a “starfish.core.morphology.binary_mask.binary_mask.BinaryMaskCollection” and I was wondering if I by any chance to access the information about the cells within that binary mask? I have the cell ids in my exported DecodedIntensityTable and I would like to add the area and coordinates of the cells as well, if possible.

Have a great day!

Hi Christoffer,

This is totally doable. See the mask_regionprops() method in the BinaryMaskCollection class. For example:

# masks is a BinaryMaskCollection
cell_0_area = masks.mask_regionprops(mask_id=0).area
cell_0_centroid = masks.mask_regionprops(mask_id=0).centroid

I would also like to recommend following the assigning spots to cells tutorial, where the DecodedIntensityTable is converted into an ExpressionMatrix. And cell properties like coordinates and area are added as Coordinates of the matrix. If you have an issue with the number of cells in the DecodedIntensityTable not matching the ExpressionMatrix see this post.