usage: AimsTextureCleaning.py [-h] [-t [TEXTURE ...]] [-m [MESH ...]]
                              [-o [OUTPUT ...]] [-n NOMENCLATURE] [-e EROSION]
                              [-d DILATION] [-s MINSIZE] [-p PROC]

Clean parcellation textures (developed initially for JulichBrain projections).
Should normally be used after volume to texture projection using AimsVol2Tex.

The nomenclature is basically an int/string labels conversion table, but may
include colors in addition to build a consistent colormap. The nomenclature
file may be given in different formats: JSON, CSV, or HIE.

- JSON (JulichBrain nomenclature):

{"properties": {"regions": [<region_def>, ...]}}

region_def: { "labelIndex": "12", "name": "rototo", "color": [255, 255, 0],
"children": [<region_def>, ...] }

- CSV (JulichBrain nomenclature):

12, rototo

(all colors will be black)

- HIE (AIMS Hierarchical nomenclature)

- XML (JulichBrain niftis)

options:
  -h, --help            show this help message and exit
  -t [TEXTURE ...], --texture [TEXTURE ...]
                        input textures
  -m [MESH ...], --mesh [MESH ...]
                        input meshes
  -o [OUTPUT ...], --output [OUTPUT ...]
                        output textures
  -n NOMENCLATURE, --nomenclature NOMENCLATURE
                        nomenclature int->string table file (JSON, or CSV, or
                        HIE)
  -e EROSION, --erosion EROSION
                        erosion distances dict to remove small parts. Default:
                        {'unknown': 7.0, 'GapMap': 1.5, 'other': 0.5}
  -d DILATION, --dilation DILATION
                        dilation distance (mm) to connect disconnected
                        regions. Default: 1.500000
  -s MINSIZE, --minsize MINSIZE
                        minimum disconnected component size (in mm2) under
                        which remaining small parts are removed. Default:
                        100.000000
  -p PROC, --proc PROC  Use parallel computing using this number of processors
                        (cores). 0=all in the machine, positive number=this
                        number of cores, negative number=all but this number.
                        Default: 0 (all)
