Time gain compensation method, device, equipment, storage medium and program product
By acquiring and fitting the TGC setting parameters in the ultrasonic imaging system, and sending the encoded TGC curve to control the voltage signal generated by the logic control device, the problem of poor ultrasonic image quality is solved and higher image quality is achieved.
Patent Information
- Application Number
- CN202210467244.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2042-04-29
AI Technical Summary
In ultrasonic imaging systems, when time gain compensation (TGC) is used to perform gain control on the echo signal, the generated ultrasonic image quality is poor.
By obtaining the time gain compensation TGC setting parameters, performing the time gain linear fitting process, obtaining the TGC curve, and sending the encoded TGC curve to the logic control device, generating the voltage signal output by the digital-to-analog converter to control the gain adjustment of the echo signal in the analog domain.
This method can improve the quality of ultrasonic images, and accurately adjust the echo signal in the analog domain by flexibly adjusting the TGC parameters.
Smart Images

Figure CN114879171B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of ultrasonic image processing, and in particular to a time gain compensation method, device, equipment, storage medium and program product. Background Art
[0002] Time gain compensation (TGC) is a processing method used by ultrasound equipment to overcome the signal attenuation caused by ultrasonic energy attenuation. It can gradually increase the gain of the echo signal from the start of pulse transmission as time goes by.
[0003] Generally, in an ultrasound imaging system, the TGC technology performs gain control on the echo signal, including gain control of the echo signal in the analog domain, and gain control of the beamformed data in the digital domain from adjustment parameters on the control panel.
[0004] However, in the related art, when TGC is used to perform gain control on an echo signal in an ultrasonic imaging system, the quality of an ultrasonic image generated according to the gain-compensated echo signal is poor. Summary of the invention
[0005] Based on this, it is necessary to provide a time gain compensation method, device, equipment, storage medium and program product to address the above technical problems, which can improve the quality of ultrasonic images generated according to the gain compensated echo signals when TGC is used to perform gain control on echo signals in ultrasonic imaging systems.
[0006] In a first aspect, an embodiment of the present application provides a time gain compensation method, the method comprising:
[0007] Get the time gain compensation TGC setting parameters;
[0008] Perform time gain straight line fitting processing according to TGC setting parameters to obtain TGC curve;
[0009] The encoded TGC curve is sent to the logic control device; the encoded TGC curve is used to instruct the logic control device to generate a control sequence for controlling the voltage signal output by the digital-to-analog converter; the voltage signal output by the digital-to-analog converter is used to perform gain adjustment on the echo signal in the analog domain.
[0010] In one embodiment, performing gain adjustment on the echo signal in the analog domain includes:
[0011] Controlling the voltage-controlled attenuator in the front-end chip in the analog domain to adjust the gain of the echo signal; or,
[0012] A TGC control signal is sent to the front-end chip in the analog domain. The TGC control signal is used to instruct the front-end chip to adjust the gain of the echo signal internally.
[0013] In one embodiment, the voltage-controlled attenuator in the analog domain control front-end chip performs gain adjustment on the echo signal, including:
[0014] Obtaining a voltage gain function relationship between a control voltage signal and a gain value of a voltage controlled attenuator;
[0015] According to the voltage gain function relationship, determining the gain value corresponding to the voltage signal output by the digital-to-analog converter;
[0016] The gain of the echo signal is adjusted by the gain value corresponding to the voltage signal output by the digital-to-analog converter.
[0017] In one embodiment, the method of obtaining the functional relationship between the control voltage signal and the gain value of the voltage controlled attenuator includes:
[0018] Determine the time gain function relationship of the unit sampling period according to the corresponding gain value of each sampling point in the preset unit sampling period;
[0019] According to the time gain function relationship, the gain value of each sampling point is processed correspondingly with the voltage value of the analog-to-digital converter to obtain the gain-attenuation function relationship between the gain and the attenuation value of the voltage-controlled attenuator;
[0020] Processing the voltage value of the analog-to-digital converter and the voltage-controlled attenuator accordingly to obtain a voltage attenuation function relationship between the control voltage signal of the voltage-controlled attenuator and the attenuation value of the voltage-controlled attenuator;
[0021] According to the gain attenuation function relationship and the voltage attenuation function relationship, a functional relationship between the control voltage signal pressure and the gain value of the voltage controlled attenuator is constructed.
[0022] In one of the embodiments, the computing resources required by the above-mentioned preset straight line algorithm to perform time gain straight line fitting processing on the TGC setting parameters are less than the preset value.
[0023] In one embodiment, the preset straight line algorithm is DDA and Bresenham algorithm.
[0024] In a second aspect, the present application further provides a time gain compensation device, the device comprising:
[0025] An acquisition module is used to acquire the time gain compensation TGC setting parameters;
[0026] A fitting module, used for performing time gain straight line fitting processing according to the TGC setting parameters to obtain a TGC curve;
[0027] The adjustment module is used to send the encoded TGC curve to the logic control device; the encoded TGC curve is used to instruct the logic control device to generate a control sequence for controlling the voltage signal output by the digital-to-analog converter; the voltage signal output by the digital-to-analog converter is used to perform gain adjustment on the echo signal in the analog domain.
[0028] In a third aspect, the present application further provides a medical device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, any step in the method embodiment of the first aspect is implemented.
[0029] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, any step in the method embodiment of the first aspect described above is implemented.
[0030] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements any step in the above-mentioned first aspect method embodiment.
[0031] The above-mentioned time gain compensation method, device, equipment, storage medium and program product obtain the voltage gain function relationship between the control voltage signal and the gain value of the voltage-controlled attenuator, determine the gain value corresponding to the voltage signal output by the digital-to-analog converter according to the voltage gain function relationship, and adjust the gain of the echo signal by the gain value corresponding to the voltage signal output by the digital-to-analog converter. In this method, since the computer device encodes the gain curve and then sends it to the logic control device to generate a control sequence, the control sequence can control the voltage output by the digital-to-analog converter to control the voltage-controlled attenuator. The encoding control of the voltage-controlled attenuator can flexibly adjust the TGC parameters, thereby achieving gain adjustment of the echo signal in the analog domain, and obtaining higher image quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1a A diagram showing an application environment of a time gain compensation method in an embodiment;
[0033] Figure 1b is a schematic diagram of ultrasonic signal attenuation in one embodiment;
[0034] Figure 1c is an echo signal corrected by time gain compensation in one embodiment;
[0035] Figure 1d is a flow chart of echo signal front-end processing in one embodiment;
[0036] Figure 2 is a schematic flow chart of a time gain compensation method in one embodiment;
[0037] Figure 3 A functional block diagram of a front-end chip in one embodiment;
[0038] Figure 4 is a schematic flow chart of a time gain compensation method in another embodiment;
[0039] Figure 5 is a graph showing the relationship between sampling point gain and voltage in one embodiment;
[0040] Figure 6 A time gain compensation signal flow diagram in one embodiment;
[0041] Figure 7 A schematic diagram of a TGC curve construction process in one embodiment;
[0042] Figure 8 A schematic diagram of a TGC curve in one embodiment;
[0043] Fig. 9 A schematic diagram of the Bresenham algorithm in one embodiment;
[0044] Fig.10 A schematic diagram of a TGC curve construction process in another embodiment;
[0045] Fig.11 A schematic diagram of a TGC curve in another embodiment;
[0046] Fig.12 is a structural block diagram of a time gain compensation device in one embodiment;
[0047] Fig.13 A block diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] The time gain compensation method provided in the embodiment of the present application can be applied to Figure 1aIn the application environment shown. Ultrasonic imaging equipment and computer equipment communicate with each other. Among them, computer equipment includes but is not limited to servers, intelligent terminals, electronic devices, etc. Among them, the computer equipment includes a processor, a memory and a network interface connected through a system bus, and the processor of the computer equipment is used to provide computing and control capabilities. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database, and the internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database is used to store relevant data of the time gain compensation process. The network interface is used to connect to the network with external medical equipment, etc. to achieve communication.
[0050] When using ultrasound to diagnose the human body, due to the characteristics of ultrasound propagation in human tissue, the ultrasound energy attenuates with the depth of transmission, making the received echo signal amplitude difference may reach 1000 times, which will cause the received echo signal amplitude to exceed the dynamic range of the analog-to-digital converter (ADC), that is, the received near-field echo signal is saturated and the far-field echo signal cannot be detected. Please refer to the figure Figure 1b As shown, Figure 1b The figure is a schematic diagram of ultrasonic signal attenuation. It can be seen that in the depth of ultrasonic attenuation, the amplitude of the near-field echo signal in the actual waveform exceeds the dynamic range of the ADC. Based on this, the time gain compensation (TGC) technology has emerged. This technology can make the near-field echo signal obtain a smaller gain and the far-field echo signal obtain a larger gain. That is, the near-field echo signal amplification factor is smaller so as not to exceed the maximum range of the ADC and cause image distortion, and the far-field echo signal amplification factor is larger so as not to fail to reach the resolution of the ADC and cause no image data. In other words, the TGC technology can increase the dynamic range of the ADC in disguise, such as Figure 1c As shown, Figure 1c This is a schematic diagram of an echo signal after time gain compensation correction. The corrected near-field echo signal is also within the dynamic range of the ADC.
[0051] In ultrasound imaging systems, an analog front-end (AFE) chip is usually used to process echo signals. The AFE chip generally has three modules: a low-noise amplifier, a voltage-controlled attenuator, and a programmable gain amplifier. The process of processing echo signals can be found in Figure 1dAs shown, the echo signal is first collected by the transducer. When the echo signal enters the AFE chip, it is first amplified in the low noise amplifier. The amplified echo signal is attenuated by the voltage-controlled attenuator. The attenuated echo signal enters the programmable gain amplifier to amplify and obtain the original data. In the ultrasonic imaging system, the TGC technology is divided into two levels, wherein the first-level TGC controls the voltage-controlled attenuator in the AFE chip to realize the gain control of the echo signal in the analog domain; the second-level TGC is the adjustment parameter from the control panel, which is the gain control of the data after beam synthesis in the digital domain. In the related art, the TGC control method is to fix the gain value of the first-level TGC as a constant and cannot be changed, and only the gain curve of the second-level TGC is allowed to be changed, so that only the brightness of the image can be adjusted. If the attenuation curve of the tissue signal of the scanned human body does not match the gain curve set by the first-level TGC, it will lead to poor image quality and the image quality cannot be improved by the second-level TGC.
[0052] Based on this, the embodiments of the present application provide a time gain compensation method, device, equipment, storage medium and program product, which can obtain an accurate TGC curve with less computing resources, control the TGC curve more accurately and efficiently, and achieve gain adjustment of the echo signal in the analog domain by controlling the voltage control attenuator, so as to obtain higher image quality. The technical scheme of the present application and how the technical scheme of the present application solves the above-mentioned technical problems will be described in detail below through embodiments and in combination with the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. It should be noted that the time gain compensation method provided by the present application can be executed by a computer device or a time gain compensation device, which can be implemented as part or all of a computer device by software, hardware or a combination of software and hardware.
[0053] See also Figure 2 As shown, in one embodiment, a time gain compensation method is provided, which involves a specific process in which a computer device performs time gain straight line fitting processing according to TGC setting parameters to obtain a TGC curve, and sends the encoded TGC curve to a logic control device. The embodiment includes the following steps:
[0054] S201, obtaining time gain compensation TGC setting parameters.
[0055] The TGC setting parameters are parameters adjusted by the TGC, such as time information, gain information, position information, etc. Optionally, the computer device acquires the TGC setting parameters in a manner including but not limited to the computer device actively acquiring the TGC adjustment parameters from the control panel, and the computer device receiving the TGC adjustment parameters sent by the control panel. The TGC adjustment parameters on the control panel may be triggered by the user pressing a corresponding function key on the control panel, etc.
[0056] S202, performing time gain straight line fitting processing according to TGC setting parameters to obtain a TGC curve.
[0057] The computer device performs time gain straight line fitting processing based on the TGC setting parameters received above to obtain a TGC curve.
[0058] Optionally, the time gain straight line fitting process can be obtained by fitting the TGC setting parameters through a preset straight line algorithm. The computing resources required by the preset straight line algorithm for fitting the TGC setting parameters to the time gain straight line are less than a preset value.
[0059] The preset value may be the computing resources required by a conventional straight line fitting method. Alternatively, the preset value is the maximum allowable computing resources determined based on large empirical data. The preset value is not limited in the embodiments of the present application, as long as the setting of the preset value can determine that the computing resources required by the preset straight line algorithm to perform time gain straight line fitting processing on the TGC setting parameters are very small.
[0060] For example, the preset straight line algorithm can be a line segment rasterization algorithm (Digital Differential Analyzer, DDA), Bresenham line algorithm and other straight line algorithms. Compared with the conventional straight line fitting method, which is to determine the straight line equation and bring in points to continue calculation, it needs to perform repeated mathematical operations and has the defect of high requirements for computing resources. The DDA straight line algorithm only involves multiplication and division of floating-point numbers and floating-point operations, and the Bresenham line algorithm only involves addition and subtraction in the calculation, and only uses integer algorithms, which require fewer computing resources, so that a more accurate TGC curve can be obtained with fewer resources.
[0061] S203, sending the encoded TGC curve to the logic control device; the encoded TGC curve is used to instruct the logic control device to generate a control sequence for controlling the voltage signal output by the digital-to-analog converter; the voltage signal output by the digital-to-analog converter is used to perform gain adjustment on the echo signal in the analog domain.
[0062] After the computer device generates the TGC curve, the TGC curve is software-encoded to obtain the encoded TGC curve. Afterwards, the computer device sends the encoded TGC curve to a logic control device, for example, the logic control device can be a Field Programmable Gate Array (FPGA), a Programming Array Logic (PAL), a Generic Array Logic (GAL), a Complex Programmable Logic Device (CPLD), etc.
[0063] After receiving the encoded TGC curve, the logic control device generates a control sequence according to the encoded TGC curve, and the control sequence is a sequence for controlling the voltage signal output by the digital-to-analog converter. The voltage signal output by the digital-to-analog converter is controlled by the control sequence, and the ultimate purpose of the control sequence controlling the voltage signal output by the digital-to-analog converter is to enable the controlled voltage signal to perform gain adjustment on the echo signal in the analog domain.
[0064] The time gain compensation method provided in this embodiment obtains TGC setting parameters, performs time gain straight line fitting processing according to the TGC setting parameters to obtain a TGC curve, and sends the encoded TGC curve to the logic control device to instruct the logic control device to generate a control sequence for controlling the voltage signal output by the digital-to-analog converter, and the voltage signal output by the digital-to-analog converter is used to adjust the gain of the echo signal in the analog domain. In this method, since the generated TGC curve is encoded by a computer device and then sent to the upper-layer software logic control device and a control sequence is generated, the control sequence is used to control the voltage output by the digital-to-analog converter to achieve gain adjustment of the echo signal in the analog domain, thereby improving image quality.
[0065] The process of gain adjusting the echo signal in the analog domain is described below through an embodiment. In one embodiment, gain adjusting the echo signal in the analog domain includes: controlling the voltage-controlled attenuator in the front-end chip in the analog domain to gain adjust the echo signal; or sending a TGC control signal to the front-end chip in the analog domain, the TGC control signal is used to instruct the front-end chip to gain adjust the echo signal internally.
[0066] Among them, the difference between controlling the voltage-controlled attenuator in the front-end chip in the analog domain to adjust the gain of the echo signal and sending the TGC control signal to the front-end chip in the analog domain is that the former directly controls the parameters of the voltage-controlled attenuator in the front-end chip through the upper-level software logic control device to achieve the gain adjustment of the echo signal, and the latter sends a digital signal to the front-end chip so that the front-end chip adjusts the gain of the echo signal from the inside.
[0067] Specifically, the process of sending a digital signal to the front-end chip so that the front-end chip can adjust the gain of the echo signal from the inside is described. Adjusting TGC by digital signal is essentially still adjusting the gain of the first-stage TGC (the first-stage TGC controls the voltage-controlled attenuator in the AFE chip to achieve gain control of the echo signal in the analog domain). The difference from the above-mentioned direct control of the parameters of the voltage-controlled attenuator in the front-end chip by the upper-layer software logic control device is that digital signals are used for communication, and the TGC control signal generation circuit is integrated in the front-end chip, which makes the response speed of gain adjustment faster. Please refer to Figure 3 As shown, the TGC control signal is output to the front-end chip through the logic control device, and the front-end chip is adjusted internally.
[0068] The process of directly controlling the parameters of the voltage-controlled attenuator to achieve gain adjustment of the echo signal is described. In one achievable manner, Figure 4 As shown, the process includes the following steps:
[0069] S301, obtaining a voltage-gain function relationship between a control voltage signal and a gain value of a voltage-controlled attenuator.
[0070] The voltage-controlled attenuator in the analog domain control front-end chip performs gain adjustment on the echo signal by determining the gain value of the voltage signal output by the digital-to-analog converter based on the voltage gain function relationship of the voltage-controlled attenuator, and performing gain adjustment on the echo signal based on the gain value. That is, it is necessary to first obtain the voltage gain function relationship of the voltage-controlled attenuator, which represents the functional relationship between the control voltage signal of the voltage-controlled attenuator and the gain value.
[0071] Optionally, a method for obtaining the voltage gain function relationship of a voltage-controlled attenuator includes: determining a time gain function relationship of a unit sampling period based on the corresponding gain values of each sampling point within a preset unit sampling period; performing corresponding processing on the gain value of each sampling point and the voltage value of the analog-to-digital converter based on the time gain function relationship to obtain a gain-attenuation function relationship between the gain and the attenuation value of the voltage-controlled attenuator; performing corresponding processing on the voltage value of the analog-to-digital converter and the voltage-controlled attenuator to obtain a voltage attenuation function relationship between the control voltage signal of the voltage-controlled attenuator and the attenuation value of the voltage-controlled attenuator; and constructing a function relationship between the control voltage signal voltage of the voltage-controlled attenuator and the gain value based on the gain-attenuation function relationship and the voltage attenuation function relationship.
[0072] Specifically, 8 sampling points can be preset in a unit sampling period, and the gain values corresponding to the 8 sampling points can be obtained. Based on the gain values of the 8 sampling points and the corresponding time, the time gain function relationship of the unit sampling period can be obtained. That is, a time gain function relationship is obtained by giving multiple gain points. For this time gain function relationship, please refer to Figure 5 Further, by making a one-to-one correspondence between the time of each sampling point and the voltage value of the digital-to-analog converter, a first correspondence relationship between the time of each sampling point and the voltage value of the digital-to-analog converter can be obtained. This first correspondence relationship can be found in Figure 5 As shown in (b), the time of each sampling point is the X coordinate, and the voltage value of the digital-to-analog converter is the Y coordinate. Next, continue to obtain the second corresponding relationship between the time of each sampling point and the attenuation value of the voltage-controlled attenuator. This second corresponding relationship can be seen in Figure 5 As shown in (c) in .
[0073] Depend on Figure 5From (a), (b) and (c) in the figure, it can be obtained that the time gain function relationship and the first corresponding relationship are matched by the Y coordinate, and the third corresponding relationship between the gain of each sampling point and the voltage of the digital-to-analog converter can be obtained; and the first corresponding relationship and the second corresponding relationship are matched by the Y coordinate, and the fourth corresponding relationship between the voltage value of the digital-to-analog converter and the attenuation value of the voltage-controlled attenuator can be obtained, and the gain-attenuation function relationship between the gain of each sampling point and the attenuation value of the voltage-controlled attenuator can be obtained from the third corresponding relationship and the fourth corresponding relationship. In addition, on the basis of the above fourth corresponding relationship, combined with the relationship between the voltage value of the digital-to-analog converter and the control voltage signal of the voltage-controlled attenuator, the voltage value of the digital-to-analog converter of the Y coordinate is transformed into the control voltage signal of the voltage-controlled attenuator, and the voltage attenuation function relationship between the control voltage signal of the voltage-controlled attenuator and the attenuation value of the voltage-controlled attenuator can be obtained. So far, the gain-attenuation function relationship (gG) and the voltage-attenuation function relationship (V control-g) are obtained, and the function relationship between the control voltage signal voltage (V control) of the voltage-controlled attenuator and the gain value (g) can be constructed by matching with the gain g. This functional relationship is the voltage gain functional relationship.
[0074] S302: Determine a gain value corresponding to the voltage signal output by the digital-to-analog converter according to a voltage gain function relationship.
[0075] S303, performing gain adjustment on the echo signal by using the gain value corresponding to the voltage signal output by the digital-to-analog converter.
[0076] According to the voltage gain function relationship, the gain value corresponding to the voltage signal actually output by the digital-to-analog converter can be determined. Specifically, in the voltage gain function relationship, the voltage value that is the same as the voltage signal actually output by the current digital-to-analog converter can be searched, and the gain value corresponding to this voltage value can be determined as the gain value corresponding to the voltage signal actually output by the digital-to-analog converter. Then, the echo signal is gain-adjusted with the gain value corresponding to the voltage signal output by the digital-to-analog converter.
[0077] See also Figure 6 As shown, the computer device generates a TGC curve after fitting the TGC setting parameters, and sends the software-encoded TGC curve to the logic control device. The logic control device decodes it and generates a control sequence for controlling the voltage signal output by the digital-to-analog converter according to the decoded TGC curve. The control sequence acts on the digital-to-analog converter, so that the voltage signal output by the digital-to-analog converter controls the voltage-controlled attenuator. Controlling the voltage-controlled attenuator is to achieve gain adjustment of the echo signal in the analog domain.
[0078] In this embodiment, by obtaining the voltage-gain function relationship between the control voltage signal and the gain value of the voltage-controlled attenuator, the gain value corresponding to the voltage signal output by the digital-to-analog converter is determined according to the voltage-gain function relationship, and the echo signal is gain-adjusted by the gain value corresponding to the voltage signal output by the digital-to-analog converter. In this method, since the computer device encodes the gain curve and then sends it to the logic control device to generate a control sequence, the control sequence can control the voltage output by the digital-to-analog converter to control the voltage-controlled attenuator. The encoding control of the voltage-controlled attenuator can flexibly adjust the TGC parameters, thereby achieving gain adjustment of the echo signal in the analog domain, and obtaining higher image quality.
[0079] The process of obtaining the TGC curve is specifically described below through examples.
[0080] In one embodiment, the above-mentioned process of obtaining a TGC curve by performing time gain straight line fitting processing according to TGC setting parameters using a preset straight line algorithm includes the following steps: according to the TGC setting parameters, obtaining the initial sampling point and the terminal sampling point in the unit sampling period, determining the X-axis change and the Y-axis change according to the initial sampling point and the terminal sampling point, and determining the stepping direction of drawing the time gain straight line point according to the size relationship between the X-axis change and the Y-axis change; and in the stepping direction, performing straight line fitting processing according to the preset iteration points until the preset iteration conditions are met, and determining the line composed of the multiple time gain straight line points drawn as the TGC curve.
[0081] The computer device determines the initial sampling point (x0, y0) and the terminal sampling point (x1, y1) within the unit sampling period according to the setting parameters of TGC, and then determines the X-axis change Δx and the Y-axis change Δy according to the initial sampling point (x0, y0) and the terminal sampling point (x1, y1), and determines the stepping direction of drawing the time gain straight line point based on the size relationship between the X-axis change Δx and the Y-axis change Δy.
[0082] Optionally, if the X-axis variation is greater than the Y-axis variation, the stepping direction is determined to be the X direction; if the X-axis variation is less than the Y-axis variation, the stepping direction is determined to be the Y direction. That is, if Δx>Δy, stepping is performed along the X direction; if Δx<Δy, stepping is performed along the Y direction.
[0083] After determining the stepping direction, a straight line fitting process is performed with preset iteration points in the corresponding stepping direction until the preset iteration conditions are met to obtain multiple points. The multiple points are the multiple time gain straight line points drawn, and the line formed by the multiple time gain straight line points drawn is the final fitted TGC curve.
[0084] The specific fitting process is explained using the DDA straight line algorithm and the Bresenham straight line algorithm respectively.
[0085] In one embodiment, the specific fitting of the DDA straight line algorithm is as follows: according to the slope of the TGC curve, the initial sampling point is used as the initial iteration point to start drawing, and whether the current iteration point meets the preset iteration condition is determined; the corresponding step size is increased for the horizontal and vertical coordinates of the current iteration point to obtain a new iteration point, and whether the new iteration point meets the preset iteration condition is continued to be determined until the new iteration point is equal to the termination sampling point, the loop is determined to be terminated, and each iteration point in the loop process is used as the time gain straight line point for drawing to obtain the TGC curve.
[0086] Specifically, the stepping direction in the X direction and the stepping direction in the Y direction are described separately. Figure 7 shown.
[0087] When stepping along the X direction, first calculate the slope k and set the iteration point (xi, yi), start entering the loop, determine each iteration point, and for each iteration point, determine whether the loop termination condition is reached, where the loop termination condition is that the abscissa of the iteration point increases to the same as the abscissa of the termination sampling point. Perform straight line point fitting calculations on the iteration points in the entire loop, and round the calculated ordinates until the rounding is completed, and then the ordinates of all iteration points can be obtained.
[0088] When stepping along the Y direction, similarly, first calculate the slope k and set the iteration point (xi, yi), start entering the loop, determine each iteration point, and for each iteration point, determine whether the loop termination condition is reached. The loop termination condition in this direction is that the ordinate of the iteration point increases to the same ordinate as the termination sampling point. Similarly, perform straight line point fitting calculations on the iteration points in the entire loop, round the calculated abscissas, and after rounding is completed, the abscissas of all iteration points can be obtained.
[0089] Among them, the slope k calculated during the above X-direction stepping and Y-direction stepping is equal to Δx / Δy, and the initial iteration point when both enter the loop is the initial sampling point (x0, y0), that is, the iteration point (xi, yi) is initially equal to the initial sampling point (x0, y0).
[0090] According to the ordinates and abscissas of all iterative points, all time gain straight line points can be plotted to obtain the TGC curve. Figure 8 As shown, Figure 8 The TGC curve is divided into two sections. The first section is the curve obtained by iteration along the X direction; the second section is the curve obtained by iteration along the Y direction. The final TGC curve is obtained after integration.
[0091] In another embodiment, the specific fitting process of the Bresenham line algorithm includes: taking the initial sampling point as the initial iteration point, the iterative process determines whether each iteration point satisfies the preset iteration condition, if not, obtains the first error parameter corresponding to the iteration point, and detects whether the error parameter belongs to the preset range to obtain the detection result, according to the detection result, increases the corresponding step size on the horizontal coordinate and / or vertical coordinate of the iteration point to obtain a new iteration point, and determines the second error parameter corresponding to the new iteration point, until the new iteration point coincides with the coordinates of the termination sampling point, the loop terminates, and each iteration point in the loop process is used as the time gain straight line point for drawing to obtain the TGC curve.
[0092] Among them, the principle of the Bresenham algorithm is as follows Fig. 9 As shown, the initial sampling point (x0, y0) and the terminal sampling point (x1, y1) are known (not shown in the figure), so the equation of the straight line where the initial sampling point (x0, y0) and the terminal sampling point (x1, y1) are located is y = kx + b. When judging whether the next point is the right point or the upper point, it is only necessary to judge the size of d1-d2. Among them: d1 = k(xi+1) + b-yi; d2 = (yi+g)-[k(xi+t)+b]; d1-d2 = 2k(xi+t)-2yi+2b-g; k = Δy / Δx.
[0093] Assume an error parameter ei = Δx(d1-d2); if ei>0, that is: d1-d2>0, then the actual point is closer to the point on the upper right (the point on the upper right should be selected), that is, ei+1 = ei+2Δy. But if ei<0, that is: d1-d2<0, then the actual point is closer to the point on the right (the point on the right should be selected), that is, ei+1 = ei+2Δy-2Δx.
[0094] Based on the above principle, specifically, the generation process of the TGC curve can be described by dividing it into the stepping direction of the X direction and the stepping direction of the Y direction.
[0095] like Fig.10 As shown in the figure, when stepping along the X direction, the initial error parameter e0 is calculated and the iteration point (xi, yi) is set, and the loop begins. The termination condition of this loop is that the horizontal coordinate of the iteration point increases to the same as the horizontal coordinate of the termination sampling point. During the loop, it is judged whether the error parameter ei is greater than 0. If so, the next point is selected closer to the upper right; if not, the point further to the right is selected.
[0096] When stepping along the Y direction, similarly, the initial error parameter e0 is calculated and the iteration point (xi, yi) is set, and the loop begins. The termination condition of this loop is that the ordinate of the iteration point increases to the same ordinate as the termination sampling point. During the loop, it is judged whether the error parameter ei is greater than 0. If so, the next point is selected closer to the upper right; if not, the point above is selected.
[0097] The initial error parameter e0=2Δy-Δx is calculated, and the initial iteration point is the initial sampling point, that is, the initial moment of the iteration point (xi, yi) is the initial sampling point (x0, y0).
[0098] In the X-direction stepping and the Y-direction stepping, if the error parameter ei is greater than 0, the next point is selected as a point closer to the upper right, and xi=xi+t, yi=yi+k, ei=ei+2(Δy-Δx) is executed.
[0099] However, if the error parameter ei is less than 0, a point further to the right is selected in the X-direction step, and xi=xi+t, ei=ei+2Δy is executed; a point further up is selected in the Y-direction step, and yi=yi+k, ei=ei+2Δx is executed.
[0100] After the iterations in both step directions are completed, all iteration points can be obtained, thereby obtaining the TGC curve.
[0101] Please Fig.11 As shown, it is a TGC curve obtained in the Bresenham algorithm, which is also divided into two sections. The first section is a curve obtained by iteration along the X direction; the second section is a curve obtained by iteration along the Y direction.
[0102] In this embodiment, the DDA straight line algorithm used only involves multiplication and division of floating-point numbers and floating-point operations, and the Bresenham line algorithm only involves addition and subtraction in the calculation, and only uses integer algorithms, which require fewer computing resources, so that a more accurate TGC curve can be obtained using fewer resources.
[0103] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0104] Based on the same inventive concept, the embodiment of the present application also provides a time gain compensation device for implementing the time gain compensation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more time gain compensation device embodiments provided below can refer to the limitations of the time gain compensation method above, and will not be repeated here.
[0105] In one embodiment, Fig.12 As shown, a time gain compensation device is provided, comprising: an acquisition module 10, a fitting module 11 and an adjustment module 12, wherein:
[0106] An acquisition module 10 is used to acquire time gain compensation TGC setting parameters;
[0107] A fitting module 11 is used to perform time gain straight line fitting processing according to the TGC setting parameters to obtain a TGC curve;
[0108] The adjustment module 12 is used to send the encoded TGC curve to the logic control device; the encoded TGC curve is used to instruct the logic control device to generate a control sequence for controlling the voltage signal output by the digital-to-analog converter; the voltage signal output by the digital-to-analog converter is used to perform gain adjustment on the echo signal in the analog domain.
[0109] In one embodiment, the adjustment module 12 includes a first adjustment unit and a second adjustment unit:
[0110] The first adjustment unit is used to control the voltage-controlled attenuator in the front-end chip in the analog domain to perform gain adjustment on the echo signal; or,
[0111] The second adjustment unit is used to send a TGC control signal to the front-end chip in the analog domain, and the TGC control signal is used to instruct the front-end chip to perform gain adjustment on the echo signal internally.
[0112] In one embodiment, the second adjusting unit comprises:
[0113] An acquisition subunit, used for acquiring a voltage gain function relationship between a control voltage signal and a gain value of a voltage controlled attenuator;
[0114] A first determining subunit, configured to determine a gain value corresponding to a voltage signal output by the digital-to-analog converter according to a voltage gain function relationship;
[0115] The regulating subunit is used to perform gain regulation on the echo signal through the gain value corresponding to the voltage signal output by the digital-to-analog converter.
[0116] In one embodiment, the second adjusting unit further includes:
[0117] A second determining subunit, configured to determine a time gain function relationship of a unit sampling period according to a corresponding gain value of each sampling point in a preset unit sampling period;
[0118] A first processing subunit is used to perform corresponding processing on the gain value of each sampling point and the voltage value of the analog-to-digital converter according to the time gain function relationship to obtain a gain-attenuation function relationship between the gain and the attenuation value of the voltage-controlled attenuator;
[0119] A second processing sub-unit is used to perform corresponding processing on the voltage value of the analog-to-digital converter and the voltage-controlled attenuator to obtain a voltage attenuation function relationship between the control voltage signal of the voltage-controlled attenuator and the attenuation value of the voltage-controlled attenuator;
[0120] The construction subunit is used to construct a functional relationship between the control voltage signal pressure and the gain value of the voltage controlled attenuator according to the gain attenuation functional relationship and the voltage attenuation functional relationship.
[0121] In one embodiment, the computing resources required by the above-mentioned preset straight line algorithm to perform time gain straight line fitting processing on the TGC setting parameters are less than the preset value.
[0122] In one embodiment, the preset straight line algorithms are DDA and Bresenham algorithm.
[0123] The specific definition of the time gain compensation device can be found in the definition of each step in the time gain compensation method above, which will not be repeated here. Each module in the above-mentioned time gain compensation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the computer device can call and execute the operations corresponding to each of the above modules.
[0124] In one embodiment, a computer device is provided, such as Fig.13As shown, the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a time gain compensation method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0125] Those skilled in the art will appreciate that the structural description of the above-mentioned computer device is only a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0126] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0127] Get the time gain compensation TGC setting parameters;
[0128] Perform time gain straight line fitting processing according to TGC setting parameters to obtain TGC curve;
[0129] The encoded TGC curve is sent to the logic control device; the encoded TGC curve is used to instruct the logic control device to generate a control sequence for controlling the voltage signal output by the digital-to-analog converter; the voltage signal output by the digital-to-analog converter is used to perform gain adjustment on the echo signal in the analog domain.
[0130] When a computer device provided in the above embodiment implements the above steps, its implementation principle and technical effect are similar to the principles of the method steps executed by the above time gain compensation method, and will not be repeated here.
[0131] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0132] Get the time gain compensation TGC setting parameters;
[0133] Perform time gain straight line fitting processing according to TGC setting parameters to obtain TGC curve;
[0134] The encoded TGC curve is sent to the logic control device; the encoded TGC curve is used to instruct the logic control device to generate a control sequence for controlling the voltage signal output by the digital-to-analog converter; the voltage signal output by the digital-to-analog converter is used to perform gain adjustment on the echo signal in the analog domain.
[0135] When implementing the above steps, the computer-readable storage medium provided in the above embodiment has an implementation principle and technical effect similar to the principle of the method steps executed by the above time gain compensation method, which will not be repeated here.
[0136] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0137] Get the time gain compensation TGC setting parameters;
[0138] Perform time gain straight line fitting processing according to TGC setting parameters to obtain TGC curve;
[0139] The encoded TGC curve is sent to the logic control device; the encoded TGC curve is used to instruct the logic control device to generate a control sequence for controlling the voltage signal output by the digital-to-analog converter; the voltage signal output by the digital-to-analog converter is used to perform gain adjustment on the echo signal in the analog domain.
[0140] When a computer program product provided in the above embodiment implements the above steps, its implementation principle and technical effect are similar to the principles of the method steps executed by the above time gain compensation method, and will not be repeated here.
[0141] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0142] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0143] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A time gain compensation method, characterized in that: The method comprises: Get the time gain compensation TGC setting parameters; Perform time gain straight line fitting processing according to the TGC setting parameters to obtain a TGC curve; Sending the encoded TGC curve to the logic control device; the encoded TGC curve is used to instruct the logic control device to generate a control sequence for controlling the voltage signal output by the digital-to-analog converter; the voltage signal output by the digital-to-analog converter is used to perform gain adjustment on the echo signal in the analog domain; The step of performing gain adjustment on the echo signal in the analog domain includes: Determine the time gain function relationship of the unit sampling period according to the corresponding gain value of each sampling point in the preset unit sampling period; According to the time gain function relationship, the gain value of each sampling point is processed correspondingly with the voltage value of the analog-to-digital converter to obtain a gain-attenuation function relationship between the gain and the attenuation value of the voltage-controlled attenuator; Processing the voltage value of the analog-to-digital converter and the voltage-controlled attenuator accordingly to obtain a voltage attenuation function relationship between the control voltage signal of the voltage-controlled attenuator and the attenuation value of the voltage-controlled attenuator; According to the gain attenuation function relationship and the voltage attenuation function relationship, construct a voltage gain function relationship between the control voltage signal and the gain value of the voltage controlled attenuator; Determining a gain value corresponding to the voltage signal output by the digital-to-analog converter according to the voltage gain function relationship; The echo signal is gain-adjusted by a gain value corresponding to the voltage signal output by the digital-to-analog converter.
2. The method according to claim 1, characterized in that The TGC setting parameters include at least time information, gain information and position information.
3. The method according to claim 1, characterized in that The step of obtaining the time gain compensation TGC setting parameters includes: Receive TGC adjustment parameters sent by the control panel; And the parameters adjusted by the TGC are used as the time gain compensation TGC setting parameters.
4. The method according to claim 3, characterized in that The parameters adjusted by the TGC on the control panel are triggered by the user pressing corresponding function keys on the control panel.
5. The method according to any one of claims 1 to 4, characterized in that: The computing resources required by the preset straight line algorithm to perform time gain straight line fitting processing on the TGC setting parameters are less than the preset value.
6. The method according to claim 5, characterized in that The preset straight line algorithms are line segment rasterization algorithm and Bresenham algorithm.
7. A time gain compensation device, characterized in that: The device comprises: An acquisition module is used to acquire the time gain compensation TGC setting parameters; A fitting module, used for performing time gain straight line fitting processing according to the TGC setting parameters to obtain a TGC curve; A regulating module, used for sending the encoded TGC curve to the logic control device; the encoded TGC curve is used to instruct the logic control device to generate a control sequence for controlling the voltage signal output by the digital-to-analog converter; the voltage signal output by the digital-to-analog converter is used to perform gain adjustment on the echo signal in the analog domain; The adjustment module is further used to determine the time gain function relationship of the unit sampling period according to the corresponding gain value of each sampling point in the preset unit sampling period; According to the time gain function relationship, the gain value of each sampling point is processed correspondingly with the voltage value of the analog-to-digital converter to obtain a gain-attenuation function relationship between the gain and the attenuation value of the voltage-controlled attenuator; Processing the voltage value of the analog-to-digital converter and the voltage-controlled attenuator accordingly to obtain a voltage attenuation function relationship between the control voltage signal of the voltage-controlled attenuator and the attenuation value of the voltage-controlled attenuator; According to the gain attenuation function relationship and the voltage attenuation function relationship, construct a voltage gain function relationship between the control voltage signal and the gain value of the voltage controlled attenuator; Determining a gain value corresponding to the voltage signal output by the digital-to-analog converter according to the voltage gain function relationship; The echo signal is gain-adjusted by a gain value corresponding to the voltage signal output by the digital-to-analog converter.
8. A medical device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Ultrasonic imaging method and system
CN103181778A
Gain compensating method for flaw detector
CN1945306A
Digital ultrasonic flaw detection signal acquisition and processing device
CN203824967U