DICOM PS3.5 2024c - Data Structures and Encoding |
---|
The RLE algorithm described in this section is used to compress Byte Segments into RLE Segments. There is a one-to-one correspondence between Byte Segments and RLE Segments. Each RLE segment must be an even number of bytes or padded at its end with zero to make it even.
A stream of identical bytes (Replicate Run) is encoded as a two-byte code:
and a non-repetitive octet-stream (Literal Run) is encoded as:
The value of -128 may not be used to prefix a byte value.
It is common to encode a 2-byte repeat run as a Replicate Run except when preceded and followed by a Literal Run, in which case it's best to merge the three runs into a Literal Run.
Three-byte repeats shall be encoded as Replicate Runs. Each row of the image shall be encoded separately and not cross a row boundary.
DICOM PS3.5 2024c - Data Structures and Encoding |
---|