Using the current implementation of separate clumps (version 0.1.1), a sizeable number of nuclei are lost. These nuclei then typically are within the cytoplasm of other cells.
The way this seems to happen is the following: A mask image from primary thresholding is fed into separate clumps. The modules finds potential clumps and searches for a "dividing" line. This dividing line is removed from the mask, thus disconnecting the cells.
I suspect that not all cells are disconnected, because sometimes there still may be diagonal connections after a dividing line is removed. [The diameter of the dividing line has been increased in the latest version, but still leaves certain edge-cases non separated]
These diagonally connected cells than get the same label when the label module is used, because they still appear to be connected. But when the polygons are made, there is a morphological opening step. Therefore, nuclei that are connected by only a small diagonal line will be separated. When there are 2 polygons created, TissueMaps throws away the smaller one, thus loosing the segmentation for the smaller nucleus.
I will try to fix this the following way: Use a 4-connected labeling instead of 8-connected labeling (diagonal pixels will not be considered neighbours). In this way, nuclei with only diagonal connections will be considered different nuclei.
@HackerMD Are there general problems you would expect with such an approach?
Using the current implementation of separate clumps (version 0.1.1), a sizeable number of nuclei are lost. These nuclei then typically are within the cytoplasm of other cells.
The way this seems to happen is the following: A mask image from primary thresholding is fed into separate clumps. The modules finds potential clumps and searches for a "dividing" line. This dividing line is removed from the mask, thus disconnecting the cells.
I suspect that not all cells are disconnected, because sometimes there still may be diagonal connections after a dividing line is removed. [The diameter of the dividing line has been increased in the latest version, but still leaves certain edge-cases non separated]
These diagonally connected cells than get the same label when the label module is used, because they still appear to be connected. But when the polygons are made, there is a morphological opening step. Therefore, nuclei that are connected by only a small diagonal line will be separated. When there are 2 polygons created, TissueMaps throws away the smaller one, thus loosing the segmentation for the smaller nucleus.
I will try to fix this the following way: Use a 4-connected labeling instead of 8-connected labeling (diagonal pixels will not be considered neighbours). In this way, nuclei with only diagonal connections will be considered different nuclei. @HackerMD Are there general problems you would expect with such an approach?