<commit_before>
[![coverage](https://github.com/SebastianoF/nilabels/blob/master/coverage.svg)](https://github.com/SebastianoF/nilabels/blob/master/coverage.svg)


<p align="center">
<img src="https://github.com/SebastianoF/nilabels/blob/master/logo_low.png" width="300">
</p>

# NiLabels

(ex. [LABelsToolkit](https://github.com/SebastianoF/LABelsToolkit))

NiLabels is a cacophony of tools to automatise simple manipulations and measurements of medical image
segmentations in nifti format. It is heavily based on and influenced by the library [NiBabel](http://nipy.org/nibabel/)

### Features

+ Written in Python 3.6 back compatible with 2.7
+ Simplifies the access to a range of tools and algorithms for the manipulation of medical image segmentations (see more under [motivations](https://github.com/SebastianoF/nilabels/wiki/Motivations))
+ After importing NiLabels, you can quickly: 
    + check if there are missing labels in a segmentation 
    + count the number of connected components
    + get the corresponding 4D RGB image (with colors provided in ITK-snap or fsl labels descriptor format) 
    + apply rotations and translations to the image header
    + permute or change the segmentation numbering, erase or merge labels 
    + compute Dice's score, covariance distance, Hausdorff distance and normalised symmetric contour distance between segmentations 
    + get the array of values at the voxels below a given label
    + symmetrise a segmentation
    + erase small connected components and replace with closest label values
    + [...and more](https://github.com/SebastianoF/nilabels/wiki/What-you-can-do-with-nilabels)
+ Facade design pattern (see the [docs](https://github.com/SebastianoF/nilabels/wiki/Design-Pattern))<commit_msg>Circle CI badge added<commit_after>
[![coverage](https://github.com/SebastianoF/nilabels/blob/master/coverage.svg)](https://github.com/SebastianoF/nilabels/blob/master/coverage.svg)
[![CircleCI](https://circleci.com/gh/SebastianoF/nilabels.svg?style=svg)](https://circleci.com/gh/SebastianoF/nilabels)

<p align="center">
<img src="https://github.com/SebastianoF/nilabels/blob/master/logo_low.png" width="300">
</p>

# NiLabels

(ex. [LABelsToolkit](https://github.com/SebastianoF/LABelsToolkit))

NiLabels is a cacophony of tools to automatise simple manipulations and measurements of medical image
segmentations in nifti format. It is heavily based on and influenced by the library [NiBabel](http://nipy.org/nibabel/)

### Features

+ Written in Python 3.6 back compatible with 2.7
+ Simplifies the access to a range of tools and algorithms for the manipulation of medical image segmentations (see more under [motivations](https://github.com/SebastianoF/nilabels/wiki/Motivations))
+ After importing NiLabels, you can quickly: 
    + check if there are missing labels in a segmentation 
    + count the number of connected components
    + get the corresponding 4D RGB image (with colors provided in ITK-snap or fsl labels descriptor format) 
    + apply rotations and translations to the image header
    + permute or change the segmentation numbering, erase or merge labels 
    + compute Dice's score, covariance distance, Hausdorff distance and normalised symmetric contour distance between segmentations 
    + get the array of values at the voxels below a given label
    + symmetrise a segmentation
    + erase small connected components and replace with closest label values
    + [...and more](https://github.com/SebastianoF/nilabels/wiki/What-you-can-do-with-nilabels)
+ Facade design pattern (see the [docs](https://github.com/SebastianoF/nilabels/wiki/Design-Pattern))
{'fraction_non_alphanumeric': 0.09513335166345889, 'fraction_numerical': 0.004399230134726423, 'mean_word_length': 4.657853810264386, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '997203', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1043, 'n_words': 349}