unravel.segment.labels_to_masks module#

Use save_labels_as_masks.py from UNRAVEL to convert an ilastik segmentation tif series or other image labels to binary .nii.gz masks.

Usage:#

save_labels_as_masks.py -i seg_ilastik_1/IlastikSegmentation -o Ai14_seg_ilasik_1 [-l 1 2 3] [-d dirs] [-p pattern] [-v]

unravel.segment.labels_to_masks.parse_args()[source]#
unravel.segment.labels_to_masks.save_labels_as_masks(ndarray, label, segmentation_dir, output_name)[source]#

Converts label in an image to a binary mask and saves it as a .nii.gz file. Assumes < 256 labels.

unravel.segment.labels_to_masks.main()[source]#