This document describes a new class, itk::RLEImage, which uses run-length encoding to reduce the memory needed for storage of label maps. This class is accompanied by all the iterators to make it a dropin replacement for itk::Image. By changing the image typedef to itk::RLEImage, many ITK image processing algorithms build without modification and with minimal performance overhead. However, it is not possible if the user code uses GetBufferPointer() or otherwise assumes a linear pixel layout.

This class is implemented to reduce the memory use of ITK-SNAP (www.itksnap.org), so ITKSNAP is the base for measuring the quantitative results.

The class, accompanying iterator specializations, automated regression tests, and test data are all packaged as an ITK remote module https://github.com/KitwareMedical/ITKRLEImage.