I have a signed distance field that I am thresholding to a label map volume, everything below zero should be identified as the segmentation that I am interested in, however when I do this the returned mask is larger than expected.
Thresholding with below and -0.01 values one can see that the data probe (arrow missing in screenshot) is on the blue edge next to pink region is segmented but the levelset background image is positive. So somehow the region is growing by a layer of voxels?
Is there something I am doing wrong, or is this a bug? the levetset is of type float.
How did you threshold the distance field to a labelmap?
Does the labelmap, the distance map, the segmentation master volume, and the segmentation’s internal binary labelmap representation has the same geometry (origin, spacing, axis directions)?
@kayarre to facilitate investigation it would help if you can provide a sample dataset and sequence of steps to replicate where you see the inconsistency.
The scene file does not contain any bulk data (images, etc.). To share a scene with someone, the easiest is to click on the small “giftbox” icon to create a .mrb file that saves the scene file and all data in a single file.
I’ve tested “Threshold Scalar Volume” module with your data set and it works as intended.
You might have though that thresholding binarizes the image, while it is not. It changes values below/above/outside the specified range and leaves other values unchanged. You see the “band” because you’ve created a labelmap volume for storing the output, which discretizes the output to integer values.
To get a binary volume, you can do it by running thresholding twice (once with “Negate threshold” disabled, then enabled) as shown below. However, you can binarize the image much more easily by using Segment Editor’s Threshold effect or Simple Filter module’s BinaryThresholdImageFilter.
Binarizing an image using Threshold Scalar Volume effect: