unravel.image_tools.modify_labels module#
Use img_modify_labels
(ml
) from UNRAVEL to modify specified label IDs in a NIfTI image.
Usage:#
img_modify_labels -i path/image.nii.gz -ids 1 2 3 -o path/image.nii.gz [-val 0] [–retain_IDs] [–binarize] [-v]
- unravel.image_tools.modify_labels.set_labels(img, label_IDs, value=0)[source]#
Set specified label IDs in the ndarray to a given value.
- Parameters:
- Returns:
The modified image with specified label IDs set to the given value.
- Return type:
ndarray