If there is a threshold value that separates the scanned object from the table then the operation is trivial:
- Threshold to create segmentation
- Keep largest island in the segmentation (this discards the table, which is thin, so its volume is smaller than the scanned object) - you might need to use more sophisticated property to find the island corresponding to the object of interest (such as objectness filter that @dzenanz recommended above), but in most cases keeping the island with the largest volume should be enough
- Solidify the segment
- Mask volume using the segment (blank out voxels outside the segment)
These steps can all be performed in 3D Slicer’s Segment Editor (using ITK and VTK internally) but can be also automated very easily. See a complete, fully automatic implementation in Python (need to be run in 3D Slicer’s Python interpreter) here.
Original image:
After automatic table removal: