Remove CT patient bed from dicom file automatically

Is it possible to remove CT bed background noise from DICOM automatically without opening Slicer’s graphic window? The python script needs to be run by the server so human intervene needs to be avoided. My question is,

  1. is there any scripts available for this
  2. how could I run the script

Are all the images acquired by the same scanner, of the same body part, using the same imaging protocol? Or you are looking for a completely generic solution that can blank out the patient table on any CT image?

The images could be different. However, I would only be interested in the bones. Yes, I am looking for a completely generic solution to remove the patient bed from the images. Thanks.

If you are only interested in the bones then it’s not a hard problem because there is always enough low-density material (muscles, fat, skin, padding on the table) to separate your region of interest (bones) from the table.

I’ve developed a short script for this some time ago, but to make it easier to use, I’ve now added it as a module in the Sandbox extension:

It will be available in the extensions manager from tomorrow.

Your solution looks great. Is it possible to run the script and obtain the modified DICOM files without opening slicer or any human intervention. Thanks!

Yes, everything that you can do using the GUI of Slicer is accessible via Python scripting.

I would recommend to spend some time with testing on a handful of randomly selected cases, carefully inspect the results and see if the default parameters work or if you need some tuning. Let me know if you think the defaults would need to be changed.

Then, you can use examples in the script repository to see how to load images from DICOM and how to write results to files using Python scripting. You can see in the module’s unit test how you can use it from a script. Note that you can use Slicer as a Jupyter kernel, if you like working with notebooks.