kits21
kits21 copied to clipboard
Removal of Cyst Label from segmentation
Hi and a very good day,
Thank you for organising this challenge and in turn providing the annotated datasets.
I have a question here, if I would want to remove the cyst label from the segmentation mask, eg: the majority voting of aggregated_MAJ_seg.nii.gz, how can I perform such action?
I have tried manually removing the label 3 (assuming that cyst label is represented by label 3) with ITK snap's Label Editor, but however it does not seem to be able to remove it after I reopen the edited mask.
Would you please give some guidance on this
Best regards, Danny
I would suggest you use a quick python script to do this. If you extract the "pixel data" from each nifti segmentation file as a numpy array called segdat
and simply use segdat[segdat==3] = 1
, then re-save the file, that should do the trick.