There is no specific function in ITK/SimpleITK to remove the bed from the image. This usually involves multiple steps. I highly recommend you follow @lassoan’s advice and use the module from 3D Slicer.
p.s. The morphology module, is an skimage module, not ITK/SimpleITK. Its documentation does say it has a dilation method (the code in the other post did not include all the imports).
Thank you @zivy . I tried 3D Slicer using the GUI. In the Segment Editor module, I used scissors to remove the table. However, in the screenshot given in @lassoan 's advice, there is a separate module named Remove CT table (RED rectangle in the below screenshot), which I could not find. Please help.
Thank you @lassoan . I could remove CT Table using the Sandbox extension. However, I cannot save the resulting DICOM series. I am trying to do Export to Dicom, but I cannot proceed. The below screenshot shows where I am stuck.
You are using a very old Slicer version. Please update to the latest Slicer Stable Release. If you still have problems with DICOM export then please ask on the Slicer Forum.