Summary of the invention
The technical problem to be solved in the present invention provides a kind of M model ultrasonic image display packing, overcoming the demonstration of prior art B pattern and M model ultrasonic image is realized by hardware, hardware circuit is numerous and jumbled, pcb board wiring complexity and upper level applications can not get sampled data, the defective of post processing of image calculation of complex.
The present invention solves the problems of the technologies described above the technical scheme that is adopted to be:
A kind of M model ultrasonic image display packing comprises step:
A1, utilize software module to show the B/M model ultrasonic image;
A2, on the B of described B/M model ultrasonic image mode image, choose the M sample line;
A3, utilize software module that the M model ultrasonic image of described M sample line correspondence is presented on the screen.
Described steps A 1 comprises step:
B1, determine B model ultrasonic image and M model ultrasonic image orientation and the displaying ratio on screen;
B2, utilize software module that the B model ultrasonic image is presented on the screen;
B3, on described B model ultrasonic image, choose the M sample line;
B4, utilize software module that the M model ultrasonic image of described M sample line correspondence is presented on the screen.
Described step B2 comprises step:
C1, set up the interpolation calculation table;
C2, calculate the gray value data of each pixel in the protruding battle array scanning area according to described interpolation calculation harmony in the exterior sampled data;
C3, described gray value data is outputed to screen show.
Described step C1 comprises step: calculate the polar coordinate value of each pixel in the protruding battle array scanning area in advance, and described polar coordinate value is deposited in the coordinate conversion table, set up described interpolation calculation table according to described coordinate conversion table.
Described interpolation calculation table is made as the assignment set of a data structure, and described data structure comprises the one dimension coordinate variable that is presented at the point on the screen, the location variable of correcting interpolation coefficient variable, sampled point.
Described step C2 comprises step: described gray value data at first deposits in first one-dimension array.Described step B4 comprises step:
D1, determine transducer array element number according to described M sample line;
D2, the sampled data of described transducer array element number is stored in M pattern sampled data memory block;
D3, the sampled data that the reads described transducer array element number row interpolation of going forward side by side calculates;
D4, will output to screen through the M pattern gray value data that interpolation calculation obtains and show.
Described M pattern gray value data at first deposits in second one-dimension array.
Data in described second one-dimension array assignment are successively given and the corresponding two-dimensional array of M pattern display pixel district size.
Described steps A 3 comprises step:
E1, determine transducer array element number according to the M sample line;
E2, the sampled data of described transducer array element number is stored in M pattern sampled data memory block;
E3, the sampled data that the reads described transducer array element number row interpolation of going forward side by side calculates;
E4, will output to screen through the M pattern gray value data that interpolation calculation obtains according to switching command and show.
Beneficial effect of the present invention is: the present invention uses software to carry out the DSC processing and carries out the demonstration of B/M model ultrasonic image, saved the hardware processing module of DSC, save hardware cost, dwindled the volume of hardware, and provide great convenience for the post processing of image.
The specific embodiment
With embodiment the present invention is described in further detail with reference to the accompanying drawings below:
1, the super pretreatment of B ultrasonic and M
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 * ScByte.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 as Fig. 2 and shown in Figure 4, corresponding scanning angle 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
0 |
Unit is physical unit millimeter (mm) |
The line number of B ultrasonic sampled data |
With reference to shown in Figure 1 |
Sr |
Dimensionless parameters |
The columns of B ultrasonic sampled data |
With reference to shown in Figure 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 |
Same W
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 line number of M over-extraction sample data |
With reference to shown in Figure 3 |
M
r |
Dimensionless parameters |
The columns of M over-extraction sample data |
With reference to shown in Figure 3 |
M
c |
Dimensionless parameters |
Be presented at the image area width on the screen |
The super image area width that is presented on the screen of M |
W
0 |
With the pixel is unit |
Be presented at the image area height on the screen |
The super image area height that is presented on the screen of M |
H
1 |
Same W
0 |
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):
The notion of M sample line and purposes
The M sample line is a line that is parallel to ultrasound echo signal that is presented on the B ultrasonic image, can changes the position.Be mainly used in the position of determining M over-extraction sample data.When B/M showed, M hypergraph picture not only changed along with the change of detection tissue place echo-signal, and changes along with the change of M sample line position.The former change is because the organization internal of detection place kinetic, and the tissue location that the latter is then surveyed has taken place to change and caused.Therefore the main uses of M sample line changes the super tissue location of surveying of M exactly.
The relation of M sample line and B ultrasonic image and M hypergraph picture
Because similarly being the transducer that will produce ultrasonic pulse, the M hypergraph place human body surface a bit, acoustic beam is injected in the body, the trajectory diagram that moves in the signal that is returned by organizational interface is launched to obtain on time shaft interface is so the doctor will determine the M sample line in position to obtain the M hypergraph picture of quantity of information than horn of plenty according to the B ultrasonic image.Therefore we can say that also the M sample line is the bridge of contact B ultrasonic image and M hypergraph picture.Relation between them as shown in Figure 5.
The M hypergraph is deposited form as sampled data
Because the M hypergraph is launched the interface movement locus figure that forms according to place, certain array element position acoustic beam echo-signal of the determined ultrasonic transducer of M sample line on time shaft, follow a scanning line and leave in successively in the memorizer according to the priority of time so its sampled data is a scanning line.For instance, ultrasonic transducer (ultrasonic probe) such as certain model is made up of 128 array elements, M sample line position on the B ultrasonic image determines that through doctor's selection (doctor can't see this information on image certainly at the 60th array element place, these array element sequence numbers that are upper level applications is represented M sample line position have been passed to bottom hardware and have been realized), stored data are exactly according to the tactic scan-line data of time order and function by the 60th array element in the M over-extraction sample data storage so.The idiographic flow that shows the M model ultrasonic image according to the M sample line as shown in Figure 6.
2, set up the coordinate conversion table of B ultrasonic image
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 pixel 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
3, set up the interpolation calculation table of B ultrasonic image
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, if establish interpolation coefficient α and β 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 pixel in the display pixel 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 pixel 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.Four interpolation coefficients are 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 P1;
int P2;
int P3;
int P4;
};
Use the vector 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
In variable FDisplayData, deposit 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 pixel 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 coordinate of display screen coordinate system is all traveled through one time, and then the data of all qualified DPCCSPT types all have been loaded among the variable FDisplayData.
Traversal FDisplayData calculates the gray value that can obtain screen display location voluntarily with the data of its DPCCSPT type.
4, the DSC processing is carried out in calculating fast
For instance, suppose to obtain by the data of k DPCCSPT type 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), and the setting according to formula (15) can get in addition:
DisGry(FDisplayData[k].DP)=
(FDisplayData[k].cc1*G[FDisplayData[k].P1]+
FDisplayData[k].cc2*G[FDisplayData[k].P2]+
FDisplayData[k].cc3*G[FDisplayData[k].P3]+
FDisplayData[k].cc4*G[FDisplayData[k].P4])>>8
5, the super interpolation calculation of M
As shown in Figure 3, because each bar M over-extraction sample data wire will be according to a pixel wide and H
1Individual pixels tall is presented at M hypergraph picture zone, and in fact the sampling number on every sampled data line is that Mr (also equaling Sr certainly) is individual, is H so Mr sampled point will be carried out interpolation processing
1Individual gradation data value.Each point on the sampled data here also is a gradation data value, i.e. data between 0~255 (comprising 0 and 255).
The interpolation processing of M over-extraction sample data is comparatively simple with respect to B ultrasonic, because have only the interpolation processing of one-dimensional data, so use simple linear interpolation can realize that M over-extraction sample data are to the conversion of M hypergraph as the area pixel gray value data.According to a linear interpolation formula needs y direction of principal axis being carried out interpolation arithmetic gets final product.
Counting of showing is H
1Individual, sampling number is Mr.The pixel that shows for k needs at first will calculate the sequence number that is used for it is carried out two adjacent sampled data points of interpolation calculation so.
Order
Then can in the hope of
If the integer part of I is i, fractional part is α, then k the gray values of pixel points MG[k that needs show] be
MG[k]=MS[i]×(1-α)+MS[i+1]×α (26)
MS[i wherein] be the value of i sampled data.The x row are traveled through, get final product the H that x lists needs demonstration
1Individual gray value data.
6, B ultrasonic shows and the super demonstration of M
Preserve the gray value of displaing coordinate
Carrying out the DSC processing by quick calculating knows, at DisGry[] in this array, the grey scale pixel value of all protruding battle array scanning areas is preserved, certainly, display pixel the district and don't initialized the time, all composed null value and be kept in this array at 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.
Because during at a kind of B/M display mode, the size in the super display pixel of M district is fixed (with reference to Fig. 4), so get final product according to the two-dimensional array that the super display pixel of M district is deposited in one of this size application.The variable of application is as follows:
BYTE FDisplayDataM[W
0][H
1]
This array is assigned zero when initialization, when not receiving the super display pixel of M district data, the super display pixel of M district will be shown as black like this, and promptly expression does not have the super signal of M yet.In variable FDisplayDataM, deposit and carry out after the interpolation processing in order to data presented
That preserves among the one-dimension array variable MG by the implication of formula (26) and parameter thereof as can be known, is the current data that need a M super scanning line showing.According to time order and function, can give array FDisplayDataM[W so with the value assignment among the array MG
0] [H
1], pass through W like this
0After the inferior assignment, the super display pixel of M district all has been the pixel data of M super scanning line just.In the next round assignment, still from array FDisplayDataM[W
0] [H
1] the place of following being designated as (0,0) carry out assignment and get final product.Illustrated for example below.We might as well establish W
0Value be 1024, H
1Value be 400.So, (actual is the 1st when the 0th, for with computer in method of counting always, we just are called the 0th) after M over-extraction sample data interpolating finishes dealing with, preserved 400 pixel value on the vertical sweep line on the 0th the super pixel display area of M so among the one-dimension array MG, give array FDisplayDataM[W with the pixel value assignment of these 400 somes this moment
0] [H
1] the 0th row (this is because computer is to store according to row major in storage during data, so we are called the 0th row, actual the 0th row pixel of representing the super display pixel of M district), i.e. FDisplayDataM[0] [0]~FDisplayDataM[0] [399].After should the 1st M over-extraction sample data interpolating finishing dealing with, can preserve 400 pixel value on the vertical sweep line on the 1st the super pixel display area of M among the one-dimension array MG, this moment with the pixel value assignment of these 400 points to array FDisplayDataM[W
0] [H
1] the 1st row, i.e. FDisplayDataM[1] [0]~FDisplayDataM[1] [399].Anshun preface is carried out this process successively, after the 1023rd M over-extraction sample data interpolating finished dealing with, can preserve 400 pixel value on the vertical sweep line on the 1023rd the super pixel display area of M among the one-dimension array MG, give array FDisplayDataM[W with the pixel value assignment of these 400 somes this moment
0] [H
1] the 1023rd row, i.e. FDisplayDataM[1023] [0]~FDisplayDataM[1023] [399].Notice a problem, this moment, M super display pixel district was shown as the M hypergraph fully as data, and next bar M over-extraction sample data will be through being arrived FDisplayDataM[W by assignment after handling so
0] [H
1] the 0th the row, still carry out assignment afterwards according to said process
To preserve the array FDisplayDataM[of the super viewing area of M gray value] first address of [] passes to explicit function and gets final product, and sends to all processes that display shows thereby finished M hypergraph picture to the end from obtaining data, interpolation processing.
When showing that by the B/M model ultrasonic image switching to single M model ultrasonic image shows, M model ultrasonic image height H
1And width W
0Variation has all taken place, so preserve the two-dimensional array FDisplayDataM[of the super viewing area of M gray value] size of [] also will change thereupon, and the size of changing into the super viewing area of single M gets final product.Still utilize formula (26) to carry out interpolation calculation.To preserve the array FDisplayDataM[of the super viewing area of M gray value then] first address of [] (size for the super viewing area of single M) passes to explicit function and get final product, thereby finish the process that is switched to single M model ultrasonic image demonstration by the demonstration of B/M model ultrasonic image.
Comparison diagram 7 and Fig. 8, 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.Experimental result proves, software DSC can be accurately promptly with the sampled data flip displays to screen, and test result shows that when reaching the highest frame per second 64, the cpu resource that is consumed also is no more than 2%, 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%.The demonstration of M mode image can reach the requirement of real-time, and testing operable speed at present was 500 line/seconds, can satisfy the ultrasonic even color ultrasound Doppler's of black and white use fully.
The embodiment of selected M sample line
Under B/M display mode as shown in Figure 9, as long as promptly enter the state that single M pattern shows by function key on the lower keyboard " Ctrl " and numeral keys " 4 " simultaneously once more.Press after " Ctrl+4 " Macintosh, promptly enter the B/M pattern and show, as shown in figure 10.
This step idiographic flow: under the situation that B/M shows, judged whether that function key " Ctrl " and numeral keys " 4 " press simultaneously,, then responded the OnKeyDown message among the VC if having, switch to that single M is super to be shown, and the array element of M sample line correspondence number no longer changes in that single M is super when showing.For example under the situation that B/M shows, the M sample line array element that rolling mouse is determined for the last time number is 200, and then when single M hypergraph picture showed, the sampled data that M deposits super memory block was the treated ultrasound echo signal of No. 200 array element of popping one's head in.Switch to the super image that shows of single M as shown in Figure 10 and Figure 11.Figure 10 is the image that has just entered when single M is super to be shown, Figure 11 is the super image that once demonstration all over the screen had been arranged of single M.
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.