|
XliCompressionScheme
IntroductionThis Sierra ECG XML format, utilized by Philips brand of cardiac monitors, compresses 12-Lead data using the XLI format. This format is not documented anywhere. Philips provided some example applications which decompress the XLI compressed data in the XML file. However, these are not easy to reuse, nor are they cross platform. DetailsThe XLI compression format is relatively straightforward. It is chunked per lead, and utilizes both LZW compression and delta codes. The general outline for decompression is the following:
Decompressed DataThe decompressed data is split into two halves, the MSB in the first half and the LSB in the second half. This is presumably done to improve the compression as the is little difference amongst the MSBs. # input contains the decompressed data
# output will contain the interleaved 16-bit delta codes
fun unpack( input[], output[], nSamples )
for i <- 1..nSamples
output[i] <- (input[i] << 8) | input[nSamples + i]
endfor
endfunDelta Compression Scheme# output contains the 16-bit delta codes
# first is the 16-bit delta code from the chunk header
fun deltaDecompression( output[], nSamples, first )
x <- output[1]
y <- output[2]
prev <- first
for i <- 3..nSamples
z <- (2 * y) - x - prev
prev <- output[i] - 64
output[i] <- z
x <- y
y <- z
endfor
endfunLimb Lead Reconstruction SchemeReconstruction of the remaining limb leads (III, aVR, aVL, and aVF) should be done after the completion of the delta decompression. The channel data for each of the leads appears to be used to ensure the proper sign of the output data, and also includes what appears to be a noise component. # Lead III
for i <- 1..nSamples
leads{III}[i] = leads{II}[i] - leads{I}[i] - leads{III}[i]
endfor
# Leads aVR, aVL, and aVF
# (these rely on Lead III, so be sure to calculate it first)
for i <- 1..nSamples
leads{aVR}[i] = -leads{aVR}[i] - (leads{I}[i] + leads{II}[i]) / 2
leads{aVL}[i] = (leads{I}[i] - leads{III}[i]) / 2 - leads{aVL}[i]
leads{aVF}[i] = (leads{II}[i] + leads{III}[i]) / 2 - leads{aVF}[i]
endfor
|