I am trying to relabel objects identified in images from immunofluroescence microscopy.
In a first step I am segmenting my nuclei to get individual cells than I am generating a voronoi as a proxy for the cytoplasm of the cells.
Aside of this I am detecting specks from another channel. Here comes the problem: I do not have one speck for one cell. Because of this I was unable to map back the detected objects (specks) to their belonging cells (that is where the voronoi should be usefull in principle). Despite all my attempts I wasn't able to change the label of the detected specks with their overlapping voronoi (I tried multiple things and nothing worked).
Does someone know how to do this? I would be happy to hear about your solution!
I have posted example images below:
The script for the object detection:
library(EBImage) Img405 = readImage("Img405.tiff") Img488 = readImage("Img488.tiff") # Nucleus segmentation FilterNuc = makeBrush(size = 51, shape = "gaussian", sigma=2) Img405smooth = filter2(Img405, filter = FilterNuc) nucThrManual = thresh(Img405smooth, w = 100, h = 100, offset = 0.0005) nucOpening = opening(nucThrManual, kern = makeBrush(15, shape="disc")) nucSeed = bwlabel(nucOpening) nucFill = fillHull(thresh(Img405smooth, w = 20, h = 20, offset = 0.001)) nucRegions = propagate(Img405smooth, nucSeed, mask = nucFill) nucMask = watershed(distmap(nucOpening), tolerance = 1, ext = 1) # Voronoi for cytoplasm proxy VoR = propagate(nucMask, nucMask, lambda = 100000) # Speck detection specThr = thresh(Img488, w = 200, h = 200, offset = 0.005) specOpening = opening(specThr, makeBrush(5, shape = 'disc')) specMask = bwlabel(specOpening) # Visualisation of segmentation NImgCol405_488 = rgbImage(blue = normalize(Img405) * 1.5, green = normalize(Img488) * 1.5) SegmSpec = paintObjects(nucMask, NImgCol405_488, col = 'purple') SegmSpec = paintObjects(VoR, SegmSpec, col = 'red') SegmSpec = paintObjects(specMask, SegmSpec, col = 'yellow') display(SegmSpec)
Many thanks in advance for you help.