Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression...

78
Aus dem Institut für Medizinische Physik Friedrich-Alexander-Universität Erlangen-Nürnberg Direktor: Prof. Dr. habil. Dr. med. h. c. Willi A. Kalender, PhD Lossless and Lossy Raw Data Compression in CT Imaging Inaugural-Dissertation zur Erlangung der Doktorwürde der Medizinischen Fakultät der Friedrich-Alexander-Universität Erlangen-Nürnberg (Dr. rer. biol. hum.) vorgelegt von Jochen Wilhelmy aus Berlin

Transcript of Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression...

Page 1: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

Aus demInstitut für Medizinische Physik

Friedrich-Alexander-Universität Erlangen-NürnbergDirektor: Prof. Dr. habil. Dr. med. h. c. Willi A. Kalender, PhD

Lossless and Lossy Raw DataCompression in CT Imaging

Inaugural-Dissertationzur Erlangung der Doktorwürde

der Medizinischen Fakultätder Friedrich-Alexander-Universität Erlangen-Nürnberg

(Dr. rer. biol. hum.)

vorgelegt vonJochen Wilhelmy

aus Berlin

Page 2: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

Gedruckt mit Erlaubnis derMedizinischen Fakultät der Friedrich-Alexander-Universität

Erlangen-Nürnberg

Dekan: Prof. Dr. Dr. h.c. J. Schüttler

Referent: Prof. Dr. W. A. Kalender

Korreferent: Prof. Dr. J. Vaupel

Tag der mündlichen Prüfung: 18. Dezember 2012

Page 3: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

Inhaltsverzeichnis

Zusammenfassung 1

Summary 3

1 CT Imaging 51.1 Quantum noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2 Raw Data Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2 Data Compression 92.1 Compression Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.1.1 Shannon Entropy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.2 Entropy Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.3 Huffman Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.4 Dictionary Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.1.5 Wavelet Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.2 Compression Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.2.1 Deflate Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.2.2 Vector Quantization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.2.3 Set Partitioning in Hierarchical Trees . . . . . . . . . . . . . . . . . . . . . 142.2.4 Wavelet Difference Reduction . . . . . . . . . . . . . . . . . . . . . . . . . 16

3 Image Quality 193.1 Relative Image Quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.1.1 Mean Squared Error and Peak Signal to Noise Ratio . . . . . . . . . . . . . 193.1.2 Structural Similarity (SSIM) . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3.2 Quality of Imaging Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

4 Data for Evaluation 234.1 Clinical CT patient scans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.2 Clinical CT phantom scans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.3 Simulated breast phantom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5 CT Raw Data Compression 275.1 Lossless Compression Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

5.1.1 Theoretical limit of lossless compression . . . . . . . . . . . . . . . . . . . 285.1.2 Lossless Algorithms for Evaluation . . . . . . . . . . . . . . . . . . . . . . 31

5.2 Lossless Compression Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315.3 Lossy Compression Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.3.1 Lossy Algorithms for Evaluation . . . . . . . . . . . . . . . . . . . . . . . . 345.3.2 Raw data vs. image compression . . . . . . . . . . . . . . . . . . . . . . . . 35

5.4 Lossy Compression Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

6 Transfer Errors in CT Raw Data 40

Page 4: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

6.1 Materials and Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

7 An FPGA Based CT Raw Data Compression Algorithm 467.1 Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477.2 Mode of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

7.3.1 Relative Image Quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557.3.2 Spatial Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597.3.3 Image Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

8 Discussion and Conclusions 64

Glossary 65

Bibliography 66

List of Figures 69

List of Tables 72

Danksagung 74

Page 5: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

1

Zusammenfassung

Hintergrund und Ziele

Kompression wird in der Computertomographie (CT) eingesetzt, um das Datenvolumen der aus denRohdaten errechneten Schnittbilder zu reduzieren, damit sie leichter archiviert oder auf einem Daten-träger bzw. über ein Netzwerk dem behandelnden Arzt übermittelt werden können. Zur Kompressionder Schnittbilder werden verlustlose oder verlustbehaftete Kompressionsalgorithmen eingesetzt. Beiverlustbehafteter Kompression ist darauf zu achten, dass die in Konsensuskonferenzen [26] [2] [32]festgelegte diagnostische Bildqualität erhalten bleibt.

In den vergangenen 15 Jahren ist die Auflösung und die Auslesefrequenz des Röntgendetektors derartgestiegen, dass sich der Aufwand für die Datenübertragung vom rotierenden auf den feststehendenTeil des CT-Scanners und für den Zwischenspeicher stark erhöht hat. Daher ist das Ziel dieser Arbeit,die Rohdaten direkt nach der Aufnahme durch den Röntgendetektor zu komprimieren und nach derÜbertragung und Zwischenspeicherung zu dekomprimieren. Dabei besteht die Anforderung, dass dieKompressionsrate mindestens 1:2 bei einer Übertragungsrate von 10 Gbit/s nach der Kompressionbeträgt, um den Aufwand zu rechtfertigen.

Material und Methoden

Im ersten Teil dieser Arbeit wurden als Arbeitsgrundlage sieben archivierte typische klinische CT-Datensätze der Körperbereiche Kopf, Hals mit Karotiden, Thorax und Abdomen ausgewählt. Diesewurden bei verschiedenen Spannungen und Strömen der Röntgenröhre aufgenommen. Außerdemwurde ein Thoraxphantom bei verschiedenen Strahlendosen und konstanter Röhrenspannung sowiezusammen mit zwei umgebenden Körperfettphantomen bei konstanter Strahlendosis und konstan-ter Röhrenspannung gescannt. Diese Datensätze wurden verwendet, um die Kompressionsraten vonexistierenden verlustlosen Kompressionsalgorithmen zu messen, die Bildqualität von gebräuchlichenverlustbehafteten Kompressionsalgorithmen zu bewerten und den Einfluss von Übertragungsfehlernauf unkomprimierte und komprimierte Rohdaten zu untersuchen. Für die verlustlose Rohdatenkom-pression wurde zusätzlich eine theoretische Abschätzung der maximal möglichen Kompressionsratedurchgeführt, wenn Quantenrauschen vorhanden ist, und mit den Messungen verglichen.

Im zweiten Teil der Arbeit wird ein Kompressionsalgorithmus für eine kostengünstige Rohdatenkom-pression auf einem Field Programmable Gate Array (FPGA) vorgestellt, der die eingangs erwähntenAnforderungen an eine Rohdatenkompression erfüllt. Die Bildqualität wurde mit Differenzbildernund dem Bildqualitätsmaß Structural Similarity (SSIM) [51] bestimmt. Der Einfluss des Algorithmusauf Ortsauflösung und Bildrauschen wurde mit einem simulierten Flachdetektorsystem gemessen.

Page 6: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

2

Ergebnisse

Modellrechnungen für verlustlose Kompression der Rohdaten haben ergeben, dass die Kompressi-onsrate von 1:2, insbesondere für niedrige Strahlendosen, nicht erreichbar ist. Deshalb wurde einverlustbehafteter Kompressionsalgorithmus entworfen, der eine Kompressionsrate bis 1:4 erzielt undDatenraten am Kompressionsausgang von bis zu 10 Gbit/s beherrscht. Übertragungsfehler vom rotie-renden auf den feststehenden Teil des CT sind auf einen Block von 4×4 Detektorelementen begrenztund werden mit einer Prüfsumme erkannt. Bei einer Kompressionsrate von 1:4 wird für die klini-schen Daten ein SSIM Index von 0,98 erreicht. Die Modulationsübertragungsfunktion des simuliertenFlachdetektorsystems nahm bei Verwendung der Rohdatenkompression um weniger als 1% ab.

Schlussfolgerungen

Werden verlustlose Bildkompressionsalgorithmen auf Rohdaten angewendet, sind Kompressionsratenim Bereich 1:1,3 bis 1:1,8 möglich, die jedoch mit geringerer Strahlendosis weiter abnehmen. Daeine möglichst niedrige Dosis in der medizinischen Röntgenbildgebung ein wichtiges Anliegen ist,erscheint verlustlose Kompression nicht geeignet, um die eingangs gesteckten Ziele zu erreichen. Mitleistungsfähigen verlustbehafteten Kompressionsalgorithmen wie JPEG 2000 lassen sich, da für dieKompression der archivierte Rohdaten keine Zeitbegrenzung besteht, Kompressionsraten bis zu 1:16realisieren, ohne dass auffällige Artefakte in den rekonstruierten Bildern sichtbar werden.

Für eine verlustbehaftete Kompression mit sehr hohen Datenraten bis 10 Gbit/s in Echtzeit direktauf dem rotierenden Teil des CT sind jedoch spezielle Algorithmen erforderlich, die robust ge-gen Übertragungsfehler sind und sich durch einen geringen Ressourcenverbrauch auf einem kosten-günstigen FPGA auszeichnen. Mit Kompressionsraten bis 1:4 eröffnen sich neue Anwendungen mitsehr großen Rohdatensätzen wie z.B. Brust-CT. Eine weitere Steigerung der Kompressionsraten vonFPGA-basierten Kompressionsalgorithmen erscheint möglich, wenn bei gegebenem Kostenrahmennoch leistungsfähigere FPGAs zur Verfügung stehen. Der neue Kompressionsalgorithmus ist zumPatent angemeldet worden („Verfahren zur blockweisen Kompression von Messdaten bei Computer-tomographen“).

Das in der vorliegenden Arbeit vorgestellte Kompressionsverfahren für Rohdaten weist zusammen-gefasst folgende Eigenschaften auf:• Die Kompressionsrate beträgt bis zu 1:4• Die Bildqualität erfüllt die Forderungen von Konsensuskonferenzen (bis Rate 1:2,7)• Keine Genauigkeitsreduktion in den Außenbereichen des Detektors• Der Algorithmus verarbeitet die hohen Datenraten von 10 Gbit/s• Übertragungsfehler auf den feststehenden Teil des CT-Scanners werden berücksichtigt• Die Kompression wurde auf einem kostengünstigen FPGA implementiert.

Page 7: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

3

Summary

Background and Aims

Compression is used in Computed Tomography (CT) to reduce the data volume of the slice imagesthat are computed from the raw data. This makes it easier to archive the images or transfer them ona data carrier or over a network to a physician for diagnosis. For the compression of the slice imageslossless and lossy compression algorithms are used. For lossy compression care has to be taken thatthe diagnostic image quality is preserved which was subject of consensus conferences [26] [2] [32].

In the last 15 years the resolution of the x-ray detector and its readout frequency were increaseddramatically so that the costs of data transfer from the rotating part to the fixed part of the CT scannerraised respectively. To counter this, the raw data are to be compressed directly after recording by thex-ray detector and decompressed after transfer and temporary storage. The compression rate shouldbe at least 1:2 at a transfer rate of 10 Gbit/s after compression to justify the additional complexity.

Materials and Methods

In the first part of the work at hand seven archived typical clinical CT data sets of the body regionshead, cervix with carotids, thorax and abdomen were selected as working base. The data sets wererecorded at various x-ray tube voltages and currents. Also a thorax phantom was scanned at vari-ous doses and constant x-ray tube voltage and the thorax phantom was scanned with two differentenclosing body fat phantoms and constant dose and x-ray tube voltage. These data sets were usedto measure the compression rates of existing lossless compression algorithms, to evaluate the imagequality of conventional lossy compression algorithms and to investigate the impact of transfer errorson uncompressed and compressed raw data. For lossy raw data compression a theoretical estimationof the maximum possible compression rate in presence of quantum noise was done and comparedwith the measurements.

In the second part of the work a compression algorithm for a cost-effective raw data compression on aField Programmable Gate Array (FPGA) is proposed that fulfills the requirements on a raw data com-pressions that were mentioned at the start. The image quality was determined using difference imagesand the image quality measure Structural Similarity (SSIM) [51]. The influence of the algorithm onthe spatial resolution and the image noise was measured using flat panel detector simulations.

Page 8: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

4

Results

The model calculations for lossless compression of raw data yield that the compression rate of 1:2is not achievable especially for low radiation doses. Therefore a lossy compression algorithm wasdeveloped that achieves a compression rate of up to 1:4 and a data rate of up to 10 Gbit/s at theoutput. Transfer errors from the rotating part to the fixed part of the CT are limited to one blockof 4 × 4 detector elements and are detected with a check sum. At a compression rate of 1:4 anSSIM index of 0.98 is achieved for the clinical data. The Modulation Transfer Function (MTF) of thesimulated flat panel system decreased by less than 1% when raw data compression was used.

Conclusions

When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 areachievable. When generic lossy compression algorithms are applied on raw data, only considerablylower compression rates in the range of 1:1.02 to 1:1.4 are achievable. Moreover the compression ratedecreases with smaller radiation dose. Because keeping the dose as low as possible is an importantgoal in medical imaging, lossless compression does not appear feasible to reach the goals of this the-sis. With efficient lossy compression algorithms like JPEG 2000 archived raw data can be compresseswith rates of up to 1:16 without peculiar artifacts becoming visible in the reconstructed images.

For a compression in realtime with data rates of up to 10 Gbit/s directly on the gantry specializedalgorithms are necessary that exhibit low resource usage on a low-cost FPGA and are robust againsttransfer errors. With compression rates of up to 1:4 new applications with very high data volumessuch as dedicated breast-CT become possible. Improvements of the compression rates of FPGA basedcompression algorithms appear possible if even more powerful FPGAs become available at the samebudget. A patent for the new compression algorithm has been applied for ("Verfahren zur blockweisenKompression von Messdaten bei Computertomographen").

In summary, the presented compression method for raw data offers the following features:• Compression rates of up to 1:4 are supported• The image quality fulfills the requirements of the consensus conferences (up to rate 1:2.7)• No reduction of precision at the border areas of the detector• The algorithm handles high data rates of 10 Gbit/s• Transfer errors of the slip ring are accounted for• The compression was implemented on a low-cost FPGA

Page 9: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

5

1 CT Imaging

X-ray Computed Tomography (CT) (from Ancient Greek τoµη, "cut" and γραφειν, "to write") is amedical imaging procedure which utilizes X-rays to produce tomographic images of specific areasof the body. In the last decades it made a rapid technical development and became a widely usedmodality for diagnosis. Early scanners produced axial slice images while modern scanners can scana 3D volume from which also coronal and sagittal planes can be visualized, the so-called MultiplanarReconstruction (MPR). MPR is used for example for examining the spine. Axial images through thespine will only show one vertebral body at a time and cannot reliably show the intervertebral disks.By using sagittal images it becomes much easier to visualize the position of one vertebral body inrelation to the others.

An important part of a clinical CT scanner as shown in Figure 1.1 is the gantry shown in Figure 1.2which consists of a fixed frame and a therein pivot-mounted rotating disk. An x-ray tube and anx-ray detector are mounted on the disk that get powered over a slip ring. The x-ray tube casts x-raysthrough a measurement field in which the patient is located onto the detector that consists of an arrayor matrix of detector elements. The disk rotates with a speed of up to 3.5 rotations per second whilethe detector records in the order of 1000 projection images per rotation. These get processed andserialized for transfer over a capacitive or optical slip ring by the detector electronics and stored ina memory buffer. This raw projection data is reconstructed to attenuation images or volumes on areconstruction computer, stored and then displayed for diagnosis. Figure 1.3 shows the path of thedata from acquisition to display. State of the art is to compress the final slice images for archiving ortransfer on a data carrier or over a network to the treating physician. After decompression the imagesare available for diagnosis.

To compress the reconstructed images lossless compression algorithms like Deflate [14] (file exten-sion .zip) or lossy algorithms like JPEG [49] or JPEG 2000 [12] are used. On consensus conferences[26] [2] [32] the maximum compression factor of 1:5 to 1:8 was defined for lossy compression of CTimages to preserve the diagnostic image quality.

In the last 15 years the resolution and the sampling frequency of the detector raised to such an extentthat the transfer rate of the slip ring had to be increased from about 60 Mbit/s to about 10 Gbit/s.The sampling frequency of the detector increased not only because of increased rotation speed butalso due to supersampling techniques like Flying Focal Spot (FFS). With FFS the focal spot ofthe x-ray tube is shifted in rotation or patient table direction by half the size of a detector elementbetween subsequent detector readouts. This way the detector resolution can be virtually doubled ineither direction. Therefore the costs of the slip ring and the needed memory buffer have increased.To decrease the requirements on the data transfer rate of the slip ring and therefore the costs, thedetector data, also called raw data, shall be compressed directly on the disk after the acquisition.Thereby it is a requirement that the compression ratio is at least 1:2 to justify the additional effortfor the compression, that the diagnostic image quality stays within the limit given by the consensusconferences and that the the compression processes high data rates of 10 Gbit/s in real time. Preferablythe compression takes transfer errors of the slip ring into account. The existing approach of Andra etal. [6] implements JPEG 2000 on an Application Specific Integrated Circuit (ASIC) that causes veryhigh initial costs and is cost efficient only for high lot sizes. Descampe et al.[13] describe a Field

Page 10: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

6

Figure 1.1: Clinical CT scanner

Slip ring

Rotating disk

X-ray tube

Field of

measurement

Patient

Detector

array

Detector

electronics

Figure 1.2: Principle of gantry of a CT scanner

Page 11: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

7

Detector

Pat. Compression Slip ring

Memory buffer

Decompression

Reconstruction

Compression

Display

DecompressionDisplay Data carrier /

network / archive

Memory

Figure 1.3: Pipeline of data processing in a CT scanner

Programmable Gate Array (FPGA) based decompression of JPEG 2000 for digital cinema that candecode only 20 to 45 images per second according to their requirements.

Attention should be paid to the quantum noise that is specific to x-ray imaging and the special rawdata formats that take the exponential drop-off of x-ray intensity into account when it passes throughmatter.

1.1 Quantum noise

In a x-ray tube electrons are accelerated by a voltage difference U between the cathode and the anode.If the electrons hit the anode bremsstrahlung of continuous spectrum is emitted. The upper limit ofthe frequency ν or the lower limit of the wave length λ is determined by hc0

λ = hν = eU where e isthe elementary electric charge, h the Planck constant and c0 the vacuum light speed. For example forU = 100 kV the wavelength equates to λ = 1.2 × 10−11 m = 12 pm. Due to this short wavelengththe particle nature of x-rays becomes relevant and a detector element receives only in the order of onehundred to one million photons per projection recording. The actual number of received photons is arandom process and obeys the Poisson distribution.

The Poisson distribution has the property that the variance is equal to the expected value. This meansif n photons get received by a detector element on average, then the variance is also n and the standarddeviation is

√n. Therefore the signal to noise ratio is n√

n=√n which means the more photons are

received the better is the signal to noise ratio.

1.2 Raw Data Formats

As the noise level rises with the number of received photons in a detector element according to thePoisson distribution, non-uniform quantization of the digitized detector values is beneficial. Thequantization steps should increase with rising detector value. A method to achieve this is to use alinear quantizer of 24 bit and encode the detector values as 16 bit floating point values. For theexponent two bits are used that indicate which 14 bits out of the 24 bits are used for the mantissa:

Page 12: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

8

Exponent Bit range used for Mantissa00 [13:0]01 [15:2]10 [19:6]11 [23:10]

For example the binary value 0000 0001 0000 0000 0000 0000 has a set bit at position 16, thereforewe use the range [19:6] for the mantissa and the value gets encoded to 10 00010000000000.

A second method to encode raw data is inspired by the fact that the received intensity decreasesexponentially with the thickness of an object that the x-rays pass through. For a homogeneous objectthis is I = I0 · e−µ·d. The projection value is P = ln I0

I = µ · d and is proportional to the thicknessof a homogeneous object. It is also proportional to the thickness of inhomogeneous objects of thesame attenuation distribution. Therefore P = ln I0

I is calculated, quantized to 16 bits and stored.Additionally to the 16 bit values for each detector element an overall scale and offset can be stored sothat the 16 bit of the detector values are fully utilized.

The Siemens Somatom Definition Flash scanner that was used in this work uses the second methodwith overall scale and offset.

Page 13: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

9

2 Data Compression

This chapter gives an overview of existing compression methods that are used for the compression ofreconstructed CT slice images. These will be investigated for suitability for raw data compression inchapter 5.

2.1 Compression Basics

2.1.1 Shannon Entropy

The Shannon Entropy quantifies the expected value of the information contained in a message, usuallyin units such as bits [40]. Shannon’s source coding theorem represents an absolute limit on the bestpossible lossless compression of data: The encoded sequence of bits of the compressed message cannot be shorter than its information content. In other words, any lossless compression scheme cannotcompress messages, on average, to have more than one bit of entropy per bit of message.

2.1.2 Entropy Coding

Entropy coding makes use of the fact that some symbols of an alphabet occur more often in a messagethan others. For example in English text the symbol ’e’ occurs more often than the symbol ’z’.Also the combination ’qu’ will be much more common than any other combination with a ’q’ in it.The idea is to use short codes for symbols with high probability and long codes for symbols withlow probability. The two entropy coding techniques Huffman coding and arithmetic coding can beadapted to the symbol probabilities of an actual message. If the alphabet is very large and the symbolprobabilities follow a known function (e.g. a Laplace distribution) then fixed variable length codessuch as Golomb [18] or Golomb-Rice [37] can be used.

2.1.3 Huffman Coding

Huffman coding [21] is an algorithm to construct a variable-length code where symbols with higherprobability get shorter codes than symbols with lower probability. Huffman codes are so-called prefixcodes which have the property that no valid code word is a prefix (start) of any other valid code word.For example, a code with code words 9, 59, 55 has the prefix property. A code consisting of 9, 5, 59,55 does not, because 5 is a prefix of both 59 and 55. With a prefix code, a receiver can identify eachcode word without requiring a special marker between code words.

A Huffman code is constructed as follows: First the probabilities of all symbols in an alphabet aredetermined and listed in a table. Then a binary tree is generated taking the two least probable symbolsand putting them together to form a new symbol having a probability that equals the sum of the twosymbols. One branch gets a ’0’ assigned, the other a ’1’. The process is repeated until there is justone symbol left. The resulting tree can be used to encode and decode symbols.

Page 14: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

10

z

↓ 2

↓ 2

even

odd

A0(z) A1(z) A2(z)

+

+

+

φ

ψ

Figure 2.1: Wavelet analysis network

φ ψ

(a)

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6

(b)

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6

(c)

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6

(d)

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6

Figure 2.2: (a) Haar wavelet; (b) (2, 2) wavelet [10]; (c) 5/11 wavelet [3]; (d) (4, 4) wavelet[10]

2.1.4 Dictionary Coding

Another approach to compressing data is to search for matches between the data to be compressedand a set of strings contained in a table (called the dictionary) maintained by the encoder. Whenthe encoder finds such a match, it substitutes it by the dictionary index of the matching string. Thedictionary can be pre-defined or built during the compression process which is done by the LZ77compression algorithm [57]. For example the word BANANA can be encoded by BAN, then theinstruction to repeat the last two letters, and an A.

2.1.5 Wavelet Transformation

Next to the Discrete Cosine Transform (DCT) a commonly used transformation in compression algo-rithms is the wavelet transformation.

Page 15: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

11

Level 1

Level 2

Level 3

Level 4

ψ1

φ1ψ2

φ2 ψ3

φ3 ψ4

φ4

Figure 2.3: Recursive wavelet analysis network

time/space frequency

(a)

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6 0.01

0.1

1

10

0 0.1 0.2 0.3 0.4 0.5

(b)

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6 0.01

0.1

1

10

0 0.1 0.2 0.3 0.4 0.5

(c)

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6 0.01

0.1

1

10

0 0.1 0.2 0.3 0.4 0.5

(d)

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6 0.01

0.1

1

10

0 0.1 0.2 0.3 0.4 0.5

(e)

-1.5

-1

-0.5

0

0.5

1

1.5

-6 -4 -2 0 2 4 6 0.01

0.1

1

10

0 0.1 0.2 0.3 0.4 0.5

T F

Figure 2.4: (a) ψ function of the first level in time/space and frequency domain for (4, 4)wavelet. (b) to (d) recursive transform of the φ function of the previous level.(e) φ function of the fourth level. T = t/ts is the normalized sampling interval,F = f/fs is the normalized frequency.

Page 16: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

12

Wavelet coefficients are approximately Lapace distributed and there exists self-similarity accross mul-tiple levels of wavelet transofrm. These properties are exploited by many lossy compression algo-rithms and was used as a basis for the CT raw data compression algorithm proposed in this work.Therefore a short introduction to the topic is given. Additionally [15], [10] and [3] are recommendedfor further reading.

A simple way to calculate wavelet transforms is the so-called lifting scheme introduced in [45]. Thisstarts by splitting a signal in even and odd samples and then alternately applying filters to the one partof the signal and adding the result to the other part of the signal. The output of the analysis networkare a lowpass component φ and a highpass component ψ. Such a lifting scheme analysis is shown inFigure 2.1, which consists of N filters A0(z) to AN−1(z). Only the first three filters are shown. It iseasy to construct the synthesis network from the analysis network. We only have to reverse the orderof the filters and subtract their result from the other part of the signal. Downsampling is replaced byupsampling and the first look-ahead (z) is replaced by a delay (z−1).

Figure 2.2 shows four types of wavelets: a) Haar wavelet, b) (2, 2) wavelet according to [10], c) 5/11wavelet according to [3] and d) (4, 4) wavelet according to [10]. The filters A0(z) to A2(z) for eachtype of wavelet are as follows:

Haar

A0(z) = −1

A1(z) = 12

A2(z) = 0

(2, 2)

A0(z) = 1

2(−z − 1)

A1(z) = 14(1 + z−1)

A2(z) = 0

5/11

A0(z) = 1

2(−z − 1)

A1(z) = 14(1 + z−1)

A2(z) = 132(z2 − z − 1 + z−1)

(4, 4)

A0(z) = 1

16(z2 − 9z − 9 + z−1)

A1(z) = 132(−z + 9 + 9z−1 − z−2)

A2(z) = 0

The wavelet transform can be applied recursively on the low pass component φ. For two dimensionalimages the wavelet transform is applied in horizontal direction and then in vertical direction. Thisresults in four partial images: LL, LH, HL and HH. LL is the low pass component in both directionswhich can be recursively transformed. The resulting layout of coefficients is shown in Figure 2.5.

The effect of the recursive wavelet transform is a decomposition of the signal in mutiple bands inthe frequency domain. Figure 2.3 shows a recursive wavelt analysis netowrk. Figure 2.4 a) to d)show four recursive levels of the (4, 4) wavelet in time/space domain and frequency domain. Themaximum amplitude of the first level is two, for the second level four, for the third level eight andfor the fourth level sixteen. This accounts for the occurrences of the coefficients, i.e. every secondwavelet coefficient is first level and every sixteenth coefficient is fourth level. The area under thefrequency amplitude curves of a) to d) is equal. Figure 2.4 e) shows the remaining dc part of thefourth level.

Page 17: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

13

LL3 HL3

LH3HH3HL2

LH2 HH2

HL1

LH1 HH1

Figure 2.5: Layout of wavelet coefficients where suffix is recursion level

2.2 Compression Algorithms

Lossless compression aims at reducing the redundancy in a message, subsequently called data, andtherefore representing it with fewer bits than the original data. The original data can be completelyrestored from the compression data, therefore no data loss occurs in the compression/decompressionprocess.

Lossy compression not only reduces the redundancy in data like lossless compression, but also re-moves parts that are not relevant to a receiver, e.g. a human observer of an image. This implies thatthe meaning of the data and its format must be known to the compression algorithm, for example if itis audio or video data with 8, 16 or 32 bit resolution per sampled value. Then the least significant bitof each value has less relevance than the most significant bit.

Lossy compression typically performs a transformation step that influences the probability of thevalues so that small values have high probability and large values have low probability. Then aquantization step removes information that is not relevant to the receiver. The remaining data iscompressed using a lossless compression algorithm, for example Huffman coding.

2.2.1 Deflate Algorithm

Deflate is a lossless data compression algorithm that is used in the well known .zip file format andcombines Huffman coding and dictionary coding in an elegant way. 286 symbols are defined wheresymbols 0 to 255 represent bytes consisting of 8 bits for direct coding of input data, symbol 256denotes the end of a compressed data block and symbols 257 to 285 are the instructions to repeat apart of the data that was already decoded. For these 286 symbols a Huffman tree is built according tothe symbol probabilities and encoded into a block of compressed data.

2.2.2 Vector Quantization

Vector Quantization is a compression method where vectors of input values (for image compressionfor example blocks of size 8× 8) are compared with a dictionary of predefined vectors and then onlythe index of the best matching dictionary entry is transferred. A method to generate this dictionary

Page 18: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

14

is described in [31]. Pyramid Vector Quantization (PVQ) is a form of vector quantization wherethe dictionary of predefined vectors is determined by an algorithm instead of a table. This way thedictionary can be very large, for example 2200 entries.

A vector of Laplacian random variables has equiprobable contours in the form of mutidimensionalpyramids. This can be seen from the multidimensional Laplacian probability density

f(x) =

2

)Le−λr (2.1)

where x is a vector of length L and r is the l1 norm radius of x: r =∑L

i=1 |xi|. It has been shownthat for large vector dimensions the radial distribution decreases so that the points concentrate ona multidimensional pyramid with radius of r = L

λ (see [16] and [22]). The quantization vectorsare placed on the surface of the pyramid in a regular pattern. The constant K controls the numberof quantization vectors: K + 1 is the number of quantization vectors on an edge of the pyramid.Such a pyramid in three dimensions with K = 4 and quantization vectors shown as points on itssurface can be seen in Figure 2.6 a). Since real data is not ideally Laplace distributed and the vectordimension has moderate size, the radius r can not be assumed to be constant and therefore has tobe transferred beside the encoded vector. This is called a product code PVQ. The radius is encodedusing a logarithmic quantizer. All quantization points of a constant radius are called a shell. Theidea is to place neighboring shells in the same distance as neighboring points on the same shell. Twoneighboring points on a shell have the distance d =

√2K r which is illustrated in Figure 2.6 b). For

the quantization of r we therefore need a function r(rq) with ∆r(rq)∆rq

= r′(rq) = d where rq is thenlinearly quantized with steps of one. This function and its inverse are

r = exp

(√2

Krq

), rq = log(r)

K√2. (2.2)

This can be veryfied by deriving r(rq): r′(rq) =√

2K exp(

√2K rq) =

√2K r. Figure 2.6 b) shows the

resulting distribution of multiple shells when using the equation 2.2.

For image compression, PVQ can be combined with the wavelet transformation as the wavelet coef-ficients are roughly Laplace distributed. Figure 2.7 shows the layout of a code word for one block of8 × 8 wavelet coefficients. First comes the dc coefficient for the block, for example 16 bits, then theencoded position on the pyramid surface (the PVQ part) and then the radius of the pyramid surface.Every encoded 8 × 8 block of coefficients uses the same number of bits which results in a fixed bitrate.

2.2.3 Set Partitioning in Hierarchical Trees

Set Partitioning in Hierarchical Trees (SPIHT) operates on wavelet coefficients that are generated bya recursive wavelet transform. The general idea of SPIHT is to (partially) sort the coefficients bymagnitude and to exploit the self-similarity across different scales of an image wavelet transform.

In a first step the coefficients are split into absolute value and sign and are arranged in a quad-treestructure where four coefficients of a higher frequency band are children of a coefficient of lowerfrequency band, as shown in Figure 2.8. An example sequence of coefficients is shown in Figure2.9. The coefficients are partially sorted as shown in Figure 2.10 which illustrates that sorting the

Page 19: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

15

(a) (b)

rK

rK

√2Kr

Figure 2.6: (a) Three dimensional pyramid with quantization vectors; (b) Distance of neigh-boring quantization vectors on one shell and product code PVQ with multipleshells.

encoded vector radiusdc-coefficient

Figure 2.7: Code word for one block of 8× 8 coefficients

Figure 2.8: SPIHT spatial orientation tree

(a)(b) 0 0 1 0 0 0 1 0 0 0 0

0 1 X 0 1 0 X 0 0 1 0

+ - + - + + - - + - +

0 X X 0 X 0 X 1 0 X 0

...

Figure 2.9: Example wavelet coefficients as columns. (a) signs, (b) bit planes where signifi-cant bits are denoted as 1 and refinement bits as X.

Page 20: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

16

(a)(b) 1 1 0 0 0 0 0 0 0 0 0

1 1 1 0 0 0 0 0 0

+ - - + - - + + + - +

1 0 0 0 0 0

...

Figure 2.10: Sorted wavelet coefficients as columns. (a) signs; (b) bit planes without refine-ment bits

coefficients exposes redundancy in the coefficients. The coefficients are encoded in bit plane order.This means that the bits of all coefficients with the highest weight are considered first. The encodingprocess iterates from the highest to the lowest bit plane and consists of two passes per bit plane. Thefirst pass encodes the significant bits, which are the highest set bits of each coefficient, and their signbits. This is the sorting pass and transfers information such as a significant bit of a coefficient andits sign or alternatively if the coefficient and some or all children in the quad-tree are not significant.The second pass transfers the refinement bits which are all bits following a significant bit in eachcoefficient. These bits are assumed to have equal probability for being 0 or 1 and therefore aretransferred directly without any coding.

2.2.4 Wavelet Difference Reduction

Wavelet Difference Reduction (WDR) is a different approach to encode the wavelet coefficients andwas presented by Tian and Wells [47]. Like SPIHT the wavelet ac-coefficients are encoded in bitplane order. The dc-coefficient is encoded separately using a uniform scalar quantizer.

In a first step the ac-coefficients are reordered into a linear list, as shown in Figure 2.11, and splitinto absolute value and sign. Then the encoding process iterates from the highest to the lowest bitplane and consists of two passes per bit plane. The first pass encodes the significant bits, which arethe highest set bits of each coefficient, and their sign bits. A scheme similar to run length coding isused to transfer the distance from one significant bit to the next. For each significant bit the distanceand the corresponding sign bit are transferred together. WDR uses four symbols, ’0’ and ’1’ for thebits of the distance value and ’+’ and ’-’ for the sign. The sign also serves as separator between thedistances and since the distance is always greater or equal to one the first bit can be omitted (if thevery first bit is significant, a distance of one is transferred). To indicate the end of a bit plane to thedecoder, the distance to the position one behind the end of the coefficient list is transferred, includinga dummy sign bit that serves as end marker for the distance. For example the encoding of the firstbit plane of the coefficients shown in Figure 2.12 results in distance/sign pairs 3/+, 4/-, 5/+. Encodedusing the four symbols this is ’1+00-01+’ which means ’advance 3 coefficients and set significant bitand posive sign, advance 4 coefficients and set significant bit and negative sign, advance behind theend of bitplane’. The four symbols are binary encoded as ’00’, ’01’, ’10’ and ’11’. Figure 2.13 a) tod) show the encoding steps of the significant bits of the first bit plane of the example in Figure 2.12.

The second pass transfers the refinement bits which are all bits following a significant bit in eachcoefficient. These bits are assumed to have equal probability for being 0 or 1 and therefore aretransferred directly without any coding.

As improvement to the significant pass Lamsrichan and Sanguankotchakorn [28], [29] have proposedto use a header that informs the decoder about the number of significant bits in a pass. The encoder canchoose between header and classical end marker, whichever is shorter. A limitation of this approach

Page 21: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

17

LL3 HL3

LH3HH3HL2

LH2 HH2

HL1

LH1 HH1

Figure 2.11: Scan order for WDR

(a)(b) 0 0 1 0 0 0 1 0 0 0 0

0 1 0 1 0 0 0 1 0

+ - + - + + - - + - +

0 0 0 1 0 0

...

Figure 2.12: WDR significant pass over wavelet coefficients as columns. (a) signs; (b) bitplanes without refinement bits

(a)(b)(c)(d)(e)(f)

distance/sign distance to end/dummydistance/sign

4/- 5/+3/+

00- 01+1+

distance/sign end symboldistance/sign

000011 0001100110

1010 1011 11000

Figure 2.13: Encoding of two significant bits (a) layout for WDR; (b) example distance andsign bits; (c) transmitted symbols; (d) transmitted bits; (e) layout for WDRHwith end symbol; (f) Huffman encoded symbols for WDRH

Page 22: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

18

(a)

0

0.05

0.1

0.15

0.2

end skip 1/+ 1/- 2/+ 2/- 3/+ 3/- 4/+ 4/- 5/+ 5/- 6/+ 6/- 7/+ 7/- 8/+ 8/-

Pro

babili

ty

Symbol

(b)

0

0.05

0.1

0.15

0.2

end skip 1/+ 1/- 2/+ 2/- 3/+ 3/- 4/+ 4/- 5/+ 5/- 6/+ 6/- 7/+ 7/- 8/+ 8/-

Pro

babili

ty

Symbol

Figure 2.14: Symbol probabilities of the first 18 symbols for WDRH. (a) encoding of wholeprojections, (b) encoding of blocks of size 16× 16

is that the header has to be inserted in front of the encoded bits of a significant pass after the pass iscomplete. This complicates hardware implementation since the encoded bits of a bit plane have to bestored in an extra memory until the header is known.

To solve this limitation and improve compression ratio especially for encoding of small blocks thisnew encoding of the significant pass is proposed. 512 symbols are introduced where 255 symbolsare for distance 1 to 255 with positive sign, 255 symbols are for distance 1 to 255 with negative signand one extra symbol ’end’ to indicate the end of a bit plane and another extra symbol ’skip’ thatskips 255 bits to increase the possible distance beyond 255. After determining the probabilities ofthese symbols a Huffman code is constructed. This variant of WDR is therefore called WDRH. Theend symbol occurs once per bit plane and is independent from the number of significant bits in thebit plane and the distance to the end of the bit plane. The skip symbol occurs when the run lengthexceeds 255 and indicates that 255 bits have to be skipped. After a skip symbol another skip symbolor a length/sign symbol follows. If large images are encoded, the skip symbol occurs quite oftenas shown in Figure 2.14 a). If blocks of 16 × 16 pixels (255 ac-coefficients) are encoded, the skipsymbol never occurs, but the probability of the end symbol is quite high as shown in Figure 2.14 b).Figure 2.13 e) shows the symbol types using WDRH and Figure 2.13 f) shows the encoded bits usinga Huffman code.

Page 23: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

19

3 Image Quality

As lossy compression of images removes some information, a degradation of image quality occurs.Therefore it is important to measure the image quality and to keep it as high as possible. In thefollowing two types of image quality measurement methods are introduced: Relative image qualitythat measures the degradation of an image relative to a reference image and quality of imaging systemsthat specifies how accurately an imaging system reproduces an imaged object.

3.1 Relative Image Quality

The relative image quality indicates how much a processed or distorted image differs from the originalimage. No statement of the absolute image quality such as spatial resolution or low contrast resolutionis made.

3.1.1 Mean Squared Error and Peak Signal to Noise Ratio

Well known relative image quality measures are Mean Squared Error (MSE), Root Mean SquaredError (RMSE) and Peak Signal to Noise Ratio (PSNR) which are related to each other. They arecalculated from the difference of the original and the distorted image of resolution m × n where thepixels of the original image are denoted as I(i, j) and the pixels of the distorted image are denoted asK(i, j):

MSE =1

mn

m−1∑i=0

n−1∑j=0

[I(i, j)−K(i, j)]2 (3.1)

RMSE =√MSE (3.2)

PSNR = 10 · log10

(MAX 2

I

MSE

)(3.3)

= 20 · log10

(MAX I√MSE

), (3.4)

where MAX I is the maximum possible signal value, for example 255 for an 8 bit image. A drawbackof MSE, RMSE and PSNR is that they only compare the images pixel by pixel and do not take humanvision into account. Therefore another relative image quality measure is presented and and used inthis work.

Page 24: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

20

(a) (b) (c)

(d) (e) (f)

Figure 3.1: Comparison of PSNR and SSIM (images by Wang et al. [51]). (a) Originalimage; (b) Mean-shifted image; (c) Contrast stretched image; (d) Salt-peppernoise contaminated image; (e) Blurred image; (f) JPEG compressed image

3.1.2 Structural Similarity (SSIM)

Human vision is sensitive to the structure of images while global changes in brightness and contrastare not so important. Structural Similarity (SSIM) (see Wang et al. [51]) was developed to addressthis. SSIM compares two images and yields a similarity index that ranges from 1 (similar) to -1 (notsimilar).

Figure 3.1 shows an exemplary image with five distorted versions. In some images hardly any dis-tortion is visible while others show severe artifacts to a human observer. Surprisingly the PSNR isalmost constant. The SSIM index on the other hand decreases with increasing perceived distortion.

Image (Figure 3.1) MSE PSNR [dB] SSIM(a) Original 0.0 ∞ 1.00(b) Mean-shifted image 144.0 26.5 0.99(c) Contrast stretched image 144.2 26.5 0.90(d) Salt-pepper noise contaminated image 143.9 26.5 0.84(e) Blurred image 143.9 26.5 0.70(f) JPEG compressed image 142.0 26.6 0.67

The basic idea of SSIM is to separate the structural information of objects from their illumination tocompare the two nonnegative image signals x and y. x is the reference image and the similarity ofy to x is measured. The overall similarity measure S(x,y) is a function of three components: theluminance comparison function l(x,y), the contrast comparison function c(x,y) and the structure

Page 25: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

21

Image xLuminance

Measurement

Luminance

Comparison

Luminance

Measurement

Contrast

Measurement

Image y

Contrast

Measurement

Contrast

Comparison

Structure

Comparison

+

+

÷

÷

Combination SSIM

Figure 3.2: Principle of Structual Similarity image comparison according to [51]

comparison function s(x,y). The comparisons are done on small areas of the images, for exampleblocks of size 8 × 8 since luminance, contrast and structure vary across an image. The luminancecomparison function compares the mean intensities µx and µy, the contrast comparison functioncompares the standard deviations σx and σy and the structure comparison function compares thenormalized signals (x−µx)/σx and (x−µx)/σx. An overview of the mode of operation of SSIM isshown in figure 3.2.

The similarity measure S(x,y) has three properties:

• Symmetry: S(x,y) = S(y,x)

• Boundedness: S(x,y) <= 1

• Unique maximum: S(x,y) = 1 if and only if x = y (images are equal)

3.2 Quality of Imaging Systems

The quality of an imaging system is determined by how accurately it reproduces an imaged object.General three dimensional imaging systems measure some property of an imaged object which is theobject function O(x, y, z). In the case of CT the object function is the three-dimensional attenuationdistribution µ(x, y, z).

An important question is how "sharp" the image is. The blurring is described by the Point SpreadFunction (PSF) of the system, also called the impulse response of the system. Mathematically, theimage results from the convolution of the object function O with the PSF and multiplication withcontrast factorK. Any real imaging system will also exhibit noise and artifacts. The imaging functionis according to [24]:

I(x, y, z) = K ·O(x, y, z) ∗ (PSF (x, y, z) + noise + artifacts). (3.5)

The PSF is the spatial domain version of the Modulation Transfer Function (MTF). The MTF de-scribes how good a line pattern with given spatial frequency is reproduced by the imaging system,i.e. it descripes the drop of contrast of a line pattern when the width of the lines decreases. The MTFof a system can be measured for example by using a wire phantom (e.g. [33] and [44]). According

Page 26: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

22

to the standard IEC 61223-3-5 [1] the spatial resolution of a system is specified by the spatial fre-quency where the MTF has dropped to 50% and 10%. Spatial resolution measurements in this workare determined by the 10% MTF value.

Page 27: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

23

4 Data for Evaluation

This section defines a data set for evaluation of the lossless compression algorithms being used in thenext section. The first class of data are clinical CT scans from various body parts taken using variousvoltages and doses. This simulates the clinical routine of CT scanner usage. One scanner model with64 detector lines was used that represents modern multi-row scanners. The second class of data areCT scans of phantoms at various doses and varying volume to examine the influence of dose andvolume on compression ratio. All scans were taken on a Siemens Somatom Definition Flash. Thedetector values are represented as logarithms of flux ratios using 16 bit resolution with offset andscale factor per projection.

4.1 Clinical CT patient scans

We selected raw data of six clinical CT scans from the body regions head, carotid arteries, thorax,heart and abdomen. Table 4.1 shows the list of clinical CT scans, where M is the number of detectorelements, L is the number of detector rows and N the number of projections, and FFS the type offlying focal spot in either α or z direction. Scans with two rows of parameters are dual source scans.Two scanned phantoms are included in the data set. Figure 4.1 shows a thorax scan. The left sideshows a part of the sinogram which is a visual representation of the raw data of one detector line. Theright side of Figure 4.1 shows a slice of the reconstruction of the thorax scan.

4.2 Clinical CT phantom scans

Additionally, we scanned an anthropomorphic phantom where we controlled dose and volume whilewe observed their influence on the performance of the compression algorithms. Table 4.2 shows the

Name M L N U /kV I/mA FFSCarotid1 736 64 48088 120 141 α+z

Abdomen1{ 736 64 6664 100 642 z

480 64 6664 100 642 z

Thorax1{ 736 64 27010 100 184 z

480 64 27010 140 145 zHead1 736 64 18252 120 190 zHeadPhantom1 736 20 139100 120 176 α+zThoraxPhantom1 736 64 6252 120 720 zThorax2 736 64 46572 120 132 α+z

Carotid2{ 736 64 12820 100 377 z

480 64 12820 140 374 z

Table 4.1: Set of clinical CT scans including two phantoms

Page 28: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

24

(a) (b)

Figure 4.1: Thorax scan. (a) Part of sinogram; (b) slice of reconstruction

Name Q/mAs M L N U /kV I/mA FFSMedium10 10 736 64 10208 120 20 zMedium30 30 736 64 10206 120 60 zMedium90 90 736 64 10208 120 180 zMedium360 360 736 64 10206 120 720 zThin 110 736 64 10026 120 220 zMedium 110 736 64 10148 120 220 zThick 110 736 64 10030 120 220 z

Table 4.2: Set of phantom CT scans

list of phantom CT scans. Figure 4.3 shows the thin and thick phantoms. See Shanneik [39] for detailson the phantom.

Page 29: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

25

(a) (b)

Figure 4.2: Thorax phantom. (a) lowest dose (10mAs); (b) highest dose (360mAs)

(a) (b)

Figure 4.3: Thorax phantom. (a) thin; (b) thick with body fat phantom

Page 30: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

26

4.3 Simulated breast phantom

Dedicated CT for the female breast has very high requirements on spatial resolution and thereforeproduces very large raw data sets. The voxel size of reconstructed volumes is in the order of 0.1 mm3

as opposed to about 1 mm3 for clinical CT. As breast-CT is still in development only a simulatedbreast phantom [25] could be used to evaluate the developed FPGA based compression algorithm.The phantom is shown in Figure 4.4 and consists of 80% adipose and 20% glandular tissue. It con-tains three low contrast lesions of 1 mm, 2 mm and 5 mm with 120 HU difference to the surroundingtissue. Also three microcalcifications consisting of spheres of 100µm, 150µm and 200µm diameterand distance are present. The material of the microcalcifications is simulated to be calcium hydrox-yapatite.

100 µm

150 µm

200 µm

Microcalcifications

Soft tissue lesions

1 mm2 mm

5 mm

Figure 4.4: Simulated breast phantom

Page 31: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

27

5 CT Raw Data Compression

Increasing detector resolution and gantry rotation speed of CT scanners lead to increasing bandwidthrequirements. In the last 15 years the slip ring transfer rate was increased by a factor of about 100resulting in increased cost. For example with a gantry rotation of about 0.3 s, a detector resolution of800x64 elements and 1200 projections per rotation, the transfer rate needed for 16 bit data is about 3gigabit per second. As an alternative this thesis works on data compression of raw data on the gantry,transfer of the compressed data over the slip ring, decompression and reconstruction on the computer.This approach reduces the bandwidth requirements for the slip ring.

Compression algorithms for this task have to meet three requirements: a) A guaranteed minimumcompression ratio, because the slip ring is bandlimited, b) low complexity in terms of FPGA resourceusage, because high transfer rates are required and space on the gantry is limited, and c) tolerant tohigh noise which is present at low dose, because low dose is an important goal when examining pa-tients with ionozing radiation. Requirement a) can be mitigated by providing a larger buffer memoryfor the compressed data.

This thesis analyzes how lossless and lossy compression algorithms perform under the given require-ments. I define compression ratio as compressed data size divided by original data size and indicateit as a quotient. For lossless compression I investigated the correlation of dose and compression ratio.Due to the discrete nature of the photons received by the detector the noise level increases at lowerdoses which is known to be problematic for compression.

Using lossy compression of medical images care has to be taken that the diagnostic quality of imagesdoes not suffer. This problem has been addressed by consensus conferences (Koff and Shulman [26],Royal College of Radiologists [2], Loose et al. [32]). In their work the compression/decompressionwas applied to the image data in the CT image processing pipeline shown in Figure 5.1 (b). Usingthese results as a reference for the diagnostic image quality, I compress the raw data (Figure 5.1 (a))and decompress it after the transfer over the slip ring.

In the literature, Bae et al. [7] investigated compression of raw data with a high compression ratiofor data storage. Wegener et al. [52] compared the compression ratio of various lossless compressionalgorithms with their PrismCT algorithm and also showed results of PrismCT on lossy compression.For lossy compression two clinical data sets were evaluated using only their own compression algo-rithm, therefore comparison to other algorithms or to compression in image space is not possible.Wang and Pelc [50] investigated the effect of lossy raw data compression in CT images, including thetransfer function of the filtered back projection algorithm.

While this thesis focuses on compression of raw data, existing work also investigated compression ofreconstructed medical image data, e.g. Paz et al. [35].

Raw data Image dataTransfer and

reconstructionAcquisition

Display or

storage

(b) (a)

Figure 5.1: CT image processing pipeline. Compression is possible at (a) or (b)

Page 32: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

28

None of the previous publications investigated the correlation of dose and lossless compression ra-tio, therefore this thesis starts by investigating the relationship between dose and maximum possiblelossless compression ratio.

In Section 5.1 I derive a relationship between dose and the minimum number of bits needed to transferand store the value of a detector element under lossless compression. I used widely used losslesscompression algorithms and evaluated their performance based on CT raw data sets. Section 5.2shows the results and limitations of lossless compression. In Section 5.3 I continue our research withlossy compression algorithms, the discussion of the results follows in Section 5.4.

5.1 Lossless Compression Methods

5.1.1 Theoretical limit of lossless compression

In this section I derive a relationship between dose and noise on the CT detector signals: Lower dosemeans lower number of photons and therefore a higher quantum noise amplitude. In general noise cannot be removed from the signal which means any signal has at least as much entropy as the quantumnoise alone. Shannon’s source coding theorem [40] says that any lossless compression scheme cannotcompress messages, on average, to have more than one bit of entropy per bit of message. Based onthis I calculated the theoretical lower bound for the bits needed to transfer an acquired image usingany lossless compression algorithm.

For the derivation of the noise entropy (i.e. noise amplitude in bit) on the output of an analog/digital(AD) converter produced by quantum noise I used the following theoretical setup: A single detec-tor element receives quanta from a monochromatic x-ray tube with adjustable current. The distancebetween the detector element and the tube is constant and no absorption takes place (vacuum). Theoutput of the detector element is fed into an AD converter with 16 bits resolution and uniform quan-tization. The digital output value is in the range of 0 to 65535. Measurement is done in a fixed timeinterval. At the beginning of each interval the photon count of the detector element is reset to zerowhile at the end of each interval sampling and AD conversion takes place.

Due to the discrete nature of the x-ray photons the photon count is Poisson distributed [17] with theparameter λ that is both the expectation and the variance:

pk = Pλ(X = k) =λk

k!e−λ, (5.1)

where pk is the probability of the photon count being k. The sum of all probabilities pk is one:

∞∑k=0

pk = 1. (5.2)

Therefore λ is the average number of photons received by a detector element. By adjusting the tubecurrent, λ can be set to a desired value. The input amplification of the AD converter is chosen so thata photon count of λ results in the middle AD converter output value of m = 32768 and variationsdue to quantum noise do not lead to range overflow. This is also a model for floating point valuesin a real system as the number of bits of the output values does not depend on λ. For simplificationI assume that the AD converter does not clamp at the maximum of 65535 since the probability of

Page 33: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

29

higher output values is negligible. The entropy of a discrete random variable X with possible values{x0, ..., xn} was denoted by Shannon as H(X) = −

∑ni=0 p(xi) log2 p(xi). The entropy of the

Poisson distribution therefore is

HP = −∞∑k=0

pk log2 pk. (5.3)

At first I calculate the noise entropy HAD of the AD converter output for λ = 32768. In this simplecase the output value is the number of photons received and therefore HAD = HP. Next I calculatethe noise entropy HAD for λ = 65536 where a photon count of 65536 maps to an AD converteroutput value of 32768. In this case every two photon counts are mapped to one AD converter outputvalue and therefore the entropy is

HAD = −∞∑i=0

(p2i + p2i+1) log2(p2i + p2i+1). (5.4)

As the Poisson distribution is a smooth function I assume 2p2i ≈ 2p2i+1 ≈ p2i + p2i+1 and use thisto simplify HAD:

HAD ≈ −∞∑i=0

p2i log2 (2p2i) +

∞∑i=0

p2i+1 log2 (2p2i+1)

= −∞∑k=0

pk log2 (2pk) .

(5.5)

As long as the approximation Npk ≈∑N−1

i=0 pk+i can be assumed, this equation can be generalizedfor λ = Nm where N ∈ N\{0} and m = 32768:

HAD ≈ −∞∑k=0

pk log2 (Npk) . (5.6)

For large values of N and therefore λ this approximation fails because the Poisson distribution cannot be assumed to be approximately constant over an interval of N values any more. Using N = λ

m ,HAD can be reformulated as follows:

HAD ≈ −∞∑k=0

pk log2

mpk

)

= −∞∑k=0

pk

(log2 pk + log2

λ

m

)= HP − log2

λ

m

(5.7)

Page 34: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

30

0

2

4

6

8

10

12

14

16

18

1 100 10000 1e+006 1e+008 1e+010

Noi

se e

ntro

py /

bits

Number of photons

16 bit AD12 bit AD

16 bit AD extrapolated

Figure 5.2: Quantum noise on the output of an analog digital converter dependent on photoncount. 280, 000 photons yield 8 bit noise on output of a 16 bit analog digitalconverter.

For large values of λ, i.e. for a large number of photons, the Poisson distribution converges to anormal distribution with mean µ = λ und variance σ2 = λ. A property of the normal distribution isthat 68.2% of the values lie in an interval of 2σ about the mean. From this it can be estimated howmany photons are necessary to render the quantum noise negligible. This is the case when 2σ

λ = 165536 ,

i.e. when 68.2% of the values fall into one quantization interval of our 16 bits AD converter. Fromλ = σ2 follows σ = 65536 ·2 and λ = 1.7 ·1010. Therefore the quantum noise becomes negligible at1.7 · 1010 photons per detector element. This is also the point where equation 5.7 becomes inaccuratebecause the distribution is not approximately constant over an interval of N values.

For λ < m each photon count maps to one AD converter output value while some of its output valuesin between have zero probability. Therefore the entropy of the AD converter output is HAD = HP

which means the maximum entropy is at λ = m and the entropy drops for smaller photon counts.

Figure 5.2 shows HAD, the quantum noise in bit of the output of the AD converter over the numberof photons. The first graph is for a 16 bit AD converter, the second for a 12 bit AD converter.Also shown is the extrapolated graph for a 16 bit converter where HAD = Hp − log2

λm is also

used for λ < m, because the noise amplitude still increases when the photon count decreases andtypical image compression algorithms do not exploit the fact that some AD converter output valueshave zero probability in a comb-like pattern. For example Golomb-Rice coding assumes a geometricdistribution, transform coding algorithms such as SPIHT work best if the transform result is Laplacedistributed. As noise is not compressible, it tells us for example that a compression factor of 2 is onlypossible if a detector element receives at least 280, 000 photons.

The maximum number of photons in a clinical CT scanner are received when using no filter or patientand maximum dose setting. Using a Siemens Somatom Definition Flash scanner this means a currenttime product of 360 mAs. The photon counts in Table 5.1 were calculated using the photon fluxper detector element, the detector element area of 1.44 mm2 and the exposure time of 1

1152 s. The

Page 35: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

31

U /kV No filter 20mm Al 20mm Al + 200mm H2O80 220770 34428 534

100 442100 90141 1748120 720090 168010 3743140 1010700 264730 6636

Table 5.1: Simulated photon counts at maximum tube current of 360mA

Algorithm Type Based onDeflate (zlib) Generic LZ77 + Huffman [14]BZIP2 Generic Burrows-Wheeler transform [9]LZMA Generic Lempel-Ziv-Markov chain AlgorithmPNG Image 2D-Prediction + Deflate [8]JPEG-LS Image 2D-Prediction + context modelling [54] [11] [55]JPEG 2000 Image Wavelet + zerotree + arithmetic coding [12]PGF Image Wavelet + block reorder + run-length/Rice coder [43]JPEG 2000 3D Volume Wavelet + zerotree + arithmetic coding

Table 5.2: Set of lossless compression algorithms

spectrum was determined by Yohannes [56] and the total photon flux was scaled to fit measured airkerma values using tabulated mass-energy transfer coefficients.

For some settings this would mean a compression ratio of 1:2 can not be reached, but a real systemhas some differences to the presented model. a) The radiation is not monochromatic. b) There is aphoton flux distribution over the detector elements while the model uses a constant average photonflux. c) Scattering occurs in the measured object. d) The detector is typically an energy integratingdetector. e) A real system exhibits additional electronic noise. f) The AD converter resolution can bedifferent in real systems, for example 11 to 14 bit dependent on the actual detector value for typicalfloating point formats. A lower number of bits means that higher compression ratios are possible. Asshown in Figure 5.2 the noise amplitude at the output of a 12 bits AD converter for 280, 000 photonsis only 4 bits which means a limit compression ratio of 1:3.

5.1.2 Lossless Algorithms for Evaluation

In this section I evaluate three general purpose data compression algorithms, four image compressionalgorithms and one volume compression algorithm which are shown in table 5.2. These are widelyused and it seems that JPEG-LS and JPEG 2000 (lossless mode) still represent state of the art losslesscompression algorithms. [42].

5.2 Lossless Compression Results

Figure 5.3 shows that no lossless compression algorithm reaches the compression factor of two forany data set as I expected in chapter 5.1.1. The transform based methods and JPEG-LS reach a factorof about 1.8, PNG and the generic algorithms only a factor of up to 1.4.

Page 36: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

32

1

1.1

1.2

1.3

1.4

1.5

1.6

1.7

1.8

Defl. BZ2 LZM PNG J-LS J-2K PGF J-3D

Com

pres

sion

rat

io

Figure 5.3: Compression ratios of clinical data in order M × L×N

Name Defl. BZ2 LZM PNG J-LS J-2K PGF J-3DMedium10 1.04 1.09 1.09 1.17 1.33 1.32 1.35 1.32Medium30 1.05 1.11 1.10 1.21 1.41 1.39 1.43 1.39Medium90 1.05 1.12 1.12 1.24 1.49 1.46 1.49 1.46Medium360 1.06 1.16 1.18 1.31 1.64 1.59 1.62 1.59Thin 1.07 1.16 1.17 1.30 1.61 1.55 1.60 1.56Medium 1.08 1.18 1.18 1.27 1.55 1.52 1.55 1.52Thick 1.03 1.09 1.09 1.22 1.46 1.43 1.47 1.43Average 1.06 1.13 1.13 1.24 1.50 1.46 1.50 1.47

Table 5.3: Results for phantom data

1

1.1

1.2

1.3

1.4

1.5

1.6

1.7

10 30 90 360

Com

pres

sion

rat

io

Dose [mAs]

Defl.BZ2,LZM

PNGJ-LS,PGFJ-2K,J-3D

Figure 5.4: Compression ratio vs. dose for phantom data

Page 37: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

33

1

1.1

1.2

1.3

1.4

1.5

1.6

1.7

Thin Medium Thick

Com

pres

sion

rat

io

Defl.BZ2,LZM

PNGJ-LS,PGFJ-2K,J-3D

Figure 5.5: Compression ratio vs. volume for phantom data

Publication FactorCanadian study by Koff and Shulman [26] 8 - 15Guidance by the Royal College of Radiologists [2] 5German consensus conference by Loose et al. [32] 5 - 8

Table 5.4: Recommentations for compression factors of CT images

I ordered the raw data either into a sequence of projections (M × L × N ) or a stack of sinograms(M×N×L) and compressed the data of a whole scan. I found that the ordering played no significantrole. Figures 5.4 and 5.5 show the dependence of the compression ratio on dose and volume of thephantom, which matches our theoretical derivation of Figure 5.2 in chapter 5.1.1.

5.3 Lossy Compression Methods

Next I evaluated lossy compression of CT raw data. In contrast to lossless compression, lossy com-pression influences the diagnostic image quality. This topic has been addressed by various publica-tions in different countries as shown in table 5.4. They consider compression of the reconstructedimages used for diagnosis. The goal was to define a general maximum compression ratio for variousimaging modalities and body regions using JPEG and JPEG 2000 compression. Table 5.4 also showsthe agreed compression ratios for CT images, which means that the correspondig quality losses areseen as beeing accepted for diagnostic imaging.

This thesis proposes lossy compression of raw data. This section shows that this is a viable ap-proach.

A typical lossy encoder consists of a transformation, a quantization and a lossless encoding step. Thegoal of the transformation step is to produce coefficients that have a high probability for low valuesand a low probability for high values, for example a Laplace distribution. Well known transformationsare the discrete cosine transform and the wavelet transform. I used compression algorithms with awavelet transformation because wavelet coefficients are approximately Lapace distributed and thereexists self-similarity across multiple levels of wavelet transform. These properties are exploited bylossy compression algorithms (e.g. Donoho [15], Calderbank et al. [10] and Adams et al. [3]). Asimple way to calculate wavelet transforms is the so-called lifting scheme introduced by Sweldens[45]. For two dimensional images the wavelet transform is applied in horizontal direction and then

Page 38: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

34

Algorithm Based on modifiedJPEG 2000 Wavelet + embedded block coding + arithmetic coding [46] [12] noWPVQ Wavelet + pyramid vector quantization [16] yesSPIHT Wavelet + zerotree [38] noWDR Wavelet + run length encoding [47] [28] noWDRH WDR + Huffman yes

Table 5.5: Set of lossy compression algorithms

in vertical direction. This results in four partial images: LL, LH, HL and HH. LL is the low passcomponent in both directions which can be recursively transformed.

5.3.1 Lossy Algorithms for Evaluation

Based on the considerations above I evaluated the widely used lossy compression algorithm JPEG2000 and three lossy compression algorithms from the literature, partly with own modifications whichare shown in table 5.5. These algorithms were selected for possibility for parallelization when appliedto blocks of data. With our modifications I considered different approaches like vector quantization,sorting and run-length encoding of wavelet coefficients.

WPVQ

I combined pyramid vector quantization (PVQ) from Fischer [16] and wavelet transform to waveletpyramid vector quantization (WPVQ). In our implementation the image was decomposed with threelevels of wavelet transform using a (2, 2) wavelet. The resulting 63 ac-coefficients were then encodedusing pyramid vector quantization. The dc-coefficient was separately encoded using a uniform scalarquantizer. For more details see section 2.2.2.

SPIHT

Set Partitioning in Hierarchical Trees (SPIHT) operates on wavelet coefficients that are generated bya recursive wavelet transform. The general idea of SPIHT is to (partially) sort the coefficients bymagnitude and to exploit the self-similarity across different scales of an image wavelet transform.Our implementation is based on the algorithm of Said and Paerlman [38].

WDR and WDRH

Wavelet Difference Reduction (WDR) is a different approach to encode the wavelet coefficients andwas presented by Tian and Wells [47]. Like SPIHT the wavelet coefficients are encoded in bitplaneorder. I implemented the algorithm according to the description of Tian and Wells and extended it byHuffman coding which I call WDRH. For more details see section 2.2.4.

Page 39: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

35

0.96

0.965

0.97

0.975

0.98

0.985

0.99

0.995

1

J2K 1:2

J2K 1:4

J2K 1:8

J2K 1:16

SS

IM in

dex

RawImage

Figure 5.6: Comparison of raw data and image compression using SSIM index as qualitymeasure for all scans of table 4.1. The left bar of each pair is raw data compres-sion, the right is compression of reconstructed images

5.3.2 Raw data vs. image compression

Due to our need to compress and transfer raw data over the slip ring, I compared the compression ofraw data and reconstructed images using JPEG 2000 (see Figure 5.1).

The compression of reconstructed image data (Figure 5.1 (a)) is state of the art for medical imaging(see table 5.4), but the compression of raw data is new (Figure 5.1 (b)). Bae [7] pointed out that rawdata is more compressible than image data. I measured the noise introduced by raw data and imagecompression in terms of SSIM. I did not use PSNR, which is the ratio between the maximum possiblepower of a signal and the power of corrupting noise, because it is a physical quality measure that doesnot take human perception into account. SSIM on the other hand takes into account that humanvisual perception is highly adapted for extracting structural information from an image and measuresdegradation of structural information For example a uniform change of contrast or luminance resultsin a high structural similarity while PSNR makes no difference between various types of noise. Figure5.6 shows the results for typical CT scans using a compression ratio of 1:2, 1:4 and 1:8. Each pair ofcolumns compares compression of raw data and images. The lower error (higher value in dB scale) isprinted in bold. In most cases the compression of image data yields less error which contradicts thestatement of Bae [7], but the order of magnitude is the same.

Figure 5.7 compares the error patterns for compression of the raw data and the reconstructed image.JPEG 2000 at a compression ratio of 1:8 was used and the error patterns are displayed at a windowof 10 Hounsfield Units (HU) centered at 0 HU. The difference image for compression of raw data(Figure 5.7 b)) exhibits a structure that the difference image for compression of image data (Figure5.7 c)) does not. This may result from superposition of compression errors during the image recon-struction using the filtered back projection algorithm. As this effect is only slight I use the followingapproach to evaluate the quality and acceptability of images reconstructed from compressed raw data:Compression of CT images with ratio 1:5 using JPEG 2000 is acceptable according to the consensusconferences, therefore I use it as a reference. Associated with the compression is an image error thatI measure using SSIM index. Any raw data compression that results in images with higher quality(i.e. higher SSIM index) than the reference I assume is also acceptable. In future work this approachshould be evaluated with a larger number of scans and radiologists who assess the images.

Page 40: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

36

(a) (b) (c)

Figure 5.7: Comparison of noise pattern for compression of Abdomen1 using JPEG 2000with ratio 1:8. (a) Original image (window C 30HU, W 100HU); (b) differenceimage for compression of raw data (C 0HU, W 10HU); (c) difference image forcompression of image (C 0HU, W 10HU).

Algorithm Applied on ratioa) WPVQ 8× 8 blocks 1:5b) SPIHT 16× 16 blocks 1:5c) WDR 16× 16 blocks 1:5d) WDRH 16× 16 blocks 1:5e) WPVQ projections / 8× 8 blocks 1:5f) SPIHT projections 1:5g) WDR projections 1:5h) WDRH projections 1:5i) JPEG 2000 projections 1:5j) JPEG 2000 reconstructed images 1:5

Table 5.6: Evaluated lossy compression algorithms

0

50

100

150

200

250

300

a) WPVQ blocky

b) SPIHT blocky

c) WDR blocky

d) WDRH blocky

e) WPVQ

f) SPIHT

g) WDR

h) WDRH

i) JPEG 2000

j) J2K on Image

0

2

4

6

8

10

Ma

x. e

rro

r [H

U]

Std

. d

evi

atio

n [

HU

]

Max. errorStd. deviation

Figure 5.8: Maximum and standard deviation of compression error on HU scale for the lossycompression algorithms listed in table 5.6 and all scans

Page 41: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

37

0.98

0.985

0.99

0.995

1

a) WPVQ blocky

b) SPIHT blocky

c) WDR blocky

d) WDRH blocky

e) WPVQ

f) SPIHT

g) WDR

h) WDRH

i) JPEG 2000

j) J2K on Image

SS

IM in

de

x

Figure 5.9: Structural similarity (SSIM) between original and compressed scans for the lossycompression algorithms listed in table 5.6 and all scans

5.4 Lossy Compression Results

Table 5.6 shows the algorithms used and the block sizes they were applied on, or if projections werecompressed (one projection is 736× 64 detector elements for the first detector and 480× 64 detectorelements for the second detector). For WPVQ the encoding and quantization step works only onblocks by principle. The JPEG 2000 algorithm in table 5.6 j) serves as reference and was applied onreconstructed images. The compression factor of 1:5 is the maximum allowed on consensus confer-ences (see table 5.4). Figure 5.8 shows maximum and standard deviation of the error when using thealgorithms and Figure 5.9 shows the PSNR and SSIM image quality measures.

The fact that compression of whole projections yields better results than blocky compression can beexplained as follows: the attenuation values in a projection vary greatly. At the borders there is mostlikely air and therefore no attenuation, at some areas bones produce high attenuation. If the samenumber of bits is allocated for blocks, then some blocks contain little information, but others containmuch information. Therefore the quantization step and the quantization error vary across blocks.When whole projections are compressed then the quantization step is uniform across the projectionand therefore more bits can be used to represent the areas with high information. This effect isshown in Figure 5.10. Figure 5.10 a) shows a projection, b) shows the difference when the wholeprojection is compressed c) shows the difference when blocks are compressed. The main advantageof blocky compression is that the encoding of blocks can be parallelized and it reduces the complexityof hardware implementations.

Figure 5.11 shows a detail of a low contrast phantom with four lines of circles of various sizes and10 and 20 HU difference to the surrounding. Figure 5.11 a) shows the image reconstructed from theoriginal data, b) shows the same detail reconstructed from raw data that was compressed using WDRblocky. All low contrast details that are visible in a) are visible in b). 5.11 c) shows the differenceimage between a) and b), d) shows the difference image between a) and the detail reconstructedfrom raw data that was compressed using WDR. Nothing of the low contrast circles is visible whichindicates that no loss of spatial resolution has occured. As the noise level of the reconstructed imagesis in the order of 100 HU while the noise level of the difference images is in the order of 10 HU, onlymarginal low contrast resolution is lost.

Page 42: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

38

(a)

(b)

(c)

Figure 5.10: Comparison between blocky and nonblocky compression using WDR. (a) Aprojection; (b) difference for compression of whole projection; (c) differencefor blocky compression

Page 43: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

39

(a) (b)

(c) (d)

Figure 5.11: Low contrast evaluation of lossy raw data compression. (a) original (window C0HU, W 100HU); (b) WDR blocky (C 0HU, W 100HU); (c) difference imagefor WDR blocky (C 0HU, W 10HU); (d) difference image for WDR (C 0HU,W 10HU)

Page 44: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

40

6 Transfer Errors in CT Raw Data

The modern clinical CT scanner that I had access to has two detectors. The first detector consists of736×64 detector elements and the second of 480×64 detector elements. About 1100 projections perrotation are taken. A 16 bit value is generated for each detector element measurement. For a typicalscan of about 50 rotations this results in about 4 GB of detector raw data for the first detector. Thisraw data is transferred over a slip ring which is a part of a communication channel that is subjectedto transfer errors. We measured a bit error rate of 10−13 which means a error rate of 0.5 bit per scan.Statistically this means one bit error every two scans.

When encoding CT raw data prior to transmission, a single bit error may corrupt the decoded datadepending on the encoding scheme. According to the Shannon entropy [40] compression of raw dataincreases the information content per bit and therefore the impact of a bit error on the image quality.

In this chapter I investigated the impact of bit errors on uncompressed and compressed raw data onthe image quality and methods to correct these. The investigations are independent from the type andalgorithm of compression. This can be lossless or lossy compression or other coding of the data.

There are two approaches for error handling: The data can be encoded in a way that errors can becorrected to the original message if the capacity of the transfer channel is not exceeded. For examplelow-density parity-check codes (LDPC) yield good results, see for example Johnson [23].

Alternatively measures can be taken that errors are at least detected and hidden. This can be doneby adding a checksum to each block of data. Erroneous blocks are then set to zero or interpolatedfrom neighboring correct blocks. The latter approach is useful for audio, video or image data where asmall data loss can be tolerated. For example the patent of Shimizume [41] describes a compact discplayer that employs error correction by interpolation. The patent of Hsieh [19] describes a methodfor detecting errors in x-ray detector samples of a computed tomography system over a slip ring.Erroneous samples are replaced by interpolated data from neighboring data samples.

Besides transfer errors there are other sources of errors which are not the scope of this thesis. Forexample the x-ray detectors may deliver erroneous data or different signal amplitudes. The patent ofUrchuk and Crawford [48] describes a method for calibrating detectors and the patent of Lai [27] de-scribes a method for eliminating ring artifacts resulting from non-calibrated detectors. Also misalign-ment of the measurement system may be present. The patent of Hu [20] describes an interpolationmethod to calculate an image at an exact spatial position from misaligned data. The patent of Popescu[36] describes a system for error monitoring and diagnosis. The data is constantly monitored at thedetectors, the slip ring receiver and the reconstruction computer. With this system an error source canbe located which aids maintenance of a computed tomography scanner.

6.1 Materials and Methods

To determine the bit error rate of a contactless slip ring, the Schleifring GmbH used a bit error ratetester (BERT) as shown in figure 6.1. The sender of the BERT was battery powered and located onthe rotating gantry. It sent test patterns with 1.25 Gbit/s per second over the slip ring to the receiver

Page 45: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

41

BERT

sender

BERT

receiverantenna

slip ring

Figure 6.1: Bit error rate testing of slip ring

of the BERT. The rotation speed was 240 rotations per minute. The test duration was one week. Themeasured bit error rate was 10−13.

For the evaluation of the impact of transfer errors on the image quality I used seven data sets from aclinical CT scanner, shown in table 4.1. Six data sets are from patients, one is the scan of a phantom.The size of one projection is given by M × L, the number of detector elements M times the numberof detector rows L. The number of projections is given by N . Voltage and current are given by U andI , the mode of flying focal spot by FFS. FFS can be used to counteract the rotation of the gantryduring the recording of one projection by moving the focal spot of the x-ray tube in the oppositedirection. It also can be used for supersampling by moving the focal spot in rotation direction orpatient table direction by half the size of a detector element between projections. Scans with tworows of parameters are dual source scans where both detectors recorded simultaneously. The datasets consist of 16 bit values per detector element that represent log intensity values with global scaleand offset to make use of the full 16 bit range.

There are two scenarios: transfer of uncompressed raw data and transfer of compressed raw data. Isimulated a bit flip of a detector value in the raw data to determine the impact of transfer errors onimage quality when using uncompressed raw data as shown in Figure 6.2. We flipped the most signifi-cant bit as this has the highest effect. To determine the impact of transfer errors on image quality whenusing compressed raw data, I assume that a block containing a bit error appears as random noise inthe worst case. Therefore I replaced blocks of various shapes or a whole projection by noise as shownin Figures 6.3, 6.4 and 6.5. The quality of reconstructed images was evaluated with difference imagesand SSIM. SSIM was chosen over PSNR because SSIM takes human visual perception into account.While PSNR measures the ratio between the maximum possible power of a signal and the powerof corrupting noise, human visual perception is highly adapted for extracting structural informationfrom an image and measures degradation of structural information. For example a uniform change ofcontrast or luminance results in a high structural similarity while PSNR makes no difference betweenvarious types of noise.

To serve as a reference, the images reconstructed from the original raw data were compressed usingJPEG 2000 with compression factor 1:5 and then their quality was determined in terms of PSNRand SSIM. The compression factor 1:5 is the maximum compression ratio that was defined to beacceptable on consensus conferences such as the Canadian study by Koff and Shulman [26], theGuidance by the Royal College of Radiologists [2] and German consensus conference by Loose et al.[32]. This reference produces an error of about 0.998 (SSIM). We assume that the image quality inthe presence of a transfer error is still acceptable if this value is reached or surpassed and if there isno visible artifact.

If transfer errors were assumed to be detectable, for example by using a CRC checksum, then Ireduced the error by replacing the erroneous block by the data of the previous projection.

Page 46: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

42

-

(a) (b) (c)

Figure 6.2: Error in reconstruction where one most significant bit is flipped. (a) detail of aprojection image recorded by the CT detector with arrow pointing at simulatederror; (b) reconstruction with center at 10HU and width at 100HU; (c) differenceimage with center/width at 0HU/10HU

(a) (b) (c)

Figure 6.3: Error in reconstruction where a column of 64 detector elements is replaced bynoise. (a) detail of a projection image recorded by the CT detector with simu-lated error; (b) reconstruction with center/width at 10HU/100HU; (c) differenceimage with center/width at 0HU/10HU

(a) (b) (c)

Figure 6.4: Error in reconstruction where a row of 64 detector elements is replaced by noise.(a) detail of a projection image recorded by the CT detector with simulated error;(b) reconstruction with center/width at 10HU/100HU; (c) difference image withcenter/width at 0HU/10HU

Page 47: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

43

(a) (b) (c)

Figure 6.5: Error in reconstruction where 64 random detector elements are replaced by noise.(a) detail of a projection image recorded by the CT detector with simulated error;(b) reconstruction with center/width at 10HU/100HU; (c) difference image withcenter/width at 0HU/10HU

6.2 Results

First I investigated the transfer of uncompressed raw data. Figure 6.2 a) shows a detail of the detectorraw data (projection image) containing the bit flip of a most significant bit, b) shows the reconstructionof the data and the difference to the correct data is shown in c). The error is about 0.9998 (SSIM) andtherefore surpasses our reference of 0.998 (SSIM). Based on our reference I classify this kind of erroras acceptable, even if no error handling has been done.

Next I investigated raw data compression in blocks of various shapes. If one bit in a compressed blockis flipped, I assume that the whole block appears as white noise in the worst case. For example a runlength encoding algorithm misplaces the bits when a run length is erroneous, for SPIHT the partialsorting of wavelet coefficients gets disordered. In figure 6.3 one column of 64 detector elements isreplaced by white noise, this leads to a sharp streak in the reconstructed image which is noticeable.The error is about 0.998 (SSIM) and therefore lies on the reference, but the error concentrates toa small area and produces a clearly visible artifact in the reconstructed image. Therefore it is notacceptable.

If a row of 64 detector elements is replaced by white noise as shown in figure 6.4, the symptom in thereconstructed image spreads over a part of the image. The error is about 0.9976 (SSIM) and thereforejust misses our reference of 0.998 (SSIM). We therefore classify this kind of error as unacceptable.

If 64 random detector elements are replaced by noise as shown in figure 6.5, random streaks arevisible in the difference image of the reconstruction. As the error is about 0.9996 (SSIM) and thereare no visible artifacts this kind of error is acceptable.

A typical approach for compressing raw data would be to organize the detector data in blocks, forexample 16× 16 detector elements. If such a block is erroneous, the error is about 0.995 (SSIM) andtherefore fails our criteria for being acceptable.

Table 6.1 summarizes the image error measures for all transfer error shapes and their acceptability.Also the number of erroneous detector elements is given.

Then I used error detection and correction by replacing the erroneous data by the data at the samelocation in the previous projection. For the block of 16× 16 detector elements the error then reached0.99997 (SSIM) which is by far acceptable when comparing with the reference. Table 6.1 also showsthe image error measures for the error correction.

Page 48: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

44

Name Number of erroneous SSIM Acceptable?detector elements

Bit flip (Figure 6.2) 1 0.99984 YesNoise column (Figure 6.3) 64 0.99817 NoNoise row 64 (Figure 6.4) 64 0.99762 NoNoise scatter (Figure 6.5) 64 0.99962 YesNoise 16× 16 256 0.99500 NoNoise row 736 0.99100 NoNoise projection 47104 0.94094 NoReplace column 64 0.99999 YesReplace row 64 64 0.99998 YesReplace scatter 64 0.99999 YesReplace 16× 16 256 0.99997 YesReplace row 736 0.99994 YesReplace projection 47104 0.99958 Yes

Table 6.1: Image error measures of transfer error shapes and their acceptability

0

100

200

300

400

500

600

Bit flip

Noise column

Noise row 64

Noise scatter

Noise 16x16

Noise row

Noise projection

Replace column

Replace row 64

Replace scatter

Replace 16x16

Replace row

Replace projection

Reference

0

5

10

15

20

Max

. err

or [H

U]

Std

. dev

iatio

n [H

U]Max. error

Std. deviation

Figure 6.6: Maximum and standard deviation of image errors for unhandled and correctedtransfer errors

0.94

0.95

0.96

0.97

0.98

0.99

1

Bit flip

Noise column

Noise row 64

Noise scatter

Noise 16x16

Noise row

Noise projection

Replace column

Replace row 64

Replace scatter

Replace 16x16

Replace row

Replace projection

SS

IM in

dex

Figure 6.7: Comparison of Image quality for unhandled and corrected transfer errors

Page 49: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

45

Figure 6.6 shows the maximum error and the standard deviation of the reconstructed images for thedifferent transfer error patterns. Figure 6.7 shows the SSIM measures for all error patterns that wereinvestigated. These are average values for all data sets listed in table 4.1. The reference on the rightof each figure is the image compressed using JPEG 2000 with factor 1:5.

Page 50: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

46

7 An FPGA Based CT Raw Data CompressionAlgorithm

In this chapter a lossy raw data compression algorithm is presented that can be used for compression ofraw data on the rotating part of the gantry. The goals were low complexity in terms of FPGA resourceutilization, high data rates of 5 to 10 GBit/s, tolerance to transfer errors and a guaranteed minimumcompression ratio so that no extra memory buffer is required to compensate a varying data rate at theoutput of the compression algorithm. The actual implementation has a fixed compression ratio, i.e.for each input data block of 16 values a fixed number of compressed output bits is generated.

Previous approaches include Golomb-Rice coding that was used in the patent of Allmendinger [4].As Golomb-Rice coding is an entropy coding scheme that assigns codes of different lengths to thedetector values, this scheme may loose synchronization if a transfer error occurs. Therefore extra bitsfor synchronization have to be inserted into the data stream. Also a memory buffer has to be providedthat compensates the varying data rate of the Golomb-Rice coder. The compression factor is variedaccording to the filling level of the memory buffer so that no buffer overrun or underrun occurs. Forthese reasons we do not use entropy coding.

The patent by Allmendinger [5] proposes a method for compression of CT raw data where the com-pression ratio is controlled by a dose signal. The dose signal represents the current radiation powerof a x-ray tube. In contrast we do not regard the dose signal as it changes only in the order of once ortwice per gantry rotation. To make use of it a large memory buffer is required that can store the dataof a whole rotation.

The disclosure by Lauther [30] describes a method to compress four detector rows that are jointlycompressed using a prediction and entropy coding to make use of their similarities. A compressionratio of 20% to 30% is claimed to be reached. For the same reason as above we do not use entropycoding. Instead of that blocks of detector values are encoded to a fixed number of bits.

In the patent by Wegener [53] a method for compression of CT detector data is published where adetector row is attenuated by a given profile so that the precision of the detector values decreasesand therefore the amount of data gets reduced. The attenuation can be varied so that a given averageoutput bit rate is maintained. We do not use such an attenuation because the optimal attenuationprofile is too dependent on patient region and orientation. If for example legs are scanned then fromthe top view the outer detectors are important and the central detectors can be attenuated. From a sideview the central detectors are important and the outer detectors can be attenuated.

The existing solution by Andra et al. [6] implements JPEG 2000 on an ASIC that has very high initialcosts and is therefore cost-effective only at very high lot sizes. Descampe et al. [13] describe anFPGA based decompression of JPEG 2000 for digital cinema, that can decode only 20 to 45 imagesper second which matches their requirements.

Page 51: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

47

Figure 7.1: DE4 development board with Stratix IV by Altera

7.1 Materials

For the development of the FPGA based compression algorithm first a development board with anFPGA from the Cyclone IV series by Altera was used. For the possibility of data transfer over a fiberoptics cable the development boards DE4 from Terasic was used which is shown in Figure 7.1. Thisboard features an FPGA from the Stratix IV series by Altera. The uses development environment was7.2 by Altera that allows implementing blocks of functionality in Very High Speed Integrated CircuitHardware Description Language (VHDL). These blocks then can be placed onto a schematic diagramand connected with eachother and input and output pins of the FPGA.

Page 52: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

48

Figure 7.2: Quartus II FPGA development environment

7.2 Mode of Operation

The detector matrix gets subdivided into blocks of 4 × 4 detector elements. Then a wavelet trans-formation is applied to each block. To keep the FPGA resource utilization low, the very simple Haarwavelet transform is used which can be calculated using only addition and subtraction operations.The transform is applied horizontally and vertically and two times recursively, i.e. the low-pass coef-ficients form the first recursion are transformed again. The result are one DC coefficient which is theaverage value of all 16 input values, and 15 AC coefficients which describe the detail information ofthe 4× 4 block. The terms DC and AC originated in electronics where they refer to direct current andalternating current. Figure 7.3 shows an overview of the algorithm that enables parallel compressionusing multiple instances of the Compressor IP-Core. An IP-Core for FPGAs denotes functionalitythat is programmed in a hardware description language such as VHDL or Verilog and translated to anet list for execution on the FPGA. Figure 7.4 shows the corresponding decompressor.

The DC coefficient gets transferred directly, i.e. without compression. Typical schemes such as

Detector divided into

blocks of size 4x4

Parallel

compression

IP-Core Average Detail Check

Output data contains

uncompressed averageSerializer

Slip ringIP-Core Average Detail Check

IP-Core Average Detail Check

Figure 7.3: Overview of FPGA based compressor

Page 53: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

49

Detector divided into

blocks of size 4x4

Parallel De-

compressionInput dataDeserializer

Slip ring

Average Detail Check

Average Detail Check

IP-Core

IP-Core

IP-Core

Average Detail Check

Figure 7.4: Overview of FPGA based decompressor

block scale or floating point representation can be used for the DC coefficient that are known fromuncompressed raw data. The number of bits for the AC coefficients gets reduced prior to transmission.This reduction is done as follows: for each AC coefficient the number of unused most significant bitsis determined. For example if a 16 bit AC coefficient has the value of 1024 (binary 0000 0100 00000000), then there are four unused bits and 12 bits that are used by the value and its sign bit. Now thelowest number of unused bits of any of the 15 AC coefficients is determined and all AC coefficients areshifted left by this value. This is comparable to shared exponent floating point numbers. For exampleif the lowest number of unused bits is two, the value of 1024 becomes 4096 (binary 0001 0000 00000000) after the left shift. The lowest number of unused bits gets transferred to the receiver so thatthe shift can be undone. Also a reduced number of bits, for example eleven bits, are transferred fromeach AC coefficient starting at the most significant bit. The value of 1024 therefore gets transferred asbit sequence 00010000000. To detect transfer errors, a parity bit, a Cyclic Redundancy Check (CRC)with 4 or 8 bits or other code for error detection can optionally be appended to each block.

Figure 7.5 shows an arrangement of 16 compressor pairs that allows continuous data transfer at10 Gbit/s. Each compressor pair reads blocks of 16× 16 detector values, compresses them and feeds4 bits of the 64 bits wide 10 Gigabit Media Independent Interface (XGMII) that runs at 156.25 MHz.The input and output of one compressor pair are switched so that one compressor reads and com-presses data while the other transfers its compressed data to the XGMII in packets of 4 bits per clockcycle. This arrangement works for compression rates up to 1:2. For larger compression rates threeor four switched compressors are needed per group. The data sent to the XGMII is converted to fourlanes of the Extended Attachment Unit Interface (XAUI) which runs at 3.125 Gbit/s. This includesan 8B/10B encoding that assigns 10 bit codes to 8 bit values. The XAUI connects to a physical layercomponent that sends the data over a copper or optical cable with nominal 10 Gbit/s.

The hardware implementation of the compressor and decompressor consists of 16 memory registersfor the detector values and some auxiliary memory registers which are processed in several phases.The memory registers consist of clocked flip-flops with common clock signal. It is possible to shiftvalues to the right or left inside a register which means moving all bits in the direction of the leastor most significant bit. It is also possible to shift values from one register to another register. If avalue is passed to the previous register, this means to the register with next lower index, for examplefrom register number 2 to register number 1. If a value is passed to the next register, this means to theregister with next higher index, for example from register number 2 to register number 3.

Figure 7.6 shows the implementation for the first phase with 19 numbered memory registers and threeprocessing units (h1, v1 and h2) which perform steps of the Haar wavelet transformation using addersand subtractors. During 19 clock cycles the data of 16 (4 × 4) detector elements get shifted into thememory registers starting with the last register that has number 18. In each clock cycle the registerspass their value to their predecessor and get a value from their successor. The 19 clock cycles get theindices -3, -2, -1, 0, ..., 14, 15. In the default case the values are passed along the continuous arrows.

Page 54: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

50

Blocks of 4x4 values 16 Compressor pairs

XGMII

16 x 4 = 64 bit

at 156.25 MHz

XAUI

4 x 3.125 Gbit/s

after 8B/10B

Pysical

Layer

Figure 7.5: Continuous compression with 10 Gbit/s output transfer rate

Page 55: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

51

Figure 7.6: First phase of FPGA basedcompressor

Figure 7.7: Second phase of FPGA basedcompressor

Page 56: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

52

Figure 7.8: Third phase of FPGA basedcompressor

Figure 7.9: Fourth phase of FPGA basedcompressor

At unit h1 the values get processed along the dashed arrows on every uneven clock cycle, at unit v1on cycles 4, 5, 6, 7, 12, 13, 14, 15 and at unit h2 on cycles 7 and 15. The results of all adders andsubtractors get divided by two (shifted right by one) in the compressor according to the Haar wavelettransformation.

Figures 7.7 shows the second phase of the compressor that lasts for only one clock cycle. The laststep of the Haar wavelet transformation is performed using two adders and two subtractors. After thisstep the average of all 16 values is in register number 0. All other values are shifted to the previousregister where the value of register number 1 is passed to register number 15.

The shifting of the values continues for 14 clock cycles in the third phase as shown in Figure 7.8.During the 15 clock cycles of second and third phase the position of the highest significant bit isdetermined.

Figure 7.9 shows the fourth phase of the compressor. Per clock cycle four bits are output, whereregister number 0 functions as shift register. First the average value and the position of the highestsignificant bit are output. At the same time the value in register number 1 is shifted so that thehighest significant bit is at a defined position (for example shift left by 15 minus position of highestsignificant bit). If register 0 becomes empty a fixed number of bits (e.g. 11 including sign bit) arepassed to register 0 for output.

Figure 7.10 shows the first phase of the decompressor, in which the average value and the position ofthe highest significant bit are read from the stream of four bit values.

Page 57: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

53

Figure 7.10: First phase of FPGA baseddecompressor

Figure 7.11: Second phase of FPGA baseddecompressor

Figure 7.11 shows the second phase of the decompressor, where the values are shifted into the reg-isters during 15 clock cycles. In the register with number 15 the values are shifted back to theiroriginal bit position, i.e. the shifting in the compressor is reverted. In unit h2 the values are processedalong the dashed lines using an adder and a subtractor. This corresponds to an inverse Haar wavelettransformation in horizontal direction.

Figure 7.12 shows the third phase of the decompressor that lasts only one clock cycle. In registernumber 15 the shift of the last value takes place and in unit v2 an inverse Haar wavelet transformationtakes place in vertical direction.

Figure 7.13 shows the fourth phase of the decompressor that lasts for 19 clock cycles which get theindices -3, -2, -1, 0, ..., 14, 15. On each clock cycle each value is passed to the previous register, thevalue of register number 0 is passed to register number 18. In the units h1 and v1 a horizontal andvertical inverse Haar wavelet transformation is performed. In unit 23 the values are processed alongthe dashed line on clock cycles 4, 5, 6, 7, 12, 13, 14, 15, in unit 24 on cycles 7 and 15.

Figure 7.14 shows the last phase where the values are output.

Page 58: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

54

Figure 7.12: Third phase of FPGA baseddecompressor

Figure 7.13: Fourth phase of FPGA baseddecompressor

Page 59: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

55

Figure 7.14: Fifth phase of FPGA based decompressor

7.3 Results

7.3.1 Relative Image Quality

To visualize the artifacts produced by the proposed algorithm the raw data of the CT image shown inFigure 7.15 were compressed using the proposed algorithm and JPEG 2000. The proposed algorithmwith compression rate of 1:1.39 produces artifacts that are visually comparable to the artifacts ofJPEG 2000 with compression rate of 1:2 which is shwon in Figures 7.16 and 7.17. The proposedalgorithm with compression rate of 1:4 produces artifacts that are visually comparable to the artifactsof JPEG 2000 with compression rate of 1:16 which is shwon in Figures 7.18 and 7.19.

The relative image quality was measured using SSIM for all data sets of Table 4.1 which is shownin Figure 7.21. The left four columns represent the quality of JPEG 2000 applied on raw data withcompression rates of 1:2 to 1:16. The middle three columns show the quality of the proposed algo-rithm applied on raw data with compression rates of 1:1.4 to 1:4. The right four columns representthe quality of JPEG 2000 applied on reconstructed image data with compression rates of 1:2 to 1:16.The blue line in this figure is the quality of JPEG 2000 applied on reconstructed image data withcompression rate of 1:5 and serves as a reference as this is the maximum rate defined in consensusconferences for compression of CT images.

Page 60: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

56

Figure 7.15: Original reconstructed image

(a) (b)

Figure 7.16: Reconstructed image from compressed raw data at center 0HU and width400HU: (a) JPEG 2000 1:2; (b) proposed algorithm 1:1.39

Page 61: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

57

(a) (b)

Figure 7.17: Difference images at center 0HU and width 10HU: (a) JPEG 2000 1:2; (b)proposed algorithm 1:1.39

(a) (b)

Figure 7.18: Reconstructed image from compressed raw data at center 0HU and width400HU: (a) JPEG 2000 1:16; (b) proposed algorithm 1:4

Page 62: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

58

(a) (b)

Figure 7.19: Difference images at center 0HU and width 10HU: (a) JPEG 2000 1:16; (b)proposed algorithm 1:4

0

200

400

600

800

1000

1200

1400

1600

1:21:4

1:81:16

1:1.41:2.1

1:2.71:4

1:21:4

1:81:16

0

5

10

15

20

25

30

Max

. err

or in

HU

Std

. dev

iatio

n in

HU

Max. errorStd. deviation

Raw data

JPEG 2000

Image data

JPEG 2000

Raw data

FPGA

Figure 7.20: Maximum error and standard deviation for JPEG 2000 on raw data, proposedalgorithm on raw data and JPEG 2000 on image data

Page 63: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

59

0.96

0.965

0.97

0.975

0.98

0.985

0.99

0.995

1

1:21:4

1:81:16

1:1.41:2.1

1:2.71:4

1:21:4

1:81:16

SS

IM in

dex

Raw data

JPEG 2000

Image data

JPEG 2000

Raw data

FPGA

Figure 7.21: Measured image quality using SSIM for JPEG 2000 on raw data, proposedalgorithm on raw data and JPEG 2000 on image data

7.3.2 Spatial Resolution

The spatial resolution of a simulated flat panel CT system as a function of the focal spot size wasmeasured using a wire phantom and the 10% MTF value with ImpactIQ, a tool developed at theinstitute. The used simulation parameters are shown in Table 7.1. The number of projections was1000 per second and one rotation was simulated. Several scans with acquisition times from 1 to 10seconds were simulated using the modes in Table 7.2.

Figure 7.22 shows the spatial resolution (in line pairs per millimeter) in the central region dependenton the focal spot size of the simulated x-ray tube. The left graph shows the result with no compressionapplied, the right graph shows the result when the raw data was compressed using the proposed algo-rithm with compression rate of 1:2.27. Figure 7.23 shows the spatial resolution in a peripheral regiondependent on the focal spot size of the simulated x-ray tube. The left graph shows the result withno compression applied, the right graph shows the result when the raw data was compressed usingthe proposed algorithm with compression rate of 1:2.27. For both simulations the spatial resolution

3

4

5

6

7

8

9

10

50 100 150 200 250 300 350 400 450 500

Spa

tial R

esol

utio

n in

lp/m

m

Focal Spot Size in um

1s, cont2s, cont

2s, step & shoot2s, FSC & TDS

5s, cont10s, cont

3

4

5

6

7

8

9

10

50 100 150 200 250 300 350 400 450 500

Spa

tial R

esol

utio

n in

lp/m

m

Focal Spot Size in um

1s, cont2s, cont

2s, step & shoot2s, FSC & TDS

5s, cont10s, cont

Figure 7.22: Spatial resolution vs focal spot size for central region. Left: Original, right:Compression of rate 1:2.27 applied to raw data

Page 64: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

60

3

4

5

6

7

8

9

10

50 100 150 200 250 300 350 400 450 500

Spa

tial R

esol

utio

n in

lp/m

m

Focal Spot Size in um

1s, cont2s, cont

2s, step & shoot2s, FSC & TDS

5s, cont10s, cont

3

4

5

6

7

8

9

10

50 100 150 200 250 300 350 400 450 500

Spa

tial R

esol

utio

n in

lp/m

m

Focal Spot Size in um

1s, cont2s, cont

2s, step & shoot2s, FSC & TDS

5s, cont10s, cont

Figure 7.23: Spatial resolution vs focal spot size for peripheral region. Left: Original, right:Compression of rate 1:2.27 applied to raw data

Air kerma 15.23mGyTube voltage 60 kVDistance focus - detector 450mmDistance wire phantom - center 2mm (central) and 60mm (peripheral)Detector resolution 2816× 4 pixelsPixel size 100× 100µm2

Reconstruction method Filtered Backprojection (FBP)Reconstruction kernel T50

Table 7.1: Parameters for image noise simulation

decreases less than 1% when compression is applied to the raw data.

7.3.3 Image Noise

The image noise of a simulated flat panel CT system as a function of the Average Glandular Dose(AGD) on a female breast phantom was measured using ImpactIQ. The simulation parameters were:

The used breast phantom (Figure 4.4) contains three clusters of microcalcifications consisting ofcalcium hydroxyapatite spheres without and with compression applied to the raw data. The distancebetween and the size of the spheres is 100µm, 150µm and 200µm. Figure 7.24 shows the areacontaining the microcalcifications. For the left image the quantum noise resulting from 3 mGy AGDwas included in the simulation. For the middle image the raw data was compressed. The rightimage shows the difference when compression was applied to the raw data for 3 mGy AGD. Thecompression does not influence the visibility of the microcalcifications.

Figure 7.25 shows the image noise at doses from 1.5 mGy to 6 mGy AGD without and with compres-sion applied to the raw data. Only at very low doses of 1.5 mGy the raw data compression adds about175 HU of noise that is visible in the graphs of the figure, which is an increase of noise by 4.4%.At dose levels of 5 mGy to 6 mGy AGD, which are typical for a mammography, only about 3 HU ofnoise are added which corresponds to an increase of noise by only 0.2%. Only focus size of 100µmis shown, the result is almost identical for a focus size of 300µm.

Page 65: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

61

(a) (b) (c)

– =

Figure 7.24: Detail of breast phantom (rotated by 90 degrees) simulated at 3mGy AGDshowing microcalcifications. (a) Original (window: C 3000HU, W 10000HU);(b) Raw data were compressed (window C 3000HU, W 10000HU); (c) differ-ence (window C 0HU, W 1000HU)

1500

2000

2500

3000

3500

4000

4500

1.5 2 2.5 3 3.5 4 4.5 5 5.5 6

Imag

e N

oise

in H

U

AGD in mGy

FS 100 muCa FBPFS 100 muCa FBP Compression

Figure 7.25: Noise vs average glandular dose without and with raw data compression at focussize (FS) of 100µm

Page 66: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

62

cont tube and detector are moving continuously during acquisitoinstep and shoot tube and detector are not moving during acquisitoinFSC & TDS focal spot control and time delayed summation [34]

Table 7.2: Acquisition modes for image noise simulations shown in figures 7.22 and 7.23

Breast phantom diameter 140mmTube voltage 60 kVFocus size 100µmDistance focus - detector 45mmDetector resolution 2816× 4 pixelsPixel size 100× 100µm2

Reconstruction method FBPReconstruction kernel high resolution (muCa)

Table 7.3: Parameters for image noise simulation

Figure 7.26 shows a detail of the breast phantom (Figure 4.4) containing the low contrast lesions andmicrocalcifications without and with compression applied to the raw data. The simulation parameterswere as listed in table 7.3 except that a low contrast reconstruction filter kernel was used. The recon-structed voxels were further processed using an average filter over 5 slices and a gaussian filter withσ = 1.4 voxels over the shown slice. The compression does not influence the visibility of the lowcontrast lesions.

Page 67: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

63

(a) (b) (c)

– =

Figure 7.26: Detail of breast phantom simulated at 6mGy AGD showing low contrast lesionsand microcalcifications in low contrast mode. (a) Original (window: C−50HU,W 500HU); (b) Raw data were compressed (window C −50HU, W 500HU);(c) difference (window C 0HU, W 20HU)

Page 68: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

64

8 Discussion and Conclusions

An upper limit for the compression ratio of lossless compression was derived using a simplified modelof a CT scanner for which the noise amplitude of the detector signals was calculated dependent onthe number of received photons. The photon counts of a real scanner with filter and patient are notsufficient to reach a compression rate of 1:2 in this model. Also the selected specialized losslessimage compression algorithms reached only rates in the range of 1:1.3 to 1:1.8 when applied to theselected clinical data sets. The generic lossless compression algorithms achieve even smaller rates inthe range 1:1.02 to 1:1.4. Additionally the compression rate decreases with lower dose. Because lowdose is an important goal for medical x-ray imaging, lossless compression is not feasible to reach thegoals of this thesis. Therefore lossy compression was investigated in this thesis.

With existing state-of-the-art lossy compression algorithms such as JPEG 2000 applied to archivedraw data, compression ratios of up to 1:16 are achieved without artifacts becoming visible in thereconstructed images. For all tested lossy compression algorithms JPEG 2000 is among the highestperforming algorithms which means compression of raw data is not fundamentally different fromcompression of image data. Also the amount of image error that is introduced by compressing rawdata and images is comparable. Therefore I reused insights form medical image compression in thecontext of raw data compression. This is for example the maximum acceptable compression ratio thatwas defined in consensus conferences.

The goals of high compression rate and high transfer rates are in conflict: To achieve a high com-pression rate whole projections have to be compressed at once. To achieve high transfer rates, aparallelizable block based compression has to be used that yields lower compression rates. This the-sis focused on high transfer rates of up to 10 Gbit/s but still reaches a compression rate of 1:3 wich ismore than 1:2 which was required to justify the additional effort.

Also the goals of high compression rate and robustness against transfer errors are in conflict: Toachieve robustness against transfer errors error checking or error correction codes have to be trans-ferred additionally which lowers the compression rate. Alternatively block based compression withsmall blocks can be used where each compressed block has the same number of bits to prevent trans-fer errors from propagating over larger areas of a projection. This also lowers the transfer rate bacausethe same number of bits are used to transfer blocks with low and high information content. This thesisuses block based compression because it increases robustness against transfer errors and is easier toparallelize.

Improvements of the compression rate of FPGA based compression algorithms should be possible ifmore powerful FPGAs get available at the same costs.

Page 69: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

65

Glossary

AC Alternating Current

AGD Average Glandular Dose

ASIC Application Specific Integrated Circuit

CRC Cyclic Redundancy Check

CT Computed Tomography

DC Direct Current

DCT Discrete Cosine Transform

FBP Filtered Backprojection

FFS Flying Focal Spot

FPGA Field Programmable Gate Array

HU Hounsfield Units

MPR Multiplanar Reconstruction

MSE Mean Squared Error

MTF Modulation Transfer Function

PSF Point Spread Function

PSNR Peak Signal to Noise Ratio

PVQ Pyramid Vector Quantization

RMSE Root Mean Squared Error

SPIHT Set Partitioning in Hierarchical Trees

SSIM Structural Similarity

WDR Wavelet Difference Reduction

VHDL Very High Speed Integrated Circuit Hardware Description Language

XAUI Extended Attachment Unit Interface

XGMII 10 Gigabit Media Independent Interface

Page 70: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

66

Bibliography

[1] IEC 61223-3-5: Evaluation and routine testing in medical imaging departments - part 3-5: Ac-ceptance tests - imaging performance of computed tomography x-ray equipment, 2004.

[2] The adoption of lossy image data compression for the purpose of clinical in-terpretation. http://www.rcr.ac.uk/docs/radiology/pdf/IT_guidance_LossyApr08.pdf, 2008.

[3] M. D. Adams and F. Kossentini. Low-complexity reversible integer-to-integer wavelet trans-forms for image. In Proc. IEEE Pacific Rim Conference, pages 177–180, 1998.

[4] T. Allmendinger. Datenübertragung bei rotierenden medizinischen systemen, August 2008.

[5] T. Allmendinger. Verfahren zur bearbeitung von detektordaten eines strahlungsdetektors, July2011.

[6] K. Andra, C. Chakrabarti, and T. Acharya. A high-performance jpeg 2000 architecture. IEEETransactions on Circuits and Systems for Video Technology, 13:209–218, 2003.

[7] K. T. Bae. CT data storage reduction by means of compressing projection data instead of images:Feasibility study. Radiology, pages 850–855, june 2001.

[8] T. Boutell et al. RFC2083 - PNG (portable network graphics) specification version 1.0. http://tools.ietf.org/html/rfc2083, march 1997.

[9] M. Burrows and D. Wheeler. Block-sorting lossless data compression algorithm. Technicalreport, DEC Systems Research Center, may 1994.

[10] A. R. Calderbank, I. Daubechies, W. Sweldens, and B.-L. Yeo. Wavelet transforms that mapintegers to integers. Applied and Computational Harmonic Analysis, 5(3):332–369, July 1998.

[11] B. Carpentieri, M. J. Weinberger, and G. Seroussi. Lossless compression of continuous-toneimages. Proc. IEEE, 88(11):1797–1809, 2000.

[12] C. Christopoulos, A. Skodras, and T. Ebrahimi. The JPEG2000 still image coding system: Anoverview. IEEE Trans. Consumer Electronics, 16(4):1103–1127, 2000.

[13] A. Descampe, F. Devaux, G. Rouvroy, B. Macq, and J. didier Legat. An efficient fpga imple-mentation of a flexible jpeg2000 decoder for digital cinema. In Proceedings of European SignalProcessing Conference, September 2004.

[14] P. Deutsch. RFC1951 - DEFLATE compressed data format specification version 1.3. http://tools.ietf.org/html/rfc1951, may 1996.

[15] D. Donoho. Unconditional bases are optimal bases for data compression and for statisticalestimation. Applied and Computational Harmonic Analysis, 1:100–115, 1993.

[16] T. Fischer. A pyramid vector quantizer. IEEE Trans. Information Theory, 32(4):568 – 583, jul1986.

Page 71: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

67

[17] A. G. Frodesen, O. Skjeggestad, and H. Tøfte. Probability and statistics in particle physics.Universitetsforlaget, 1979.

[18] S. Golomb. Run-length encodings. IEEE Transactions on Information Theory, 12(3):399–401,1966.

[19] J. Hsieh, E. Pearson, and D. H. Pritzkow. Data transmission scheme and system for imagereconstruction. Patent US 7,050,616 B2, 2006.

[20] H. Hu. System and method for data interpolation in a multislice x-ray computed tomographysystem. Patent US 6,307,908 B1, 2001.

[21] D. Huffman. A method for the construction of minimum-redundancy codes. In Proceedings ofthe I.R.E., pages 1098–1101, September 1952.

[22] A. C. Hung, E. K. Tsern, and T. H. Meng. Error-resilient pyramid vector quantization for imagecompression. IEEE Trans. Image Processing, 7(10):1373–86, 1998.

[23] S. J. Johnson. Iterative Error Correction. Cambridge University Press, 2010.

[24] W. A. Kalender. Computed Tomography, 3rd Edition. Publicis Publishing, 2011.

[25] W. A. Kalender, M. Beister, J. M. Boone, D. Kolditz, S. Vollmar, and M. Weigel. High-resolution spiral ct of the breast at very low dose: concept and feasibility considerations. Euro-pean Radiology, 22(1):1–8, January 2012.

[26] D. A. Koff and H. Shulman. An overview of digital compression of medical images: Can we uselossy image compression in radiology. Canadian Association of Radiologists J., 57(4):211–217,2006.

[27] C.-M. Lai. Progressive correction of ring artifacts in a computed tomography system. PatentUS 6,115,445, 2000.

[28] P. Lamsrichan and T. Sanguankotchakorn. Adaptive wavelet difference reduction using high-order context modeling for embedded image compression. In IEEE ICICS, pages 900–904,2005.

[29] P. Lamsrichan and T. Sanguankotchakorn. Embedded image coding using context-based adap-tive wavelet difference reduction. In IEEE Conf. Image Processing, pages 1137–1140, oct 2006.

[30] U. Lauther. Apparatus for compuer tomography scanning with compression of measurementdata, October 2002.

[31] Y. Linde, A. Buzo, and R. Gray. An algorithm for vector quantizer design. IEEE Trans. Com-munications, 28(1):84 – 95, jan 1980.

[32] R. Loose, R. Braunschweig, E. Kotter, P. Mildenberger, R. Simmler, and M. Wucherer. Com-pression of digital images in radiology - results of a consensus conference. RoeFo, 181(1):32–37, 2009.

[33] C. E. Metz and K. Doi. Transfer function analysis of radiographic imaging systems. Physics inMedicine and Biology, 24(6):1079, 1979.

[34] T. Nowak. Untersuchungen zur Auflösungsverbesserung und Dosisreduktion in der Computer-tomographie. PhD thesis, Medizinische Fakultät der Friedrich-Alexander-Universität Erlangen-Nürnberg, January 2012.

Page 72: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

68

[35] J. Paz, M. Pérez, P. Schelkens, and J. Rodríguez. Impact of JPEG 2000 compression on lesiondetection in mr imaging. Medical Physics, 36(11):4967–4976, 2009.

[36] S. Popescu. Method and system for data transmission in a ct device, with integrated errormonitoing and diagnosis. Patent US 2005/0005206 A1, 2005.

[37] R. F. Rice and R. Plaunt. Adaptive variable-length coding for efficient compression of spacecrafttelevision data. IEEE Transactions on Communications, 16(9):889–897, Dec 1971.

[38] A. Said, W. A. Pearlman, and S. Member. A new fast and efficient image codec based onset partitioning in hierarchical trees. IEEE Trans. Circuits and Systems for Video Technology,6:243–250, 1996.

[39] K. Shanneik. Temporal and Spatial Resolution in Cardiac CT Imaging. PhD thesis,Friedrich–Alexander–University of Erlangen–Nuremberg, 2005.

[40] C. E. Shannon. A mathematical theory of communication. Bell System Technical Journal,27:379–423, 623–656, 1948.

[41] K. Shimizume. Compact disc players. Patent EP 0 446 033 A2, 1991.

[42] J. Shukla, M. Alwani, and A. Tiwari. A survey on lossless image compression methods. InConference on Computer Engineering and Technology, volume 6, pages 136–141, april 2010.

[43] C. Stamm. PGF - a new progressive file format for lossy and lossless image compression. J.WSCG, 10(2):421–428, 2002.

[44] C. Steiding. Entwicklung und validierung einer methodik zur automatisierten quantifizierungder bildqualität eines ct-systems. Master’s thesis, Technische Universität Ilmenau, december2011.

[45] W. Sweldens. The lifting scheme: a construction of second generation wavelets. SIAM J.Mathematical Analysis, 29(2):511–546, 1998.

[46] D. Taubman. High performance scalable image compression with EBCOT. IEEE Trans. ImageProcessing, 9:1158–1170, 2000.

[47] J. Tian and R. O. Wells. Wavelet Image and Video Compression, chapter Embedded ImageCoding Using Wavelet Difference Reduction, pages 289–301. Kluwer Academic Publishers,1998.

[48] S. N. Urchuk and C. R. Crawford. Apparatus and method for calibrating detectors in a computedtomography scanner. Patent US 6,148,057, 2000.

[49] G. K. Wallace. The jpeg still picture compression standard. Communications of the ACM -Special issue on digital multimedia systems, 34(4):30 – 44, April 1991.

[50] A. S. Wang and N. J. Pelc. Understanding and controlling the effect of lossy raw data compres-sion on CT images. Medical Physics, 36(8):3643–3653, 2009.

[51] Z. Wang, A. C. Bovik, H. R. Sheikh, S. Member, and E. P. Simoncelli. Image quality assessment:From error measurement to structural similarity. IEEE Trans. Image Processing, 13:600–612,2004.

[52] A. Wegener, N. Chandra, L. Yi, R. Senzig, and R. Herfkens. Real-time compression of rawcomputed tomography data: technology, architecture and benefits. In SPIE Medical Imaging2009: Physics of Medical Imaging, volume 7258, feb 2009.

Page 73: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

69

[53] A. W. Wegener. Adaptive compression of computed tomography projection data, December2010.

[54] M. J. Weinberger, G. Seroussi, and G. Sapiro. LOCO-I: A low complexity, context-based,lossless image compression algorithm. In Proc. Data Compression Conference, pages 140–149,1996.

[55] M. J. Weinberger, G. Seroussi, and G. Sapiro. The LOCO-I lossless image compression algo-rithm: principles and standardization into JPEG-LS. IEEE Trans. Image Processing, 9(8):1309–1324, 2000.

[56] I. Yohannes, D. Kolditz, and W. A. Kalender. Semiempirical analysis of materials’ elementalcomposition to formulate tissue-equivalent materials: a preliminary study. Phys. Med. Biol.,56:2963–2977, 2011.

[57] J. Ziv and A. Lempel. A universal algorithm for sequential data compression. IEEE Transactionson Information Theory, 23(3):337–343, 1977.

Page 74: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

70

List of Figures

1.1 Clinical CT scanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.2 Principle of gantry of a CT scanner . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.3 Pipeline of data processing in a CT scanner . . . . . . . . . . . . . . . . . . . . . . 7

2.1 Wavelet analysis network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.2 (a) Haar wavelet; (b) (2, 2) wavelet [10]; (c) 5/11 wavelet [3]; (d) (4, 4) wavelet [10] . 102.3 Recursive wavelet analysis network . . . . . . . . . . . . . . . . . . . . . . . . . . 112.4 (a) ψ function of the first level in time/space and frequency domain for (4, 4) wavelet.

(b) to (d) recursive transform of the φ function of the previous level. (e) φ functionof the fourth level. T = t/ts is the normalized sampling interval, F = f/fs is thenormalized frequency. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.5 Layout of wavelet coefficients where suffix is recursion level . . . . . . . . . . . . . 132.6 (a) Three dimensional pyramid with quantization vectors; (b) Distance of neighboring

quantization vectors on one shell and product code PVQ with multiple shells. . . . . 152.7 Code word for one block of 8× 8 coefficients . . . . . . . . . . . . . . . . . . . . . 152.8 SPIHT spatial orientation tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.9 Example wavelet coefficients as columns. (a) signs, (b) bit planes where significant

bits are denoted as 1 and refinement bits as X. . . . . . . . . . . . . . . . . . . . . . 152.10 Sorted wavelet coefficients as columns. (a) signs; (b) bit planes without refinement bits 162.11 Scan order for WDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.12 WDR significant pass over wavelet coefficients as columns. (a) signs; (b) bit planes

without refinement bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.13 Encoding of two significant bits (a) layout for WDR; (b) example distance and sign

bits; (c) transmitted symbols; (d) transmitted bits; (e) layout for WDRH with endsymbol; (f) Huffman encoded symbols for WDRH . . . . . . . . . . . . . . . . . . . 17

2.14 Symbol probabilities of the first 18 symbols for WDRH. (a) encoding of whole pro-jections, (b) encoding of blocks of size 16× 16 . . . . . . . . . . . . . . . . . . . . 18

3.1 Comparison of PSNR and SSIM (images by Wang et al. [51]). (a) Original image; (b)Mean-shifted image; (c) Contrast stretched image; (d) Salt-pepper noise contaminatedimage; (e) Blurred image; (f) JPEG compressed image . . . . . . . . . . . . . . . . 20

3.2 Principle of Structual Similarity image comparison according to [51] . . . . . . . . . 21

4.1 Thorax scan. (a) Part of sinogram; (b) slice of reconstruction . . . . . . . . . . . . . 244.2 Thorax phantom. (a) lowest dose (10 mAs); (b) highest dose (360 mAs) . . . . . . . 254.3 Thorax phantom. (a) thin; (b) thick with body fat phantom . . . . . . . . . . . . . . 254.4 Simulated breast phantom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5.1 CT image processing pipeline. Compression is possible at (a) or (b) . . . . . . . . . 275.2 Quantum noise on the output of an analog digital converter dependent on photon

count. 280, 000 photons yield 8 bit noise on output of a 16 bit analog digital converter. 305.3 Compression ratios of clinical data in order M × L×N . . . . . . . . . . . . . . . 325.4 Compression ratio vs. dose for phantom data . . . . . . . . . . . . . . . . . . . . . 32

Page 75: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

71

5.5 Compression ratio vs. volume for phantom data . . . . . . . . . . . . . . . . . . . . 335.6 Comparison of raw data and image compression using SSIM index as quality measure

for all scans of table 4.1. The left bar of each pair is raw data compression, the rightis compression of reconstructed images . . . . . . . . . . . . . . . . . . . . . . . . 35

5.7 Comparison of noise pattern for compression of Abdomen1 using JPEG 2000 withratio 1:8. (a) Original image (window C 30 HU, W 100 HU); (b) difference image forcompression of raw data (C 0 HU, W 10 HU); (c) difference image for compressionof image (C 0 HU, W 10 HU). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8 Maximum and standard deviation of compression error on HU scale for the lossycompression algorithms listed in table 5.6 and all scans . . . . . . . . . . . . . . . . 36

5.9 Structural similarity (SSIM) between original and compressed scans for the lossycompression algorithms listed in table 5.6 and all scans . . . . . . . . . . . . . . . . 37

5.10 Comparison between blocky and nonblocky compression using WDR. (a) A projec-tion; (b) difference for compression of whole projection; (c) difference for blockycompression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

5.11 Low contrast evaluation of lossy raw data compression. (a) original (window C 0 HU,W 100 HU); (b) WDR blocky (C 0 HU, W 100 HU); (c) difference image for WDRblocky (C 0 HU, W 10 HU); (d) difference image for WDR (C 0 HU, W 10 HU) . . . 39

6.1 Bit error rate testing of slip ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416.2 Error in reconstruction where one most significant bit is flipped. (a) detail of a pro-

jection image recorded by the CT detector with arrow pointing at simulated error; (b)reconstruction with center at 10 HU and width at 100 HU; (c) difference image withcenter/width at 0 HU/10 HU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

6.3 Error in reconstruction where a column of 64 detector elements is replaced by noise.(a) detail of a projection image recorded by the CT detector with simulated error; (b)reconstruction with center/width at 10 HU/100 HU; (c) difference image with cen-ter/width at 0 HU/10 HU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

6.4 Error in reconstruction where a row of 64 detector elements is replaced by noise. (a)detail of a projection image recorded by the CT detector with simulated error; (b)reconstruction with center/width at 10 HU/100 HU; (c) difference image with cen-ter/width at 0 HU/10 HU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

6.5 Error in reconstruction where 64 random detector elements are replaced by noise. (a)detail of a projection image recorded by the CT detector with simulated error; (b)reconstruction with center/width at 10 HU/100 HU; (c) difference image with cen-ter/width at 0 HU/10 HU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

6.6 Maximum and standard deviation of image errors for unhandled and corrected trans-fer errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

6.7 Comparison of Image quality for unhandled and corrected transfer errors . . . . . . . 44

7.1 DE4 development board with Stratix IV by Altera . . . . . . . . . . . . . . . . . . . 477.2 Quartus II FPGA development environment . . . . . . . . . . . . . . . . . . . . . . 487.3 Overview of FPGA based compressor . . . . . . . . . . . . . . . . . . . . . . . . . 487.4 Overview of FPGA based decompressor . . . . . . . . . . . . . . . . . . . . . . . . 497.5 Continuous compression with 10 Gbit/s output transfer rate . . . . . . . . . . . . . . 507.6 First phase of FPGA based compressor . . . . . . . . . . . . . . . . . . . . . . . . . 517.7 Second phase of FPGA based compressor . . . . . . . . . . . . . . . . . . . . . . . 517.8 Third phase of FPGA based compressor . . . . . . . . . . . . . . . . . . . . . . . . 527.9 Fourth phase of FPGA based compressor . . . . . . . . . . . . . . . . . . . . . . . 527.10 First phase of FPGA based decompressor . . . . . . . . . . . . . . . . . . . . . . . 53

Page 76: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

72

7.11 Second phase of FPGA based decompressor . . . . . . . . . . . . . . . . . . . . . . 537.12 Third phase of FPGA based decompressor . . . . . . . . . . . . . . . . . . . . . . . 547.13 Fourth phase of FPGA based decompressor . . . . . . . . . . . . . . . . . . . . . . 547.14 Fifth phase of FPGA based decompressor . . . . . . . . . . . . . . . . . . . . . . . 557.15 Original reconstructed image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567.16 Reconstructed image from compressed raw data at center 0 HU and width 400 HU:

(a) JPEG 2000 1:2; (b) proposed algorithm 1:1.39 . . . . . . . . . . . . . . . . . . . 567.17 Difference images at center 0 HU and width 10 HU: (a) JPEG 2000 1:2; (b) proposed

algorithm 1:1.39 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577.18 Reconstructed image from compressed raw data at center 0 HU and width 400 HU:

(a) JPEG 2000 1:16; (b) proposed algorithm 1:4 . . . . . . . . . . . . . . . . . . . . 577.19 Difference images at center 0 HU and width 10 HU: (a) JPEG 2000 1:16; (b) proposed

algorithm 1:4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587.20 Maximum error and standard deviation for JPEG 2000 on raw data, proposed algo-

rithm on raw data and JPEG 2000 on image data . . . . . . . . . . . . . . . . . . . . 587.21 Measured image quality using SSIM for JPEG 2000 on raw data, proposed algorithm

on raw data and JPEG 2000 on image data . . . . . . . . . . . . . . . . . . . . . . . 597.22 Spatial resolution vs focal spot size for central region. Left: Original, right: Com-

pression of rate 1:2.27 applied to raw data . . . . . . . . . . . . . . . . . . . . . . . 597.23 Spatial resolution vs focal spot size for peripheral region. Left: Original, right: Com-

pression of rate 1:2.27 applied to raw data . . . . . . . . . . . . . . . . . . . . . . . 607.24 Detail of breast phantom (rotated by 90 degrees) simulated at 3 mGy AGD show-

ing microcalcifications. (a) Original (window: C 3000 HU, W 10000 HU); (b) Rawdata were compressed (window C 3000 HU, W 10000 HU); (c) difference (window C0 HU, W 1000 HU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

7.25 Noise vs average glandular dose without and with raw data compression at focus size(FS) of 100µm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

7.26 Detail of breast phantom simulated at 6 mGy AGD showing low contrast lesionsand microcalcifications in low contrast mode. (a) Original (window: C −50 HU,W 500 HU); (b) Raw data were compressed (window C −50 HU, W 500 HU); (c)difference (window C 0 HU, W 20 HU) . . . . . . . . . . . . . . . . . . . . . . . . 63

Page 77: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

73

List of Tables

4.1 Set of clinical CT scans including two phantoms . . . . . . . . . . . . . . . . . . . . 234.2 Set of phantom CT scans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5.1 Simulated photon counts at maximum tube current of 360 mA . . . . . . . . . . . . 315.2 Set of lossless compression algorithms . . . . . . . . . . . . . . . . . . . . . . . . . 315.3 Results for phantom data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325.4 Recommentations for compression factors of CT images . . . . . . . . . . . . . . . 335.5 Set of lossy compression algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . 345.6 Evaluated lossy compression algorithms . . . . . . . . . . . . . . . . . . . . . . . . 36

6.1 Image error measures of transfer error shapes and their acceptability . . . . . . . . . 44

7.1 Parameters for image noise simulation . . . . . . . . . . . . . . . . . . . . . . . . . 607.2 Acquisition modes for image noise simulations shown in figures 7.22 and 7.23 . . . . 627.3 Parameters for image noise simulation . . . . . . . . . . . . . . . . . . . . . . . . . 62

Page 78: Lossless and Lossy Raw Data Compression in CT Imaging · 2013. 9. 3. · When lossless compression is applied to raw data, compression rates in the range of 1:1.3 to 1:1.8 are achievable.

74

Danksagung

Meinem Doktorvater, Prof. Dr. Dr. med. h. c. Willi A. Kalender, möchte ich ganz besondersdanken, dass er mir die Möglichkeit einer Promotion am Institut für Medizinische Physik in Erlangenmit einem hochinteressanten Thema gegeben und mir mit Herrn Dr. Jürgen Vaupel einen fachlichenExperten zur Seite gestellt hat. Ihm gilt mein besonderer Dank für die zahlreichen konstruktivenGespräche, trotz vollen Terminkalenders.

Die zahlreichen netten Kollegen waren mir eine Freude, von denen einige mich bei dieser Arbeitunterstützt haben: Harry Schilling, der mir aufgrund seiner Erfahrung bei der Firma Schleifringwertvolle Hinweise geben konnte, Robert Lapp als der erste interne Ansprechpartner, Marcel Beisterund Robert Bohle, die beim Korrekturlesen der Zusammenfassung geholfen haben, Martin Hupfer,der mir Tipps bei der Berechnung von Photonenzahlen gegeben und die letzten Ergebnisse Korrekturgelesen hat, Christian Steiding für seine Ausführungen zur Berechnung der Point Spread Function,und Ronny Hendrych für die letzten Hinweise vor Redaktionsschluss. Die offene, konstruktive At-mosphäre am Institut inklusive der Institutsskifahrten werden mir immer in Erinnerung bleiben.

Vielen Dank auch an die Sportwissenschaftler: Simon von Stengel für seinen Kampf gegen den Win-terspeck und Michi Bebenek für die Zusammenarbeit beim Vibrationsplattenprojekt.

Nicht zuletzt möchte ich mich bei meiner Familie bedanken, insbesondere bei meinem Vater undmeinem Bruder, mit denen ich manche technische Diskussion geführt habe. Meinen Berliner Fre-unden Henry Hoffman und Stefan Mader danke ich, dass sie immer spontan zur Verfügung standen,wenn ich aus Erlangen gekommen bin.