I have a 3D labelmap image with the values 1 for foreground and 0 for background. I want to erode 1-2 voxels from the edge of the foreground. This is my code:
f = sitk.BinaryErodeImageFilter() f.SetKernelType(sitk.sitkBall) f.SetKernelRadius(1) f.SetBackgroundValue(0) f.SetForegroundValue(1) new_img = f.Execute(img)
new_img is all zeros (while
img has 496 voxels labeled as 1). What am I doing wrong? I have tried with kernels other than
sitkBall with similar results.