vanvalenlab / deepcell-tf

Deep Learning Library for Single Cell Analysis
https://deepcell.readthedocs.io
Other
427 stars 99 forks source link

Segmentation Mask FIle Issues #704

Closed tbudiman7 closed 11 months ago

tbudiman7 commented 11 months ago

Hi VanValen Lab,

We are using a Mesmer standalone program to generate segmentation masks and then inputting it to steinbock. We are running into an issue where when steinbock generates object intensities for each sample, the resulting csv files will show that only 255 cells are present in each sample. We know this is not correct and seems to be an issue with our Mesmer generated segmentation masks because when we retried steinbock with masks generated by Ilastik/CellProfiler steinbock will list out a number of cells in the correct range.

I have attached an image of the code we use to export our segmentation mask.

Screenshot 2023-12-19 at 3 53 10 PM
rossbar commented 11 months ago

Again, this is an issue with the remainder of the pipeline not with mesmer itself. When using default parameters, the Mesmer.predict method will return masks with dtype int32, which are capable of representing segmentation masks with over 2 billion cells.

Changing the dtype of the mask can cause overflows if you use dtypes that are not capable of representing the number of cells in the image; however, this is part of your pipeline and not Mesmer itself.