Method and system for automatically calculating left and right pulmonary vein opening included angle based on space structure
By automatically calculating the angle between the openings of the left and right pulmonary veins using deep learning models and morphological operations, the problem of computational difficulties in existing technologies has been solved, enabling high-precision and rapid analysis of pulmonary vein anatomy and improving the accuracy and efficiency of atrial fibrillation treatment.
Patent Information
- Application Number
- CN202510548869.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies struggle to accurately, automatically, and quickly calculate the angle between the openings of the left and right pulmonary veins in three-dimensional space, resulting in poor accuracy and consistency in surgical path planning, which affects the efficiency and safety of atrial fibrillation treatment.
A deep learning model is used in conjunction with morphological erosion and dilation operations. The centerline is extracted through skeletonization algorithm, and the incision section is determined by principal component analysis. The angle between the openings of the left and right pulmonary veins is automatically calculated. Multiple medical imaging data are used for precise segmentation and structural refinement.
It achieves high-precision and high-efficiency analysis of pulmonary vein anatomy, eliminates human error, adapts to anatomical variations in different patients, and improves the accuracy of individualized treatment plans for atrial fibrillation and the success rate of surgery.
Smart Images

Figure CN120931702A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of medical image analysis and cardiac electrophysiology surgery planning, specifically to a method for automatically calculating the angle between the openings of the left and right pulmonary veins based on spatial structure, aiming to provide an accurate pulmonary vein anatomy analysis tool for preoperative assessment and surgical pathway planning of patients with atrial fibrillation. Background Technology
[0002] The anatomical structure of the pulmonary veins plays a crucial role in the pathogenesis and treatment of atrial fibrillation (AF). In particular, the angle between the openings of the left and right pulmonary veins is of significant clinical importance for catheter ablation therapy. Accurate calculation of this angle helps physicians plan the surgical path more scientifically, thereby improving surgical efficiency and safety. However, the following challenges currently exist in clinical practice:
[0003] 1. Complexity of anatomical structure: The location and shape of the pulmonary vein openings vary greatly among different patients, which increases the difficulty of accurately measuring the angle.
[0004] 2. Limitations of two-dimensional measurement: Traditionally, doctors mainly rely on two-dimensional slice images for visual estimation or manual measurement, which is difficult to accurately reflect the actual angle in three-dimensional space.
[0005] 3. Subjectivity of manual measurement: Measurement results among doctors may vary greatly, lacking objective and unified standards.
[0006] 4. Low time efficiency: Detailed manual measurements are time-consuming and cannot meet the needs of rapid diagnosis and treatment decisions.
[0007] 5. Relationship with other anatomical structures: The spatial relationship between the pulmonary vein opening angle and adjacent structures such as the left atrium and pulmonary artery is complex and requires comprehensive consideration of multiple factors.
[0008] 6. Image quality impact: Differences in image quality between different imaging modalities (such as CT and MRI) may affect the accuracy of measurements.
[0009] Therefore, there is an urgent need for a method that can automatically, accurately, and efficiently calculate the angle between the openings of the left and right pulmonary veins based on three-dimensional medical imaging data. This method can not only improve the accuracy and consistency of the angle calculation, but also provide a reliable anatomical basis for the development of individualized atrial fibrillation treatment plans. Summary of the Invention
[0010] This invention combines artificial intelligence segmentation technology with medical image processing algorithms to provide a method for automatically calculating the angle between the openings of the left and right pulmonary veins based on spatial structure, including:
[0011] Step 1: Acquire three-dimensional medical imaging data including the left atrium and pulmonary vein regions;
[0012] Step 2: Use a deep learning model to perform preliminary segmentation of the left atrial region and extract its main structures;
[0013] Step 3: Through morphological erosion and expansion operations, perform high-precision structural subdivision of the left atrium and left and right pulmonary veins;
[0014] Step 4: Extract the center lines of the left and right pulmonary veins based on the fine segmentation results;
[0015] Step 5: Determine the anatomical incision section at the junction of the left and right pulmonary veins and the left atrium;
[0016] Step 6: Accurately locate the origin of the openings of the left and right pulmonary veins based on the centerline and the incision section;
[0017] Step 7: Extend a fixed distance along the centerline from the starting point to determine the endpoints of the openings of the left and right pulmonary veins;
[0018] Step 8: Construct a spatial vector based on the starting and ending points of the pulmonary vein openings, and calculate the opening angle between the left and right pulmonary veins respectively.
[0019] Furthermore, the three-dimensional medical imaging data obtained in step 1 can be various high-resolution medical images covering the anatomical structure of the left heart region of the human body; the medical imaging data includes multi-slice spiral CT angiography, cardiac MRI sequence images, rotating X-ray angiography images, or three-dimensional echocardiography; these advanced imaging technologies can comprehensively and accurately present the complex spatial structure of the left atrium, pulmonary veins, and surrounding tissues, providing a reliable data foundation for subsequent automatic identification and angle calculation.
[0020] Furthermore, the deep learning models used in step 2 include the SegmentAnythingModel 2 (SAM2) general segmentation model based on two-dimensional images, and convolutional neural network structures MedNeXt, UNETR++, and VNet based on three-dimensional images. These models, through training and optimization on medical image datasets, can adaptively learn the complex features of the heart structure, thereby performing a well-connected three-dimensional segmentation of the left atrial region in the three-dimensional medical image data obtained in step 1. This segmentation has high spatial accuracy, but it does not perform fine-grained differentiation between the left atrium and pulmonary veins.
[0021] Furthermore, in step 3, the method for obtaining finely segmented structures of the left atrium and left and right pulmonary veins through erosion and expansion operations includes the following steps:
[0022] Step 3.1: Perform multiple morphological erosion operations on the original left atrial structure; each erosion operation precisely shrinks the structural boundaries, thereby gradually removing accessory structures including the pulmonary veins and left atrial appendage, until the remaining volume reaches a preset threshold 'a', and record the number of erosion operations N. The erosion operation expression is:
[0023]
[0024] Where S represents the input original left atrial volume, This represents the volume after N erosion cycles. B is the structural element, typically a spherical or cubic structural unit. Indicates an etching operation;
[0025] Step 3.2: Perform N+1 morphological dilation operations on the eroded structure to accurately restore the main structural volume while maintaining the separation of structural boundaries. The dilation operation is defined as follows:
[0026]
[0027] in, This represents the volume after N corrosion cycles. This represents the volume after N+1 expansions. B is the structuring element used in the expansion operation, which is the same as the structuring element used in the erosion operation. Indicates an expansion operation;
[0028] Step 3.3: Perform a precise overlap analysis on the original left atrial structure and the expanded structure, extracting their intersection to obtain a refined left atrial structure. This operation is represented as:
[0029]
[0030] Where S represents the original left atrial structure, This represents the volume after N+1 expansion operations;
[0031] Step 3.4: Compare the original left atrial structure with the refined left atrial structure, and extract their difference set to obtain high-precision fine segmentation results of the left and right pulmonary veins. The difference set operation is defined as follows:
[0032] S diff =SS fine
[0033] Where S represents the original left atrial structure. fine This represents the refined left atrial structure obtained through the intersection operation in step 3.3.
[0034] Furthermore, in step 4, the centerline of the pulmonary vein is extracted using an improved skeletonization algorithm, which includes the following sub-steps:
[0035] Step 4.1: Perform a three-dimensional Euclidean distance transformation on the fine left atrial structure and the fine pulmonary vein structure to create a distance field that accurately represents the distance from each voxel to the boundary. The definition of this distance field is as follows:
[0036]
[0037] Where x represents any internal voxel point, V represents all voxel points on the boundary, and dist(x,v) represents the Euclidean distance between any voxel point x and the boundary voxel point b.
[0038] Step 4.2: By performing local maximum analysis on the distance field, possible center points are identified, and these center points are intelligently connected to construct the initial centerline structure. The set of center points P is defined as follows:
[0039]
[0040] Where N(x) represents the 18-neighborhood of voxel x, and the condition D(x) > D(x′) guarantees that the point is a local maximum.
[0041] Step 4.3: Apply a curvature flow-based smoothing algorithm to the initial centerline structure to remove unnecessary branches and noise interference, obtaining a smooth centerline that accurately reflects the spatial structure of the left atrium and pulmonary veins. The centerline extraction process is represented as follows:
[0042]
[0043] Where, skeletonize represents the image thinning skeletonization operation, P0 represents the initial set of centerline voxels, i.e., the initial set of centerline points extracted from step 4.2, P i This represents the refined centerline structure result generated after the i-th iteration, where T represents the maximum number of iterations. This represents the stable centerline skeleton obtained after iterative convergence, i.e., the final centerline C(x).
[0044] Furthermore, in step 5, the method for locating the incision sections of the left and right pulmonary veins and the left atrium includes the following steps:
[0045] Step 5.1: Based on the relative positions of each pulmonary vein in the left-right direction (X-axis) and the up-down direction (Z-axis), accurately identify and distinguish the left superior pulmonary vein, left inferior pulmonary vein, right superior pulmonary vein, and right inferior pulmonary vein;
[0046] Step 5.2: Based on the left atrial fine segmentation results obtained in Step 3, construct a spatial point set index structure for efficient distance calculation;
[0047] Step 5.3: For each identified left superior pulmonary vein, left inferior pulmonary vein, right superior pulmonary vein, and right inferior pulmonary vein, extract voxel points in its segmented structure that are at a distance β from the surface of the left atrium, forming the corresponding point set D. i .
[0048] Step 5.4: For each point set D i The optimal fitting plane direction is determined by applying principal component analysis.
[0049] Step 5.5: Based on the principal component analysis results, construct an optimal fitting plane for each pulmonary vein, serving as the cross-section between the pulmonary vein and the left atrium. The calculation is expressed as follows:
[0050] P i =PCA(D i )
[0051] A i x+B i y+C i z+D i =0
[0052] Among them, P i It is a point set D i Principal component, (A) i B i C i ) is the normal vector corresponding to the principal component, D i The intercept is the plane intercept calculated from the position of the centroid of the point set.
[0053] Furthermore, in step 6, using the pulmonary vein centerline information extracted in step 4, the Euclidean distance from each voxel point on the centerline to the four pulmonary vein incision planes constructed in step 5 is calculated. The centerline point with the smallest distance to the corresponding incision planes of the left upper pulmonary vein, left lower pulmonary vein, right upper pulmonary vein, and right lower pulmonary vein is selected in sequence and precisely defined as the opening starting point of the corresponding pulmonary vein.
[0054] Furthermore, in step 7, based on the centerline information extracted in step 4, starting from the pulmonary vein opening point determined in step 6, a fixed distance of 10mm is precisely extended along the main direction of the pulmonary vein, and the extension endpoint is defined as the opening endpoint of the pulmonary vein, which is used as the endpoint reference point for subsequent angle calculation.
[0055] Furthermore, the method for calculating the opening angle of the left and right pulmonary veins in step 8 includes the following steps:
[0056] Step 8.1: For each pulmonary vein, construct the corresponding spatial vector based on the starting point determined in Step 6 and the opening end point determined in Step 7;
[0057] Step 8.2: Calculate the angle between the left superior pulmonary vein vector and the left inferior pulmonary vein vector to obtain the angle of the left pulmonary vein opening;
[0058] Step 8.3: Calculate the angle between the vector of the right upper pulmonary vein and the vector of the right lower pulmonary vein to obtain the angle of the opening of the right pulmonary vein;
[0059] The formula for calculating the included angle is:
[0060]
[0061] in, and These are the spatial vectors of the two pulmonary veins. and θ is the magnitude of the vector, and θ is the final calculated pulmonary vein angle.
[0062] The present invention also provides a system for automatically calculating the angle between the openings of the left and right pulmonary veins to implement the above method, comprising:
[0063] The image acquisition module is used to acquire three-dimensional medical image data containing the left atrium and pulmonary vein regions;
[0064] The segmentation module is used to perform preliminary segmentation of the left atrial region in the three-dimensional image data using a deep learning model and extract its main structure.
[0065] The structural refinement module is used to perform high-precision structural subdivision of the left atrium and left and right pulmonary veins through morphological erosion and expansion operations.
[0066] The centerline extraction module is used to extract the centerlines of the left and right pulmonary veins based on the refined structure.
[0067] The incision section recognition module is used to determine the anatomical incision section at the connection between the left and right pulmonary veins and the left atrium;
[0068] The opening origin positioning module is used to accurately locate the opening origin of each pulmonary vein based on the extracted centerline and incision section;
[0069] The pulmonary vein opening endpoint determination module is used to extend a fixed distance along the pulmonary vein centerline from the opening origin to determine the opening endpoint.
[0070] The angle calculation module is used to construct a pulmonary vein spatial vector based on the opening start and end points, and to calculate the opening angle between the left and right pulmonary veins respectively.
[0071] Technical effect
[0072] This invention provides a method for automatically calculating the angle between the openings of the left and right pulmonary veins based on spatial structure. Combined with advanced artificial intelligence segmentation algorithms and precise measurement strategies, this method achieves high-precision and high-efficiency analysis of pulmonary vein anatomy. The method is highly automated, eliminating human error and is applicable to various imaging modalities, adapting to anatomical variations in different patients. These characteristics make this invention a powerful tool for developing individualized treatment plans for atrial fibrillation, significantly improving the accuracy of preoperative assessment and providing a reliable basis for optimizing surgical pathway planning, increasing surgical success rates, and reducing the risk of complications. Attached Figure Description
[0073] The invention will be better understood by referring to the following description of specific embodiments of the invention given in the accompanying drawings, and the purpose, details, and features of each step of the invention will become more apparent.
[0074] Figure 1 This is a flowchart illustrating the method for calculating the pulmonary vein opening angle described in this invention.
[0075] Figure 2 A diagram of the left atrium structure obtained through segmentation using a deep learning model;
[0076] Figure 3A A schematic diagram of the structure obtained by repeatedly eroding and then expanding the original left atrial structure.
[0077] Figure 3B A detailed diagram illustrating the segmented structure of the left atrium and pulmonary veins, to be obtained further;
[0078] Figure 4 This diagram illustrates the centerline extracted from the left atrium and pulmonary vein structures.
[0079] Figure 5A This is a schematic diagram of the cross-section of the left superior pulmonary vein and the left inferior pulmonary vein;
[0080] Figure 5B This is a schematic diagram of the cross-section of the right superior pulmonary vein and the right inferior pulmonary vein;
[0081] Figure 6 A schematic diagram showing the spatial locations of the openings and ending points of the upper left, lower left, upper right, and lower right pulmonary veins, and the opening and ending point of the lower right pulmonary vein.
[0082] Figure 7 This is a schematic diagram illustrating the calculation of the spatial angle between the openings of the left and right pulmonary veins. Detailed Implementation
[0083] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that the embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. Furthermore, it should be understood that after reading the disclosure of this invention, those skilled in the art can make various modifications or alterations to the invention, and these equivalent forms also fall within the scope of protection defined by this invention.
[0084] This invention proposes a method for automatically calculating the angle between the openings of the left and right pulmonary veins, such as... Figure 1 As shown, it includes the following steps:
[0085] Step 1: Acquire three-dimensional medical imaging data containing the left atrium and pulmonary vein region. The three-dimensional medical imaging data can be various high-resolution medical image types covering the complex anatomical structures of the left atrium. This data includes, but is not limited to, multi-slice spiral CT angiography, cardiac MRI sequences, rotating X-ray angiography, or three-dimensional echocardiography. These advanced imaging techniques can comprehensively and accurately reflect the complex anatomical information of the left atrium, pulmonary veins, and surrounding tissues, providing a high-quality data foundation for subsequent analysis.
[0086] Step 2: In the acquired 3D medical image data, the left atrial structure extracted using a deep learning model is coarsely segmented to obtain the following results: Figure 2 The preliminary structure of the left atrium is shown. In this step, the deep learning model includes, but is not limited to, the following artificial intelligence algorithms and architectures: the Segment Anything Model 2 (SAM2) general segmentation model based on two-dimensional images, and advanced convolutional neural networks based on three-dimensional images, such as MedNeXt (Transformer-driven Scaling of ConvNets for Medical Image Segmentation), UNETR++ (Delving into Efficient and Accurate 3D Medical Image Segmentation), and V-Net (Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation). These models, trained and optimized on medical image datasets, can adaptively learn the complex features of the heart structure, thereby performing high-precision coarse segmentation of the left atrium on the three-dimensional medical image data obtained in step 1, providing a foundation for subsequent structural refinement and anatomical analysis.
[0087] Step 3: Obtain the results of fine segmentation of the left atrium and left and right pulmonary veins through erosion and expansion operations, as shown in Figure 3, including the following steps:
[0088] Step 3.1: Perform multiple morphological erosion operations on the coarse segmentation results using spherical structural elements with a radius of 2 voxels. Each erosion gradually shrinks the structural boundaries, significantly weakening accessory structures such as the pulmonary veins and left atrial appendage, thereby achieving their effective removal. The erosion process continues until the remaining left atrial structure volume is reduced to 50% of the preset threshold of the original volume. Simultaneously, the number of erosion operations N required to complete the process is recorded. The erosion operation can be represented as:
[0089]
[0090] Where S represents the input original left atrial volume, This represents the volume after N erosion cycles. B is the structural element, typically a spherical or cubic structural unit. Indicates an etching operation;
[0091] Step 3.2: Perform N+1 morphological dilation operations on the eroded result to accurately recover the main structural volume while maintaining the separation of structural boundaries. The dilation operation is defined as follows:
[0092]
[0093] in, This represents the volume after N corrosion cycles. This represents the volume after N+1 expansions. B is the structuring element used in the expansion operation, which is the same as the structuring element used in the erosion operation. Indicates an expansion operation;
[0094] Step 3.3: Perform a precise overlap analysis between the original left atrial structure and the expanded structure, extracting the intersection to obtain a refined left atrial structure. The results are as follows: Figure 3A As shown, this operation is represented as:
[0095]
[0096] Where S represents the original left atrial structure. This represents the volume after N+1 expansion operations;
[0097] Step 3.4: Compare the differences between the original left atrial structure and the refined left atrial structure, extract the difference set, and thus obtain high-precision fine segmentation results of the left and right pulmonary veins. The results are as follows: Figure 3B As shown, the difference operation is defined as follows:
[0098] S diff =SS fine
[0099] Where S represents the original left atrial structure. fineThis represents the refined left atrial structure obtained through the intersection operation.
[0100] Step 4: The centerline of the pulmonary veins is extracted using an improved skeletonization algorithm, as shown in the following figure. Figure 4 As shown, the algorithm includes the following sub-steps:
[0101] Step 4.1: Perform a three-dimensional Euclidean distance transformation on the fine left atrial and pulmonary vein structures to create a distance field that accurately represents the distance from each voxel to the boundary. The calculation of this distance field is expressed as follows:
[0102]
[0103] Where x represents any internal voxel point, B represents all voxel points on the structural boundary, and dist(x,b) represents the Euclidean distance between any voxel point x and the boundary voxel point b.
[0104] Step 4.2: Perform local maximum analysis on the distance field generated in Step 4.1 to identify possible center points, and form an initial centerline structure by connecting these center points. The set of center points P is defined as follows:
[0105]
[0106] Where N(x) represents the 18-neighborhood of voxel x, and the condition D(x) > D(x′) guarantees that the point is a local maximum.
[0107] Step 4.3: Apply a curvature flow-based smoothing algorithm to the initial centerline structure to remove redundant branches and noise interference, thereby obtaining a smooth centerline that accurately reflects the structural morphology of the left atrium and pulmonary veins. The centerline extraction process can be represented as follows:
[0108]
[0109] Here, `skeletonize` represents the image thinning and skeletonization operation. `P0` represents the initial set of centerline voxels, i.e., the initial set of centerline points extracted in step 4.2. i This represents the refined centerline structure result generated after the i-th iteration, where T represents the maximum number of iterations. This represents the stable centerline skeleton obtained after iterative convergence, i.e., the final centerline C(x).
[0110] Step 5: Locate the incision sections for the left and right pulmonary veins and the left atrium. The result is shown in Figure 5. The specific steps include:
[0111] Step 5.1: Based on the relative positions of each pulmonary vein in the left-right direction (X-axis) and the up-down direction (Z-axis), accurately identify and distinguish the left superior pulmonary vein, left inferior pulmonary vein, right superior pulmonary vein, and right inferior pulmonary vein.
[0112] Step 5.2: Based on the left atrial fine segmentation results obtained in Step 3, construct a spatial point set index structure for efficient distance calculation.
[0113] Step 5.3: For each identified left superior pulmonary vein, left inferior pulmonary vein, right superior pulmonary vein, and right inferior pulmonary vein, calculate the set D of points in the segmentation result that are 1 distance from the surface of the left atrium. i .
[0114] Step 5.4: Obtain the point set D for each pulmonary vein i Principal component analysis is applied to obtain the optimal planar orientation.
[0115] Step 5.5: Based on the results of principal component analysis, construct a best-fit plane for each pulmonary vein. These four planes represent the cross-sections between each pulmonary vein and the left atrium.
[0116] P i =PCA(D i )
[0117] A i x+B i y+C i z+D i =0
[0118] Among them, P i It is a point set D i Principal component, (A) i B i C i ) is the normal vector of the principal component, D i The intercept of the plane is calculated through the centroid to construct the best-fit plane for each pulmonary vein.
[0119] Step 6: Using the pulmonary vein centerline information extracted in Step 4, combined with the incision section at the connection between the pulmonary vein and the left atrium obtained in Step 5, calculate the starting points of the left and right pulmonary vein openings. The results are as follows: Figure 6 As shown by points A1, B1, C1, and D1, the following steps are included:
[0120] Step 6.1: Calculate the Euclidean distance from each point on the centerline to the corresponding pulmonary vein incision plane. The calculation formula is as follows:
[0121]
[0122] Among them, (A) i Bi C i D i ) is the normal vector parameter of the pulmonary vein section extracted in step 5, d(P j ,P i ) represents point P j With plane P i The distance between them.
[0123] Step 6.2: Traverse all pulmonary vein centerline points and select the centerline point closest to the incision plane as the starting point of the pulmonary vein opening. The selection process is as follows:
[0124]
[0125]
[0126] P start =P j*
[0127] Where min represents finding the minimum distance value, agrmin represents finding the index of the point that minimizes the distance, and P start It is the final selected origin of the pulmonary vein opening.
[0128] Step 7: Based on the pulmonary vein centerline information extracted in Step 4, calculate the endpoints of the left and right pulmonary vein openings, starting from the opening start point determined in Step 6. The results are as follows: Figure 6 As shown by points A2, B2, C2, and D2, the following steps are included:
[0129] Step 7.1: Starting from the opening point, calculate the cumulative distance from each point on the center line to the starting point.
[0130] Specifically as follows:
[0131]
[0132]
[0133] in, Let j be the j-th point on the center line. d represents the Euclidean distance between two consecutive centerline points. cumulative This represents the cumulative path length from the starting point of the opening to the i-th point.
[0134] Step 7.2: From the calculated cumulative distance, select the centerline point 10mm from the starting point as the endpoint of the pulmonary vein's opening. If there is no point exactly 10mm away, select the first point slightly larger than 10mm. The formula is as follows:
[0135]
[0136]
[0137] Among them, P end The coordinates of the final determined pulmonary vein opening endpoint.
[0138] Step 7.3: Use the vector from the starting point to the ending point as the direction vector of the pulmonary vein for subsequent angle calculation. The definition is as follows:
[0139]
[0140] (x start ,y start ,z start ) is the starting point of the opening P start The coordinates. (x) end ,y end ,z end ) is the opening endpoint P end The coordinates.
[0141] Step 8: The method for calculating the angle between the openings of the left and right pulmonary veins includes the following steps:
[0142] Step 8.1: For each pulmonary vein, construct a spatial vector using the starting point determined in Step 6 and the ending point determined in Step 7;
[0143] Step 8.2: Calculate the angle between the left superior pulmonary vein vector and the left inferior pulmonary vein vector to obtain the angle of the left pulmonary vein opening;
[0144] Step 8.3: Calculate the angle between the right upper pulmonary vein vector and the right lower pulmonary vein vector to obtain the angle of the right pulmonary vein opening.
[0145] The formula for calculating the included angle is:
[0146]
[0147] in, and These are the spatial vectors of the left (right) superior pulmonary vein and the left (right) inferior pulmonary vein, respectively. and θ is the magnitude of the vector, and θ is the angle between the left (right) pulmonary veins, which is the final calculated angle.
Claims
1. A method for automatically calculating the angle between the openings of the left and right pulmonary veins based on spatial structure, characterized in that, include: Step 1: Acquire three-dimensional medical imaging data including the left atrium and pulmonary vein regions; Step 2: Use a deep learning model to perform preliminary segmentation of the left atrial region and extract its main structures; Step 3: Through morphological erosion and expansion operations, perform high-precision structural subdivision of the left atrium and left and right pulmonary veins; Step 4: Extract the center lines of the left and right pulmonary veins based on the fine segmentation results; Step 5: Determine the anatomical incision section at the junction of the left and right pulmonary veins and the left atrium; Step 6: Accurately locate the origin of the openings of the left and right pulmonary veins based on the centerline and the incision section; Step 7: Extend a fixed distance along the centerline from the starting point to determine the endpoints of the openings of the left and right pulmonary veins; Step 8: Construct a spatial vector based on the starting and ending points of the pulmonary vein openings, and calculate the opening angle between the left and right pulmonary veins respectively.
2. The method for automatically calculating the angle between the openings of the left and right pulmonary veins according to claim 1, wherein the three-dimensional medical imaging data acquired in step 1 can be various high-resolution medical images covering the anatomical structure of the left heart region; the medical imaging data includes multi-slice spiral CT angiography, cardiac MRI sequence images, rotating X-ray angiography images, or three-dimensional echocardiography; these advanced imaging technologies can comprehensively and accurately present the complex spatial structure of the left atrium, pulmonary veins, and surrounding tissues, providing a reliable data foundation for subsequent automatic identification and angle calculation.
3. The method for automatically calculating the angle between the openings of the left and right pulmonary veins according to claim 2, wherein the deep learning model used in step 2 includes the SAM2 general segmentation model based on two-dimensional images, and convolutional neural network structures MedNeXt, UNETR++, and VNet based on three-dimensional images; the above models, through training and optimization on medical image datasets, can adaptively learn the complex features of the heart structure, thereby performing a well-connected three-dimensional segmentation of the left atrial region in the three-dimensional medical image data obtained in step 1. This segmentation has high spatial accuracy, but does not perform fine-grained differentiation between the left atrium and pulmonary veins.
4. The method for automatically calculating the angle between the openings of the left and right pulmonary veins according to claim 3, wherein step 3, the method for obtaining the finely segmented structure of the left atrium and the left and right pulmonary veins through erosion and expansion operations, includes the following steps: Step 3.1: Perform multiple morphological erosion operations on the original left atrial structure; each erosion operation precisely shrinks the structural boundaries, thereby gradually removing accessory structures including the pulmonary veins and left atrial appendage, until the remaining volume reaches a preset threshold 'a', and record the number of erosion operations N. The erosion operation expression is: Where S represents the input original left atrial volume, This represents the volume after N erosion cycles. B is the structural element, typically a spherical or cubic structural unit. Indicates an etching operation; Step 3.2: Perform N+1 morphological dilation operations on the eroded structure to accurately restore the main structural volume while maintaining the separation of structural boundaries. The dilation operation is defined as follows: in, This represents the volume after N corrosion cycles. This represents the volume after N+1 expansions. B is the structuring element used in the expansion operation, which is the same as the structuring element used in the corrosion operation. ⊕ represents the expansion operation. Step 3.3: Perform a precise overlap analysis on the original left atrial structure and the expanded structure, extracting their intersection to obtain a refined left atrial structure. This operation is represented as: Where S represents the original left atrial structure, This represents the volume after N+1 expansion operations; Step 3.4: Compare the original left atrial structure with the refined left atrial structure, and extract their difference set to obtain high-precision fine segmentation results of the left and right pulmonary veins. The difference set operation is defined as follows: S diff =S-S fine Where S represents the original left atrial structure. fine This represents the refined left atrial structure obtained through the intersection operation in step 3.
3.
5. The method for automatically calculating the angle between the openings of the left and right pulmonary veins according to claim 4, wherein in step 4, the centerline of the pulmonary veins is extracted using an improved skeletonization algorithm, which includes the following sub-steps: Step 4.1: Perform a three-dimensional Euclidean distance transformation on the fine left atrial structure and the fine pulmonary vein structure to create a distance field that accurately represents the distance from each voxel to the boundary. The definition of this distance field is as follows: in, x represents any internal voxel point, B represents all voxel points on the boundary, and dist(x,b) represents the Euclidean distance between any voxel point x and the boundary voxel point b. Step 4.2: By performing local maximum analysis on the distance field, possible center points are identified, and these center points are intelligently connected to construct the initial centerline structure. The set of center points P is defined as follows: Where N(x) represents the 18-neighborhood of voxel x, and the condition D(x) > D(x′) guarantees that the point is a local maximum point; Step 4.3: Apply a curvature flow-based smoothing algorithm to the initial centerline structure to remove unnecessary branches and noise interference, obtaining a smooth centerline that accurately reflects the spatial structure of the left atrium and pulmonary veins. The centerline extraction process is represented as follows: Here, `skeletonize` represents the image thinning and skeletonization operation. `P0` represents the initial set of centerline voxels, i.e., the initial set of centerline points extracted in step 4.
2. i This represents the refined centerline structure result generated after the i-th iteration, where T represents the maximum number of iterations. This represents the stable centerline skeleton obtained after iterative convergence, i.e., the final centerline C(x).
6. The method for automatically calculating the angle between the openings of the left and right pulmonary veins according to any one of claims 1-5, wherein step 5, the method for locating the incision section between the left and right pulmonary veins and the left atrium, includes the following steps: Step 5.1: Based on the relative positions of each pulmonary vein in the left-right direction (X-axis) and the up-down direction (Z-axis), accurately identify and distinguish the left superior pulmonary vein, left inferior pulmonary vein, right superior pulmonary vein, and right inferior pulmonary vein; Step 5.2: Based on the left atrial fine segmentation results obtained in Step 3, construct a spatial point set index structure for efficient distance calculation; Step 5.3: For each identified left superior pulmonary vein, left inferior pulmonary vein, right superior pulmonary vein, and right inferior pulmonary vein, extract voxel points in its segmented structure that are at a distance β from the surface of the left atrium, forming the corresponding point set D. i . Step 5.4: For each point set D i The optimal fitting plane direction is determined by applying principal component analysis. Step 5.5: Based on the principal component analysis results, construct an optimal fitting plane for each pulmonary vein, serving as the cross-section between the pulmonary vein and the left atrium. The calculation is expressed as follows: P i =PCA(D i ) A i x+B i y+C i z+D i =0 Among them, P i It is a point set D i Principal component, (A) i B i C i ) is the normal vector corresponding to the principal component, D i The intercept is the plane intercept calculated from the position of the centroid of the point set.
7. In the method for automatically calculating the angle between the openings of the left and right pulmonary veins according to claim 6, in step 6, the Euclidean distance from each voxel point on the central line to the four pulmonary vein incision planes constructed in step 5 is calculated using the pulmonary vein central line information extracted in step 4. The central line point with the smallest distance from the corresponding incision planes of the left upper pulmonary vein, left lower pulmonary vein, right upper pulmonary vein, and right lower pulmonary vein is selected in sequence and precisely defined as the opening starting point of the corresponding pulmonary vein.
8. The method for automatically calculating the angle between the openings of the left and right pulmonary veins according to claim 7, in step 7, based on the centerline information extracted in step 4, starting from the starting point of the pulmonary vein opening determined in step 6, a fixed distance of 10mm is precisely extended along the main direction of the pulmonary vein, and the extension endpoint is defined as the opening endpoint of the pulmonary vein, which is used as the endpoint reference point for subsequent angle calculation.
9. The method for automatically calculating the angle between the openings of the left and right pulmonary veins according to claim 8, wherein step 8 of the method for calculating the angle between the openings of the left and right pulmonary veins includes the following steps: Step 8.1: For each pulmonary vein, construct the corresponding spatial vector based on the starting point determined in Step 6 and the opening end point determined in Step 7; Step 8.2: Calculate the angle between the left superior pulmonary vein vector and the left inferior pulmonary vein vector to obtain the angle of the left pulmonary vein opening; Step 8.3: Calculate the angle between the vector of the right upper pulmonary vein and the vector of the right lower pulmonary vein to obtain the angle of the opening of the right pulmonary vein; The formula for calculating the included angle is: in, and These are the spatial vectors of the two pulmonary veins. and θ is the magnitude of the vector, and θ is the final calculated angle between the pulmonary veins.
10. A system for implementing the method for automatically calculating the angle between the openings of the left and right pulmonary veins based on spatial structure as described in any one of claims 1 to 9, characterized in that, include: The image acquisition module is used to acquire three-dimensional medical image data containing the left atrium and pulmonary vein regions; The segmentation module is used to perform preliminary segmentation of the left atrial region in the image data using a deep learning model and extract its main structure; The structural refinement module is used to perform high-precision structural subdivision of the left atrium and left and right pulmonary veins through morphological erosion and expansion operations. The centerline extraction module is used to extract the centerlines of the left and right pulmonary veins based on the refined structure. The incision section recognition module is used to determine the anatomical incision section at the connection between the left and right pulmonary veins and the left atrium; The opening origin positioning module is used to accurately locate the opening origin of each pulmonary vein based on the extracted centerline and incision section; The pulmonary vein opening endpoint determination module is used to extend a fixed distance along the pulmonary vein centerline from the opening origin to determine the opening endpoint. The angle calculation module is used to construct a pulmonary vein spatial vector based on the opening start and end points, and to calculate the opening angle between the left and right pulmonary veins respectively.