Interactive coordinate conversion method based on CBCT image
By using the straight-line Bresenham algorithm in the DICOM image browser to calculate the pixel coordinates of the CBCT image and integrating the AI algorithm, the problem of insufficient coordinate conversion and AI integration in the existing technology is solved, and more efficient image analysis and diagnostic assistance are achieved.
Patent Information
- Application Number
- CN202410909991.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-10-15
AI Technical Summary
The existing DICOM image browser has shortcomings in coordinate conversion and AI algorithm integration of CBCT images, and cannot provide accurate coordinate mapping and automated diagnosis support.
By opening the DICOM file directory, use the straight-line Bresenham algorithm to calculate the coordinates of all pixels connecting two points on the CT image, and transfer the generated slice data to the AI algorithm interface for analysis to achieve interactive coordinate conversion and integration of AI algorithms.
It improves the accuracy and efficiency of image analysis, provides multi-angle observation of anatomical structures, enhances the auxiliary nature of diagnosis and treatment, reduces the workload of doctors and improves treatment efficiency.
Smart Images

Figure CN118780975A_ABST
Abstract
Description
Technical Field
[0001] The present invention is applied to the field of oral medicine, and specifically is an interactive coordinate conversion method based on CBCT images. Background Art
[0002] The purpose of coordinate transformation of CBCT images is to provide an accurate coordinate mapping. Usually, the CT we get is in the transverse position (i.e., looking down from the top of the head / looking up from the soles of the feet) as the observation position, but the information that can be obtained by observing CT images from this angle alone is extremely limited. The coordinate transformation of CBCT images provides accurate mapping from different perspectives to more comprehensively analyze and understand the patient's anatomical structure. Through coordinate transformation in three-dimensional space, doctors can view the patient's internal structure from any angle, which is crucial for multiple links such as surgical planning, disease diagnosis, and treatment effect evaluation. Other observation positions (such as lateral observation position, front and back observation position) are generated based on the CT transverse image. The obtained image can also be used as input for machine learning algorithms to automatically identify and mark key anatomical features, providing important support for early diagnosis, disease progression monitoring, and treatment effect evaluation.
[0003] The existing DICOM image browsers, although providing the basic functions of browsing CBCT images and processing functions, do not have the ability to perform coordinate conversion, nor do they have the ability to integrate AI algorithms. DICOM image browsers are indispensable tools in the modern medical imaging diagnosis and treatment process. They greatly improve the quality and efficiency of medical services by providing efficient image viewing and processing functions, but they still have deficiencies in coordinate conversion and AI algorithm integration. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an interactive coordinate conversion method based on CBCT images in view of the deficiencies of the prior art.
[0005] In order to solve the above technical problems, the present invention provides an interactive coordinate conversion method based on CBCT images, which specifically includes the following steps:
[0006] Open the DICOM file directory;
[0007] Browse the CT image collection and select the location to generate the slice image by drawing a line segment;
[0008] Confirm the coordinates of the first and last points of the line segment, and use the straight line Bresenham algorithm to calculate the coordinates of all pixel points connecting the two points on the image; and obtain the pixel point set connecting the two points on all CT images, and stack and splice the pixel point set in the up and down order of the cross-section to obtain the slice image;
[0009] The generated slice image data is passed into the AI algorithm interface for algorithm analysis and marking of diseased areas.
[0010] As a possible implementation, further, the step of determining the coordinates of the first and last points of the line segment and calculating the coordinates of all pixels of the line connecting the two points on the image using the straight line Bresenham algorithm includes:
[0011] The starting point and end point of the line segment are (x1, y1) and (x2, y2) respectively. By comparing the sizes of x1 and x2, it is confirmed that the drawing direction is from left to right. If x1>x2, then the starting point and end point are swapped, and the new starting point and end point are still set to (x1, y1) and (x2, y2);
[0012] Determine the y drawing direction. If y1 is greater than y2, then set the y_neg flag to true, indicating that the y coordinate should decrease during the drawing process.
[0013] As a possible implementation, further, the step of determining the coordinates of the first and last points of the line segment and calculating the coordinates of all pixel points of the line connecting the two points on the image using the straight line Bresenham algorithm also includes:
[0014] Let dx be the absolute value of (x1-x2) and dy be the absolute value of (y1-y2). If it is a vertical line, that is, dx=0, then draw point by point from min(y1,y2) to max(y1,y2). If it is a horizontal line, that is, dy=0, then draw point by point from x1 to x2.
[0015] As a possible implementation, further, the step of determining the coordinates of the first and last points of the line segment and calculating the coordinates of all pixel points of the line connecting the two points on the image using the straight line Bresenham algorithm also includes:
[0016] Calculate the slope k = dy / dx. If the absolute value of k is greater than 1, swap the values of dx and dy and set the flag sign_k to false, that is, swap the roles of the x-axis and the y-axis, that is, symmetric about y = x, to adapt to the situation where the slope is steeper. Only calculate the situation where the absolute value of k is less than 1. When calculating the point, calculate the point symmetrically about y = x. At this time, k = 1 / k.
[0017] As a possible implementation, further, the step of determining the coordinates of the first and last points of the line segment and calculating the coordinates of all pixel points of the line connecting the two points on the image using the straight line Bresenham algorithm also includes:
[0018] Set the decision parameter p = 2dy-dx to determine whether the y coordinate should increase each time the x coordinate increases during iteration;
[0019] Set the initial parameters x=x1, y=y1, v=2dy, u=2dy-2dx, and start from the starting point;
[0020] If sign_k is true, y_neg is true, save the point (x,2y1-y);
[0021] If sign_k is true and y_neg is false, save the point (x,y);
[0022] If sign_k equals false, y_neg equals true, save the point (yb,2y1-(x+b));
[0023] If sign_k equals false, y_neg equals false, and the point (yb,x+b) is saved.
[0024] If p>0, set x=x+1, y=y+1, p=p+u;
[0025] If p<=0, set x=x+1, p=p+v.
[0026] Repeat the above steps until the end point is reached. The points saved above are the coordinates of all the pixel points connecting the two points.
[0027] An interactive coordinate conversion system based on CBCT images, comprising:
[0028] DICOM file editing module, used to open the DICOM file directory and browse and edit the CT image sets therein;
[0029] The editing is to select the position for generating the slice image in a manner of drawing line segments.
[0030] As a possible implementation, further, it also includes:
[0031] The slice image generation module is used to confirm the coordinates of the first and last points of the line segment, and use the straight line Bresenham algorithm to calculate the coordinates of all pixel points connecting the two points on the image; and obtain the pixel point set connecting the two points on all CT images, and stack and splice the pixel point set in the up and down order of the cross-section to obtain the slice image.
[0032] As a possible implementation, further, it also includes:
[0033] The AI algorithm module is used to transfer the generated slice image data to the AI algorithm interface, perform algorithm analysis and mark the diseased area.
[0034] As a possible implementation, further, it also includes:
[0035] The slice image measurement module is used to calculate the distance between two points in the slice image; specifically: select two points on the slice image to draw a line segment, obtain the distance a between the pixel points of the CT atlas and the distance b between two consecutive CT images in the upper and lower parts through the DICOM file header information; the length of the slice image is the pixel points calculated by the straight line Bresenham algorithm, and the scaling ratio c of the image length and the actual length is calculated, that is, c = sqrt(dx^2+dy^2) / the number of point sets; the x-axis difference and y-axis difference x, y of the two points to be measured in the slice image are respectively x = (x1-x2)*ac, y = (y1-y2)*b; calculate the distance dist between the two points in the slice image = sqrt(x^2+y^2).
[0036] The present invention adopts the above technical solution and has the following beneficial effects: through the precise coordinate conversion method, the accuracy and efficiency of image analysis are improved. Compared with the traditional DICOM image browser, the coordinate conversion of the present invention allows doctors to obtain other observation images of corresponding positions while browsing the cross-sectional images of CT, which is more conducive to diagnosis and treatment assistance, and can greatly improve the efficiency and quality of diagnosis and treatment. At the same time, an AI algorithm interface is provided, and the generated other observation images are provided as input to the AI algorithm, which can enhance automation and intelligence. Doctors can review and confirm on the basis of the image analysis work completed by AI, which can greatly improve work efficiency and reduce workload. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0038] Figure 1 The present invention is a schematic diagram of a process for generating a slice map according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0040] Embodiment 1:
[0041] The present invention provides an interactive coordinate conversion method based on CBCT images, which specifically comprises the following steps:
[0042] Open the DICOM file directory;
[0043] Browse the CT image collection and select the location to generate the slice image by drawing a line segment;
[0044] Confirm the coordinates of the first and last points of the line segment, and use the straight line Bresenham algorithm to calculate the coordinates of all pixel points connecting the two points on the image; and obtain the pixel point set connecting the two points on all CT images, and stack and splice the pixel point set in the up and down order of the cross-section to obtain the slice image;
[0045] The generated slice image data is passed into the AI algorithm interface for algorithm analysis and marking of diseased areas.
[0046] The steps of confirming the coordinates of the first and last points of the line segment and using the straight line Bresenham algorithm to calculate the coordinates of all the pixels connecting the two points on the image include:
[0047] The starting point and end point of the line segment are (x1, y1) and (x2, y2) respectively. By comparing the sizes of x1 and x2, it is confirmed that the drawing direction is from left to right. If x1>x2, then the starting point and end point are swapped, and the new starting point and end point are still set to (x1, y1) and (x2, y2);
[0048] Determine the y drawing direction. If y1 is greater than y2, then set the y_neg flag to true, indicating that the y coordinate should decrease during the drawing process.
[0049] Among them, the steps of confirming the coordinates of the first and last points of the line segment and using the straight line Bresenham algorithm to calculate the coordinates of all pixel points connecting the two points on the image also include:
[0050] Let dx be the absolute value of (x1-x2) and dy be the absolute value of (y1-y2). If it is a vertical line, that is, dx=0, then draw point by point from min(y1,y2) to max(y1,y2). If it is a horizontal line, that is, dy=0, then draw point by point from x1 to x2.
[0051] Among them, the steps of confirming the coordinates of the first and last points of the line segment and using the straight line Bresenham algorithm to calculate the coordinates of all pixel points connecting the two points on the image also include:
[0052] Calculate the slope k = dy / dx. If the absolute value of k is greater than 1, swap the values of dx and dy and set the flag sign_k to false, that is, swap the roles of the x-axis and the y-axis, that is, symmetric about y = x, to adapt to the situation where the slope is steeper. Only calculate the situation where the absolute value of k is less than 1. When calculating the point, calculate the point symmetrically about y = x. At this time, k = 1 / k.
[0053] Among them, the steps of confirming the coordinates of the first and last points of the line segment and using the straight line Bresenham algorithm to calculate the coordinates of all pixel points connecting the two points on the image also include:
[0054] Set the decision parameter p = 2dy-dx to determine whether the y coordinate should increase each time the x coordinate increases during iteration;
[0055] Set the initial parameters x=x1, y=y1, v=2dy, u=2dy-2dx, and start from the starting point;
[0056] If sign_k is true, y_neg is true, save the point (x,2y1-y);
[0057] If sign_k is true and y_neg is false, save the point (x,y);
[0058] If sign_k equals false, y_neg equals true, save the point (yb,2y1-(x+b));
[0059] If sign_k equals false, y_neg equals false, and the point (yb,x+b) is saved.
[0060] If p>0, set x=x+1, y=y+1, p=p+u;
[0061] If p<=0, set x=x+1, p=p+v.
[0062] Repeat the above steps until the end point is reached. The points saved above are the coordinates of all the pixel points connecting the two points.
[0063] An interactive coordinate conversion system based on CBCT images, comprising:
[0064] DICOM file editing module, used to open the DICOM file directory and browse and edit the CT image sets therein;
[0065] The editing is to select the position for generating the slice image in a manner of drawing line segments.
[0066] It also includes: a slice image generation module, which is used to confirm the coordinates of the first and last points of the line segment, and use the straight line Bresenham algorithm to calculate the coordinates of all pixel points connecting the two points on the image; and obtain the pixel point set connecting the two points on all CT images, and stack and splice the pixel point set in the upper and lower order of the cross-section to obtain a slice image.
[0067] It also includes: an AI algorithm module, which is used to transfer the generated slice image data to the AI algorithm interface, perform algorithm analysis and mark the diseased area.
[0068] It also includes: a slice image measurement module, which is used to calculate the distance between two points in the slice image; specifically: two points are selected on the slice image to draw a line segment, and the distance a between the pixel points of the CT atlas and the distance b between two consecutive CT images are obtained through the DICOM file header information; the length of the slice image is the pixel points calculated by the straight line Bresenham algorithm, and the scaling ratio c of the image length and the actual length is calculated, that is, c=sqrt(dx^2+dy^2) / the number of point sets; the x-axis difference and y-axis difference x, y of the two points to be measured in the slice image are respectively x=(x1-x2)*ac, y=(y1-y2)*b; the distance dist between the two points in the slice image is calculated as dist=sqrt(x^2+y^2).
[0069] Embodiment 2:
[0070] An interactive coordinate transformation method based on CBCT images, comprising:
[0071] Run the system.
[0072] Select and open the DICOM file directory.
[0073] Browse the CT image set and select the location where the slice image is to be generated appropriately in the form of line segments.
[0074] Generate a slice map:
[0075] Confirm the coordinates of the first and last points of the drawn line segment, and use the straight line Bresenham algorithm to calculate the coordinates of all pixel points connecting the two points on the pixel map. We assume that the starting point and the end point are (x1, y1) and (x2, y2) respectively.
[0076] ① First, make sure that the drawing direction is from left to right, so compare x1 and x2. If x1>x2, then swap the starting point and the end point. For the sake of convenience, we still set the new starting point and the end point to (x1, y1) and (x2, y2).
[0077] ② Determine the drawing direction of y. If y1 is greater than y2, set the y_neg flag to true, indicating that the y coordinate should decrease during the drawing process.
[0078] ③dx is the absolute value of (x1-x2), dy is the absolute value of (y1-y2). If it is a vertical line, that is, dx=0, then draw point by point from min(y1,y2) to max(y1,y2). If it is a horizontal line, that is, dy=0, then draw point by point from x1 to x2. The drawing ends here in the above two cases, and the following steps are required in other cases.
[0079] ④ Calculate the slope k = dy / dx. If the absolute value of k is greater than 1, we need to swap the values of dx and dy and set the flag sign_k to false. In fact, we swap the roles of the x-axis and the y-axis, that is, symmetric about y = x, to adapt to the situation where the slope is steeper. We only calculate the situation where the absolute value of k is less than 1. When calculating the point at the end, we can calculate the point symmetrically about y = x. At this time, k = 1 / k.
[0080] ⑤ Set the decision parameter p = 2dy-dx. This parameter determines whether the y coordinate should increase each time the x coordinate increases during iteration.
[0081] ⑥ Set the initial parameters x=x1, y=y1, v=2dy, u=2dy-2dx, and start from the starting point.
[0082] ⑦(1) If sign_k is true and y_neg is true, save the point (x,2y1-y);
[0083] (2) If sign_k equals true and y_neg equals false, save the point (x, y);
[0084] (3) If sign_k equals false and y_neg equals true, save the point (yb, 2y1-(x+b));
[0085] (4) If sign_k equals false, y_neg equals false, save the point (yb,x+b).
[0086] ⑧(1) If p>0, set x=x+1, y=y+1, p=p+u;
[0087] (2) If p<=0, set x=x+1, p=p+v.
[0088] ⑨ Repeat steps ⑦ and ⑧ until reaching the end point. All saved points are the coordinates of all pixel points connecting the two points.
[0089] A pixel point set connecting two points is obtained on all CT images, and the pixel point set is stacked and spliced in the up-down order of the cross-section to obtain a slice image.
[0090] The generated image data is passed into the AI algorithm interface.
[0091] Measurement functions on slice images:
[0092] Select two points on the slice to draw a line segment.
[0093] The distance a between pixels in the CT atlas and the distance b between two consecutive CT images are obtained through the DICOM file header information.
[0094] Since the length of the slice image is the pixel point calculated by the straight line Bresenham algorithm, it is necessary to calculate the scaling ratio c of the image length and the actual length, that is, c = sqrt(dx^2+dy^2) / number of point sets
[0095] Then the x-axis difference and y-axis difference x and y of the two points that need to be measured in the slice diagram are x=(x1-x2)*ac and y=(y1-y2)*b respectively.
[0096] Calculate the distance between two points in the slice image: dist = sqrt(x^2+y^2).
[0097] The above are embodiments of the present invention. For ordinary technicians in this field, according to the teachings of the present invention, all equivalent changes, modifications, substitutions and variations made within the scope of the patent application of the present invention without departing from the principles and spirit of the present invention should fall within the scope of the present invention.
Claims
1. An interactive coordinate transformation method based on CBCT images, characterized in that: The specific steps include: Open the DICOM file directory; Browse the CT image collection and select the location to generate the slice image by drawing a line segment; Confirm the coordinates of the first and last points of the line segment, and use the straight line Bresenham algorithm to calculate the coordinates of all pixel points connecting the two points on the image; and obtain the pixel point set connecting the two points on all CT images, and stack and splice the pixel point set in the up and down order of the cross-section to obtain the slice image; The generated slice image data is passed into the AI algorithm interface for algorithm analysis and marking of diseased areas.
2. The interactive coordinate transformation method based on CBCT images according to claim 1, characterized in that: The steps of determining the coordinates of the first and last points of the line segment and using the straight line Bresenham algorithm to calculate the coordinates of all pixel points on the line connecting the two points on the image include: The starting point and end point of the line segment are (x1, y1) and (x2, y2) respectively. By comparing the sizes of x1 and x2, it is confirmed that the drawing direction is from left to right. If x1>x2, then the starting point and end point are swapped, and the new starting point and end point are still set to (x1, y1) and (x2, y2); Determine the y drawing direction. If y1 is greater than y2, then set the y_neg flag to true, indicating that the y coordinate should decrease during the drawing process.
3. The interactive coordinate transformation method based on CBCT images according to claim 2, characterized in that: The step of determining the coordinates of the first and last points of the line segment and calculating the coordinates of all pixels of the line connecting the two points on the image using the straight line Bresenham algorithm also includes: Let dx be the absolute value of (x1-x2) and dy be the absolute value of (y1-y2). If it is a vertical line, that is, dx=0, then draw point by point from min(y1,y2) to max(y1,y2). If it is a horizontal line, that is, dy=0, then draw point by point from x1 to x2.
4. The interactive coordinate transformation method based on CBCT images according to claim 3, characterized in that: The step of determining the coordinates of the first and last points of the line segment and calculating the coordinates of all pixels of the line connecting the two points on the image using the straight line Bresenham algorithm also includes: Calculate the slope k = dy / dx. If the absolute value of k is greater than 1, swap the values of dx and dy and set the flag sign_k to false, that is, swap the roles of the x-axis and the y-axis, that is, symmetric about y = x, to adapt to the situation where the slope is steeper. Only calculate the situation where the absolute value of k is less than 1. When calculating the point, calculate the point symmetrically about y = x. At this time, k = 1 / k.
5. The interactive coordinate transformation method based on CBCT images according to claim 4, characterized in that: The step of determining the coordinates of the first and last points of the line segment and using the straight line Bresenham algorithm to calculate the coordinates of all pixel points on the line connecting the two points on the image also includes: Set the decision parameter p = 2dy-dx to determine whether the y coordinate should increase each time the x coordinate increases during iteration; Set the initial parameters x=x1, y=y1, v=2dy, u=2dy-2dx, and start from the starting point; If sign_k is true, y_neg is true, save the point (x,2y1-y); If sign_k is true and y_neg is false, save the point (x,y); If sign_k equals false, y_neg equals true, save the point (yb,2y1-(x+b)); If sign_k equals false, y_neg equals false, and the point (yb,x+b) is saved. If p>0, set x=x+1, y=y+1, p=p+u; If p<=0, set x=x+1, p=p+v. Repeat the above steps until the end point is reached. The points saved above are the coordinates of all the pixel points connecting the two points.
6. An interactive coordinate conversion system based on CBCT images, characterized in that: include: DICOM file editing module, used to open the DICOM file directory and browse and edit the CT image sets therein; The editing is to select the position for generating the slice image in a manner of drawing line segments.
7. An interactive coordinate conversion system based on CBCT images, characterized in that: Also includes: The slice image generation module is used to confirm the coordinates of the first and last points of the line segment, and use the straight line Bresenham algorithm to calculate the coordinates of all pixel points connecting the two points on the image; and obtain the pixel point set connecting the two points on all CT images, and stack and splice the pixel point set in the up and down order of the cross-section to obtain the slice image.
8. An interactive coordinate transformation system based on CBCT images, characterized in that: Also includes: The AI algorithm module is used to transfer the generated slice image data to the AI algorithm interface, perform algorithm analysis and mark the diseased area.
9. An interactive coordinate conversion system based on CBCT images, characterized in that: Also includes: The slice image measurement module is used to calculate the distance between two points in the slice image; specifically: select two points on the slice image to draw a line segment, obtain the distance a between the pixel points of the CT atlas and the distance b between two consecutive CT images in the upper and lower parts through the DICOM file header information; the length of the slice image is the pixel points calculated by the straight line Bresenham algorithm, and the scaling ratio c of the image length and the actual length is calculated, that is, c=sqrt(dx^2+dy^2) / the number of point sets; the x-axis difference and y-axis difference x, y of the two points to be measured in the slice image are respectively x=(x1-x2)*ac and y=(y1-y2)*b; calculate the distance dist=sqrt(x^2+y^2) between the two points in the slice image.
