1

I have a 3d image which is the segmentation result of a input volume, the system works fine except for when two cells are located very close to each other, then in that case the segmentation results come back as the two cells joined as shown in the image below:

enter image description here

The circled are are actually two cells but are joined combined due to being closely located. In CC counting these two come up as a single cell.

I tried using morphological opening but it does not seem to provide the result I want. With a single iteration I have no effect ad with enough iterations to break the gap, I lose the smaller blobs.

import imageio as io
import numpy as np
import skimage.morphology as morph
import scipy.ndimage as ndimage

img = io.volread('test_volumes/volume_4_1_predictions.tif')

bw_img = img > 0.5      # binrize image
bw_img = 1 - bw_img     # this changes True False to 1 and 0
bw_img = 1 - bw_img     # Make background black and foreground white

strel = morph.ball(1)

opened = ndimage.binary_opening(opened, strel, 5)

5 iterations of this opens the gap but i seem to lose a lot of information.

Erosion does not work either as it loses more information than opening.

What would be the best way to disconnect these two cells?

Here is the 3d image in.tif format: https://app.box.com/s/9wcqf3qbn8d9jg8zfvw3ijz85baes8t4

StuckInPhDNoMore
  • 2,507
  • 4
  • 41
  • 73
  • 2
    This is not a duplicate, because it's for a different programming language, but it does show the general solution: distance transform + watershed. https://stackoverflow.com/questions/42374463/matlab-segmentation-to-separate-touching-objects-in-an-image – Cris Luengo Feb 12 '19 at 18:23
  • That worked. Many thanks @CrisLuengo – StuckInPhDNoMore Feb 18 '19 at 16:09

0 Answers0