Closed namsaraeva closed 1 year ago
I changed the PR to merge into the development branch. At the moment I think it makes sense to keep our new developments separate until we decide that we are ready for a new version and then bring them into the main branch.
Nucleus Mask before filtering
Nucleus Mask after filtering
We are definitely starting to remove some of the segmentation masks we no longer want. But for some reason some of the nuclei and cytosol masks re remaining that we would also want to eliminate. For example we still have the cytosol (and one nucleus mask) for the cell highlighted in red.
I will go back into the code to try and figure out why this is happening. I thought your filtering approach should have taken care of it but it only removes one of the nuclei masks not both of them and also doesn't remove the cytosol mask.
I implemented the changes I commented in the code and I think it's looking good now.
I also added a debugging function where we can directly compare nucleus and cyotosol mask before and after filtering.
The final segmentations would then look like this:
It would be cool if we could also make some more debugging visualisations to see why we are losing specific cells. This can help us to troubleshoot segmentations in the future. Some ideas:
So I checked the extracted single-cell images and we still have the problem that we have some nucleus ids without a matching cytosol id. I think we will need to add the same filtering step for the nucleus make as I added for the cytosol mask where we set all ids not found in the lookup table to 0.
Updates the cellpose DAPI + Cytosol segmentation method by introducing several additional filtering steps based on the filtering threshold defined in the config file.