Skip to content

What you can do with nilabels

Sebastiano Ferraris edited this page Jul 9, 2019 · 10 revisions

Main features of the code are:

  • Check if there are missing labels in a segmentation (.nii or .nii.gz) and returns a report with the number of connected components per label.

  • Given a segmentation and a label descriptor (itk-snap convention or fsl convention) it returns the corresponding RGB image (4d image with 3 layers in the fourth dimension corresponding to R G B channels).

  • Get the stacks of 4d images so that they are predisposed for label fusion algorithms (using for example niftySeg for the label fusion).

  • Quickly manipulate the components of the header, applying rotations respect to the center of the image or the origin, change the datatype or the translational part.

  • Normalise the intensities of an image given the values below a list of labels of a segmentation,

  • Get the contour of a segmentation, and of each label of a segmentation with no overlaps

  • Easily produce graftings between segmentations (impose a patch label on a segmentation from another one).

  • Relabel a segmentation given the list of old and the corresponding new labels.

  • Permute labels according to a given permutation (permutations and other manipulations can be extended to the labels descriptor text file in fsl and ITK-Snap convention).

  • Keep only one label and assign all the others the same value.

  • Merge a stack of segmentations to get a probabilistic prior for each label.

  • Clean a segmentation leaving only a pre-defined number of connected components for each label and merging the extra components with the closest label.

  • Compute volumes per label of a segmentations.

  • Compute distances between segmentations, such as the dice score, covariance distance, Hausdorff distance and normalised symmetric contour distance.

  • Get all the voxel values below a specified label of a segmentation from the underpinning anatomical image (FA, MD...)

  • Manipulate the shape of the volume of an image, extending a slice to a new dimension, splitting the labels in a 4d image and merge it back. Finally mask and cut each slice of a 4d volume for a given 3d binary compatible segmentation.

  • Symmetrize a segmentation respect to a plane (and also with rigid registration based on an underpinning anatomy - this functionality required NiftyReg to be installed).

  • Create a simple phantom to test label fusion algorithms.

  • Visualise a 3D or 4D array from an Ipython session, through a dummy nifti image opened in ITK-snap.