According to the DICOM specification, RLE compression consists of the following steps:
- the image is converted to a sequence
of Composite Pixel Codes;
- the Composite Pixel Codes are used to generate a set of
Byte Segments;
- each Byte Segment is RLE compressed to produce a RLE
Segment;
- the RLE Header is appended in front
of the concatenated RLE Segments.