I am trying to use the ConnectedThresholdImageFilter class to segment the "C" looking white region of a binary image ('slice87.jpg'). The idea was to pick a seed value that was lies within the region and only add neighboring pixels that also have an intensity of 255 (between threshold of 254 and 256).
However, my code results in an image with every pixel set to 0:
Instead of this (manually edited through photoshop):
My seed value was (x,y) = (115,35). img.GetPixel(115,35)
returns 255.
import SimpleITK as sitk
img = sitk.ReadImage('slice87.jpg')
seeds = [(115,35)]
output = sitk.ConnectedThreshold(image1=img,
seedList = seeds,
lower = 254,
upper = 256,
replaceValue = 255)
sitk.WriteImage(output, 'output.jpg')