paper mainly does some research in the conversion from DICOM format files into general image/ media files. The procedure is to convert DICOM format files into ...
Medical Image Conversion with DICOM Boqiang Liu, Minghui Zhu, Zhenwang Zhang, Cong Yin, Zhongguo Liu and Jason Gu* School of Control Science and Engineering, Shandong University, China *Department of Electrical and Computer Engineering, Dalhousie University, Canada
Abstract-As the standard especially for the storage and transmission of medical images, the standard of Digital Imaging and Communications in Medicine (DICOM) is popular to the people of the world. And as a result, almost all the outputs of the Computerized Tomography (CT), magnetic resonance (MR), digital subtraction angiography (DSA) and Ultrasonography (US) are saved as DICOM format. However, the DICOM format files can be opened by the original programs of windows OS, which is not convenient with the further research in image processing. The paper mainly does some research in the conversion from DICOM format files into general image/ media files. The procedure is to convert DICOM format files into bitmaps and then convert the bitmaps into other general image/ media files. The images then can be viewed directly by the original programs of windows OS, which will facilitate the further researches on image process. The DICOM format files can be displayed while being converted; the images displayed can also be done with some further operations, such as the process of lightness and contrast gradient of image, image filtering and segmentation. Keywords: DICOM format, conversion, bitmap
I.
INTRODUCTION
With the development of the digital image and computer communication techniques and requires of digital hospital in new century, Picture Achieving and Communication System (PACS) plays an important part nowadays. Instead of traditional films, PACS get, save, display and transport medical images and other related information through digital ways, and assist medical diagnoses efficiently. For the implement of communication between the medical image equipments, the standard of Digital Imaging and Communications in Medicine (DICOM) is constituted, which embodies a number of major enhancements to previous versions of the ACR-NEMA Standard: It is applicable to a networked environment. The ACR-NEMA Standard was applicable in a point-to-point environment only; for operation in a networked environment a Network Interface Unit (NIU) was required. DICOM supports operation in a networked environment using the industry standard networking protocol TCP/IP. It is applicable to an off-line media environment. The ACR-NEMA Standard did not specify a file format or choice of physical media or logical file system. It specifies how devices claiming conformance to the Standard react to commands and data being exchanged. The ACR-NEMA Standard was confined to the transfer of data, but DICOM specifies, through the concept of Service Classes, the semantics
of commands and associated data. It specifies levels of conformance. The ACR-NEMA Standard specified a minimum level of conformance. DICOM explicitly describes how an implementer must structure a Conformance Statement to select specific options. It is structured as a multi-part document. This facilitates evolution of the Standard in a rapidly evolving environment by simplifying the addition of new features. ISO directives which define how to structure multi-part documents have been followed in the construction of the DICOM Standard. It introduces explicit Information Objects not only for images and graphics but also for waveforms, reports, printing, etc. It specifies an established technique for uniquely identifying any Information Object. This facilitates unambiguous definitions of relationships between Information Objects as they are acted upon across the network. Now the version of DICOM standard is 3.0. The standard of DICOM is a medical image format and communication interface. All the equipments that accord with DICOM format can connect with PACS and transport and exchange information with other equipments directly. For the requirement of research, teaching and scientific communion, the data of DICOM files acquired from standard digital medical image equipments have to be converted into general image/ media files. The paper follows the standard of DICOM 3.0 strictly and does some research in the model that can convert DICOM format files into general image/media files by means of object-oriented methods. The model will be the foundation of further operation of images. II. LOAD OF DICOM FILES In order to load a DICOM format file, the construction of it should be analyzed. There are four parts in the standard of DICOM: patient, study, series and image [1, 4, 5, 6, and 7]. As usual medical images may have more parameters than general images, such as the data of the patient, location and study, which have special meanings. But the most interesting place is image information they contain. Before loading of the files, there are several very useful parameters have to be known [2]. (1)UID (Unique Identifier) It can be used in different places in the world to make sure each identifier was unique. For example, “1.2.840.10008.5.1.4.1.1.2” means CT image storage. Before
36 0840-7789/07/$25.00 ©2007 IEEE
DICOM format files are stored behind the Tag (7FE0, 0010), which now can be saved in the memories in order to do some further operation.
the load of the image, some important identifiers should be known first. (2) Data Element Tag It means an ordered pair of 16-bit unsigned integers representing the Group Number followed by Element Number. For example, the Tag (0008, 0020) represents the research date. It is obviously that all the related data have their own tags. Some important tags must be known in order to read the data.
III. GRAYSCALE DISPLAY AND CONVERSION OF DICOM FILES
In order to do some researches in grayscale display and conversion of DICOM files, a model is made to display DICOM format files by Visual C++ 6.0, which can open a (3)VR (Value Representation) single DICOM format file and also can open a whole folder It specifies the data type and format of the Value(s) containing DICOM format files. The model has a function of contained in the Value Field of a Data Element, it can be auto-searching the computer by tree traversal algorithm, and separated into two kinds, implicit VR and explicit VR. Implicit the DICOM format files searched can be put in a list. Before VR means that for a given Data Element Tag the values can be displaying the files by left-clicking, a render method should be defined by the Data Dictionary. While explicit VR means that known. the values can be represented directly by a two-byte character The render of DICOM images are not so difficult than what string, for example AE is short for Application Entity. you think, but it is also not easier than the render of bitmaps. Visual C++ 6.0 provides special functions for the render of (4) Little Endian and Big Endian bitmaps, but none of DICOM format files. The 256-color They are separated by the least significant byte encoded first grayscale image data have already been got, so there are two or the most significant byte shall be encoded first. Little ways to display the image: one is to encapsulate the grayscale Endian means that a form of byte ordering where multiple byte image data into a bitmap file, it is better because there are binary values are encoded with the least significant byte special functions in Visual C++ 6.0 to process bitmap files, but encoded first; and the remaining bytes encoded in increasing the headers of bitmaps should be made; the other is to show the order of significance, while Big Endian means that a form of pixel data on the monitor directly, it is better because it is easy byte ordering where multiple byte binary values are encoded to display, but the speed of display is much too slow. Whatever with the most significant byte encoded first; and the remaining way it takes, the image is shown on the monitor at last, as is bytes encoded in decreasing order of significance. For example, shown in Fig.1. an unsigned integer 12345678H will be encoded as As a researching platform, the display of image is a 78,56,34,12 according to the Little Endian style and will be readiness for the further operation, such as the process of encoded as 12,34,56,78 according to the Big Endian style. lightness and contrast gradient of images, image filtering and Both the parameters upon are defined in Transfer Syntax segmentation. All the operations upon are done by changing UID. Generally the structure is encoded using implicit VR pixel values through related algorithms. Little Endian Transfer Syntax. (5) Sample Value As a matter of fact, it is one pixel of the image. Sample value is specified by Bits Allocated, Bits Stored and High Bit, which are easily found behind the Tag (0028, 0100), (0028, 0101) and (0028, 0102). Effective pixel bits can be affirmed by the three tags. Bits Allocated is a very important value which will be used when converting files. (6)Other parameters: rows and columns of the images, patients’ name, sex and dates. The image data can be read if the parameters upon are known. But as is said before, the default transfer syntax of DICOM format files is implicit VR Little Endian Transfer Syntax,so once the data which are carried by data elements are read, the first important thing is to make sure whether it is default value. If VR is explicit, a two-byte character string between the Tag and the Value Length of the data element should be skipped, and for the same reason, if it is Big Endian, all the data read should be swapped. The image data of
(1)
37
(3)The Palette, it contains a blue part, a green part and a red part. In the 256-color grayscale lookup table (LUT), all the three parts should be the same. (4)Actual image data, the image data read from DICOM format files should be filled in this place. Attention: (1)BMP image rows need to be 4-byte aligned. That is to say, the actual width of the image should be a four times of an integer and be the nearest number which is larger than or equal with the width of the image. If not so, some number should be added. For example, if the width of the image is 240, then the actual width is also 240; if the width of the image is 241, then the actual width is 244. The way to solve it out is to use the following formula:
(2)
nLineWidth = nSrcWidth*3/4*4
(1)
The nSrcWidth is the original width of the image, and the nLineWidth is the new width of the image adjust to double words rule.
nLineWidth