Image Compression

Published on January 2017 | Categories: Documents | Downloads: 28 | Comments: 0 | Views: 357
of 9
Download PDF   Embed   Report

Comments

Content

 

Lossless Compressio Compression n of Medical Medical Images Using Hilbert Space-Fillin Space-Filling g Curves Curves Jan-Yie Liang  , Chih-Sheng Chen  , Chua-Huang Huang  , and Li Liu  

 

 

 

 

Department of Information Engineering and Computer Science Feng Chia University Taichung, Taiwan liangty,, chenc, chh   @pmlab.iecs.fcu.edu.tw liangty  

 

 

Graduate Institute of Medical Informatics Taipei Medical University Taipei, Taiwan [email protected]

Abstract

image processing generates large and data-rich electronic files.. To speed up electroni files electronicc transmission transmission and to minimize computer storage space, medical images often are compressed into files of smaller size. Compressed medical images images must pres preserve erve all the origin original al data details details when they are restored for image presentation. That is, medical

A Hilber Hilbertt spacespace-fill filling ing curve curve is a cur curve ve of  two-dimens two-d imensional ional space that it visit visitss neigh neighborin boring g point pointss consecuti conse cutively vely without without crossing crossing itself. itself. The applic application ation of Hilbert space-filling curves in image processing is to rearrange image pixels in order to enhance pixel locality. An iterativ iterativee progra program m of the Hilbert space-filling space-filling curve ordering orderi ng gene generated rated from a tensor tensor produ product ct formul formulation ation is used used to rear rearra rang ngee pixe pixels ls of medi medica call imag images es.. We implement implem ent four lossless encoding encoding sche schemes, mes, run-length run-length encodi enc oding, ng, LZ77 LZ77 cod coding ing,, LZW cod coding ing,, and Huffman Huffman coding cod ing,, along along wit with h the Hil Hilber bertt spa spacece-fill filling ing cur curve ve or or-dering der ing.. Combin Combinati ation on of these these enco encodin ding g sch scheme emess are also implemented implemented to study the effe effecti ctivene veness ss of various various compression methods. methods. In addition, differential encod encoding ing is employed to medical images to study different format of image representation to the above encoding schemes. In the paper, we report the testing results of compression ratio and performance evaluation. The experiments show that the pre-processing operation of differential encoding  

 

 

 

 

image compression and uncomprssion must be lossless. Data compress compression ion is a long-his long-history tory technique technique of human activities. Abbreviation and other devices for shortening the length of transmitted messages have been used in every human society society.. Befor Beforee Shannon, Shannon, the acti activity vity of data compression was informal. It was Shannon who first created a formal intellectual discipline for data compression. A remarkable remarkable outco outcome me of Shann Shannon’ on’ss formalizat formalization ion of data compression has been the use of sophisticated theoretical ideass [24]. For exam idea example, ple, the JPEG standa standard, rd, propose proposed d in the 1980’s and in use for transmitting and storing images,, uses discrete ages discrete cosi cosine ne trans transformat formation, ion, quantizati quantization, on, run-length coding, and entropy coding [20].

Modern medical diagnosti Modern diagnostics cs are often based on X-ray computerized tomograghy (CT) and magnetic resonance imaging imagin g (MRI) (MRI) technique. technique. The raw d data ata d deliv elivered ered by suc such h imaging devices usually take several mega-bytes of disk 

In this paper, the concept of information theory is reviewed. viewed. sev several eral coding sche schemes, mes, including run-l run-length ength coding, Huffman coding, LZ77 coding, and LZW coding, are used to compress medical images. These entropies of  CT images before and after compression are shown. The approach is to lower the entropy of the compressed image,increasing the amount of compression resulted from thosee compress thos compression ion method methods. s. Run-l Run-length ength encoding encoding is a simple simp le and effecti effective ve compr compressi ession on scheme [6]. [6]. An example of a real-world use of run-length coding is for the ITU-T T.4 (G3 fax) standard for facsimile data compression.. This is the standa sion standard rd for all home and busi business ness facsimile machines used over regular phone lines. The basic idea is to identify strings of adjacent messages of equal value and replace them with a single occurrence along with a count. The Huffman coding scheme first scans the source data to obtain a probability model of the source

space.. The diagnostic space diagnostic images images for radiologic radiologic inte interpret rpretaation must be efficiently stored and transmitted to physicia cians ns for fut future ure med medica icall or legal legal pur purpos poses. es. Dig Digita itall med medica icall

data and then generates a coding tree using the probability model [8]. The Huffm Huffman an coding scheme scheme is proba probably bly the mostly used one in data and image compression pro-

followed by the Hilbert space-filling curve ordering and the compre compress ssion ion met method hod of LZW cod coding ing follo followed wed by Huffman coding will give the best compression result. Keywords:   Hilbert Hilbert space-fill space-filling ing curve, Run-L Run-Length ength encoding, LZ77 coding, LZW coding, Huffman coding, differential encoding.

1

Intr Introd oduc ucti tion on

1

 

Khuri and Hsu propose a run-le run-length ngth encoding encoding algorithm with Hilbert space-fillin space-filling g curve ordering [14]. [14]. Some experiments show that storage could be reduced up to 60% in the Hilbert space-filling curve order comparing to the row/column major order for images with high spatial homogeneity [1, 5].

grams, such as GZIP and JPEG. The Lempel-Ziv coding schemes, known as LZ77 and LZW coding schemes, are dictionary dictio nary based based [15, 16]. A dictionary dictionary is created created at the time when source data is parsed. LZW coding schem schemee is often enhanced with the probability model as in the Huffman coding scheme. Examples of enhanced LZW coding are GZIP and ITU-T V.42bis.

In this paper, we will investigate lossless compression of med medica icall ima images ges using using the Hil Hilber bertt spa spacece-fill filling ing cur curve ve or or-der. The programs generated from tensor product formulas [18] are used to perform perform pixel reording. reording. Four codin coding g schemes, run-length coding, Huffman coding, LZ77 coding, and LZW coding, will be tested to compress medical images. images. Thes Thesee schemes are also combined combined in image compressi comp ression. on. In addition to the codin coding g schemes schemes,, image imagess are pre-processed with order one to order three differentiation. entia tion. The paper paper is organiz organized ed as the followi following. ng. An overvie ove rview w of lossless lossless compressio compression n metho methods ds is giv given en in Section 2. The Hilbe Hilbert rt Space-fi Space-filling lling curv curves es is described described in Section Secti on 3. Progra Programs ms generat generated ed from tensor product formulas for both Hilbert space-filling curve ordering and its inverse are included in Section 3. The inverse Hilbert space-filling curve order is need for data uncompression.

The Hilbert Hilbert space-fillin space-filling g curve is a one-to-on one-to-onee mappi mapping ng between an   -dimensional space and a one-dimensional space [7]. The Hilbert space-filling curve scans all points of the   -dimensional space without without crossing crossing itself. Also, the curve preserves neighborhoods of points as much as possible. possi ble. Since D Davi avid d Hilbert Hilbert prese presented nted the Hi Hilbert lbert spac spaceefilling curve in 1981, there have been several several researc research h works about formal specification of an operational model or a functional model. A mathematical history of Hilbert spacespa ce-fill filling ing curv curves es is given given by Sagan [22 [22]. ]. Butz Butz pro pro-poses an algorithm to compute the mapping function of  Hilbert Hilbe rt spac space-filli e-filling ng curve curvess using using bit opera operations tions [2, 3]. Quinqueton and Berthod propose an algorithm for computing all addresses of scanning path as a recursive proceduree [21]. Kamata cedur Kamata  et al.   proposes a non-recursive al 

 

 

  -dimensional Hilbert curve gorithm gorith m for thetables using look-up [11, 12]. Lin  presents a tensor  et al.space-filling product based algebraic formulation of two-dimensional and three-dime three-dimension nsional al Hilbe Hilbert rt space space-fillin -filling g curves curves [4, 18]. The tensor product formulas are also used to generate Hilbert space-filling curves in C programming language. Jagadish Jagad ish analyzes analyzes the clustering clustering properti properties es of Hilbe Hilbert rt space-filling curves [9]. He shows that the Hilbert spacefilling curve achieves the best clustering, i.e., it is the best space-filling curve in minimizing the number of clusters. Moon et al.  provide closed-form formulas of the number of clu cluste sters rs require required d by a given given que query ry re regio gion n of an arbi arbitra trary ry shape for Hilbert space-filling curves [19].

Exper Experiment iments s and perfo performanc rmance e ev evaluat aluation ion arerks prese presented and discussed discus sed in Section 4. Concl Concluding uding remarks rema andnted future works are given in Section 5.

Hilbert space-filling curves have been applied to image compression broadly. In most of the works, image pixels initially stored in the row major order are reordered using the Hilbert space-filling curve permutation and then a given procedure is employed to perform data compression. sion. If an ima image ge is not of hor horizo izonta ntall or ve verti rtical cal stripe stripes, s, the Hilbert space-filling curve ordering places similar color pixels in adjacent areas consecutively, i.e., the compressibility of an image under the Hilbert space-filling curve order is more effective effective than the row-majo row-majorr order order.. Lempel and Ziv prove that the compression rate of an image is lower-bounded if it is scanned in the Hilbert spacefilling filling curv curvee order [17]. [17]. Kam Kamata ata   et al.   uses uses a simple simple zero-order zero-o rder interpolati interpolation on comp compressi ression on algor algorithm ithm to compress gray images images and color images images [10, 13]. Befo Before re the applic app licati ation on of the zer zero-o o-orde rderr interp interpola olatio tion, n, the pix pixels els of an image are rearr rearranged anged into the Hilbe Hilbert rt space-filli space-filling ng curve order.. Experi order Experimenta mentall results of images are reported. reported. The

For a compr compressi ession on technique, technique, we actually actually refer to two dual processes of compression algorithm: construction of  the compressed data and reconstruction of the original data.. Base data Based d on the resul resulting ting data of recon reconstruc struction, tion, data compre com pressi ssion on sch scheme eme can be di divid vided ed into into two classe classes: s: lossless compression scheme   and  lossy compression scheme [23] [23].. Th Thee   compression ratio   is defined as the ratio of  the number of original uncompressed bytes to the number of com compre presse ssed d byt bytes es inc includ luding ing ove overhe rhead ad bytes bytes.. A compression technique is considered optimum when the information content of the compressed data is closed to the entropy entropy of the origi original nal image image.. Shann Shannon on show showss that any definition of entropy satisfying his assumptions will   , wher wheree   is tthe he const constant ant of a be measurement unit [24]. This implies that the efficiency of  a source alphabet with   symbo symbols ls can b bee defin defined ed sim simply ply as being equal to its entropy.

compressed images will lose some content details and irreversib rev ersible. le. How Howev ever, er, accordi according ng to their study, study, the quality of the compressed images are close to JPEG images.

If data has been losslessly compressed, the original data can be totally recovered from the compressed data. Lossless compressio compression n is used for appli applicatio cations ns that cannot cannot toler toler--

2

Lossl Lossless ess Data Data Comp Compre ressi ssion on

Compression is a process used to reduce the physical size of information. information. A compress compression ion process has many goals: to store more information on the same media (reduce disk  space usage, to reduce transmission time and bandwidth on a network, and to reuse an digital image.

 

 

 

 

 

 



 

 









 

 

 

 

 

 

 

 

Lossless compression implies no loss of information.

2

 

convention is to put the lower weight root on   . the left, if 

ate any difference between the original and reconstructed data. Lossless compression is generally implemented using one of two different types of modeling: statistical and dictionary-based.

 

 

 

 

 

When building building the prefix prefix-code -code tree, we must consid consider er the conditions for an optimal variable-length binary code [23]. We list these conditions as follows:

Statistical model reads in and encodes a single symbol at a ti time me usi using ng the probab probabili ility ty of the cha charac racter ter app appear earanc ance. e. This model generally encodes a single symbol at a time: reading readi ng a symbol, symbol, calc calculati ulating ng its p probab robability ility,, then gener generatating its compressed code. An example of this compression scheme is Huffman coding.

  , 1. Giv Given en any two letters   and   , if  then   , where   is the n numb umber er of b bits its in tthe he codeword for   .  

 

 

 

 

 

 

 

 

 

 



 

 

 

 

 



 

 

 

 

 

 

A dictionary based compression technique uses a different concept. It reads in input data and looks for groups of symbols that appear appear in a dicti dictionary onary.. If a string mat match ch is found, a pointer or index into the dictionary can be output instead instead of the code for the symb symbol. ol. Intui Intuitiv tively ely,, the longerr the match, longe match, the bett better er is the compressi compression. on. Static dictionary and adaptive dictionary schemes are two kinds of  dictionary dictio nary schemes. schemes. The genesis genesis of most modern adap adap-tive dictionary schemes can be traced to two landmark  papers pap ers,, writte written n by Lem Lempel pel and Ziv Ziv, in 197 1977 7 and 1978 [15, 16]. The codin coding g scheme schemess based on the 1977 paper are named as LZ77 schemes; those based on the 1978 pa-

2. The two least probable lette letters rs have codewords codewords with the same maximum length   .  

 

3. In the tree cor correspo responding nding to the optim optimum um code code,, there must be two branches stemming from each intermediate node. 4. Suppo Suppose se we change an interme intermediate diate node node into a leaf  node by combining all the leaves descending from it into a compo composite site word of a reduc reduced ed alphabe alphabet. t. Then, if the original tree was optimal for the original alphabet, the reduced tree is optimal for the reduced alphabet.

per are named as LZ78 schemes. schemes. For exam example, ple, LZW is one of LZ78 schemes. In the rest of this section, we will briefly review algorithms of Huffman coding, LZ77 coding, and LZW coding schemes. schemes. We also review review a simpl simplee coding schem scheme: e: ru runn-le leng ngth th codi coding ng.. In data data co comp mpre ress ssio ion, n, some some prepreprocessing steps are performed before the application of a coding scheme. A pre-process, called differential coding, is to compute the difference of adjacent data elements. In addition, the review will include the differential coding scheme.

2.1

In this paper, we build an optimal prefix-code tree when applying Huffman coding scheme.

2.2

The LZ77 algorithm compresses by building a dictionary of previously seen strings that consists of a group of characters acte rs of var varying ying lengths. lengths. At the highest level level the algorithmss can be describe rithm described d as follo follows. ws. The LZ77 algorithm and its var variants iants use a slidin sliding g windo window w that start startss from the beginning of the data and moves along with the cursor.

Huffman Huffman Coding Coding Algorithm Algorithm

The window can be divided into two parts, the part before the cursor cursor,, cal called led the dic dictio tionar nary y, and the part part sta starti rting ng at the cursor, called the lookahead buffer. The size of these two parts are parameters of the program and are fixed during executio exe cution n of the algorit algorithm. hm. The algorit algorithm hm includes includes the following steps :

A Huffman code is an optimal prefix code generate generated d from a set of probabilities [8]. It scans the source data to obtain a probability model of the source data first, and then generates a coding tree using the obtained probability model. We will describe ge generation neration of the prefix-code tree below below.. 1. Start with a forest forest of tr trees, ees, one for each data element. element. Each tree contains a single vertex with weight , where   is the probability of the data element on the vertex.  

1. Find the longe longest st match of a string starti starting ng at the cursor and compl completely etely contained contained in the loo lookahe kahead ad buf buffer fer to a string in the dictionary.

 

 

 

 

 

LZ77 LZ77 Coding Coding Algori Algorithm thm

 

2. Repeat until only a single tree remain remains: s:

2. Out Output put a triple   containing the position of the occurrence in the window, the length   of the match and the next character   passing the match.  

(a) Selec Selectt two trees with the lowest lowest weight roots, say,   and   .  









 

 

 

 

 

 

 



 

(b) Combin Combinee the them m into into a sin single gle tree by add adding ing a 3. Mov Movee the cu cursor rsor

new root with weight   and making making the two trees trees its chi childr ldren. en. It does not matt matter er which subtree is the left or right child, but the  

 

 

 

 

 



 

 

characters forward.

We will use the LZ77 coding scheme in the experiments. 3

 

2.3

LZW Coding Coding Algori Algorithm thm

the length length of the origin original al string. In this case run-len run-length gth encoding will increase the data size.

Unlike the LZ77, the LZW coding scheme does not have an existing dictionary. The LZW algorithm reads the data and tries to match a sequence of data bytes as large as possible with an encoded string from the dictionary. The matched data sequence and its succeeding character are

run-length encoding has the advantage of being simple to implement, but it is incapable of achieving high levels of compression for most data. Although some graphical images may compress well using run-length encoding, most textual data does not contain long runs of repeated characters.

grouped together and is then added to the dictionary for encoding encod ing later later data sequenc sequence. e. For an image with   -bit pixels, the compressed code of each pixel occupies bits or large larger. r. While a smaller smaller compres compressed sed code results results in higher compression rate, it also limits the size of the dictionary dictio nary.. For exampl example, e, a commo common n arrangeme arrangement nt uses a 12-bit compress compressed ed code for each 8-bit dat dataa element element.. A 12-bit code size allows allows 4096 entries entries in the dictiona dictionary ry.. If  the encoder runs out of space in the dictionary, the traditional LZW encoder must be aborted and a larger compression code size is tried again. The initial dictionary is a collection of roots containing all possible values of an -bit pixel. Let   be a matched string that is eempty mpty at th thee beginning. begin ning. The LZW compressi compression on algorithm start startss from the beginning beginning of the original data strea stream m and performs the following steps:  

 

 



The run-length encoding compression algorithm steps are:

 

1. Step throug through h the source data from begin beginning ning to end, watching for repeated sequences of characters. 2. Build the compre compressed ssed dat dataa string as the sourc sourcee data is scanned. In this paper, we also compress medical images using the run-length encoding scheme and compare its results with other encoding schemes.

 

2.5 1. Let   be the next character in the data stream.

Differentia Differentiall Encoding Encoding Algorithm Algorithm

Let   be the source data string and   be the   -the character of    . A difference is generated by taking the differ differ-  . Let   be th thee resulting data string. The ences differential encoding algorithm is described as below:

 

 

 

 

 

2. Does string string

 

 

 

present in the dictionary?

 

 

 

 

 

 

 

2.1. If yes,

 

 

 

 

 

(extend   with   ).

 

 

 

 

 

 

2.2.. If no, 2.2 no,

1. Let

 

 

 

 

.

 

 

2.2.1. Output the code word word which denotes   to the code stream.

2. Let

2.2.2.. Add the 2.2.2 the string

3. Compute the diffe difference, rence,

 

2.2.3.

 

 

 

 

 

to the dictionary dictionary..

  (   now contains only the character   ).  

 

4. If 

 















 

 



 

 

 

,

 

 

then

 

 









 

 

 

 

 

 

 

 

, and

 

















 

 

else

 

 

 



 

 





 

 



 

 

 

. 

 









  





.  

 









.  

 

5. Let

3. Is end of data data straem? straem?

 

   

 



.

 

6. If    is less than the size of the source string then  

3.1. If yes, go to step 2 2..

6.1.

3.2. If no, output the code word word which deno denotes tes   to the code stream.









 

 

 









 

,









 

   

 

 

.

 

6.2. Go to Step 2 2.. The value 256 in Step 6.1 is determined by the gray level 00   to   FF. Note that the resulting string of the differential encoding scheme has the same length as the source data string. string. Hence, Hence, the differentia differentiall encoding scheme scheme is only a pre-processing pre-processing proce procedure dure of a data compr compressi ession on algorithm. It must be followed by other encoding schemes such as Huffman, LZW, LZ77, and run-length encoding schemes.

We implement the LZW coding scheme with 8-bit pixel and 12-bit code size.

2.4

Run-Lengt Run-Length h Encoding Encoding Algorithm Algorithm

The run-length run-length encoding scheme analyzes analyzes the data to be compressed by looking for runs of repeated characters. It stores these runs as a single character, precdded by a number representing the number of times this character is repeated in the run. Random data will not be compressed

3

well if there are no runs of repeated characters. The algorithm cannot cannot perform any compres compression sion at all. For example, the string ”ABAB” will become ”1A1B1A1B”, twice

Hilb Hilbert ert Space Space-F -Fill illin ing g Curv Curves es

-dimension nsional al spa space. ce. Peano Peano,, in 1890, dis dis-Let   be an   -dime covered the existence of a continuous curve which passes  

 

4

 

 

through every poin through pointt of a closed square. In 1891, Hilbert [7] presented a curve having the space filling property in as shown in Figure 1(a). An understanding of the way in which a Hilbert curve is drawn is rapidly gained from Figure 1 showing the first three steps of a recursive construction for the two-dimensional case. The   Hilbert space-filling curve, as in Figure 1(b), is constructed by

13

 

 

 

14

 

 

four copies of    curves, and the   curve, as in Figure 1(c 1(c), ), is the then n constr construct ucted ed by fou fourr copies copies of    curves. In the recursive construction, construction, the subcurves are con connected nected in a given order, i.e., the order of four-point Gray permutation which is also the order of the   Hilbert spacefilling curve, curve, and the orientation of each subcurve must be adjusted to fit into the connection order.  

 

 

 

 

 

 

 

 

 

 

15

 

16 17 18 19 20

The Hilbert space-filling curve visits all points on a continuous plane if we iterate the curve formation algorithm to the infinite. For a finite space, the Hilbert space  grid and visits visits confilling curve is a curve on a secutive neighboring points without crossing the curve. A   Hilbert space-filling curve is recursively con  Hilbert space-filling curves. structed from  

 

 

 

 

4

 

 

 

 

 

 

 

 

(int)pow(2,2*n-1)]; // i0= i0=1, 1, j0= j0=1 1 b[ b[i1 i1*( *(in int) t)(p (pow ow(2 (2,n ,n-1 -1)) ))+j +j1+ 1+ 2*(int)pow(4,n-1)]= a[i1*(int)(pow(2,n))+j1+ (int)pow(2,2*n-1)+(int)pow(2,n-1)]; } } for (i=0 (i=0; ; i<( i<(int int)po )pow( w(4,n 4,n); ); i++ i++) ) a[i a[i] ] = b[ b[i]; i]; hilb hilbert( ert(n-1, n-1, &a[0 &a[0]); ]); hilb hilbert( ert(n-1, n-1, &a[(in &a[(int)po t)pow(4, w(4,n-1) n-1)]); ]); hilb hilbert( ert(n-1, n-1, &a[2*(i &a[2*(int)p nt)pow(4 ow(4,n-1 ,n-1)]); )]); hilb hilbert( ert(n-1, n-1, &a[3* &a[3*(int (int)pow )pow(4,n (4,n-1)] -1)]); ); } }

 

 

 

 

b[ b[i1 i1*( *(in int) t)(p (pow ow(2 (2,n ,n-1 -1)) ))+j +j1+ 1+ (int)pow(4,n-1)]= a[i1*(int)(pow(2,n))+j1+(int)pow(2,n-1)]; // i0= i0=1, 1, j0= j0=0 0 b[ b[(( ((in int) t)po pow( w(2, 2,nn-1) 1)-1 -1-j -j1) 1)* * (int)(pow(2,n-1))+ ((int)pow(2,n-1)-1-i1)+ 3*(int)pow(4,n-1)]= a[i1*(int)(pow(2,n))+j1+

 

 

The recursive tensor product formula of Hilbert spacefilling curve for mapping from two-dimensional values to one-dimens one-d imensional ional points points is presented presented in [18]. This recursive tensor product formula is manipulated to an iterative formula. formu la. Operations Operations of a tensor tensor product can be mapped into program constructs of high-level programming languages. Therefore, the recursive recursive and iterati iterative ve ten tensor sor product formulas of Hilbert space-filling curves are translated into C programs. We We use this program to reorder pixels of  medical images before applying a compression algorithm described in Section 2.

Ex Expe peri rime ment ntss an and d Pe Perf rfor orma manc ncee Evaluation

The goal of thi thiss pap paper er is to test and comp compare are var variou iouss lossless loss less compression compression algori algorithms. thms. These algorit algorithms hms are applied with and without Hilbert space-filling curve ordering der ing.. The inte intenti ntion on is to ve verif rify y the effe effecti ctiven veness ess of  Hilbert space-filling curve ordering in lossless medical image comp compressi ression. on. Similarly to differenti differentiation ation encod encoding, ing, the Hilbert space-filling curve ordering is not a compression scheme, but it is a pre-processing procedure. The experiments are carried out on a personal computer of Pentium III 850 and and 384 mega-byte memory running Microsoft Windows 2000. The programs are written in C language and are developed using Microsoft Visual C++ 6.0. JPEG-LS, a lossless compression standard published by ISO/ITU jointly, is also tested and compared.

In addition to image compression, an image must be uncompressed to be restored to the original format. In order to perform image uncompression, the inverse Hilbert space-filling curve must be used. With the iterative tensor product formula of Hilbert space-filling curve, it is pos-

The JEPG-LS program is a shareware published by Signal Processing and Multimedia Group (SPMG). The images being tested are 40 CT images shown in Figure 2(a1) to (a40). Each ima image ge is an 8-bit   store stored d in the bitmap format occupies 263,222 bytes.

sible to derive the formula of the inverse Hilbert spacefilling curves [18] and to generate its corresponding C program.



We conclude this section with the iterative C program of Hilbert space-filling curves. 01 voi void d 02 in int t 03 int 04 in int t 05 06 07 08 09 10 11 12



 

 





 

At first, we measure the entropies of the averages of  the images images.. The ent entrop ropy y of the orig origina inall CT image image is 3.381574. The entropy of the images are rearranged into the Hilbert space-filling curve order followed by the differential feren tial sche scheme me is 2.715905 2.715905.. The CT images are processed by the differential scheme followed by the rearrangement range ment into the Hilbe Hilbert rt space-fill space-filling ing curve order is 2.6265 2.6 26565. 65. We obs observ ervee tha thatt the CT images images process processed ed by the differential scheme followed by the rearrangement into the Hilbert space-filling curve order is the lowest en-

hilbe hilbert rt(in (int t n, in int t *a) { i1 i1, , j1 j1, , i; b b[(in [(int)po t)pow(4, w(4,n)]; n)]; t tm mp;

if ( (n n==1 =1) ) { tmp = a a[ [2]; a[2] = a[3]; a[3] = tmp; } else { fo for r (i1 (i1=0; =0; i i1<( 1<(int int)p )pow( ow(2, 2,n-1 n-1); ); i1 i1++ ++) ) { fo for r (j (j1= 1=0; 0; j j1< 1<(i (int nt)p )pow ow(2 (2,n ,n-1 -1); ); j1+ j1++) +) {

tropy. In the experiments, we test various encoding schemes, including run-length encoding, LZ77 coding, LZW cod-

// i0 i0=0, =0, j0= j0=0 0w(2,nb[j b[j1*( 1*(in int)( t)(po pow(2 ,n-1) 1))+i )+i1] 1]= = a[i1*(int)(pow(2,n))+j1]; // i0 i0=0, =0, j0= j0=1 1

5

 

 

 

 

 

 

 

(a)

 

 

 

 

(b)   (c) Figure 1: Hilbert space-filling curves  

 

 

ing, and Huffman coding, and their combinations. Along with the encoding encoding schemes schemes,, differentia differentiation tion and Hilbe Hilbert rt space-filling curve ordering are applied as pre-processing operations opera tions.. The expe experimen rimental tal case casess are summarized summarized as the following:

 

 

 

Table 1: Average image size of each compression method and pre-processing operation None (a) (b) (c) (d)

(1) The CT images are compressed compressed by the LZ77 coding.

None

(1)

(2)

(3 )

(4)

(5)

(6)

26 263, 3,22 222 2

11 111, 1,88 888 8

10 103, 3,70 709 9

97,3 97,312 12

11 118, 8,35 354 4

10 108, 8,22 223 3

93 93,1 ,170 70

16 169, 9,53 533 3

   

26 263, 3,22 222 2 26 63 3 ,,2 22 22 2

11 112, 2,26 266 6 11 10 0 ,,8 86 68 8

10 101, 1,23 230 0 83 3,, 9 91 15

98,2 98,242 42 9 3, 3, 3 36 60

11 118, 8,35 354 4 10 08 8 ,,1 18 89 9

10 108, 8,47 473 3 98 8,, 8 86 69

92 92,2 ,298 98 77 7,, 8 82 27

21 210, 0,91 914 4 18 80 0 ,,5 51 19 9

   

26 263, 3,22 222 2 26 63 3 ,,2 22 22 2

11 113, 3,61 614 4 11 11 1 ,,3 30 00 0

86 86,8 ,869 69 81 1,, 5 53 35

92 92,1 ,125 25 9 4, 4, 9 98 88

11 110, 0,39 398 8 10 08 8 ,,1 18 89 9

10 102, 2,15 156 6 99 9,, 1 14 45

80 80,2 ,248 48 76 6,, 9 93 31

22 220, 0,06 065 5 20 03 3 ,,5 54 40 0

 

(7)

(2) The CT images are are compressed by the LZW coding. (3) The CT CT images images are compresse compressed d by the ru run-len n-length gth encoding.

image size of each compression method of seven encoding schemes (1) to (7) and each of four pre-processing operation (a) to (d). The first data column marked ”none” means that no encoding scheme is applied. The first data row marked ”none” means that no pre-processing operation is applied. applied. All the image siz sizes es also count the file header hea der.. Not Notee tha thatt all the data obtained obtained in the firs firstt colcolumn is the same as the original image size because preprocessing proce ssing oper operation ationss do not reduce the image size. Table 2 is the average bit-per-pixel of the same compression be an im imag agee methods metho ds and pre-p pre-proces rocessing sing operations operations.. Let   be size. The bit-per-pixel is calculated as   . The experiments show that case (6d), which applies differential scheme followed by Hilbert space-filling curve ordering pre-processing operations and then compressed by the LZW codin coding g followed followed by Huffma Huffman n codin coding g scheme, has the best compressio compression n result. The best compressio compression n ratio achieves size reduction of 71.77%. The experiments re revea veals ls tha thatt Hilber Hilbertt spa spacece-fill filling ing cur curve ve ord orderi ering ng alone alone may not help to reduc reducee compres compressed sed image images. s. How Howev ever, er, with the differential pre-processing, the source data are transformed to another format which has better locality. In this case, cas e, Hil Hilber bertt spa spacece-fill filling ing cur curve ve ord orderi ering ng doe doess pla play y its rol rolee to enhance compression effect. Finally, we would like to point out that JPEG-LS does better without applying any pre-processing operation. However, its compression ratio is not as good as the other encoding schemes.

(4) The CT images are are compre compressed ssed by the Huf Huffman fman cod cod-ing. (5) The CT images are compressed compressed by comb combining ining LZ7 LZ77 7 and then Huffman (6) The CT images are compressed compressed by combining combining LZW and then Huffman. (7) The CT images are are processed by JPEG-LS alone. For each of the above encoding schemes, the follow-

 

 

ing age pre-processing compression: operations are applied before im(a) The piexe piexels ls of a CT image is rearranged rearranged into the Hilbert space-filling curve order. (b) The CT images images are proce processed ssed by the differen differen-tial scheme. (c) The CT images are rearrang rearranged ed into the Hilbert space-filling curve order and then followed by the differential scheme. (d) The CT images images are proce processed ssed by the differen differen-tial scheme scheme and then follo followed wed by the rearra rearrangengement into the Hilbert space-filling curve order.

 

 

 









 

 









 

All the compression methods are testes on 40 CT im-

We also report execution time for image compression

ages shown shown in Figure 2. The aver average age size and aver average age execution time from the 40 images obtained of each compression method are reported. Table 1 shows the average

and uncompression uncompression of various various encoding schemes and preprocessing proce ssing ope operatio rations ns in Table 3. In Tab Table le 3, two execution times are given. The first value denotes execution 6

 

  (a (a1)

(a2)

(a3)

(a4)

(a5)

 (a  ( a6)

(a7)

(a8)

(a9)

(a10)

  (b (b1)

(b2)

(b3)

(b4)

(b5)

 (b6)

(b7)

(b8)

(b9)

(b10)

  (c (c1)

(c2)

(c3)

(c4)

(c5)

  ( c6)

(c7)

(c8)

(c9)

(c10)

 (a  ( a11)

(a12)

(a13)

(a14)

(a15)

 (a16)

(a17)

(a18)

(a19)

(a20)

 (b  ( b11)

(b12)

(b13)

(b14)

(b15)

 (b16)

(b17)

(b18)

(b19)

(b20)

  (c ( c11)

(c12)

(c13)

(c14)

(c15)

  ( c16)

(c17)

(c18)

(c19)

(c20)

(a22)

 (a23)

(a25)

 (a26)

(a27)

(a28)

(a29)

(a30)

(b25)

  (b (b26)

(b27)

(b28)

(b29)

(b30)

(c25)

  (c ( c26)

(c27)

(c28)

(c29)

(c30)

(a35)

 (a36)

(a37)

(a38)

(a39)

(a40)

  (b (b36)

(b37)

 (b38)

  (b ( b39)

(b40)

  (c ( c36)

(c37)

(c39)

(c40)

 (a21)

  (b (b21)

  (a (a24)

(b22)

(b23)

(c22)

(c23)

 (a31)

(a32)

(a33)

(a34)

 (b31)

(b32)

(b33)

(b34)

  (b35)

  (c31)

(c32)

  (c (c34)

(c35)

  (c (c21)

  (c33)

(b24)

(c24)

(c38)

Figure 2: CT medical images

Table 3: Exec Execution ution time for CT image compression compression and uncompression (second)

Table 2: Bit-per-p Bit-per-pixel ixel of each compression compression method and pre-processing operation None (a) (b) (c) (d)

None 8.03 8.03 8.03 8.03 8.03

(1 ) 3.41 3.43 3.38 3.47 3.40

(2) 3.16 3.09 2.56 2.65 2.49

(3) 2.97 3.00 2.85 2.81 2.90

(4) 3.61 3.61 3.30 3.37 3.30

(5) 3.30 3.31 3.01 3.12 3.03

(6) 2.84 2.82 2.38 2.45 2.35

None

(7) 5.17 6.44 5.51 6.72 6.21

None (a) (b) (c) (d) -

(1) 0.328 0.048 0.482 0.237 0.341 0.056 0.497 0.248 0.497 0.248

(2) 0.082 0.051 0.238 0.242 0.094 0.058 0.250 0.251 0.250 0.251

(3) 0.043 0.042 0.198 0.234 0.053 0.049 0.210 0.241 0.210 0.241

(4) 0.105 0.160 0.263 0.353 0.115 0.168 0.271 0.361 0.272 0.361

(5) 0.408 0.196 0.565 0.387 0.419 0.202 0.576 0.396 0.576 0.396

(6) 0.155 0.181 0.315 0.377 0.167 0.191 0.325 0.385 0.325 0.385

time for image compression and the other value denotes execution of image uncompression. It worth to note that it takes about 0.156 seconds to rearrange pixels into the Hilbert space-filling curve order and it takes about about 0.191 seconds to restore pixels from Hilbert space-filling curve order back to the row-major order. Differential and reverse differential operations takes only a minor time of  about 0.010 second. second. The combination combination of Hilbert spacefilling curve ordering and different differential ial takes about the to-

is for the compression combined LZW and Huffman coding schemes schemes.. The most overhe overhead ad is for the comp compress ression ion of  run-length run-l ength enco encoding ding sche scheme. me. If we consider the best co comm-

tal of the two individ individual ual ex execu ecutio tion n tim times. es. The execuexecution time overhead for Hilbert space-filling curve ordering ranges from 38.24% to 362.7 362.79%. 9%. The least overhead overhead

pression scheme of differential with Hilbert space-filling curve ordering pre-processing operation and LZW with Huffman coding scheme, the overhead is about 41.17%. 7

 

5

Conclu Conclusion sionss and Fut Futur uree Work orkss

tional Journal of Geog Geograph raphical ical Infor Informatio mation n Systems, 4(1):21–31, 4(1):21–31, 1990.

The paper is to study the effectiveness of Hilbert spacefilling curves on lossless medical image compression. We rearrange pixels of a CT image according to the Hilbert space-filling curve order before it is applied to each of the four encoding schemes, run-length encoding, LZ77 coding, LZW codin coding, g, and Huffman coding coding.. Combinatio Combination n of  these encoding encoding schem schemes es are also tested. From the expe experriments, LZW coding followed by Huffman coding yields the best compression compression resu result. lt. Also, by measurin measuring g the entropy tropy,, we can verify verify tha thatt the lower lower entrop entropy y to get the bet better ter compressio compr ession n ratio. ratio. How Howeve ever, r, the pre-p pre-proces rocessing sing operation operation of Hilbert space-filling curve ordering seems not to make major improvement.

[3] A. R. Butz Butz.. Convergence with Hilbert’ Hilbert’ss space filling curve.   Jou Journal rnal of Compu Computer ter and Syst System em Sciences Sciences, 3(2):128–14 3(2):1 28–146, 6, 1969.

The LZW coding scheme is very sensitive with the size of table being used in the algorithm. The CT images are not com compre presse ssed d well well by enlarg enlarging ing the table table siz size. e. Cha Changi nging ng the word size in the LZW scheme to match the frequently repeated repea ted strings strings size usually impro improves ves compr compressi ession on result. result.

[5] V. Gaede and O. G¨u unther. nther. Multidimensional access access methods.  ACM Computing Surveys, 30(2):170–231, 1998.

[2] A. R. Butz. Space filling filling curv curves es and math mathemat ematical ical programming. Information and Control, 12(4):314– 330, 1968.

[4] C.-S C.-S.. Chen, Chen, S.-Y. Lin, and C.-H. C.-H. Hua Huang. ng. Alg Algeebraic formulation and program generation of threedimensiona dimen sionall Hilbe Hilbert rt spac space-fill e-filling ing curv curves. es. In   The 2004 International Conference on Imaging Science, Systems, and Technology, 2004. To appear.

[6] S. W W.. Golom Golomb. b. Run Run-le -lengt ngth h enco encodin dings. gs.   IEEE  Tr Transac ansactions tions on Infor Informatio mation n Theor Theoryy, IT-1 IT-12:1 2:140– 40–

Differential pre-processing operation is applied to CT

149, 1966.

images.. Sin images Since ce a CT imag imagee has most pix pixels els clo closed sed to very ver y whi white te and very dark gray leve level. l. Dif Differ ferent ential ial preprocessing proce ssing conv convert ert pixels to diffe difference rencess of clos closer er valvalues. It yields more data elements with similar values and improves compression compression ratio. Following differential differential preprocessing operation, Hilbert space-filling curve ordering enhances the locality of the differences. It makes the encoding schemes much more effectively. effectively. We also test CT image compression with multiple times of differential operation. It does not make the compression even better.

¨ [7] D. Hilbert. Hilbert.   Uber die stetige abbildung einer linie auf Fl¨aachenst¨ chenst¨u uck. ck.  Mathematische Annalen, 38:459– 460, 1891. [8] D. A. Huffman. Huffman. A method for for the constr constructio uction n of  minimum redundancy redundancy code codes. s. In  Proceedings of the 1098–1101, 1951.  IRE , pages 1098–1101, [9] H. V. V. Jagadish. Jagadish. Linea Linearr clustering clustering of objec objects ts with multiple attributes. In Proceedin  Proceedings gs of the 1990 ACM  SIGMOD International Conference on Manageme Management  nt  of Data, pages 332–342. ACM Press, 1990.

Non-medical images, such as colored human portrait images and scenery images are also tested with the same pre-proces pre-pr ocessing sing oper operation ationss and encoding schemes. schemes. For these images, the Hilbert space-filling curve ordering will give much better results than CT images. However, in re-

[10] S. Kamata, Kamata, Y. Y. Bandoh, and N. Nis Nishi. hi. Color image image

ality, In these often do loss-less compression. the images future work, wenot willrequire also study application of  the Hilbert space-filling curve ordering to lossy compression methods.

compression compressi on using using a Hilbert scan scan.. In   Proceedings of Fourteenth International Conference on Pattern  Recognition, volume 3, pages 1575– 1575–1578, 1578, 1998.

The Hilbert space-filling curves presented in the paper points points.. Man Many y image imagess are rea rearra rrange ngess source source data data of    not necessary satisfy this limitation. One simple compensation satio n is to extend an image image with padding pix pixels. els. A real solution is to develop space-filling curves with arbitrary size. We will work on the design of space-fil space-filling ling curves curves of a rectangle space and size other than power of two.

[11] S. Kamata, Kamata, R. O. Eason, Eason, and Y. Y. Bandou Bandou.. A new algorithm for N-dimensional Hilbert scanning.   IEEE  8(7):964–97 64–973, 3, Transactions Transactions on Image Processing, 8(7):9 1999.

 

 

 

 

 

[12] S. Kamata, M. Niimi, R. O. Eason, and E. Kawag Kawaguc uchi hi.. An imp imple leme ment ntat atio ion n of an Ndi dime mens nsio iona nall Hilb Hilber ertt scan scanni ning ng al algo gori rith thm. m. In Proceedings of the 9th Scandlnavian Conference on  Image Analysis, pages 431–440, 1995.

References

[13] S. Kamata, Kamata, M M.. Niimi Niimi,, and E. Kaw Kawaguch aguchi. i. A gray image compressi compression on using a Hilbert Hilbert scan. In  Proceedings of Thirteenth International Conference on Pattern Recognition, volume 2, pages 905–909, 1996.

[1] D. J. Abel and D. M. Mark. Mark. A comparat comparativ ivee ana anallysis of some 2-dimensional 2-dimensional orderings. orderings.   Interna8

 

[14] S. Khuri and H.-C. H.-C. Hsu. Intera Interactiv ctivee pack packages ages for learning learn ing image comp compressi ression on algorithms algorithms.. In Proceedingss of the 5th Ann ing Annual ual Con Confer ferenc encee on Inn Innov ovati ation on and  Technology in Computer Science Education, pages 73–76, 2000. [15]] A. Lempel [15 Lempel and J. Ziv Ziv. A univ univers ersal al algo algorit rithm hm for data compression.   IEEE Transactions on Information Theory, 23:337–343, 23:337–343, 1977. [16] A. Lempel and J. Ziv Ziv.. Compression of individual sequences quenc es via variable variable-rate -rate coding. coding. IEEE Transactions Transactions on Information Theory, 24(5): 24(5):530–5 530–536, 36, 1978. [1 [17] 7] A A.. Lemp Lempel el and J. Ziv Ziv. Co Comp mpre ress ssio ion n of two two-dimensional data.   IEEE Tr Transactions ansactions on Information Theory, 32:2–8, 1986. [1 [18] 8] S.-Y S.-Y Lin, Lin, C.-S C.-S Ch Chen en,, L. Liu, Liu, an and d C. C.-H -H Huan Huang. g. Tensor product formulation for Hilbert space-filling cu curv rves es.. In  Proceedings of the 2003 International Conference on Parallel Processing, pages 99–106, 2003. [19]] B. [19 Moon, H.ysis V. of Jag Jagadi adish, sh, C.ering Fal Falout outsos sos, , and J. the H. Saltz. Saltz . Anal Analysis the clust clustering pro properti perties es of Hilbert Hilbe rt spac space-filli e-filling ng curve curve..   Know Knowledg ledgee and Data  Engineering, 13(1) 13(1):124– :124–141, 141, 2001. [20] W. B. Pennebaker Pennebaker and J. L. Mitchell. Mitchell.   JPEG Still Nostrand trand  Image Data Compres Compression sion Standard . Van Nos Reinhold, 1993. [21]] J. Quinque [21 Quinqueton ton an and d M. Ber Bertho thod. d. A local locally ly adap adap-tiv tivee Peano scan scanning ning algorithm. algorithm.   IEEE T Transacransactions on Pattern Analysis and Machine Intelligence , 3(4):403–41 3(4):4 03–412, 2, 1981. [22] H. Sagan. Sagan.   Space-Filling Curves. Springer-Verlag, Springer-Verlag, 1994. [23]] K. [23 Say Sayood ood. .   Intr Introduct oduction to Data Compr Compressi ession on. Moorgan Kaufmann, 2ndion edition, 1991. [24] C. E. Shannon. A mathematical mathematical theory of communication.  Bell System Technical Journal, 27:379–423, 623–656, 1948.

9

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close