Closed valosekj closed 9 months ago
MONAI prediction clipping sets background values to 0.5 instead of 0!
https://github.com/sct-pipeline/contrast-agnostic-softseg-spinalcord/blob/f88d927c6709dcebb79d38ccd3bd45aa2e355474/monai/run_inference_single_image.py#L308-L309
Possible fix:
# clip the prediction between 0.5 and 1 pred = torch.clamp(pred, 0.5, 1) # set background values to 0 pred[pred <= 0.5] = 0
or sct_maths command for already existing predictions:
sct_maths
$ sct_maths -i ${file}_seg_monai.nii.gz -thr 0.51 -o ${file}_seg_monai_thr.nii.gz
Thanks for catching this bug, Jan! It has been fixed in commit 4694169352fb962f607e7684fe778677adc123dc !
Thank you for the fix, Naga!
MONAI prediction clipping sets background values to 0.5 instead of 0!
https://github.com/sct-pipeline/contrast-agnostic-softseg-spinalcord/blob/f88d927c6709dcebb79d38ccd3bd45aa2e355474/monai/run_inference_single_image.py#L308-L309
Possible fix:
or
sct_maths
command for already existing predictions: