See: Http://pan.baidu.com/s/1gfFLbJ9
DICOM an accelerating algorithm for window transformation of medical images *
Zhang Yu Race , Chungshan
(Computing Center, Tongji University, Shanghai 200092, China)
(Department of Electronics and Information, East China Ship Industry Institute, Zhenjiang 212003, Jiangsu)
E_mail:[email protected]
Abstract: This paper studies the display technology of DICOM medical images, and presents an accelerating algorithm for Image window transformation, which is simple, practical and effective, and can display dicom medical images in real time under the condition of dynamically adjusting the image window value continuously.
Key Words: DICOM; medical image; DIB; window transformation
Middle Figure Classification number : TP391 tp445-39 Document identification code:A
A Fast algorithm of the Window transformation for DICOM Medical Imageszhang Yousai Chen fumin
(Center of computer, Tongji University, Shanghai 200092)
(Dept. of Electronics and information, East China Shipbuilding Institute, Zhenjiang Jiangsu, 212003)
Abstract: This paper introduces the display approach of DICOM medical images, and presents a fast algorithm of the window Transforma tion of images, which is able to realtimely display DICOM medical images under the condition of continuously adjusting win Dow values of them.
Key Words: DICOM; Medical image; DIB; Window transformation
1 Introduction
In the middle of the 90, the American Institute of Radiology (American College of RADIOLOGY,ACR) and the National Electrical Manufacturers ' Association (Nation Electrical Manufactures association, NEMA) has developed the medical digital image archiving and transmission standard DICOM (digital Imagingand Communication in Medicine) 3.0[1], for a variety of medical imaging equipment produced by different manufacturers (such as CT, NMR, endoscopy, Ultrasonic, etc.) provides interface standards and interactive protocols, and strongly promotes the development and application of PACS (picture archiving and communication System). Because the general computer does not directly support the display of DICOM medical images, the real-time display technology of DICOM medical images is one of the key technologies of PACs (2).
Based on the simple introduction of the basic format of dicom file, this paper studies the display technology based on DICOM medical image, discusses the accelerating algorithm of the window transform of dicom medical image, and realizes the real-time display of dicom medical image with dynamic continuous adjustment (such as dragging with mouse) image window value.
2 DICOM basic format of the file
In the form of information object and business class description, the DICOM 3.0 standard uses the prescribed data structure to encode various medical information and image data to form a standard dicom file format. Its data structure is stored in the database element, with each data element being tagged (tag), the type of value (VALUEREPRESENTATION,VR), the length of the range (value length), and the range (value Field) consists of four basic units, 1 of which are shown. where "label" as the identifier of the data element uniquely defines the physical meaning of the data element (such as patient name, age, device, image type, image window value, image data, etc.); "Type of value" is an option that depends on the dicom semantics, which describes the data type of the data element's value domain (such as String, Integer, Floating-point numbers, etc.); the "range length" defines the number of bytes of the "range"; "Range" contains the value of the data element.
Dicom offers three kinds of semantics: implicit VR, BIG ENDIAN, and Little ENDIAN. These semantics specify whether the "type of value" item for a data element appears, the number of bytes of the "range length" item, and the order in which the bytes are stored in memory.
At present, a variety of medical imaging equipment (such as CT, MRI, etc.) usually with DICOM standard digital interface, can be easily obtained dicom file, for other non-standard medical image files can also be processed by computer to the DICOM format.
3 DICOM the display method of medical image
Since the display of DICOM medical images cannot be directly supported in a general-purpose computer, the Dicom file needs to be converted to a file format supported by other computers, such as device-independent bitmaps (Devices Independentbitmap, DIB), etc.
3.1 DIB Bitmap
The DIB bitmap [3] is a commonly used bitmap file format for computers, as shown in 2. The bitmap file header describes the composition of the file, the bitmap information header describes the basic information of the image data, the color table describes the image display color information, namely red, green, blue three color components.
Because in memory, only the bitmap information header, color table and image data are needed to display the bitmap, so when the Dicom medical image is converted to a DIB bitmap, the data structure and the image data can only be transformed according to the relevant data elements of the Dicom file. Since medical images are generally grayscale images, the three color components of each pixel in the color table Rgbblue = Rgbgreen = rgbred. It is shown that the maximum gray level of grayscale images using DIB bitmap is level 256.
3.2 window Transformation of image data
Because of the large dynamic range of medical image data (pixel depth is usually no less than 4096 grayscale), it is difficult for a general display to provide such a high dynamic range to display full details of the entire image at once. In order to display the full information of medical images realistically, the following method of Image Data window transformation can be used [4].
The so-called Image Data Window transformation refers to the window area of the image data is linearly converted to the maximum display range of the display, the image data above or below the lower limit of the window is set to the brightest or darkest display value respectively by restricting a data observation window. By dynamically adjusting the window width (the display range of image data) and the window (the center value of the displayed image data), the full information details of the medical image can be observed in turn. Figure 3 is the window to transform the image data and display values of the graph, V is the image data, G for the display display value, GM for the display of the maximum display value (corresponding to the DIB bitmap rgbblue= rgbgreen = rgbred = 255), for the window width, the window position, (1) formula for the conversion.
3.3 an accelerating algorithm for window transformation
When using the image window value to transform dicom medical image data into a window, if all image data (each pixel point) is transformed directly using (1), it will obviously affect the display speed of the image and delay the visual. To this end, we propose the following fast-check table acceleration algorithm, to meet the dynamic continuous adjustment of image window values (such as the use of mouse drag) under the real-time display image requirements.
Firstly, when the Dicom medical image is opened, the maximum and minimum values of the image data and the image window values are obtained according to the DICOM data elements, the distribution of the image data and the conversion region corresponding to the (1) type (4) are obtained, and then an image data conversion table is built in memory according to the (1) formula. Finally, the DICOM image data is converted to display value by a table-checking method. This assumes that the image shows a value of {0,1,2,..., 255} total of 256 levels.
Figure 4 Schematic diagram of the Accelerated Algorithm for window transformations
As can be seen, in the formation of the image data conversion table, only in the DICOM image data in the range (instead of all pixels) by the (1) One-time calculation, and then use the image data pointer to look up the table method can be realized Dicom image Data window transformation. Moreover, in the dynamic Adjustment window value, no need to recalculate the entire conversion table, as long as the window width changes in the range of table data for local adjustment. The following is a quick look-up table algorithm written in Visual C + + principle program. In the program, the cyclic overlay window is used to transform the slope ratio, and the multiplication in the (1) formula is converted to addition, and the conversion speed is further improved.
float wmin = C–W/2; C: Window Position
float Wmax = c + w/2; W: Window width
float Ratio = 255/w; The slope of the window transformation
float tabledata = 0; The window is zeroed along the data
/* Form image data Conversion table */
The extremum of pixelmin and pixelmax:dicom image data
PTable: Data pointers for conversion tables
int i;
for (i = pixelmin; I <=Pixelmax; i++, ptable++)
{
if (I < wmin)
*ptable = 0;
else if (I < Wmax)
{
*ptable = Tabledata;
Tabledata = Tabledata + Ratio;
}
Else
*ptable = 255;
}
/* Adjust the conversion table data pointer to pixel = 0 */
ptable = ptable– (pixelmax+ 1);
/* Image Data Window Transform */
Allpixels: Total number of image pixels; data pointers to Pdicomdata, pdibdata://dicom, and DIB images
unsigned int J;
for (j=0; j<allpixels;
J + +, pdibdata++,pdicomdata++)
*pdibdata = * (ptable + *pdicomdata);
Fig. 5 is an abdominal ct image with different window values obtained by using this algorithm. Figure 6 shows the inverse white image (negative) of Figure 5 (b) using the window curve shown in Figure 7.
(a) w:342 c:28 (b) w:65 c:20
Fig. 5 abdominal CT images under different window values
Fig. 6 Figure 4 (b) Negative Figure 7 image Anti-white window curve
4 Results Analysis
The window acceleration algorithm reduces the data processing range from all the pixels of the image to the value range of the image data, for 512x512 pixels, 4096 gray-level images, the amount of information is reduced by 64 times times; In the program, the cyclic overlay window is used to transform the slope, and the multiplication operation in the (1) formula is converted to the addition operation. The width of the width of the wider acceleration effect is more obvious, such as a window width of 500, you can reduce the multiplication of 500 times.
5 Concluding remarks
Based on DICOM 3.0 standard, this paper realizes the real-time display of dicom medical images in general-purpose computer by adding window display technology. The accelerated algorithm of Image window transform reduces the processing range of image data, uses cyclic superposition instead of multiplication, and greatly reduces the computational amount of image data conversion from two aspects, obviously improves the display speed and achieves the real-time display requirement under dynamic Continuous adjustment of window value. The algorithm is simple, practical and ideal for accelerating, and can be applied to other similar occasions.
Reference documents
[1] National Electricalmanufacturers Association, Digital Imaging and Communications in Medicine, ps3.5-1998:9-34.
[2] Jack, treatment, the realization of medical imaging archiving and transmission system of several key technologies, Chinese Journal of Image Graphics, 2000.7
[3] Wang Hua, et. Visual C + + 6.0 programming examples and techniques. Mechanical industry Press, 1999. 223-231.
[4] Kangxiaodong, modern medical imaging technology. Tianjin Science and Technology translation and publishing Company, 2000. 198-199.
* Fund Project: Shanghai Science and Technology Development Fund Project Subsidy (No.: 015115045)
Author Profile: Zhang Yu, associate professor, doctoral students, the main research direction for image processing and three-dimensional visualization. Chungshan, professor, doctoral tutor, the main research direction for virtual reality, network multimedia, image processing.
Accelerating algorithm of window transformation in dicom medical image