A medical image ruler automatic measurement method, system, device and medium
By applying mathematical analysis and continuous wavelet transform methods in a medical imaging workstation, the problems of data dependence and low adaptability of artificial intelligence deep learning models were solved, realizing the automatic measurement of medical image scales, reducing the workload of data acquisition and annotation, and improving adaptability and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MINGSHI MEDICAL TECHNOLOGY (NINGBO) CO LTD
- Filing Date
- 2023-09-07
- Publication Date
- 2026-06-26
AI Technical Summary
Existing deep learning models for artificial intelligence in medical imaging workstations suffer from high data dependence and low adaptability in image recognition and measurement, resulting in a large workload for data collection and annotation, and failing to effectively adapt to the ever-changing medical imaging equipment on the market.
By employing mathematical analysis and continuous wavelet transform, a brightness function is constructed by scanning the scale pixel values in the image. Then, linear transformation of angular frequency and continuous wavelet transform are performed to obtain the scale unit conversion factor of the image, thereby achieving automatic measurement.
It effectively reduced the workload of data collection and annotation, improved the compatibility of image workstations and external devices, and enhanced the efficiency and accuracy of algorithm models.
Smart Images

Figure CN117173135B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically to an automatic measurement method, system, device, and medium for medical image rulers. Background Technology
[0002] A medical imaging workstation is a device that can directly connect to and receive images and data from various medical imaging equipment, such as CT, MRI, and ultrasound machines. It enables synchronous display and dynamic processing of image information at the workstation, allowing for image acquisition, viewing, editing, recording, image processing and analysis (lesion measurement, annotation, and assisted diagnosis), generating textual and graphic diagnostic reports, and managing, analyzing, and statistically processing patient text, image, and imaging data. Among these functions, lesion measurement is one of the crucial bases for diagnosing diseases in radiologists and ultrasound physicians.
[0003] In the existing technology, there are two common methods for medical imaging workstations to perform scale measurement on input images. One is to use manual intervention (traditional method), in which the radiologist or technician (reporter) manually inputs the scale from the input image into the workstation for scale calibration. This method has low accuracy and depends entirely on manual measurement. The second method employs artificial intelligence deep learning image recognition technology to identify scale markers in images. For example, Chinese patent CN109492653A discloses a method, device, computer equipment, and storage medium for measuring breast lesion volume. This method automatically scans and acquires breast ultrasound images, then performs smoothing filtering and enhancement processing on the images to facilitate identification and detection. Edge detection is performed on the pre-processed breast ultrasound images to identify the breast ultrasound edge region image in each single frame. The volume of the breast lesion in each single frame is calculated, and the volumes of all single frames are cumulatively measured to obtain the total breast lesion volume. This method achieves accurate and efficient measurement of breast lesion volume, reducing repetitive and tedious work. The advantage of this method is that it uses artificial intelligence image detection and segmentation technology, resulting in relatively high accuracy. However, it is limited to certain device models, exhibiting low compatibility with multiple brands and models. In other words, the recognition range and accuracy of this artificial intelligence algorithm model depend on the selection and labeling of the training data, exhibiting a clear training data dependency. Because medical imaging equipment on the market is so diverse, its image formats and display scales are also so varied, making it impossible to achieve standardization. This results in a huge workload for data acquisition, selection, and annotation. Furthermore, the AI imaging workstations currently available on the market are limited by the high dependence on training data and low adaptability of deep learning algorithm models, resulting in a very limited number of external devices that can be connected to and recognized.
[0004] Given the above problems, how to solve the issues of high data dependence and low adaptability of deep learning-based network models and reduce the workload of data collection and annotation is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0005] In view of the above, the present invention provides an automatic measurement method, system, device and medium for medical image scales, which at least partially solves the technical problems existing in the background art.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] This invention first discloses an automatic measurement method for medical image rulers, comprising the following steps:
[0008] Scan the target image to be detected, and construct the brightness function corresponding to the scan line using the set of pixel values of all scales in the target image as the independent variable;
[0009] The independent variable in the brightness function corresponding to the scan line is linearly transformed by angular frequency to obtain the brightness transformation function;
[0010] Perform a continuous wavelet transform on the brightness conversion function to obtain the continuous wavelet transform function;
[0011] The pixel estimate in the continuous wavelet transform function is iterated through to obtain the pixel estimate corresponding to the maximum value of the continuous wavelet.
[0012] The pixel estimate corresponding to the maximum value of the continuous wavelet is used as the scale unit conversion factor of the target image to be detected.
[0013] Preferably, scanning the target image to be detected specifically includes:
[0014] A column-by-column scanning method is used to perform vertical scanning along the x-axis of the target image to be detected.
[0015] Preferably, a brightness function corresponding to the scan line is constructed using the set of pixel values of all scales in the target image to be detected as the independent variable, specifically including:
[0016] Obtain the pixel value set of all scales, where all scales include the pixel value set of all large vertical scales and the pixel value set of all small vertical scales in the target image;
[0017] A brightness function is constructed using the set of pixel values for all the scales as the independent variable and the brightness value of the pixels as the dependent variable.
[0018] Preferably, the independent variable in the brightness function corresponding to the scan line is linearly transformed by angular frequency to obtain the brightness transformation function, specifically including the following formula:
[0019]
[0020] In the formula, AT is the domain of the brightness conversion function f(t), AT=A*2π / a, A is the domain of the size of the target image to be detected; a is the estimated value of the number of pixels represented by each cm distance in the target image to be detected;
[0021] KT is the set of angular frequencies t when the scan line intersects the scale line, KT = K * 2π / a, where K is the set of pixel values of all scales in the target image.
[0022] Preferably, the brightness transformation function is subjected to a continuous wavelet transform to obtain the continuous wavelet transform function, specifically including the following steps:
[0023] Integrating the conjugate function of the Morlet wavelet basis function with the brightness transformation function f(t) yields the following continuous wavelet transform function:
[0024]
[0025] In the formula, ω is the conjugate function of the Morlet wavelet basis function; a is the estimated number of pixels represented by each cm distance in the target image to be detected; b is the initial offset value of the y coordinate, b = h0 * 2π / a, where h0 represents the pixel value of the starting scale; i represents the imaginary part of the complex number; ω0 is the center frequency.
[0026] Preferably, the pixel estimate corresponding to the maximum value of consecutive wavelets is used as the scale unit conversion factor of the target image to be detected, specifically including the following steps:
[0027] The formula for converting scale units is: 1cm = Aopt * hpixel, where Aopt represents the estimated pixel value corresponding to the maximum value of the continuous wavelet, and hpixel represents the width of a unit pixel.
[0028] The present invention also discloses an automatic measurement system for medical image rulers, the system comprising:
[0029] The scanning module is used to scan the target image to be detected and construct the brightness function corresponding to the scan line using the set of pixel values of all scales in the target image to be detected as the independent variable.
[0030] The brightness conversion function conversion module is used to perform a linear angular frequency conversion on the independent variable in the brightness function corresponding to the scan line to obtain the brightness conversion function.
[0031] The continuous wavelet transform module is used to perform a continuous wavelet transform on the brightness conversion function to obtain the continuous wavelet transform function.
[0032] The pixel estimate traversal module is used to iterate through the pixel estimates in the continuous wavelet transform function to obtain the pixel estimate corresponding to the maximum value of the continuous wavelet.
[0033] The scale unit conversion factor acquisition module is used to use the pixel estimate corresponding to the maximum value of the continuous wavelet as the scale unit conversion factor of the target image to be detected.
[0034] Preferably, in the continuous wavelet transform module, the independent variable in the brightness function corresponding to the scan line is linearly transformed by angular frequency to obtain the brightness transformation function, specifically including:
[0035] Integrating the conjugate function of the Morlet wavelet basis function with the brightness transformation function f(t) yields the following continuous wavelet transform function:
[0036]
[0037] In the formula, ω0 is the conjugate function of the Morlet wavelet basis function; a is the estimated number of pixels represented by each cm distance in the target image to be detected; b is the initial offset value of the y coordinate, b = h0 * 2π / a; ω0 is the center frequency.
[0038] The present invention also discloses an automatic medical image ruler measurement device, the device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the automatic medical image ruler measurement method according to any one of the present invention.
[0039] The present invention also discloses an automatic measurement medium for medical image rulers, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, it can implement the automatic measurement method for medical image rulers according to any one of the present invention.
[0040] As can be seen from the above technical solutions, compared with the prior art, the present invention discloses an automatic measurement method, system, device, and medium for medical image scales, which has the following beneficial effects:
[0041] This invention proposes a mathematical analysis and transformation method, which uses continuous wavelet transform to extract image features and segment content from common scales and markings in medical images, thereby enabling automatic measurement of target objects in the image and effectively solving the problem of data dependence in network models based on artificial intelligence deep learning.
[0042] The image scale recognition and automatic measurement method provided in this embodiment can effectively reduce the workload of data acquisition and annotation, increase the compatibility of image workstations and external devices, greatly improve the efficiency of algorithm models, and reduce computing power requirements. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0044] Figure 1 This is a schematic diagram of the overall process of the method provided in the embodiment of the present invention.
[0045] Figure 2 This is a schematic diagram of a target image to be measured, provided as an embodiment of the present invention.
[0046] Figure 3 This is a typical medical imaging scale diagram provided for an embodiment of the present invention.
[0047] Figure 4 The time-frequency diagram of continuous wavelet transform provided in the embodiment of the present invention.
[0048] Figure 5 This is a schematic diagram of a breast ultrasound image provided in an embodiment of the present invention.
[0049] Figure 6 This is a schematic diagram of the brightness function when the scan line scans to the scale, as provided in an embodiment of the present invention.
[0050] Figure 7 The spectrum obtained by wavelet transform is provided in an embodiment of the present invention.
[0051] Figure 8 This is a schematic diagram of manual marking provided for an embodiment of the present invention. Detailed Implementation
[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0053] This invention discloses an automatic measurement method for medical image rulers, such as... Figure 1 As shown, it includes the following steps:
[0054] Scan the target image to be detected, and construct the brightness function corresponding to the scan line using the set of pixel values of all scales in the target image as the independent variable;
[0055] The independent variable in the brightness function corresponding to the scan line is linearly transformed by angular frequency to obtain the brightness transformation function;
[0056] Perform a continuous wavelet transform on the brightness conversion function to obtain the continuous wavelet transform function;
[0057] The pixel estimate in the continuous wavelet transform function is iterated through to obtain the pixel estimate corresponding to the maximum value of the continuous wavelet.
[0058] The pixel estimate corresponding to the maximum value of the continuous wavelet is used as the scale unit conversion factor of the target image to be detected.
[0059] The above steps involve scanning the target image to be detected, specifically including:
[0060] A column-by-column scanning method is used to perform vertical scanning along the x-axis of the target image to be detected.
[0061] In the above steps, the brightness function corresponding to the scan line is constructed using the set of pixel values of all scales in the target image to be detected as the independent variable. Specifically, this includes:
[0062] Obtain the pixel value set of all scales, where all scales include the pixel value set of all large vertical scales and the pixel value set of all small vertical scales in the target image;
[0063] A brightness function is constructed using the set of pixel values for all the scales as the independent variable and the brightness value of the pixels as the dependent variable.
[0064] In the above steps, the independent variable in the brightness function corresponding to the scan line is linearly transformed by angular frequency to obtain the brightness transformation function, which specifically includes the following formula:
[0065]
[0066] In the formula, AT is the domain of the brightness conversion function f(t), AT=A*2π / a, A is the domain of the size of the target image to be detected; a is the estimated value of the number of pixels represented by each cm distance in the target image to be detected;
[0067] KT is the set of angular frequencies t when the scan line intersects the scale line, KT = K * 2π / a, where K is the set of pixel values of all scales in the target image.
[0068] The above steps involve performing a continuous wavelet transform on the brightness conversion function to obtain the continuous wavelet transform function. Specifically, this includes the following steps:
[0069] Integrating the conjugate function of the Morlet wavelet basis function with the brightness transformation function f(t) yields the following continuous wavelet transform function:
[0070]
[0071] In the formula, ω is the conjugate function of the Morlet wavelet basis function; a is the estimated number of pixels represented by each cm distance in the target image to be detected; b is the initial offset value of the y coordinate, b = h0 * 2π / a, where h0 represents the pixel value of the starting scale; i represents the imaginary part of the complex number; ω0 is the center frequency.
[0072] In the above steps, the pixel estimate corresponding to the maximum value of the continuous wavelet is used as the scale unit conversion factor of the target image to be detected, specifically including the following steps:
[0073] The formula for converting scale units is: 1cm = Aopt * hpixel, where Aopt represents the estimated pixel value corresponding to the maximum value of the continuous wavelet, and hpixel represents the width of a unit pixel.
[0074] The inventive principle of the present invention will be further illustrated below through more specific embodiments. The present invention discloses an automatic measurement method for medical image rulers, comprising the following steps:
[0075] S1, such as Figure 2 As shown, on the display image of the target to be measured, a vertical line is used to scan horizontally (x-axis) to the left, starting from the rightmost part of the image, and the scan is completed in a column-by-column manner until the middle of the image is reached; the coordinates of each pixel read by the scan are represented by (x,y), where x∈[0,W-1] and y∈[0,H-1].
[0076] S2. Construct the scan line brightness function, F(y)=Brightness(y), F(y)∈[0,255], as follows:
[0077] like Figure 3 As shown, assuming the image size is w*h, the domain of the depth function f(y) is defined as A, i.e., A={0,1,2,...,h-1}. Assuming the width of the large scale line is pix1 pixels, the scale interval is delta pixels starting from the depth h0, and there are num roots.
[0078] The width of the small tick marks is 2 pixels, and there are n small tick marks between every two adjacent large tick marks. The spacing between the small tick marks is delta / (n+1) pixels.
[0079] The set of large ticks with linewidth pix1 at a certain depth h0 is represented as {h0, h0+1, ..., h0+pix1-1}. Let K1 be the set of depths y when the scan line intersects the large tick line; then the set of all large ticks with root num at depth y is K1.
[0080] K1 = {
[0081] h0, h0+1, ..., h0+pix1-1,
[0082] h0+1*delta,h0+1*delta+1,...,h0+1*delta+pix1-1, ...
[0084] h0+(num-1)*delta,h0+(num-1)*delta+1,...,h0+(num-1)*delta+pix1-1}
[0085] Similarly, the set of small ticks with a linewidth of pix2 at a depth of h0+delta / (n+1) is represented as: l1={h0+1 / (n+1)*delta,h0+1 / (n+1)*delta+1,...,h0+1 / (n+1)*delta+pix2-1},
[0086] The next smaller scale l2 = {h0 + 2 / (n+1)*delta, h0 + 2 / (n+1)*delta + 1, ..., h0 + 2 / (n+1)*delta + pix2 - 1},
[0087] The nth subscale ln = {h0+n / (n+1)*delta,h0+n / (n+1)*delta+1,...,h0+n / (n+1)*delta+pix2-1},
[0088] The set of n smaller scales between two large scales can be represented as:
[0089] Li = {l1, l2, ..., ln}, i = {1, n}
[0090] Similarly, the set of all minor ticks y in num major ticks is K2:
[0091] K2={
[0092] h0+1 / (n+1)*delta,h0+1 / (n+1)*delta+1,...,h0+1 / (n+1)*delta+pix2-1,
[0093] h0+2 / (n+1)*delta,h0+2 / (n+1)*delta+1,...,h0+2 / (n+1)*delta+pix2-1,
[0094] h0+n / (n+1)*delta,h0+3 / (n+1)*delta+1,...,h0+3 / (n+1)*delta+pix2-1,
[0095] h0+delta+1 / (n+1)*delta,h0+delta+1 / (n+1)*delta+1,...,
[0096] h0+delta+1 / (n+1)*delta+pix2-1,
[0097] h0+delta+2 / (n+1)*delta,h0+delta+2 / (n+1)*delta+1,...,
[0098] h0+delta+2 / (n+1)*delta+pix2-1,
[0099] h0+delta+3 / (n+1)*delta,h0+delta+3 / (n+1)*delta+1,...,
[0100] h0+delta+3 / (n+1)*delta+pix2-1, ...
[0102] h0+(num-1)*delta+delta+1 / (n+1)*delta,h0(num-
[0103] 1)*delta++delta+1 / (n+1)*delta+1,...,h0+(num-
[0104] 1)*delta+delta+1 / (n+1)*delta+pix2-1,
[0105] h0+(num-1)*delta+delta+2 / (n+1)*delta,h0(num-1)*delta++delta+2 / 4*delta+1,...,
[0106] h0+(num-1)*delta+delta+2 / 4*delta+pix2-1,
[0107] h0+(num-1)*delta+delta+3 / 4*delta,h0(num-1)*delta++delta+3 / 4*delta+1,...,h0+(num-1)*delta+delta+3 / 4*delta+pix2-1}
[0108] We can obtain the set of all the markings on the scan line at depth y, K = K1 + K2.
[0109] The resulting pixel brightness function for this scan line is shown below:
[0110]
[0111] The pixel brightness function is linearly transformed, and the independent variable y is converted into angular frequency. Let t = 2π*y / a, that is, y = t*a / (2π), where a is the estimated number of pixels represented by each cm distance in the target image to be detected.
[0112] When the scan line intersects the large scale line at an angular frequency, the set of depths y can be obtained as the brightness function f(t) with the independent variable.
[0113]
[0114] In the formula, AT is the domain of the brightness conversion function f(t), AT=A*2π / a, and A is the domain of the size of the target image to be detected;
[0115] KT is the set of angular frequencies t when the scan line intersects the scale line, KT = K * 2π / a, where K is the set of pixel values of all scales in the target image.
[0116] Assuming the image size is 800x600
[0117] Domain, A = {0, 1, 2, ..., 599}
[0118] Assuming the width of the large scale line is 4 pixels, starting from a depth of 100, the scale spacing is 100 pixels, and there are 4 scale lines.
[0119] The width of the small scale line is 2 pixels, and there are three small scales between every two adjacent large scales, with a spacing of 25 pixels between the small scales.
[0120] The set of depths y where the large scale is located is,
[0121] K1={100,101,102,103,200,201,202,203,300,301,302,303,400,401,402,403}
[0122] Small scale y set
[0123] K2={125,126,150,151,175,176,
[0124] 225,226,250,251,275,276,
[0125] 325,326,350,351,375,76,
[0126] 425,426,450,451,475,476}
[0127] K = K1 + K2
[0128]
[0129] S3. Perform Morlet continuous wavelet transform (CWT) on f(t).
[0130] The Morlet wavelet basis function is typically expressed as follows:
[0131]
[0132] Where 'a' is the estimated number of pixels represented by each cm distance in the image; 'b' is the initial offset of the y-coordinate, requiring a corresponding linear transformation, i.e., b = h0 * 2π / a. 'ω0' is the center frequency, with an initial value chosen from empirical values, such as a constant of 100. Integrating the conjugate function of the basis functions with f(t) yields...
[0133]
[0134] The key step in this patent is to find the maximum value of the conjugate function by iterating through the parameter 'a', and the corresponding value of 'a' is the pixel value to be obtained.
[0135] S4. Traverse parameter a and calculate the corresponding wavelet transform value.
[0136]
[0137] According to the display resolution specifications commonly used in medical imaging, the value of the number of pixels 'a' based on 1 cm is usually between 20 and 150 pixels / cm. By iterating through the parameters 'a' of the wavelet transform function, the value of 'a' (Aopt) corresponding to the maximum value of the wavelet transform Ψf(a, b) is found. This is the number of pixels that are actually equivalent to a distance of 1 cm in the image.
[0138] S5. In this way, we can accurately convert pixel values to cm units during measurement, that is, 1cm = Aopt * hpixel, where hpixel is the width of a unit pixel.
[0139] In this invention, wavelet analysis is a time-frequency analysis method based on the traditional Fourier transform. It features multi-resolution analysis, capable of characterizing local signal features in both the time and frequency domains. It is well-suited for detecting and analyzing instantaneous anomalies embedded in normal signals and can specifically reveal their components. The wave nature of the Morlet wavelet can be expressed using complex trigonometric functions, or, if small, using a decay function; mathematically, this smallness is called finite support. That is, the finite support of the Morlet wavelet is achieved through an exponential decay function. The complex trigonometric functions enable frequency analysis (by maximizing the integral of the product with the original signal), and the decay function allows for time positioning. Together, these properties enable the Morlet wavelet to be used for time-frequency analysis.
[0140] For example, a time-varying signal function has frequency components of 4, 6, and 10, with specific time zones as follows.
[0141]
[0142] Performing a Morlet wavelet transform on it, the time-frequency plot of its continuous wavelet transform is as follows: Figure 4 As shown in the figure, the frequency components of the original signal and their corresponding time intervals can be clearly identified.
[0143] The specific implementation method is to select a center frequency (here we use an empirical value, such as 100. The size of the center frequency only affects the convergence of the calculation. If it is too large or too small, the calculation may not converge, but the size does not affect the calculation result). Then, a large number of center frequencies are obtained through scaling transformation, and a series of basis functions in different intervals are obtained through time shifting. Each of these basis functions is multiplied by a certain segment of the original signal (corresponding to the interval of the basis function) and then integrated. The frequency corresponding to the extreme value is the frequency contained in this interval of the original signal.
[0144] Applied to our medical image measurement and analysis, for example Figure 5 The image shown is a breast ultrasound image. The right side displays a scale with a large scale of 1cm depth, including four smaller scales (each 2.5mm). This scale exhibits significant repetition or frequency characteristics compared to other elements in the image. We treat the image depth (pixel values) as the time axis and the brightness value of each pixel as a function value. Drawing a vertical line in the image yields a function with depth (y) as the independent variable and brightness as the function value (F(y)). When this vertical line is precisely at a scale mark, we obtain a function containing the periods of the large scale (1cm) and the small scales (2.5mm), as described in step S2. We find the maximum CWT value corresponding to parameter a by iterating through the parameter.
[0145] For each display specification, the pixel size is fixed. For example, a 19-inch display screen with a 4:3 aspect ratio has a diagonal length of 48.26cm, a length of 38.61cm, a width of 28.96cm, and a resolution of 1280x1024. Its pixel size is 0.03x0.028cm. Our goal is to accurately find parameter 'a', which is a dynamic scale parameter. The core objective of this invention is to find this value of 'a', obtained through step S4.
[0146] For example
[0147] Figure 3 This is a common scale in medical imaging. Assuming the centimeter scale (thick scale) is 4 pixels high and the 0.25 cm scale (thin scale) is 2 pixels high, using the aforementioned vertical-line horizontal scanning method, the brightness vs. depth function can be obtained.
[0148] Brightness = f(y), where y is the depth.
[0149] For common medical images, the brightness values are irregular numbers from 0 to 255, making it impossible to generate regular frequency characteristics. When the scan line reaches the scale, the brightness function is as follows: Figure 6 As shown: It can be seen that the thick centimeter scale lines and the thin 0.25cm scale lines have obvious frequency characteristics.
[0150] The wavelet transform of this function is shown in the following code:
[0151] fs = 43.3
[0152] N=200
[0153] k = np.arange(200)
[0154] #print(k)
[0155] frq=k*fs / N*2*np.pi
[0156] frq1 = frq[range(int(N / 2))]
[0157] #Image Single-sided spectrum
[0158] plt.figure(figsize=(12,9))
[0159] #plt.subplot(311)
[0160] #data_f=abs(np.fft.fft(cA)) / N
[0161] #data_f1=data_f[range(int(N / 2))]
[0162] #plt.plot(frq1,data_f1,'red')
[0163] #plt.title('transformed')
[0164] plt.subplot(312)
[0165] data_ff=abs(np.fft.fft(cD)) / N
[0166] data_f2=data_ff[range(int(N / 2))]
[0167] plt.plot(frq1,data_f2,'k')
[0168] plt.title('Transformed Result')
[0169] plt.xlabel('pixels')
[0170] plt.ylabel('amplitude')
[0171] plt.show()
[0172] It can be obtained Figure 7 The wavelet transform spectrum shown (converted to pixels) clearly shows that the amplitude value is largest at a frequency of 100 pixels. From this, the centimeter scale position of the coarse scale line can be obtained. Through the above S4 step, the parameter a is obtained by traversal method, and the number of pixels per centimeter can be calculated.
[0173] However, in actual medical images, the image annotations of some devices may not be as shown in our figure, which may cause interference and prevent the accurate acquisition of a clear spectral function. The solution is as follows:
[0174] Using manual methods, 1cm annotation lines are manually drawn on the static image displayed on the image workstation, such as... Figure 8 As shown, by using the same vertical line scanning method to obtain a pixel value of 1cm, and then calibrating the system, accurate measurement of the target object can be achieved. Therefore, we need to add a manual calibration step (for cases where the image cursor is unclear).
[0175] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0176] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An automatic measurement method for medical image rulers, characterized in that, Includes the following steps: Scan the target image to be detected, and construct the brightness function corresponding to the scan line using the set of pixel values of all scales in the target image as the independent variable; The independent variable in the brightness function corresponding to the scan line is linearly transformed by angular frequency to obtain the brightness transformation function; specific Including the following formulas: ; In the formula, AT is the domain of the brightness conversion function f(t), AT = A*2π / a, where A is the domain of the size of the target image to be detected; a is the estimated number of pixels represented by each cm distance in the target image to be detected; KT is the set of angular frequencies t when the scan line intersects the scale line, KT = K*2π / a, where K is the set of pixel values of all scales in the target image; Perform a continuous wavelet transform on the brightness conversion function to obtain the continuous wavelet transform function; The estimated number of pixels in the continuous wavelet transform function is iterated through to obtain the estimated number of pixels corresponding to the maximum value of the continuous wavelet. The estimated number of pixels corresponding to the maximum value of consecutive wavelets is used as the scale unit conversion factor for the target image to be detected.
2. The automatic measurement method for medical image scales according to claim 1, characterized in that, Scanning the image of the target to be detected, specifically including: A column-by-column scanning method is used to perform vertical scanning along the x-axis of the target image to be detected.
3. The automatic measurement method for medical image scales according to claim 1, characterized in that, A brightness function corresponding to the scan line is constructed using the set of pixel values of all scales in the target image to be detected as the independent variable, specifically including: Obtain the pixel value set of all scales, where all scales include the pixel value set of all large vertical scales and the pixel value set of all small vertical scales in the target image; A brightness function is constructed using the set of pixel values for all the scales as the independent variable and the brightness value of the pixels as the dependent variable.
4. The automatic measurement method for medical image scales according to claim 1, characterized in that, Perform a continuous wavelet transform on the brightness conversion function to obtain the continuous wavelet transform function. Specifically... Includes the following steps: Integrating the conjugate function of the Morlet wavelet basis function with the brightness transformation function f(t) yields the following continuous wavelet transform function: ; In the formula, ω is the conjugate function of the Morlet wavelet basis function; b is the initial offset value of the y coordinate, b = h0 * 2π / a, where h0 represents the pixel value of the starting scale; i represents the imaginary part of the complex number; ω0 is the center frequency.
5. The automatic measurement method for medical image scales according to claim 1, characterized in that, The estimated number of pixels corresponding to the maximum value of consecutive wavelets is used as the scale unit conversion factor for the target image to be detected. The specific steps include: The formula for converting scale units is: 1cm = Aopt * hpixel, where Aopt represents the estimated number of pixels corresponding to the maximum value of a continuous wavelet, and hpixel represents the width of a unit pixel.
6. An automatic measurement system for medical image rulers, characterized in that, The system includes: The scanning module is used to scan the target image to be detected and construct the brightness function corresponding to the scan line using the set of pixel values of all scales in the target image to be detected as the independent variable. The brightness conversion function conversion module is used to perform a linear angular frequency conversion on the independent variable in the brightness function corresponding to the scan line to obtain the brightness conversion function; specifically, it includes the following formula: ; In the formula, AT is the domain of the brightness conversion function f(t), AT = A*2π / a, where A is the domain of the size of the target image to be detected; a is the estimated number of pixels represented by each cm distance in the target image to be detected; KT is the set of angular frequencies t when the scan line intersects the scale line, KT = K*2π / a, where K is the set of pixel values of all scales in the target image; The continuous wavelet transform module is used to perform a continuous wavelet transform on the brightness conversion function to obtain the continuous wavelet transform function. The pixel estimate traversal module is used to iterate through the estimated number of pixels in the continuous wavelet transform function to obtain the estimated number of pixels corresponding to the maximum value of the continuous wavelet. The scale unit conversion factor acquisition module is used to use the pixel estimate corresponding to the maximum value of the continuous wavelet as the scale unit conversion factor of the target image to be detected.
7. The automatic measurement system for medical image scales according to claim 6, characterized in that, In the continuous wavelet transform module, the independent variable in the brightness function corresponding to the scan line is linearly transformed by angular frequency to obtain the brightness transformation function, specifically including: Integrating the conjugate function of the Morlet wavelet basis function with the brightness transformation function f(t) yields the following continuous wavelet transform function: ; In the formula, ω0 is the conjugate function of the Morlet wavelet basis function; a is the estimated number of pixels represented by each cm distance in the target image to be detected; b is the initial offset value of the y coordinate, b=h0*2π / a, where h0 represents the pixel value of the starting scale; i represents the imaginary part of the complex number; ω0 is the center frequency.
8. An automatic measuring device for medical image rulers, characterized in that, The device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the automatic measurement method for medical image scales as described in any one of claims 1 to 5.
9. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, enables the automatic measurement method of medical image rulers as described in any one of claims 1 to 5.