image = | compactIndexImg (inImg) |
Re-indexes the labels (or class indices) in order to use a minimum range of values.
The CompactIndexImg algorithm can be used when some values are missing in a label or a class image. Its purpose is to assign new values to each pixel/voxel in order to reduce the image range.
The figure below shows the result of the algorithm on a label image where the shapes 3 and 4 have been removed (top-left). The result is a label image with reindexed labels : the shapes 5 becomes 3 and the new index of the shape 6 is 4. The bottom line displays the corresponding histograms.