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
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) : https://gist.github.com/lassoan/84d1f9a093dbb6a46c0fcc89279d8088
You can also remove the patient table, instruments, or any other objects from the image manually as shown in this short tutorial:
Thanks a lot for your detailed response, I learned a lot from it. I will check them thoroughly.
Great answer, thank you! One question - do you know if it’s possible to perform all the steps in your gist witk SimpleITK?
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.
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?
- Loading CT scan in 3D slicer.
- 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.