Realize that the GPU computing improves the method for DR image processing speed
Technical field
The present invention relates to the medical image processing technical field, relate in particular to the method that a kind of GPU of realization computing improves the DR image processing speed.
Background technology
In field of medical image processing, the technology of utilizing Console software to carry out DR (DigitalRadiography, Direct Digital X ray photography) Medical Image Processing at present mainly contains: Gain corrections, lumbar vertebrae isostatic correction, usm sharpening, slightly smoothly, moderate smoothing processing etc.
Above-mentioned DR Medical Image Processing generally adopts the CPU of microcomputer to handle, the Console software that moves among the CPU, its most of image processing techniquess have all been used the convolution operator processing, convolution operator is little 3*3,5*5,39*39,101*101 or the like, and these spatial domain convolution operators can pass through FFT (fast fourier transform) and realize at frequency filtering in addition.By optimized Algorithm flow process, optimizer code, the two-dimensional convolution operator is alternative with the one dimension convolution operator, the processing time can be reduced, but because the console aftertreatment is more, bulk treatment speed is still too slow.From the Pentium4 epoch, the lifting of cpu clock frequency meets with bottleneck, rests on about 2GHz to 3GHz always.Therefore, utilize GPU (Graphic Processing Unit, graphic processing circuit) to replace or the technology that cooperates CPU to carry out Medical Image Processing also engenders, as:
Based on the hardware-accelerated object plotting method of GPU, may further comprise the steps: (1) carries out being stored as texture after the pre-service to volume data in No. 200510110665.9 disclosed a kind of medical image of disclosed Chinese invention patent application on May 24th, 2006; (2) for calculating, GPU generates and provides parameter: the 1. generation of benchmark tangent plane; 2. in the ray cast process, the increment of texture and the step number that need advance of light altogether; 3. in GPU handles, redundant points corresponding redundant department is removed; (3) GPU calculates, and generate image: pixel rendering is the ray cast calculating section, comprising: determine light two ends and blend of colors.This patented claim technology is that light projecting algorithm, the traditional texture volume rendering algorithm realized in conjunction with traditional C PU are one, uses GPU to finish the ray cast process, uses the blend of colors method to generate image, sends to then in the color buffer district.Its basic ideas are with graphics card hardware graphic plotting to be carried out speed-up computation, obtain real-time render speed when keeping picture quality, satisfy the needs of digital medical system.
Do not put down in writing the technical matters that concrete measure realizes utilizing the GPU acceleration for overcoming above-mentioned No. 200510110665.9 patented claim, No. 200910131429.3 Chinese invention patent application disclosed on September 2nd, 2009, this application discloses a kind of GPU that utilizes and quickens CR/DR/CT image demonstration and image process method and specialized equipment, it comprises one in PC computer, CR/DR workstation or PACS server.Wherein PC computer chain is followed CR/DR workstation or PACS server, utilize the general-purpose computations ability of novel GPU, realize the quick demonstration of CR/DR/CT image, the demonstration of image and image processing function all utilize GPU to finish, proposition is with the disposal route of image segmentation amalgamation, GDI two dimension to PACS use is in the past quickened different, this method basic ideas are to utilize the general-purpose computations ability of GPU, CPU is freed from the heavy calculating of Flame Image Process, be absorbed in the processing of data communication and data security, to improve system effectiveness.
Must use graphics workstation to carry out GPU to quicken to cause the high technical matters of complex structure cost for overcoming above-mentioned No. 200910131429.3 patented claim, the disclosed a kind of three-dimensional medical image display method that quickens based on GPU of disclosed Chinese invention patent application on Dec 2nd, 2009 200910059864.X number, this method are that medical science DICOM image sequence file is saved in Installed System Memory in the mode of volume data; Utilize the 3 d graphic library programming expansion interface function API of OPENGL or DIRECTX then, volume data is loaded into the GPU video memory; Calculate again to generate and act on behalf of solid, and the polygonal slices of acting on behalf of in the solid is carried out illumination calculation and color calculation by pixel; Mix by ALPHA at last and will act on behalf of the synthetic 3 d medical images of polygonal slices all in the solid.These method basic ideas are to utilize the certain programmed interface, realize the real-time interactive demonstration and need not use graphics workstation on the popular PC of ordinary consumption levels, to reduce cost.
But, above-mentioned 200910059864.X patented claim technology is utilized the 3 d graphic library programming expansion interface function API of OPENGL or DIRECTX, and the method that the volume data of medical science DICOM image sequence file is loaded into the GPU video memory only is suitable for 3-D view and handles.Program that this method need customize or circuit, process is comparatively complicated, and requiring very that the research staff of familiar with computers software engineering, hardware technology designs and researches and develops, R﹠D costs are higher, efficient is lower, stability is difficult to guarantee and be inconvenient to safeguard when breaking down.
Summary of the invention
The technical matters that the present invention mainly solves provides the method that a kind of GPU of realization computing improves the DR image processing speed, can be simple and easy, realize directly calling the function that GPU carries out medical image processing at low cost on the popular PC of ordinary consumption levels.
For solving the problems of the technologies described above, the technical scheme that the present invention adopts is: provide a kind of GPU of realization computing to improve the method for DR image processing speed, comprise: read the primitive medicine view data, with image edge pixels described primitive medicine image is expanded and polishing, wherein establishing described original image size is imageW * imageH, convolution kernel is of a size of kernelW * kernelH, picture size is fftW * fftH behind the polishing, fftW=imageW+kernelW-1 wherein, fftH=imageH+kernelH-1; The Fast Fourier Transform (FFT) FFT program that adopts the unified equipment framework of calculating programming model CUDA to write is directly called the computational resource of GPU, primitive medicine view data behind described expansion and the polishing and convolution kernel are carried out the FFT computing respectively, correspondingly obtain a FFT result and the 2nd FFT result; Adopt and calculate the convolution program that unified equipment framework programming model CUDA writes, directly call the computational resource of GPU a described FFT result and the 2nd FFT result are asked multiplication at frequency domain, obtain multiplied result; Adopt and calculate the contrary FFT program that unified equipment framework programming model CUDA writes, the computational resource that directly calls GPU carries out contrary FFT computing to described multiplied result.
Wherein, described FFT computing comprises an imageW * imageH size two-dimensional FFT operation, a fftW * fftH size two-dimensional FFT operation, described frequency domain that multiplication comprises imageW * imageH size and the fftW * fftH size multiplication mutually of asking, described contrary FFT computing comprises a fftW * contrary FFT computing of fftH size two dimension.
Wherein, described primitive medicine view data behind described expansion and the polishing and convolution kernel are carried out respectively in the step of FFT computing, select for use the CUFFT storehouse of nVidia exploitation to carry out described FFT computing.
The invention has the beneficial effects as follows: be different from the program that prior art need customize or circuit carries out the GPU Flame Image Process and make design process comparatively complicated, have relatively high expectations, the more high situation of cost, the present invention adopts the unified equipment framework of calculating programming model CUDA to write the various programs of carrying out Medical Image Processing, the program of these CUDA exploitations can directly be called GPU when handling image computational resource carries out Flame Image Process, key is to write the concurrent operation program relevant with moving Medical Treatment on the personal computer of cheapness, do not need to build complicated platform, do not need special hardware device or software, make implement very simple and low-cost; Simultaneously, CUDA is a kind of multiple programming model and software environment, and by CUDA, the user can utilize GPU to carry out general-purpose computations, and it adopts the C language development of expansion, and except that can directly calling the computational resource of GPU, operation efficiency is higher; The present invention is directed to medical image and need carry out the characteristics that image edge pixels is handled, with image edge pixels described primitive medicine image is expanded and polishing, implement with aforementioned employing CUDA technology, common effect is to make not need the computing machine of higher level to research and develop operating personnel, do not need special platform and equipment, just can carry out described Medical Image Processing, therefore, the present invention can be simple and easy, on the popular PC of ordinary consumption levels, realize directly calling the function that GPU carries out medical image processing at low cost.
Description of drawings
Fig. 1 is that the present invention realizes that the GPU computing improves the process flow diagram of the method embodiment of DR image processing speed.
Embodiment
By describing technology contents of the present invention, structural attitude in detail, realized purpose and effect, give explanation below in conjunction with embodiment and conjunction with figs. are detailed.
See also Fig. 1, the present invention realizes that the method embodiment of GPU computing raising DR image processing speed mainly comprises step:
Step 101: read the primitive medicine view data, with image edge pixels described primitive medicine image is expanded and polishing, wherein establishing described original image size is imageW * imageH, convolution kernel is of a size of kernelW * kernelH, picture size is fftW * fftH behind the polishing, fftW=imageW+kernelW-1 wherein, fftH=imageH+kernelH-1;
Step 102: the Fast Fourier Transform (FFT) FFT program that adopts the unified equipment framework of calculating programming model CUDA to write is directly called the computational resource of GPU, primitive medicine view data behind described expansion and the polishing and convolution kernel are carried out the FFT computing respectively, correspondingly obtain a FFT result and the 2nd FFT result;
Step 103: adopt and calculate the convolution program that unified equipment framework programming model CUDA writes, directly call the computational resource of GPU a described FFT result and the 2nd FFT result are asked multiplication at frequency domain, obtain multiplied result;
Step 104: adopt and calculate the contrary FFT program that unified equipment framework programming model CUDA writes, the computational resource that directly calls GPU carries out contrary FFT computing to described multiplied result.
Below as can be seen, the present invention adopts the unified equipment framework of calculating programming model CUDA to write the various programs of carrying out Medical Image Processing, the program of these CUDA exploitations can directly be called GPU when handling image computational resource carries out Flame Image Process, key is to write the concurrent operation program relevant with moving Medical Treatment on the personal computer of cheapness, do not need to build complicated platform, do not need special hardware device or software, make implement very simple and low-cost; Simultaneously, CUDA is a kind of multiple programming model and software environment, and by CUDA, the user can utilize GPU to carry out general-purpose computations, and it adopts the C language development of expansion, and except that can directly calling the computational resource of GPU, operation efficiency is higher; The present invention is directed to medical image and need carry out the characteristics that image edge pixels is handled, with image edge pixels described primitive medicine image is expanded and polishing, implement with aforementioned employing CUDA technology, common effect is to make not need the computing machine of higher level to research and develop operating personnel, do not need special platform and equipment, just can carry out described Medical Image Processing, therefore, the present invention can be simple and easy, on the popular PC of ordinary consumption levels, realize directly calling the function that GPU carries out medical image processing at low cost.
In addition, the present invention can also realize following technique effect:
1) the present invention can make full use of the powerful calculating ability of GPU, can reach near 1Tflops/s even higher as GT200;
2) GPU has high bandwidth of memory, and image calculation efficient is higher;
3) under the equal computing power, GPU is more more cheap than CPU;
4), can on the personal computer of cheapness, write and move concurrent program based on the CUDA technology.With respect to the parallel computation environment based on network of workstations and cluster of MPI technology, the present invention has significant cost advantage.
For ease of GPU computing and conserve bandwidth, describedly described primitive medicine image is expanded in the step with polishing with image edge pixels, picture size behind the polishing is set at the multiple that is less than or equal to 1024 2n number or nearest 512.Such as, original image is of a size of 1220 * 120, and convolution kernel is of a size of 7 * 7, calculates to such an extent that fftW and fffH are respectively 1226 and 126, and it is 1536 * 128 that the picture size fftW * fftH that then finally participates in computing need supply.
Image operation in the embodiment of the invention, the FFT computing comprises an imageW * imageH size two-dimensional FFT operation, a fftW * fftH size two-dimensional FFT operation as described, described frequency domain that multiplication comprises imageW * imageH size and the fftW * fftH size multiplication mutually of asking, described contrary FFT computing comprises a fftW * contrary FFT computing of fftH size two dimension.
Wherein, described primitive medicine view data behind described expansion and the polishing and convolution kernel are carried out respectively in the step of FFT computing, select for use the CUFFT storehouse of nVidia exploitation to carry out described FFT computing.
The above only is embodiments of the invention; be not so limit claim of the present invention; every equivalent structure or equivalent flow process conversion that utilizes instructions of the present invention and accompanying drawing content to be done; or directly or indirectly be used in other relevant technical fields, all in like manner be included in the scope of patent protection of the present invention.