aigt icon indicating copy to clipboard operation
aigt copied to clipboard

Support images multiple segments

Open ungi opened this issue 2 years ago • 1 comments

We need to start supporting multiple segments by one-hot encoding, multi-channel model outputs, and softmax instead of sigmoid final activation. Robert tried this on his dataset by modifying our code, and he says it was quite simple to do.

I think Single Slice Segmentation exports different segments as different values, so that may need to be converted to one-hot encoding later by one of the scripts. The safest place to do this would be in the training script. But we may need to modify the prepare_data script too. Multi-value segmentation arrays should only be resized using nearest neighbor interpolation. Standard image resize functions can interpolate between values (if a new pixel position falls between two old pixel positions). But interpolated non-integer values cannot be later converted using one-hot encoding.

ungi avatar May 11 '23 22:05 ungi

FYI, Slicer supports segmentarion data with one-hot encoding (one volume for each segment) and softmax activation ("provability" value encoded at 8 bits per voxel). You can import, visualize, export segmentation in this representation (@Sunderlandkyl even implemented interactive editing of segmentations in this representation.

The representation is called "Fractional labelmap".

lassoan avatar May 12 '23 00:05 lassoan