Thresholding + Cropping tool inconsitencies between labelmap and 3D Volume

Hello,

I’m currently working on a thresholding tool to label a dcm file with the given thresholding range and bounding box.
I’m using a vtkVolume in combination with a pieceWiseFunction to visualise what will be thresholded on the dcm.
The issue i’m facing is that the void/air around a circular dcm is also labeled on the label map whereas this is not visual in the Volume.
Can the piecewise function in somehow detect what is inside the dcm or what is really in the dcm?
Beneath you can see an example of what I mean.

Hi, I’m not fully understanding what the circled portions mean. The left black circle in particular confuses me, since you seem to be circling the cropping handles and edges. In any case, piecewise functions can’t distinguish “inside or outside”, unless the outside is valued at a constant (e.g. 0) and the inside is guaranteed to be valued greater than 0.