Create a mask filling holes of the image

Hello,

I have a question, I want to remove the table of dicom files. For that, I do an “open” to remove the table and an “close” to fill the image as a mask. The problem comes with “close” to fill in the image with a big kernel, the program becomes very slow and it sometimes crashes. But If I remove this step some structures are missing with the erosion of the “open”. So I need a way to make the mask filled.

Is there any filter that can help me with that?. I have tried to make subregions but as one side of the table is very close to the body some areas cannot be discarded if I do that. So I need to do the “open” to the whole image.

The image is a 3d dicom.

mask

What I would like to obtain is this mask of the whole image but it is not feasible to make morphology for that.

Thanks

Hello @zandarina,

You can mimic the opening and closing binary morphological operators using a signed distance map, SignedMaurerDistanceMapImageFilter. This is likely to be faster.

With t>0:
closing (dilation followed by erosion):
signed_distance_map(signed_distance_map(mask)<t)<-t

opening (erosion followed by dilation):
signed_distance_map(signed_distance_map(mask)<-t)<t

As you are interested in removing the bed from CT, not necessarily in binary morphology, consider using the Slicer module that does this, see YouTube video tutorial.

You could pick up a C++ implementation of Ziv’s idea from here:

Thank you very much. I will replace the morphology operations with the distance map. Thanks !!!