CT patient bed and clothing removal from dicom files

Hi,
I need to remove patient bed, clothing etc. from CT (dicom file) but could not find a code and I am really new in medical analysis. I couldn’t find any HU value for bed, clothing etc as well to use as a threshold value. Could anyone help me regarding this issue?

Thanks in advance
Gökçe

Clothing, patient table, and patient support in CT are usually kept as low density as possible to reduce interference with imaging and minimize patient dose. Therefore, you can separate them from the patient’s body by the following processing steps:

  • create a mask using global thresholding, which encloses the patient’s body (and may contain parts of the table)
  • keep largest connected component (this keeps the island corresponding to the patient’s body, but removes table, clothes, buttons, etc.)
  • solidify the region (otherwise you would erase voxels in internal body cavities, etc.)
  • blank out the volume outside this region

A fully automatic Python script that implements all these steps within 3D Slicer’s Python environment is available here (using a combination of ITK and VTK filters) : TableRemoveFromCT.py · GitHub

You can also remove the patient table, instruments, or any other objects from the image manually as shown in this short tutorial:

2 Likes

Dear Andras,
Thanks a lot for your detailed response, I learned a lot from it. I will check them thoroughly.

Kind regards
Gökçe

1 Like

Great answer, thank you! One question - do you know if it’s possible to perform all the steps in your gist witk SimpleITK?

1 Like

The key step of the method is solidifying the region using a variant of the shrink-wrap algorithm (iterative shrink-wrap with remeshing, concave region carving, and optional grow-wrap mode). As far as I know, shrink-wrap is not available in ITK.

Note that that you can use the gist in 3D Slicer’s Python environment without using the GUI, so you can use it from any other Python scripts or environments.

1 Like

Dear Andras,

I would like to use the fully automatic Python script.
The code with example works fine in 3D slicer.
But I’m struggling to understand how I can apply this to my own patient image?

  1. Loading CT scan in 3D slicer.
  2. Apply the code by changing “masterVolumeNode = sampleDataLogic.GetMasterVolumeNode()”.

And I get the Slicer error " Wrap solidify failed: Input segment closed surface representation is empty.

Please help me how to solve this problem.

Oh!!! I appreciate you a lot for sharing this code for everybody.

You can find several examples of running segmentation from Python script, without GUI in the Slicer script repository. If you have further Slicer-specific questions it would be better to discuss those on the Slicer forum.

1 Like