The specific embodiment
With embodiment the present invention is described in further detail with reference to the accompanying drawings below:
1, DSC pretreatment
The present invention is according to principle and the flow process of DSC, at first several coordinate systems according to the mode unification of translation and conversion in same coordinate system, in this unified coordinate system, carry out interpolation arithmetic is tried to achieve needs the display element position on the screen pixel value then.The form of sampled data and size are stored according to shown in Figure 1, and total Sr is capable, the Sc row, and size is Sr * Sc byte (Byte).The scan depths that sampled data on each is gone is all corresponding identical, capable to Sr from first row, corresponding scan depths is successively uniformly-spaced from the zero probe maximum scan degree of depth that is increased to setting.The scanning angle that each sampled data that lists is all corresponding identical is listed as the Sc row from first, and corresponding scanning angle (with reference to shown in Figure 2) is successively uniformly-spaced from-θ
0Be increased to θ
0Table 1 has been listed and need have been obtained, setting and precalculated parameter.
Table 1
Parameter name |
The definition of parameter |
Symbol |
Remarks |
The scanning angle of convex array probe |
During the convex array probe scanning, become segmental angle |
2θ
0 |
Unit is a radian |
The radius of curvature of convex array probe |
Radius of curvature is the fan-shaped shape radius of the physics of convex array probe |
r
0 |
Unit is physical unit millimeter (mm) |
The scan depths that convex array probe is current |
The scan depths of the convex array probe corresponding with sampled data |
D
0 |
Unit is physical unit millimeter (mm) |
The minimum scan depths that convex array probe can be set |
Minima in the scan depths that convex array probe can use |
D
min |
Unit is physical unit millimeter (mm) |
The line number of sampled data |
Shown in Fig. 2-1 |
Sr |
Dimensionless parameters |
The columns of sampled data |
Shown in Fig. 2-1 |
Sc |
Dimensionless parameters |
Be presented at the image area width on the screen |
Carry out being presented at after the DSC image area width on the screen |
W
0 |
With the pixel is unit |
Be presented at the image area height on the screen |
Carry out being presented at after the DSC image area height on the screen |
H
0 |
The same W of unit
0 |
Vertical distance |
The probe center of circle is to the vertical dimension of coordinate system x-y coordinate axes x |
d |
Unit is physical unit millimeter (mm) |
The computing formula of the distance of hanging down:
d=r
0×cosθ
0 (1)
The coordinate translation formula:
With reference to Fig. 2 as can be known,
And
Can get by formula (2) and formula (3)
Formula (4) is the coordinate translation formula that finally is used for DSC.
With reference to Fig. 2, under the situation that each parameter is all determined, if the coordinate (x under the x-y coordinate system, y) through the coordinate under the u-v coordinate system corresponding after the coordinate translation be (u, v), and coordinate (u, be (R v) through corresponding coordinate under R-θ coordinate system after the coordinate transform, θ), can get coordinate (u, the transformation for mula that v) arrives coordinate R-θ as the formula (5):
If it is q that the utmost point directly quantizes the factor
r, q then
rComputing formula as the formula (6):
If the polar angle quantizing factor is q
θ, q then
θComputing formula as the formula (7):
If the polar coordinate (R after quantizing
q, θ
q), through the polar coordinate behind coordinate translation and the polar coordinate transform be (R, θ), then the relation between them as the formula (8):
For the numbering of utmost point footpath and sampled data can be unified, need to give the utmost point directly to go partially, it is F that the setting utmost point directly removes inclined to one side constant
R, F then
RAs the formula (9):
In order to allow 0 position of polar angle and first column alignment of sampled data, need go partially to polar angle, it is F that the setting polar angle removes inclined to one side constant
θ, F then
θAs the formula (10):
F
θ=S
c/2 (10)
If the polar coordinate after quantizing to go partially are (R
Qf, θ
Qf), through the coordinate after the conversion of coordinate translation and polar coordinate be (R, θ), then the relation between them as the formula (11):
2, set up coordinate conversion table
Coordinate Conversion, its operand is very big, but certain rules is arranged again simultaneously.If when carrying out Coordinate Conversion, all carry out once-through operation at every turn, the consumption of CPU will be had influence on so, and frame frequency can be reduced, do not reach the requirement of real-time.Create that a two-dimensional array---two-dimensional look-up table is carried out the conversion of coordinate, will address the above problem.
At scan depths D as shown in Figure 2
0Down, the line number of corresponding coordinate conversion table is:
Consider that different scan depths all uses same coordinate conversion table, just must find out a minimum but can satisfy a coordinate conversion table line number under all scan depths operating positions simultaneously again, because
So when determining minimum line number, get scan depths minima D
MinCalculate.
Because the width in display element district is W
0, and W
0Conversion can not take place, so the columns of coordinate conversion table is decided to be W yet under the situation that display screen is determined
0
According to formula (13) as can be known, the line number of coordinate conversion table is by D
MinDetermine that columns is by W
0Determine.The line number of establishing coordinate conversion table CTT (Coordinate Transform Table) so is CTT
Row, columns is CTT
Col, then
Then formula (14) is the final computing formula of determining the Coordinate Conversion table size.
According to formula (1), formula (4), formula (5), formula (11) and formula (14), (x y) carries out cyclic transformation to (R according to input coordinate
Qf, θ
Qf) get final product 0≤x<CTT wherein
Col, 0≤y<CTT
Row
After having set up coordinate conversion table CCT,, set up this with regard to no longer needing to rerun and shown unless change probe or change display mode.
3, set up the interpolation calculation table
By the bilinear interpolation operational formula as can be known, calculate polar coordinate point (R
Qf, θ
Qf) gray value located, just need the value of four nearest with it around this some sampled points.Try to achieve R
QfInteger part, be made as i, try to achieve θ
QfInteger part, be made as j.So, by the point under the polar coordinate system (i, j), point (i, j+1), point (i+1, j) and point (i+1, the j+1) gray value of four points can bilinear interpolation point (R
Qf, θ
Qf) gray value.
By formula bilinear interpolation operational formula as can be known, be α and β if establish interpolation coefficient, and α=R
Qf-i, β=θ
Qf-j, and establish point under the polar coordinate (r, gray value θ) be G (r, θ), then
G(R
qf,θ
qf)=(1-α)×(1-β)×G(i,j)+
(1-α)×β×G(i,j+1)+ (15)
α×(1-β)×G(i+1,j)+
α×β×G(i+1,j+1)
The content of interpolation table:
(1) as shown in Figure 2, (x, coordinate position y) is converted into one dimension by two dimension, and preserves with the protruding battle array scanning area picture element in the display element district.Be made as DP (Display Position), then:
DP=y×W
0+x (16)
Pay special attention to: the coordinate position of not preserving protruding battle array scanning area picture element in addition as shown in Figure 2.
(2) preserve four rectification interpolation coefficients (Correctional Coefficient) using, and they are converted into WORD (double byte) integer from floating number.Correct interpolation coefficient for four and be made as CC respectively
1, CC
2, CC
3, CC
4, then:
CC
1=(1-α)×(1-β)×256 (17)
CC
2=(1-α)×β×256 (18)
CC
3=α×(1-β)×256 (19)
CC
4=α×β×256 (20)
The position of (3) four sampled points
Preserve the position (Sample Points/Position) of four sampled points that interpolation needs, and its coordinate position is converted into one dimension by two dimension preserves, the position of four sampled points is made as SP respectively
1, SP
2, SP
3, SP
4, then:
SP
1=i×Sc+j (21)
SP
2=i×Sc+j+1 (22)
SP
3=(i+1)×Sc+j (23)
SP
4=(i+1)×Sc+j+1 (24)
Because this structure includes the one dimension coordinate figure (DisplayPosition) that is presented at the point on the screen, include corrigent interpolation coefficient (Correctional Coefficient), also including the position (Sample Points/Position) of sampled point, is DPCCSPT (Table represented in letter " T ") so be called for short this structure.Shown in this structure is defined as follows:
struct DPCCSPT
{
int DP;
WORD CC1;
WORD CC2;
WORD CC3;
WORD CC4;
int SP1;
int SP2;
int SP3;
int SP4;
};
The DP correspondence is presented at the one dimension coordinate figure of the point on the screen, four sampled point SP
1, SP
2, SP
3, SP
4Correct interpolation coefficient CC for corresponding respectively four
1, CC
2, CC
3, CC
4When calculating, multiplying each other them then in order successively, summation gets final product.
Use the vector v ector among the C++STL, to the vector of a DPCCSPT type of internal memory application, the variable of application is as follows:
std::vector<DPCCSPT>FDisplayData;
Deposit among the variable FDisplayData and carry out the data that interpolation needs.
(R
Qf, θ
Qf) be the polar coordinate value that finds out through the coordinate transform table, R
QfInteger part be i, θ
QfInteger part be j, α=R
Qf-i, β=θ
Qf-j.
Owing to be not the information that all coordinates in display element district all have the B ultrasonic image, so coordinate position that will non-protruding battle array scanning area excludes, the purpose of doing like this has two: one, and the minimizing operand has improved arithmetic speed; The 2nd, saved the memory storage space.
The condition of store data is as follows: 0≤i<S
rAnd 0≤j<S
c, so just can satisfy above requirement.
Satisfying under the situation of above-mentioned condition the data of the DPCCSPT structure type that will use of in variable FDisplayData, packing into.The fast processing characteristics of coordinate in the display image area scope (the display screen coordinate system) according to computer are all traveled through one time line by line, when traversal, search corresponding polar coordinate value in the CCT table, calculate the SP of this DPCCSPT categorical data then according to polar value
1, SP
2, SP
3, SP
4, CC
1, CC
2, CC
3, CC
4The value of the variables D P of this DPCCSPT categorical data is to determine according to the coordinate in this display image area scope, then the data of all qualified DPCCSPT types all have been loaded among the variable FDisplayData, those ineligible displaing coordinates have been endowed null value when initialization, promptly be shown as black.Traversal FDisplayDaa calculates the gray value that can obtain screen display location voluntarily with the data of its DPCCSPT type.
For interpolation table DPCCSPT,, just no longer need to recomputate and set up this and shown unless scan depths changes or changes display mode.
4, the DSC processing is carried out in calculating fast
According to the data of interpolation calculation table gained, just can calculate the gray value of protruding each pixel of battle array scanning area shown in Figure 2.
At first definite zone that will show:
For instance, suppose to obtain by the data of k DPCCSPT type among the FDisplayData gray value of a point on the display screen, carry out following calculating and get final product.The gray value of at first establishing m position on the screen is DisGry[m], the setting according to formula (15) can get in addition:
DisGry(FDisplayData[k].DP)=
(FDisplayData[k].cc1*SD[FDisplayData[k].P1]+
FDisplayData[k].cc2*SD[FDisplayData[k].P2]+
FDisplayData[k].cc3*SD[FDisplayData[k].P3]+
FDisplayData[k].cc4*SD[FDisplayData[k].P4])>>8
5, sending to display shows
Carrying out the DSC processing by quick calculating knows, at DisGry[] in this array, the pixel gray value of all protruding battle array scanning areas is preserved, certainly, display element the district and don't initialized the time, all composed null value and be kept in this array in the pixel value of protruding battle array scanning area.All to have preserved and will be presented at the screen area width be W to this array so
0, highly be H
0The gray value of all pixels.
Want the array DisGry[of viewing area gray value with having preserved all] first address pass to explicit function and get final product, thereby finished whole DSC from obtain data, coordinate transform, interpolation processing to the end send to all processes that display shows.
Comparison diagram 3 and Fig. 4, can be clear that, software DSC has saved the hardware DSC blood processor equipment in the B ultrasonic instrument, saved the hardware cost of B ultrasonic instrument, dwindled the volume of B ultrasonic hardware circuit, and a lot of convenience have been brought for the software design of B ultrasonic, for the software processes of image provides a great convenience.
Fig. 5 has summed up the handling process of digital scan convertor of the present invention:
1, sets up coordinate conversion table CCT and interpolation table DPCCSPT, (describing implementation procedure hereinbefore in detail).It should be noted that: after having set up coordinate conversion table CCT,, set up this with regard to no longer needing to rerun and shown unless change probe or change display mode.For interpolation table DPCCSPT,, just no longer need to recomputate and set up this and shown unless scan depths changes or changes display mode.
2, deposit the array SD[Sr * Sc of sampled data] in pretreatment, will define, size is to set according to the size of sampled data, and its size is Sr * Sc byte, and data type is the BYTE type, is defined as with C++: " BYTE SD[Sr*Sc]; " this array deposits is the gray value of frame sampling data, the scope of gray value is 0
-255.Value such as the 3rd BYTE type data of this array is 100, then can think SD[2] value be 100 (because first value of array is SD[0], thus the 3rd be SD[2]).Because sampled data can be uploaded a frame at regular intervals, so (the same position in the array) its gray value is also constantly changing in same sampling location.
3, deposit the one-dimension array DisGry[W of dateout
0* H
0]: this array is deposited the gray value of each pixel of display element district as shown in Figure 2, so its size is the big or small W in display element district
0* H
0, data type is the BYTE type, is defined as with C++: " BYTE DisGray[W
0* H
0] ".Before carrying out quick DSC processing, deposit the one-dimension array DisGry[W of dateout
0* H
0] be initialised.Unless scan depths or display mode or probe are changed, this array is no longer carried out initialization.During initialization, all elements of this array is assigned zero of gray value, is black.
4, fast DSC handles: carrying out quick DSC when handling, according to the restrictive condition that calculates interpolation table, can know array FDisplayData[] in the displaing coordinate position DP that preserves all in protruding battle array scanning area as shown in Figure 2.
As shown in Figure 6 and Figure 7, test result certifying software DSC can accurately promptly be shown to sampled data on the screen, and when reaching the highest frame per second 64, the cpu resource that is consumed also is no more than 2%, has reached the requirement of real-time fully.When frame frequency was set in 32 frames, the cpu resource display result that is consumed showed and is no more than 1%.
At formula (11),,,, can adopt cordic algorithm to realize in order to simplify computing so operand is bigger owing to involve the computing of square evolution and the trigonometric function of negating in the formula.If adopt cordic algorithm to realize evolution and the computing of the tan of negating, time that will corresponding minimizing initialization Coordinate Conversion look-up table, reduce B ultrasonic system response time during some important parameters in changing table 1.
Below introduce in detail the detailed process of using cordic algorithm the evolution and the tangent of negating to be converted to plus-minus and shift operation.
Cordic algorithm is that (a, (R, iterative algorithm θ) have not only been avoided the calculating of evolution and antitrigonometric function, even have avoided the multiplication and division computing, and only need carry out plus and minus calculation and shifting function can be finished b) to become polar coordinate rectangular coordinate.The CORDIC interative computation comprises three parallel streamlines, and three outputs of streamline after the n time iteration are used x (n), y (n), z (n) expression respectively, the initial value of iteration:
Interative computation converges on:
Iterative algorithm is as follows:
Wherein:
Arctg2
-nIt is anglec of rotation constant
2
-nY (n) the n position that y (n) need be moved to left, 2
-nX (n) only needs the n position that move to left with x (n), all uses an anglec of rotation constant for every grade of the CORDIC interative computation, and these anglec of rotation constants are respectively sequentially: 45 degree, 26 degree, 14 degree, 7 degree, 3.5 degree ....Iterations is always limited, and the anglec of rotation constant of afterbody is actually the angular accuracy that iteration realizes, for example the angular accuracy of 16 grades of iteration realizations is 0.00175 degree.
Those skilled in the art do not break away from essence of the present invention and spirit, can there be the various deformation scheme to realize the present invention, the above only is the preferable feasible embodiment of the present invention, be not so limit to interest field of the present invention, the equivalent structure that all utilizations description of the present invention and accompanying drawing content are done changes, and all is contained within the interest field of the present invention.