0

I have some 3D CT scan images. Some slices of that image contains unnecessary things. I want remove that things giving the intensity value -1000. How can I do that?

1 Answers1

0

Since you're loading with SimpleITK, here's how you can do it with SimpleITK

import SimpleITK as sitk

ct_image = sitk.ReadImage("your_ct_scan_here")

# produce a binary mask image for all pixels>-1000
mask_image = (ct_image>-1000)

# apply the mask to make a new image
new_ct_image = ct_image * mask_image

sitk.WriteImage(new_ct_image, "masked_ct_image.nii.gz")
Dave Chen
  • 1,905
  • 1
  • 12
  • 18