WO2021098617A1 - Method for generating tumor in digital blood vessel model, system, and electronic device - Google Patents

Method for generating tumor in digital blood vessel model, system, and electronic device Download PDF

Info

Publication number
WO2021098617A1
WO2021098617A1 PCT/CN2020/128855 CN2020128855W WO2021098617A1 WO 2021098617 A1 WO2021098617 A1 WO 2021098617A1 CN 2020128855 W CN2020128855 W CN 2020128855W WO 2021098617 A1 WO2021098617 A1 WO 2021098617A1
Authority
WO
WIPO (PCT)
Prior art keywords
tumor
blood vessel
model
grid
mesh
Prior art date
Application number
PCT/CN2020/128855
Other languages
French (fr)
Chinese (zh)
Inventor
吴剑煌
王浩宇
步文瑜
Original Assignee
中国科学院深圳先进技术研究院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国科学院深圳先进技术研究院 filed Critical 中国科学院深圳先进技术研究院
Publication of WO2021098617A1 publication Critical patent/WO2021098617A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/50ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for simulation or modelling of medical disorders

Definitions

  • This application belongs to the technical field of virtual surgery, and in particular relates to a method, system and electronic equipment for generating tumors in a blood vessel digital model.
  • the virtual surgery system is a typical application of virtual reality technology in the medical field.
  • Virtual surgery is a surgical system that starts from medical image data, uses computer graphics to reconstruct a virtual human soft tissue model, simulates a virtual medical environment, and uses tactile interactive devices to interact with it. The doctor can observe the expert's operation process on the virtual operation system, and can also repeat the exercise. Virtual surgery greatly shortens the time for surgical training, reduces the need for expensive experimental subjects, and can avoid the shortcomings of traditional surgery such as high risk, high patient pain, and unsatisfactory postoperative results.
  • the case model refers to the digital model of the diseased blood vessel.
  • the digital model of the diseased blood vessel there are three main technical solutions for obtaining the digital model of the diseased blood vessel:
  • This method performs blood vessel segmentation based on CT/MRI/DSA scan images of actual cases, and then uses three-dimensional reconstruction technology to obtain a three-dimensional digital blood vessel model with tumor lesions.
  • 3D reconstruction method due to various factors, there is often a large amount of noise in the scanned image, and the automatic segmentation and recognition of blood vessels is difficult, and it is difficult to find a universal method. Therefore, the blood vessel model obtained by this method is often rough and requires manual intervention and post-processing before it can be used for virtual surgery.
  • the prerequisite for this method to obtain the case model is to have the image of the case. Due to the issue of patient privacy, it is difficult to obtain, and it is necessary to master the post-processing method of the rough model obtained by 3D reconstruction.
  • This method is based on the three-dimensional blood vessel digital model that has been acquired and undergoes three-dimensional reconstruction and post-processing.
  • the three-dimensional blood vessel digital model is edited through 3ds Max or Maya and other three-dimensional editing software to obtain different types of diseased blood vessel models.
  • This method can obtain a case model with a rich variety of pathological characteristics.
  • the method of editing through 3D software requires the operator to learn the use of 3Ds Max or Maya and other 3D editing software, and also need to understand the structure of the blood vessel digital model. Learning costs.
  • This method is also based on the three-dimensional blood vessel digital model that has been acquired and undergoes three-dimensional reconstruction and post-processing.
  • the steps of tumor location selection, tumor hole cutting and tumor grid generation the vascular tumor lesions can be constructed simply and quickly.
  • the direct editing method can quickly and conveniently generate digital models of tumor lesions, this method cannot adapt to digital models of blood vessels with different radii.
  • the transition between the generated tumor and the digital model of blood vessels is unnatural, which is quite different from the real tumor.
  • the operation process of direct editing will reduce the mesh quality of the blood vessel digital model.
  • This application provides a method, system, and electronic device for generating tumors in a digital blood vessel model, and aims to solve one of the above-mentioned technical problems in the prior art at least to a certain extent.
  • a method for generating a tumor in a digital blood vessel model including the following steps:
  • Step a Select the tumor position on the blood vessel digital model
  • Step b Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
  • Step c Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
  • Step d Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
  • Step e smoothing the connection between the tumor mesh model and the blood vessel digital model
  • Step f Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
  • the technical solution adopted in the embodiment of the application further includes: in the step a, the method for selecting the tumor position is specifically: selecting a point on the blood vessel digital model, and using the position information of the point as the screen coordinate information;
  • the coordinate information is converted into world coordinate information, and the world coordinate information and the position of the virtual camera are connected to form a ray;
  • the triangle patch on the digital model of the blood vessel that intersects with the ray is calculated, and the geometric center points of the three vertices of the triangle are calculated
  • Position T c this position T c is the tumor position selected on the blood vessel digital model.
  • the approximate radius calculation method specifically includes:
  • Step b1 Take the tumor position selected on the blood vessel digital model as the center, obtain m triangle faces whose surrounding radius is R, calculate the normal vector of the first triangle face and the normal vector of the second triangle face Vector product of Calculate the vector product of the normal vector of the second triangular facet and the normal vector of the third triangular facet
  • m-1 vector products can be calculated Then calculate their mean
  • Step b2 Take the triangle f 0 where the tumor position coordinates selected on the blood vessel digital model are located, calculate the coordinates G 0 (x 0 , y 0 , z 0 ) of its center of gravity, and pass And G 0 , we get a pass through G 0 and perpendicular to The point French equation of the plane, namely:
  • Step b3 Set a positive real number ⁇ , and find all the barycentric coordinates G i (x i , y i , z i ) in all triangles that make up the blood vessel digital model to meet the inequality - ⁇ A(xx i )+B (yy i )+C(zz i ) ⁇ and form a set F, calculate the average of the barycentric coordinates of all triangles in F, and get a point O 0 ;
  • Step b4 Calculate the linear distance between the center of gravity of all triangles in the set F and the point O 0 and then calculate the average value R 0 , and the average value R 0 is the approximate radius of the blood vessel digital model at the selected tumor position.
  • the constructing a smooth and regular tumor grid model specifically includes:
  • Step c2 Perform collision detection between the virtual sphere and the blood vessel digital model to obtain all triangle sets S that intersect the virtual sphere, and find the average normal vector D t of all triangle faces in the set S, which is the growth direction of the tumor;
  • Step c3 Delete all the triangular faces in the set S from the blood vessel digital model to obtain an irregular boundary.
  • the set of all vertices on the boundary is S bd ;
  • Step c4 Connect each vertex on the vertex set S bd with the center of the sphere T c , and obtain the intersection set S int of the corresponding link and the virtual sphere respectively;
  • Step c5 Triangulate the vertices on the vertex set S bd and the intersection set S int to form a circle of triangle meshes, and use the vertices in the intersection set S int as the vertices where the tumor and the blood vessel intersect;
  • Step c6 Calculate the tumor sphere center position P T and the tumor highest point position P H :
  • Step c7 Connect the vertices in the intersection set S int and the highest point position P H of the tumor to form a cone-shaped grid.
  • the triangle set that composes the grid is S 0 , and each triangle in the set S 0 is performed Subdivision operation, a new triangle set S 1 is obtained , and then the same subdivision operation is performed on each triangle in the set S 1. This operation is performed for N rounds, and the final triangle set S N is the regular tumor mesh model .
  • the technical solution adopted in the embodiment of the present application further includes: the subdivision operation of each triangle specifically includes: for each triangle in the set, if two vertices A and B of the three vertices belong to the intersection set S int , then Take the midpoints X and Y of the other two sides except the side composed of vertices A and B, and take any one of the midpoints X and Y to connect with any one of the vertices A and B, and divide the original triangle into 3, X and Y are newly added vertices; if none of the three vertices of the triangle belong to the vertex set S int , then take the midpoints X, Y, Z of the three sides and connect them in pairs to divide the original triangle Into 4 triangles, X, Y and Z are the new vertices; move the new vertices X and Y or X, Y and Z to the rays P T X and P T Y or P T X, P T Y and At the
  • the constructing an irregular deformation on the surface of the tumor grid specifically includes:
  • Step d1 Use the generated tumor mesh model as the input mesh S of the mesh deformation operation
  • Step d2 Divide the tumor grid into m parts, randomly select q control points in each part; for each control point, select triangles within a certain range around the tumor grid, and divide these triangles The vertex of the slice is used as the free point set corresponding to the control point;
  • Step d3 Set the position constraint information of the control point as: the position of the current control point after moving ⁇ R along the normal direction or the normal direction of the point; where ⁇ is a constant between greater than 0 and less than 1, and R is the radius of the tumor ;
  • Step d4 Combine input grid information, control points and their corresponding free point set information, and fixed position constraint information to perform rigidity-preserving grid deformation.
  • the rigidity-preserving grid deformation specifically includes:
  • Step 1 Obtain the adjacency information of the input mesh S, and make the vertex v i and its 1-neighboring triangle patch form a unit C i ;
  • Step 2 Define the rigid energy of each unit, and sum to obtain the overall rigid energy:
  • S is the input mesh
  • S′ is the deformed input mesh
  • E(S′) is the rigid energy of the entire mesh
  • n is the number of vertices in the input mesh S
  • C i is the vertex v i and its 1-neighbor triangular facet constitute a unit
  • C i ′ is the deformed unit
  • E(C′) is the rigid energy of a unit
  • N(i) is the vertex adjacent to vertex v i collection
  • p i is a vertex v i coordinates
  • p j is a vertex v j of the coordinates
  • w ij is the weight of the edge e ij weight
  • ⁇ ij and ⁇ ij are the two opposite corners of the edge e ij
  • R i is the rotation matrix before and after the transformation of the unit
  • Step 3 Determine the initial guess of the vertex coordinates after deformation; for the selected control point, its initial guess is the fixed position constraint set before; for free points, determine the initial guess by minimizing
  • 2, Where ⁇ Lp, p is the coordinates of the vertices in the initial grid input by the user, and p′ is the coordinates of the vertices in the grid after the control point coordinates have been changed according to the above fixed position constraints;
  • w ij is the weight of edge e ij
  • N(i) is the set of vertices adjacent to the vertex v i ;
  • the fourth step use the post-deformation vertex coordinates p i ′ and use the singular value decomposition to calculate the optimal rotation matrix of all deformed units;
  • Step 5 Use the current optimal rotation matrix to solve the linear equations to obtain the new vertex coordinates; when R i is determined, solve the linear equations Obtain p′ that minimizes E(S′). For each p i ′, the following equation can be obtained:
  • the sixth step iteratively execute the fourth and fifth steps until the overall rigidity energy is less than the set threshold.
  • the smoothing process includes:
  • Step e1 Select the triangle surface of the tumor hole boundary and its n-neighboring triangle surface on the vascular mesh model, and use the digital mesh model composed of the above triangle surface as the input of the first mesh smoothing operation:
  • ⁇ ij and ⁇ ij are the two opposite corners of the edge (i, j);
  • p i is the coordinate of vertex i
  • p j is the coordinate of the adjacent point j of vertex i
  • the original coordinate p i is updated to ⁇ L (i) + p i; where ⁇ is a positive real number less than 1;
  • Step e2 Select again all the triangles on the tumor and the triangles of the tumor hole boundary on the vascular mesh model and its n-neighbor triangles, and use the digital mesh model composed of the above triangles as the mesh light For smooth input, perform the above mesh smoothing operation iteratively m 2 times, where m 1 should be much larger than m 2 .
  • the technical solution adopted in the embodiment of the present application further includes: in the step f, the strict boundary-preserving mesh simplification of the tumor mesh model specifically includes:
  • Step f1 Calculate the error matrix Q for all initial vertices to obtain all valid edges (v 1 , v 2 );
  • Step f2 For each valid edge (v 1 , v 2 ), calculate the optimal extraction target v and the cost of extracting this edge;
  • Step f3 Store all edges in a heap according to the extraction cost cost
  • Step f4 Remove the edge with the least extraction cost each time, and merge the vertices v 1 and v 2 into And update all The extraction cost of the connected effective edges and the optimal extraction position, and calculate the number of triangles in the tumor mesh after the least cost edge is removed;
  • Step f5 Repeat steps f1 to f4 until the number of existing faces is small to set a threshold.
  • a system for generating tumors in a digital blood vessel model including:
  • Tumor location selection module used to select the tumor location on the blood vessel digital model
  • Approximate radius calculation module used to calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
  • Tumor grid building module used to generate a virtual sphere with the selected tumor position as the center of the sphere, collide the virtual sphere with the blood vessel digital model and delete the collision triangle, generate a cavity by growing toward the center of the virtual sphere, and pass Iterative triangle refinement method builds a smooth and regular tumor mesh model;
  • Tumor grid deformation module used to edit the surface of the tumor grid model, select a certain number of control points, and construct irregular deformations on the tumor grid surface by maintaining rigid deformation;
  • Grid smoothing processing module used for smoothing the connection between the tumor grid model and the blood vessel digital model
  • Grid simplification module used to perform grid simplification with strict boundary preserving on the tumor grid model to obtain the result of tumor generation in the blood vessel digital model.
  • an electronic device including:
  • At least one processor At least one processor
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the above-mentioned method for generating a tumor in a blood vessel digital model.
  • Step a Select the tumor position on the blood vessel digital model
  • Step b Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
  • Step c Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
  • Step d Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
  • Step e smoothing the connection between the tumor mesh model and the blood vessel digital model
  • Step f Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
  • the beneficial effects produced by the embodiments of the present application are that the method, system and electronic device for generating tumors in the digital blood vessel model of the embodiments of the present application design an automatic generation and optimization method of the vascular tumor model. It is used to enrich the available case models in the field of virtual surgery, and make the operation simple and efficient. Compared with the prior art, this application has the following advantages:
  • This application does not have the problem of limited source of case data, and it can be used without any learning cost. It can construct tumors at almost any position in the digital model of normal blood vessels, and has a high degree of freedom;
  • the approximate radius of any position of the blood vessel digital model can be calculated, and the tumor radius and hole radius can be set adaptively according to the radius of the blood vessel model at the selected position when generating the tumor, instead of manually setting each time;
  • the transition between the tumor and the blood vessel model is made smoother through the two-step grid smoothing, which is more in line with the morphology of the real tumor and the blood vessel connection;
  • the grid simplification with strict boundary preservation is carried out, so that there will be no excessive difference between the grid density of the tumor grid and the blood vessel grid.
  • Fig. 1 is a flowchart of a method for generating a tumor in a blood vessel digital model according to an embodiment of the present application
  • Figure 2 is a schematic diagram of the relationship between R and r in the generated tumor grid model
  • Figure 3(a) is a schematic diagram of the grid between two arcs on the tumor grid
  • Figure 3(b) is a schematic diagram of a part of the tumor grid when the tumor grid is divided into three parts;
  • Fig. 4 is a flow chart of grid deformation to maintain rigidity
  • Figure 5 is a schematic diagram of a vertex v i and its corresponding unit C i;
  • Figure 6 is a schematic diagram of the process of rigidity-preserving deformation of the tumor mesh
  • Figure 7 is a schematic diagram of the first step grid smoothing operation process
  • Figure 8 is a schematic diagram of the smoothing process of the grid at the junction of the tumor grid and the blood vessel digital model
  • Figure 9 is a simplified flow chart of the grid
  • Figure 10 is a schematic diagram of the final effect of generating a tumor in a blood vessel digital model
  • FIG. 11 is a schematic structural diagram of a system for generating a tumor in a digital blood vessel model according to an embodiment of the present application.
  • FIG. 12 is a schematic diagram of the hardware device structure of the method for generating a tumor in a blood vessel digital model provided by an embodiment of the present application.
  • FIG. 1 is a flowchart of a method for generating a tumor in a blood vessel digital model according to an embodiment of the present application.
  • the method for generating a tumor in a digital blood vessel model of the embodiment of the present application includes the following steps:
  • Step 100 Select the tumor position on the blood vessel digital model
  • the specific method for selecting the tumor position is: click on a point on the blood vessel digital model, and use the position information of the point as the screen coordinate information; convert the screen coordinate information into world coordinate information, and combine the world coordinate information with the virtual
  • the position of the camera is connected to form a ray; calculate the triangular facet on the blood vessel digital model that intersects the ray, calculate the position T c of the geometric center point of the three vertices of the triangle, the position T c is selected on the blood vessel digital model Tumor location.
  • Step 200 Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
  • step 200 through a series of simple calculations based on a plane-based French equation, the approximate radius of the blood vessel digital model at any position can be obtained, and the tumor radius and the hole radius can be adaptively set according to the approximate radius when the tumor is generated subsequently.
  • the approximate radius calculation methods include:
  • Step 201 Take the tumor position selected on the blood vessel digital model as the center, obtain m triangle faces whose surrounding radius is R, calculate the normal vector of the first triangle face and the normal vector of the second triangle face Vector product of Calculate the vector product of the normal vector of the second triangular facet and the normal vector of the third triangular facet
  • m-1 vector products can be calculated Then calculate their mean
  • Step 202 Take the triangle f 0 where the tumor position coordinates selected on the blood vessel digital model are located, calculate the coordinates G 0 (x 0 , y 0 , z 0 ) of its center of gravity, and pass And G 0 , we get a pass through G 0 and perpendicular to The point French equation of the plane, namely:
  • the plane is considered to be approximately perpendicular to the direction in which the blood vessel extends.
  • Step 203 Set an appropriate positive real number ⁇ , and find all the barycentric coordinates G i (x i , y i , z i ) conform to the inequality- ⁇ ⁇ A (xx i ) among all the triangular faces constituting the blood vessel digital model +B(yy i )+C(zz i ) ⁇ and form a set F. Calculate the average value of the barycentric coordinates of all triangles in F to obtain a point O 0 ;
  • Step 204 Calculate the linear distance between the center of gravity of all triangles in the set F and the point O 0 and then calculate the average value R 0.
  • the average value R 0 is the approximate radius of the blood vessel digital model at the selected tumor position.
  • Step 300 Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and constructed by an iterative triangle refinement method Smooth and regular tumor grid model;
  • step 300 the method for constructing a tumor grid model specifically includes:
  • Step 302 Perform collision detection between the virtual sphere and the blood vessel digital model to obtain all the triangle sets S that intersect the virtual sphere, and find the average normal vector D t of all triangle faces in the set S, where the normal vector is the growth direction of the tumor;
  • Step 303 Delete all the triangular patches in the set S from the blood vessel digital model to obtain an irregular boundary, and the set of all vertices on the boundary is S bd ;
  • Step 304 Connect each vertex on the vertex set S bd to the center of the sphere T c , and obtain the intersection set S int of the corresponding link and the virtual sphere respectively;
  • Step 305 Triangulate the vertices on the vertex set S bd and the intersection set S int to form a circle of triangle meshes, and use the vertices in the intersection set S int as the vertices where the tumor and the blood vessel intersect;
  • Step 306 Calculate the tumor sphere center position P T and the tumor highest point position P H :
  • R is equal to The relationship of r is shown in Figure 2.
  • Step 307 the highest point of intersection of the tumor and the position of the vertex in the set of P H S int are connected to form a tapered grid, composed of triangles of the grid set S 0, set S 0 of each of the triangles, Subdivision operation, a new triangle set S 1 is obtained , and then the same subdivision operation is performed on each triangle in the set S 1. This operation is performed for N rounds, and the final triangle set S N is the regular tumor mesh model .
  • Step 400 Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
  • step 400 the irregular deformation can simulate a more abundant tumor shape.
  • Specific construction methods include:
  • Step 401 Set the input grid, select the control points and set the free point set corresponding to each control point, set the fixed position constraints of the control points, and perform the rigidity-preserving grid deformation;
  • Step 402 Use the generated tumor mesh model as the input mesh S of the mesh deformation operation
  • this method divide the tumor grid into m parts, each part has One of the above strip grids, the last part has The above strip grids.
  • Fig. 3(a) is a schematic diagram of the grid between two arcs on the tumor grid
  • Fig. 3(b) is a schematic diagram of a part of the tumor grid when the tumor grid is divided into three parts. Divide the tumor mesh into m parts, randomly select q control points in each part; for each control point, select triangles within a certain range around the tumor mesh, and divide the vertices of these triangles As the free point set corresponding to this control point.
  • Step 404 Set fixed position constraint information; set the position of the control point as: the position of the current control point after moving ⁇ R along the normal direction or the reverse of the normal direction of the point; where ⁇ is a constant between greater than 0 and less than 1, R is the radius of the tumor; the user can customize ⁇ , the larger the ⁇ , the greater the degree of irregular deformation of the tumor surface.
  • Step 405 Combine the input grid information, control points and their corresponding free point set information, and fixed position constraint information to perform rigidity-preserving grid deformation.
  • the deformation process of the rigid mesh is shown in Figure 4, which specifically includes the following steps:
  • Step 1 Obtain the adjacency information of the input mesh S, and make the vertex v i and its 1-neighbor triangle patch form a unit C i , as shown in Figure 5; if the unit C i undergoes a rigid transformation, then the before and after transformation
  • Step 2 Define the rigid energy of each unit, and sum to obtain the overall rigid energy:
  • S is the input mesh
  • S′ is the deformed input mesh
  • E(S′) is the rigid energy of the entire mesh
  • n is the number of vertices in the input mesh S
  • C i is the vertex v i and its 1-neighbor triangular facet constitute a unit
  • C i ′ is the deformed unit
  • E(C′) is the rigid energy of a unit
  • N(i) is the vertex adjacent to vertex v i collection
  • p i is a vertex v i coordinates
  • p j is a vertex v j of the coordinates
  • w ij is the weight of the edge e ij weight
  • ⁇ ij and ⁇ ij are the two opposite corners of the edge e ij
  • R i is the rotation matrix before and after the transformation of the unit
  • the mesh By minimizing the rigid energy E(S'), the mesh can be deformed as rigidly as possible.
  • E(S') formula only the coordinates p i ′ and the rotation matrix R i after the vertex are deformed are unknown quantities.
  • Step 3 Determine the initial guess of the vertex coordinates after deformation; for the selected control point, the initial guess is the fixed position constraint set before.
  • the initial guess is determined by minimizing
  • 2 , where ⁇ Lp, p is the coordinate of the vertex in the initial grid input by the user, and p′ is the coordinate of the control point which has been constrained according to the above fixed position The coordinates of the vertices in the changed mesh.
  • w ij is the weight of edge e ij
  • N (i) is the set of vertices adjacent to vertex v i.
  • AX free +BX fixed Lp.
  • A is the matrix composed of columns corresponding to the free vertex subscripts in matrix L
  • X free is the coordinates of the free vertex, which is an unknown quantity
  • B is the matrix composed of columns corresponding to the fixed vertex subscripts in matrix L
  • X fixed is the fixed vertex The coordinates of, including the control points and the remaining vertices in mesh S.
  • a T AX free A T (Lp-BX fixed ), and X free can be obtained by solving the equations, which is the initial guess of the free point.
  • Step 5 Use the current optimal rotation matrix to solve the linear equations to obtain the new vertex coordinates; when R i is determined, solve the linear equations Obtain p′ that minimizes E(S′). For each p i ′, the following equation can be obtained:
  • Step 6 Iteratively execute the fourth and fifth steps until the overall rigidity energy is less than the set threshold; in the next iteration, use the newly obtained p′ as a known quantity to solve for the new R and p′, and repeat , Until the grid rigidity energy is less than the threshold specified by the user.
  • Step 500 Smoothing the connection between the tumor mesh model and the blood vessel digital model
  • step 500 the smoothing process is divided into the following two steps:
  • the first step is to smooth the grid: after the above-mentioned longitude and latitude sampling method is used to construct the tumor, it is easy to obtain the triangle surface near the bottom of the tumor grid (that is, the triangle surface where the tumor and the digital model of blood vessels are connected). In addition, select the triangle surface of the tumor hole boundary and its n-neighboring triangle surface on the vascular mesh model.
  • the digital mesh model composed of the above-mentioned triangular faces is used as the input of the first mesh smoothing operation.
  • the first step of grid smoothing operation process is shown in Figure 7, which specifically includes the following steps:
  • Step 501 Obtain the adjacency information of the digital grid model, and record the set of adjacency points of each vertex i as N(i);
  • Step 502 Calculate the weight of each neighboring point of each vertex:
  • ⁇ ij and ⁇ ij are two opposite corners of the edge (i, j).
  • Step 503 Calculate the Laplacian coordinate L(i) of each point in the digital grid model according to the adjacency information and w ij:
  • p i is the coordinate of vertex i
  • p j is the coordinate of point j adjacent to vertex i.
  • Step 504 the original coordinates p i is updated to ⁇ L (i) + p i; where ⁇ is a positive real number less than 1;
  • Step 505 Iterate the mesh smoothing step m 1 times, and then perform the second smoothing operation.
  • the second step is to smooth the mesh: select again all the triangles on the tumor and the triangles of the tumor hole boundary on the vascular mesh model and its n-neighboring triangles, and the digital grid composed of the above triangles
  • the model is used as the input of mesh smoothing, and the above mesh smoothing operation is iteratively performed m 2 times, where m 1 should be much larger than m 2 .
  • the smoothing process of the grid at the junction of the tumor grid and the blood vessel digital model is shown in Figure 8.
  • Figure 8 (b) is the tumor grid after the first step of smoothing
  • Figure 8 (c) The tumor grid after smoothing in the second step.
  • Step 600 Perform a strict boundary-preserving mesh simplification on the tumor mesh model, and obtain the result of generating the tumor in the blood vessel digital model.
  • step 600 after the tumor grid is generated, a grid simplification with strict boundary preservation is performed, so that there will be no excessive difference between the grid density of the tumor grid and the blood vessel grid.
  • the entire tumor grid is used as the input grid to perform strict boundary-preserving QEM (secondary error metric) grid simplification.
  • QEM secondary error metric
  • Step 601 Calculate the error matrix Q for all initial vertices to obtain all valid edges (v 1 , v 2 ) (valid edges refer to the edges of China Unicom);
  • Step 602 For each valid edge (v 1 , v 2 ), calculate the optimal extraction target v and the cost of extracting this edge;
  • step 602 if the edge (v 1 , v 2 ) is a boundary edge, the extraction cost is set to infinite.
  • the extraction cost of this edge should be Differentiate cost and calculate the value of v when its derivative is 0 That is to solve the equation:
  • q ij is the corresponding element in matrix Q. If the coefficient matrix is invertible, the coordinates of the optimal extraction target v 0 can be obtained by solving the above equation. If the coefficient matrix is not invertible, then let Take the midpoint of v 1 and v 2.
  • Step 603 Store all edges in a heap according to the extraction cost cost
  • Step 604 Remove the edge with the least extraction cost each time, and merge the vertices v 1 and v 2 into And update all
  • the extraction cost of the connected effective edges and the optimal extraction position are calculated to calculate the number of triangles in the tumor mesh after the least cost edge is removed.
  • Step 605 Repeat the above steps until the number of existing faces is small to set a threshold.
  • FIG. 11 is a schematic structural diagram of a system for generating a tumor in a blood vessel digital model according to an embodiment of the present application.
  • the system for generating a tumor in a blood vessel digital model in an embodiment of the present application includes a tumor position selection module, an approximate radius calculation module, a tumor grid construction module, a tumor grid deformation module, a grid smoothing processing module, and a grid simplification module.
  • Tumor position selection module used to select the tumor position on the blood vessel digital model; the specific method of tumor position selection is: click on a point on the blood vessel digital model, and use the position information of the point as the screen coordinate information; this screen coordinate information Convert it into world coordinate information, and connect the world coordinate information and the position of the virtual camera into a ray; calculate the triangle face on the digital model of the blood vessel that intersects the ray, and calculate the position T of the geometric center point of the three vertices of the triangle c , the position T c is the tumor position selected on the blood vessel digital model.
  • Approximate radius calculation module used to calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane; the approximate radius calculation method is specifically:
  • the plane is considered to be approximately perpendicular to the direction in which the blood vessel extends.
  • the average value R 0 is the approximate radius of the blood vessel digital model at the selected tumor position.
  • Tumor mesh building module used to generate a virtual sphere with the selected tumor position as the center of the sphere, collide the virtual sphere with the blood vessel digital model and delete the collision triangle, generate a cavity in a way that grows toward the center of the virtual sphere, and iteratively
  • the triangle refinement method constructs a smooth and regular tumor mesh model; the specific method for constructing the tumor mesh model is as follows:
  • R is equal to The relationship of r is shown in Figure 2.
  • Tumor grid deformation module used to edit the surface of the tumor grid model, select a certain number of control points, and construct irregular deformations on the tumor grid surface by maintaining rigid deformation; specific construction methods include:
  • Fig. 3(a) is a schematic diagram of the grid between two arcs on the tumor grid
  • Fig. 3(a) is a schematic diagram of the grid between two arcs on the tumor grid
  • 3(b) is a schematic diagram of a part of the tumor grid when the tumor grid is divided into three parts. Divide the tumor grid into m parts, randomly select q control points in each part; for each control point, select triangles within a certain range around the tumor grid, and divide the vertices of these triangles As the free point set corresponding to this control point.
  • the rigid mesh deformation process includes:
  • Step 1 Obtain the adjacency information of the input mesh S, and make the vertex v i and its 1-neighbor triangle patch form a unit C i , as shown in Figure 5; if the unit C i undergoes a rigid transformation, then the before and after transformation
  • Step 2 Define the rigid energy of each unit, and sum to obtain the overall rigid energy:
  • S is the input mesh
  • S′ is the deformed input mesh
  • E(S′) is the rigid energy of the entire mesh
  • n is the number of vertices in the input mesh S
  • C i is the vertex v i and its 1-neighbor triangular facet constitute a unit
  • C i ′ is the deformed unit
  • E(C′) is the rigid energy of a unit
  • N(i) is the vertex adjacent to vertex v i collection
  • p i is a vertex v i coordinates
  • p j is a vertex v j of the coordinates
  • w ij is the weight of the edge e ij weight
  • ⁇ ij and ⁇ ij are the two opposite corners of the edge e ij
  • R i is the rotation matrix before and after the transformation of the unit
  • the mesh By minimizing the rigid energy E(S'), the mesh can be deformed as rigidly as possible.
  • E(S') formula only the coordinates p i ′ and the rotation matrix R i after the vertex are deformed are unknown quantities.
  • Step 3 Determine the initial guess of the vertex coordinates after deformation; for the selected control point, the initial guess is the fixed position constraint set before.
  • the initial guess is determined by minimizing
  • 2 , where ⁇ Lp, p is the coordinate of the vertex in the initial grid input by the user, and p′ is the coordinate of the control point which has been constrained according to the above fixed position The coordinates of the vertices in the changed mesh.
  • w ij is the weight of edge e ij
  • N (i) is the set of vertices adjacent to vertex v i.
  • AX free +BX fixed Lp.
  • A is the matrix composed of columns corresponding to the free vertex subscripts in matrix L
  • X free is the coordinates of the free vertex, which is an unknown quantity
  • B is the matrix composed of columns corresponding to the fixed vertex subscripts in matrix L
  • X fixed is the fixed vertex The coordinates of, including the control points and the remaining vertices in mesh S.
  • a T AX free A T (Lp-BX fixed ), and X free can be obtained by solving the equations, which is the initial guess of the free point.
  • Step 5 Use the current optimal rotation matrix to solve the linear equations to obtain the new vertex coordinates; when R i is determined, solve the linear equations Obtain p′ that minimizes E(S′). For each p i ′, the following equation can be obtained:
  • Step 6 Iteratively execute the fourth and fifth steps until the overall rigidity energy is less than the set threshold; in the next iteration, use the newly obtained p′ as a known quantity to solve for the new R and p′, and repeat , Until the grid rigidity energy is less than the threshold specified by the user.
  • Grid smoothing processing module used to smooth the connection between the tumor grid model and the blood vessel digital model; the smoothing processing process is divided into the following two steps:
  • the first step is to smooth the grid: after the above-mentioned longitude and latitude sampling method is used to construct the tumor, it is easy to obtain the triangle surface near the bottom of the tumor grid (that is, the triangle surface where the tumor and the digital model of blood vessels are connected). In addition, select the triangle surface of the tumor hole boundary and its n-neighboring triangle surface on the vascular mesh model.
  • the digital mesh model composed of the above-mentioned triangular faces is used as the input of the first mesh smoothing operation.
  • the first step of grid smoothing operation includes:
  • ⁇ ij and ⁇ ij are two opposite corners of the edge (i, j).
  • p i is the coordinate of vertex i
  • p j is the coordinate of point j adjacent to vertex i.
  • the second step is to smooth the mesh: select again all the triangles on the tumor and the triangles of the tumor hole boundary on the vascular mesh model and its n-neighboring triangles, and the digital grid composed of the above triangles
  • the model is used as the input of mesh smoothing, and the above mesh smoothing operation is iteratively performed m 2 times, where m 1 should be much larger than m 2 .
  • the smoothing process of the grid at the junction of the tumor grid and the blood vessel digital model is shown in Figure 8.
  • Figure 8 (b) is the tumor grid after the first step of smoothing
  • Figure 8 (c) The tumor grid after smoothing in the second step.
  • Mesh simplification module used to simplify the tumor mesh model with strict boundary preservation, and obtain the result of tumor generation in the blood vessel digital model; after generating the tumor mesh, perform strict boundary preservation mesh simplification to make the tumor network There will not be too much difference between the grid density of the grid and the blood vessel grid.
  • the entire tumor grid is used as the input grid, and the QEM (quadratic error metric) grid simplification with strict boundary preservation includes:
  • q ij is the corresponding element in matrix Q. If the coefficient matrix is invertible, the coordinates of the optimal extraction target v 0 can be obtained by solving the above equation. If the coefficient matrix is not invertible, then let Take the midpoint of v 1 and v 2.
  • FIG. 12 is a schematic diagram of the hardware device structure of the method for generating a tumor in a blood vessel digital model provided by an embodiment of the present application.
  • the device includes one or more processors and memory. Taking a processor as an example, the device may also include: an input system and an output system.
  • the processor, the memory, the input system, and the output system may be connected by a bus or in other ways.
  • the connection by a bus is taken as an example.
  • the memory can be used to store non-transitory software programs, non-transitory computer executable programs, and modules.
  • the processor executes various functional applications and data processing of the electronic device by running non-transitory software programs, instructions, and modules stored in the memory, that is, realizing the processing methods of the foregoing method embodiments.
  • the memory may include a program storage area and a data storage area, where the program storage area can store an operating system and an application program required by at least one function; the data storage area can store data and the like.
  • the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices.
  • the memory may optionally include a memory remotely provided with respect to the processor, and these remote memories may be connected to the processing system through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input system can receive input digital or character information, and generate signal input.
  • the output system may include display devices such as a display screen.
  • the one or more modules are stored in the memory, and when executed by the one or more processors, the following operations of any of the foregoing method embodiments are performed:
  • Step a Select the tumor position on the blood vessel digital model
  • Step b Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
  • Step c Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
  • Step d Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
  • Step e smoothing the connection between the tumor mesh model and the blood vessel digital model
  • Step f Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
  • the embodiment of the present application provides a non-transitory (non-volatile) computer storage medium, the computer storage medium stores computer executable instructions, and the computer executable instructions can perform the following operations:
  • Step a Select the tumor position on the blood vessel digital model
  • Step b Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
  • Step c Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
  • Step d Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
  • Step e smoothing the connection between the tumor mesh model and the blood vessel digital model
  • Step f Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
  • the embodiment of the present application provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer To make the computer do the following:
  • Step a Select the tumor position on the blood vessel digital model
  • Step b Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
  • Step c Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
  • Step d Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
  • Step e smoothing the connection between the tumor mesh model and the blood vessel digital model
  • Step f Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
  • the method, system and electronic device for generating tumors in digital blood vessel models in the embodiments of this application design an automatic generation and optimization method of blood vessel tumor models to enrich the available case models in the field of virtual surgery and make the operation simple Efficient. Compared with the prior art, this application has the following advantages:
  • This application does not have the problem of limited source of case data, and it can be used without any learning costs.
  • the tumor can be constructed at almost any position in the digital model of normal blood vessels, with a high degree of freedom;
  • the approximate radius of any position of the blood vessel digital model can be calculated, and the tumor radius and hole radius can be set adaptively according to the radius of the blood vessel model at the selected position when generating the tumor, instead of manually setting each time;
  • the transition between the tumor and the blood vessel model is made smoother through the two-step grid smoothing, which is more in line with the morphology of the real tumor and the blood vessel connection;
  • the grid simplification with strict boundary preservation is carried out, so that there will be no excessive difference between the grid density of the tumor grid and the blood vessel grid.

Abstract

A method for generating a tumor in a digital blood vessel model, a system, and an electronic device. The method comprises: step a: selecting a tumor position on a digital blood vessel model; step b: calculating the approximate radius of the digital blood vessel model at the tumor position; step c: constructing a smooth and regular tumor grid model; step d: editing a surface of the tumor grid model, and constructing an irregular deformation on a surface of the tumor grid; step e: performing fairing on a connection portion of the tumor grid model and the digital blood vessel model; and step f: performing strict boundary-preserving grid simplification on the tumor grid model to obtain a generation result of a tumor in the digital blood vessel model. The problem in which case data sources are limited does not exist, and the present invention may be used almost without any learning costs; in addition, a tumor may be constructed at almost any position in a normal digital blood vessel model, the degree of freedom is relatively high, and operation is simple and efficient.

Description

一种在血管数字模型中生成肿瘤的方法、系统及电子设备Method, system and electronic equipment for generating tumor in blood vessel digital model 技术领域Technical field
本申请属于虚拟手术技术领域,特别涉及一种在血管数字模型中生成肿瘤的方法、系统及电子设备。This application belongs to the technical field of virtual surgery, and in particular relates to a method, system and electronic equipment for generating tumors in a blood vessel digital model.
背景技术Background technique
研究表明,手术教学训练中80%的失误是人为因素引起的,所以对于医生手术技能的训练极其重要。利用虚拟手术系统进行手术技能训练是一种新兴且高效的方式。Studies have shown that 80% of errors in surgical teaching and training are caused by human factors, so it is extremely important for doctors to train surgical skills. The use of virtual surgery system for surgical skills training is a new and efficient way.
虚拟手术系统是虚拟现实技术在医学领域的一个典型应用。虚拟手术是由医学图像数据出发,应用计算机图形学重构出虚拟人体软组织模型,模拟出虚拟的医学环境,并利用触觉交互设备与之进行交互的手术系统。医生可在虚拟手术系统上观察专家手术过程,也可重复练习。虚拟手术使得手术培训的时间大为缩短,减少了对昂贵的实验对象的需求,同时能够避免传统手术风险高,病人痛苦大,术后效果不理想等缺点。The virtual surgery system is a typical application of virtual reality technology in the medical field. Virtual surgery is a surgical system that starts from medical image data, uses computer graphics to reconstruct a virtual human soft tissue model, simulates a virtual medical environment, and uses tactile interactive devices to interact with it. The doctor can observe the expert's operation process on the virtual operation system, and can also repeat the exercise. Virtual surgery greatly shortens the time for surgical training, reduces the need for expensive experimental subjects, and can avoid the shortcomings of traditional surgery such as high risk, high patient pain, and unsatisfactory postoperative results.
虚拟手术系统目前的技术难点之一是如何得到虚拟手术系统中所需要的病例模型。在颅内动脉瘤手术模拟训练系统中,病例模型是指病变血管数字模型,目前已有的得到病变血管数字模型技术方案主要有以下三种:One of the current technical difficulties of the virtual surgery system is how to obtain the case model needed in the virtual surgery system. In the intracranial aneurysm surgery simulation training system, the case model refers to the digital model of the diseased blood vessel. At present, there are three main technical solutions for obtaining the digital model of the diseased blood vessel:
(1)三维重建(1) Three-dimensional reconstruction
该方法基于实际病例的CT/MRI/DSA等扫描图像进行血管分割,进而采用三维重建技术获得具有肿瘤病变的三维血管数字模型。然而,三维重建方法中,由于种种因素,扫描图像中往往存在着较大的噪声,血管的自动分割和识别比较困难,很难找到一种普适 的方法。所以此方法获得的血管模型往往是粗糙的,需要经过人工干预和后期处理才能用于虚拟手术。该方法获取病例模型的前提是拥有该病例的图像,由于涉及到病人隐私的问题,获取较为困难,并且需要掌握对三维重建获得的粗糙模型的后期处理方法。This method performs blood vessel segmentation based on CT/MRI/DSA scan images of actual cases, and then uses three-dimensional reconstruction technology to obtain a three-dimensional digital blood vessel model with tumor lesions. However, in the 3D reconstruction method, due to various factors, there is often a large amount of noise in the scanned image, and the automatic segmentation and recognition of blood vessels is difficult, and it is difficult to find a universal method. Therefore, the blood vessel model obtained by this method is often rough and requires manual intervention and post-processing before it can be used for virtual surgery. The prerequisite for this method to obtain the case model is to have the image of the case. Due to the issue of patient privacy, it is difficult to obtain, and it is necessary to master the post-processing method of the rough model obtained by 3D reconstruction.
(2)通过三维编辑软件编辑(2) Edit through 3D editing software
该方法建立在已经获取并且经过三维重建和后期处理的三维血管数字模型的基础之上,通过3ds Max或Maya等三维编辑软件,对三维血管数字模型进行编辑,进而获取不同类型的病变血管模型。该方法可以获得病理特征种类丰富的病例模型,然而通过三维软件进行编辑的方法,需要操作人员学习3Ds Max或Maya等三维编辑软件的软件使用,而且需要了解血管数字模型的结构,需要较大的学习成本。This method is based on the three-dimensional blood vessel digital model that has been acquired and undergoes three-dimensional reconstruction and post-processing. The three-dimensional blood vessel digital model is edited through 3ds Max or Maya and other three-dimensional editing software to obtain different types of diseased blood vessel models. This method can obtain a case model with a rich variety of pathological characteristics. However, the method of editing through 3D software requires the operator to learn the use of 3Ds Max or Maya and other 3D editing software, and also need to understand the structure of the blood vessel digital model. Learning costs.
(3)直接编辑(3) Direct editing
该方法同样建立在已经获取并且经过三维重建和后期处理的三维血管数字模型的基础之上,通过肿瘤位置选取、肿瘤孔洞切割和肿瘤网格生成等步骤,简单快速的构造出血管肿瘤病变。直接编辑的方法虽然可以快速方便的生成肿瘤病变血管数字模型,然而该方法无法适配不同半径的血管数字模型,生成的肿瘤与血管数字模型相连接处过渡不自然,与真实肿瘤有较大区别,除此之外,直接编辑的操作过程会降低血管数字模型的网格质量。This method is also based on the three-dimensional blood vessel digital model that has been acquired and undergoes three-dimensional reconstruction and post-processing. Through the steps of tumor location selection, tumor hole cutting and tumor grid generation, the vascular tumor lesions can be constructed simply and quickly. Although the direct editing method can quickly and conveniently generate digital models of tumor lesions, this method cannot adapt to digital models of blood vessels with different radii. The transition between the generated tumor and the digital model of blood vessels is unnatural, which is quite different from the real tumor. In addition, the operation process of direct editing will reduce the mesh quality of the blood vessel digital model.
发明内容Summary of the invention
本申请提供了一种在血管数字模型中生成肿瘤的方法、系统及电子设备,旨在至少在一定程度上解决现有技术中的上述技术问题之一。This application provides a method, system, and electronic device for generating tumors in a digital blood vessel model, and aims to solve one of the above-mentioned technical problems in the prior art at least to a certain extent.
为了解决上述问题,本申请提供了如下技术方案:In order to solve the above problems, this application provides the following technical solutions:
一种在血管数字模型中生成肿瘤的方法,包括以下步骤:A method for generating a tumor in a digital blood vessel model, including the following steps:
步骤a:在血管数字模型上选取肿瘤位置;Step a: Select the tumor position on the blood vessel digital model;
步骤b:基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;Step b: Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
步骤c:以选取的肿瘤位置为球心生成一个虚拟球体,将所述虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;Step c: Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
步骤d:对所述肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;Step d: Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
步骤e:对所述肿瘤网格模型与血管数字模型的连接处进行光顺处理;Step e: smoothing the connection between the tumor mesh model and the blood vessel digital model;
步骤f:对所述肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果。Step f: Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
本申请实施例采取的技术方案还包括:在所述步骤a中,所述肿瘤位置选取方式具体为:在血管数字模型上点选一点,以该点的位置信息作为屏幕坐标信息;将该屏幕坐标信息转换为世界坐标信息,并将该世界坐标信息与虚拟相机的位置连成一条射线;计算与该射线相交的血管数字模型上的三角形面片,计算该三角形三个顶点的几何中心点的位置T c,该位置T c即在血管数字模型上选取的肿瘤位置。 The technical solution adopted in the embodiment of the application further includes: in the step a, the method for selecting the tumor position is specifically: selecting a point on the blood vessel digital model, and using the position information of the point as the screen coordinate information; The coordinate information is converted into world coordinate information, and the world coordinate information and the position of the virtual camera are connected to form a ray; the triangle patch on the digital model of the blood vessel that intersects with the ray is calculated, and the geometric center points of the three vertices of the triangle are calculated Position T c , this position T c is the tumor position selected on the blood vessel digital model.
本申请实施例采取的技术方案还包括:在所述步骤b中,所述近似半径计算方法具体包括:The technical solution adopted in the embodiment of the present application further includes: in the step b, the approximate radius calculation method specifically includes:
步骤b1:以在血管数字模型上选取的肿瘤位置为中心,得到其周围半径为R内的m个三角面片,计算第1个三角面片的法向量与第2个三角面片的法向量的向量积
Figure PCTCN2020128855-appb-000001
计算第2个三角面片的法向量与第3个三角面片的法向量的向量积
Figure PCTCN2020128855-appb-000002
依此类推,可以计算得到m-1个向量积
Figure PCTCN2020128855-appb-000003
然后计算它们的均值
Figure PCTCN2020128855-appb-000004
Step b1: Take the tumor position selected on the blood vessel digital model as the center, obtain m triangle faces whose surrounding radius is R, calculate the normal vector of the first triangle face and the normal vector of the second triangle face Vector product of
Figure PCTCN2020128855-appb-000001
Calculate the vector product of the normal vector of the second triangular facet and the normal vector of the third triangular facet
Figure PCTCN2020128855-appb-000002
By analogy, m-1 vector products can be calculated
Figure PCTCN2020128855-appb-000003
Then calculate their mean
Figure PCTCN2020128855-appb-000004
步骤b2:取在血管数字模型上选取的肿瘤位置坐标所在的三角面片f 0,计算其重心的坐标G 0(x 0,y 0,z 0),通过
Figure PCTCN2020128855-appb-000005
和G 0,得到一个经过G 0且垂直于
Figure PCTCN2020128855-appb-000006
的平面的点法式方程,即:
Step b2: Take the triangle f 0 where the tumor position coordinates selected on the blood vessel digital model are located, calculate the coordinates G 0 (x 0 , y 0 , z 0 ) of its center of gravity, and pass
Figure PCTCN2020128855-appb-000005
And G 0 , we get a pass through G 0 and perpendicular to
Figure PCTCN2020128855-appb-000006
The point French equation of the plane, namely:
A(x-x 0)+B(y-y 0)+C(z-z 0)=0 A(xx 0 )+B(yy 0 )+C(zz 0 )=0
步骤b3:设定一个正实数α,在构成血管数字模型的所有三角面片中,找到所有重心坐标G i(x i,y i,z i)符合不等式-α≤A(x-x i)+B(y-y i)+C(z-z i)≤α的三角面片并构成集合F,计算F中所有三角面片重心坐标的平均值,得到一个点O 0Step b3: Set a positive real number α, and find all the barycentric coordinates G i (x i , y i , z i ) in all triangles that make up the blood vessel digital model to meet the inequality -α≤A(xx i )+B (yy i )+C(zz i )≤α and form a set F, calculate the average of the barycentric coordinates of all triangles in F, and get a point O 0 ;
步骤b4:计算集合F中所有三角面片的重心与点O 0之间的直线距离然后求平均值R 0,该平均值R 0即为血管数字模型在选取的肿瘤位置处的近似半径。 Step b4: Calculate the linear distance between the center of gravity of all triangles in the set F and the point O 0 and then calculate the average value R 0 , and the average value R 0 is the approximate radius of the blood vessel digital model at the selected tumor position.
本申请实施例采取的技术方案还包括:在所述步骤c中,所述构建光滑且规则的肿瘤网格模型具体包括:The technical solution adopted in the embodiment of the present application further includes: in the step c, the constructing a smooth and regular tumor grid model specifically includes:
步骤c1:以在血管数字模型上选取的肿瘤位置T c为球心,生成一个半径为r的虚拟球体,r=αR 0,α为0到1之间的值; Step c1: Taking the tumor position T c selected on the blood vessel digital model as the center of the sphere, a virtual sphere with a radius of r is generated, r=αR 0 , and α is a value between 0 and 1;
步骤c2:将虚拟球体与血管数字模型进行碰撞检测,得到所有与该虚拟球体相交的三角形集合S,求集合S中所有三角形面片的平均法向量D t,该法向量为肿瘤的生长方向; Step c2: Perform collision detection between the virtual sphere and the blood vessel digital model to obtain all triangle sets S that intersect the virtual sphere, and find the average normal vector D t of all triangle faces in the set S, which is the growth direction of the tumor;
步骤c3:将集合S中的所有三角形面片从血管数字模型中删除,得到一个不规则的边界,该边界上的所有顶点集合为S bdStep c3: Delete all the triangular faces in the set S from the blood vessel digital model to obtain an irregular boundary. The set of all vertices on the boundary is S bd ;
步骤c4:将顶点集合S bd上的每一个顶点与球心T c进行连线,分别求得对应连线与虚拟球体的交点集合S intStep c4: Connect each vertex on the vertex set S bd with the center of the sphere T c , and obtain the intersection set S int of the corresponding link and the virtual sphere respectively;
步骤c5:将顶点集合S bd和交点集合S int上的顶点进行三角化连接,构成一圈三角形网格,并将交点集合S int中的顶点作为肿瘤与血管相交位置的顶点; Step c5: Triangulate the vertices on the vertex set S bd and the intersection set S int to form a circle of triangle meshes, and use the vertices in the intersection set S int as the vertices where the tumor and the blood vessel intersect;
步骤c6:计算肿瘤球心位置P T和肿瘤最高点位置P HStep c6: Calculate the tumor sphere center position P T and the tumor highest point position P H :
P T=T c+(R 2-r 2)D t P T =T c +(R 2 -r 2 )D t
P H=P T+RD t P H =P T +RD t
上述公式中,R为肿瘤半径,R=μr,μ为大于1的常数,r=αR 0,R 0为血管数字模型在选取的肿瘤位置处的近似半径; In the above formula, R is the radius of the tumor, R=μr, μ is a constant greater than 1, r=αR 0 , R 0 is the approximate radius of the blood vessel digital model at the selected tumor position;
步骤c7:将交点集合S int中的顶点和肿瘤最高点位置P H进行连接,形成一个锥形的网格,组成该网格的三角形集合为S 0,对集合S 0中的每一个三角形进行细分操作,得到新的三角形集合S 1,然后对集合S 1中的每一个三角形进行同样的细分操作,该操作进行N轮,最终得到的三角形集合S N即为规则的肿瘤网格模型。 Step c7: Connect the vertices in the intersection set S int and the highest point position P H of the tumor to form a cone-shaped grid. The triangle set that composes the grid is S 0 , and each triangle in the set S 0 is performed Subdivision operation, a new triangle set S 1 is obtained , and then the same subdivision operation is performed on each triangle in the set S 1. This operation is performed for N rounds, and the final triangle set S N is the regular tumor mesh model .
本申请实施例采取的技术方案还包括:所述每一个三角形进行细分操作具体包括:对于集合中的每一个三角形,如果三个顶点中有两个顶点A和B属于交点集合S int,则取除了由顶点A和B组成的边以外的另两个边的中点X和Y相连,并取中点X和Y中的任意一个与顶点A和B中的任意一个相连,将原三角形分成3个,X和Y为新增的顶点;如果三角形的三个顶点中没有任何顶点属于顶点集合S int,则取三条边的中点X,Y,Z,并两两相连,将原三角形分割成4个三角形,X、Y和Z为新增的顶点;将新增的顶点X和Y或X、Y和Z分别移动到射线P TX和P TY或P TX、P TY和P TZ与虚拟球体的交点处,得到其最终的位置。 The technical solution adopted in the embodiment of the present application further includes: the subdivision operation of each triangle specifically includes: for each triangle in the set, if two vertices A and B of the three vertices belong to the intersection set S int , then Take the midpoints X and Y of the other two sides except the side composed of vertices A and B, and take any one of the midpoints X and Y to connect with any one of the vertices A and B, and divide the original triangle into 3, X and Y are newly added vertices; if none of the three vertices of the triangle belong to the vertex set S int , then take the midpoints X, Y, Z of the three sides and connect them in pairs to divide the original triangle Into 4 triangles, X, Y and Z are the new vertices; move the new vertices X and Y or X, Y and Z to the rays P T X and P T Y or P T X, P T Y and At the intersection of P T Z and the virtual sphere, get its final position.
本申请实施例采取的技术方案还包括:在所述步骤d中,所述在肿瘤网格表面构造出不规则的形变具体包括:The technical solution adopted in the embodiment of the present application further includes: in the step d, the constructing an irregular deformation on the surface of the tumor grid specifically includes:
步骤d1:将生成的肿瘤网格模型作为网格变形操作的输入网格S;Step d1: Use the generated tumor mesh model as the input mesh S of the mesh deformation operation;
步骤d2:将肿瘤网格分成m个部分,在每个部分中随机选取q个控制点;对每一个控制点,在肿瘤网格上选取其周围一定范围内的三角面片,将这些三角面片的顶点作为该控制点对应的自由点集;Step d2: Divide the tumor grid into m parts, randomly select q control points in each part; for each control point, select triangles within a certain range around the tumor grid, and divide these triangles The vertex of the slice is used as the free point set corresponding to the control point;
步骤d3:将控制点的位置约束信息设置为:当前控制点沿该点法向或法向的反向移动λR距离后的位置;其中λ为介于大于0小于1的常数,R为肿瘤半径;Step d3: Set the position constraint information of the control point as: the position of the current control point after moving λR along the normal direction or the normal direction of the point; where λ is a constant between greater than 0 and less than 1, and R is the radius of the tumor ;
步骤d4:结合输入网格信息、控制点及其对应的自由点集信息以及固定位置约束信息进行保刚性网格变形。Step d4: Combine input grid information, control points and their corresponding free point set information, and fixed position constraint information to perform rigidity-preserving grid deformation.
本申请实施例采取的技术方案还包括:保刚性网格变形具体包括:The technical solutions adopted in the embodiments of the present application also include: the rigidity-preserving grid deformation specifically includes:
第一步:获取输入网格S的邻接信息,令顶点v i与其1-邻域三角面片构成一个单元C iStep 1: Obtain the adjacency information of the input mesh S, and make the vertex v i and its 1-neighboring triangle patch form a unit C i ;
第二步:定义每一单元的刚性能量,求和得到整体刚性能量:Step 2: Define the rigid energy of each unit, and sum to obtain the overall rigid energy:
Figure PCTCN2020128855-appb-000007
Figure PCTCN2020128855-appb-000007
上公式中,S为输入网格,S′为变形后的输入网格;E(S′)为整个网格的刚性能量;n为输入网格S中顶点的个数,C i为顶点v i与其1-邻域三角面片构成的一个单元,C i′为变形后的该单元,E(C′)为一个单元的刚性能量,N(i)为与顶点v i相邻的顶点的集合,p i为顶点v i的坐标,p i变形后的坐标为p i′,p j为顶点v j的坐标,p j变形后的坐标为p j′,w ij为边e ij的权重,使用余切权值
Figure PCTCN2020128855-appb-000008
α ij和β ij是边e ij的两个对角;R i为单元C i变换前后的旋转矩阵;
In the above formula, S is the input mesh, S′ is the deformed input mesh; E(S′) is the rigid energy of the entire mesh; n is the number of vertices in the input mesh S, and C i is the vertex v i and its 1-neighbor triangular facet constitute a unit, C i ′ is the deformed unit, E(C′) is the rigid energy of a unit, N(i) is the vertex adjacent to vertex v i collection, p i is a vertex v i coordinates, coordinates of p i deformed p i ', p j is a vertex v j of the coordinates, the coordinates of the p j deformed p j', w ij is the weight of the edge e ij weight , Using cotangent weights
Figure PCTCN2020128855-appb-000008
α ij and β ij are the two opposite corners of the edge e ij ; R i is the rotation matrix before and after the transformation of the unit C i;
第三步:确定变形后顶点坐标的初始猜测;对于选中的控制点,其初始猜测为之前设置的固定位置约束;对于自由点,通过最小化||Lp′-δ|| 2确定初始猜测,其中δ=Lp,p是用户输入的初始网格中顶点的坐标,p′为控制点坐标已经根据上述固定位置约束改变后的网格中顶点的坐标;||Lp′-δ|| 2要实现最小,则为Lp′=Lp,,其中矩阵L定义如下: Step 3: Determine the initial guess of the vertex coordinates after deformation; for the selected control point, its initial guess is the fixed position constraint set before; for free points, determine the initial guess by minimizing ||Lp′-δ|| 2, Where δ=Lp, p is the coordinates of the vertices in the initial grid input by the user, and p′ is the coordinates of the vertices in the grid after the control point coordinates have been changed according to the above fixed position constraints; ||Lp′-δ|| 2 Realize the smallest, then Lp′=Lp, where the matrix L is defined as follows:
Figure PCTCN2020128855-appb-000009
Figure PCTCN2020128855-appb-000009
上述公式中,w ij为边e ij的权重,使用余切权值
Figure PCTCN2020128855-appb-000010
N(i)为与顶点v i相邻的顶点集合;通过进一步计算和化简,可得:A TAX free=A T(Lp-BX fixed),解该方程组即可得到X free,即为自由点的初始猜测;
In the above formula, w ij is the weight of edge e ij , and the weight of cotangent is used
Figure PCTCN2020128855-appb-000010
N(i) is the set of vertices adjacent to the vertex v i ; through further calculation and simplification, it can be obtained: A T AX free =A T (Lp-BX fixed ), and X free can be obtained by solving the equations, namely Is the initial guess of the free point;
第四步:利用变形后顶点坐标p i′,使用奇异值分解记算出所有变形单元的最优旋转矩阵; The fourth step: use the post-deformation vertex coordinates p i ′ and use the singular value decomposition to calculate the optimal rotation matrix of all deformed units;
第五步:利用当前最优旋转矩阵,解线性方程组得到新的顶点坐标;当R i确定后,通过求解线性方程组
Figure PCTCN2020128855-appb-000011
得到使E(S′)最小的p′,对于每个p i′可以得到以下方程:
Step 5: Use the current optimal rotation matrix to solve the linear equations to obtain the new vertex coordinates; when R i is determined, solve the linear equations
Figure PCTCN2020128855-appb-000011
Obtain p′ that minimizes E(S′). For each p i ′, the following equation can be obtained:
Figure PCTCN2020128855-appb-000012
Figure PCTCN2020128855-appb-000012
上述方程左侧的线性组合就是p′的离散拉普拉斯-贝尔特拉米算子,因此方程组可以写为:Lp′=b;求解该方程组即可得到p′;The linear combination on the left side of the above equation is the discrete Laplacian-Beltrami operator of p′, so the system of equations can be written as: Lp′=b; p′ can be obtained by solving the system of equations;
第六步:迭代执行第四、五步,直到整体刚性能量小于设定阈值。The sixth step: iteratively execute the fourth and fifth steps until the overall rigidity energy is less than the set threshold.
本申请实施例采取的技术方案还包括:在所述步骤e中,所述光顺处理过程包括:The technical solution adopted in the embodiment of the present application further includes: in the step e, the smoothing process includes:
步骤e1:选取血管网格模型上肿瘤孔洞边界的三角面片及其n-邻域三角面片,以上述三角面片组成的数字网格模型作为第一步网格光顺操作的输入:Step e1: Select the triangle surface of the tumor hole boundary and its n-neighboring triangle surface on the vascular mesh model, and use the digital mesh model composed of the above triangle surface as the input of the first mesh smoothing operation:
获取数字网格模型的邻接信息,记每一个顶点i的邻接点集合为N(i);Get the adjacency information of the digital grid model, and record the set of adjacency points of each vertex i as N(i);
计算每个顶点的各邻接点权值:Calculate the weight of each adjacent point of each vertex:
Figure PCTCN2020128855-appb-000013
Figure PCTCN2020128855-appb-000013
上述公式中,
Figure PCTCN2020128855-appb-000014
α ij和β ij是边(i,j)的两个对角;
In the above formula,
Figure PCTCN2020128855-appb-000014
α ij and β ij are the two opposite corners of the edge (i, j);
根据邻接信息和w ij计算数字网格模型中每个点的拉普拉斯坐标L(i): Calculate the Laplacian coordinate L(i) of each point in the digital grid model according to the adjacency information and w ij:
Figure PCTCN2020128855-appb-000015
Figure PCTCN2020128855-appb-000015
上述公式中,p i为顶点i的坐标,p j为顶点i的邻接点j的坐标; In the above formula, p i is the coordinate of vertex i, and p j is the coordinate of the adjacent point j of vertex i;
将原始坐标p i更新为λL(i)+p i;其中λ为小于1正实数; The original coordinate p i is updated to λL (i) + p i; where λ is a positive real number less than 1;
将上述网格光顺步骤迭代进行m 1次; Perform the above grid smoothing step iteratively m 1 times;
步骤e2:再次选取肿瘤上所有的三角面片以及血管网格模型上肿瘤孔洞边界的三角面片及其n-邻域三角面片,以上述三角面片组成的数字网格模型作为网格光顺的输入,将上述网格光顺操作迭代进行m 2次,其中,m 1应远大于m 2Step e2: Select again all the triangles on the tumor and the triangles of the tumor hole boundary on the vascular mesh model and its n-neighbor triangles, and use the digital mesh model composed of the above triangles as the mesh light For smooth input, perform the above mesh smoothing operation iteratively m 2 times, where m 1 should be much larger than m 2 .
本申请实施例采取的技术方案还包括:在所述步骤f中,所述对肿瘤网格模型进行严格保边界的网格简化具体包括:The technical solution adopted in the embodiment of the present application further includes: in the step f, the strict boundary-preserving mesh simplification of the tumor mesh model specifically includes:
步骤f1:对所有的初始顶点计算误差矩阵Q,得到所有有效边(v 1,v 2); Step f1: Calculate the error matrix Q for all initial vertices to obtain all valid edges (v 1 , v 2 );
步骤f2:对每一条有效边(v 1,v 2),计算最优抽取目标v以及抽取这条边的代价; Step f2: For each valid edge (v 1 , v 2 ), calculate the optimal extraction target v and the cost of extracting this edge;
步骤f3:将所有的边按照抽取代价cost的大小存入一个堆中;Step f3: Store all edges in a heap according to the extraction cost cost;
步骤f4:每次移除抽取代价最小的边,将顶点v 1,v 2合并到
Figure PCTCN2020128855-appb-000016
并且更新所有与
Figure PCTCN2020128855-appb-000017
相连的有效边的抽取代价和最佳抽取位置,计算移除代价最小边后肿瘤网格中三角面片的数量;
Step f4: Remove the edge with the least extraction cost each time, and merge the vertices v 1 and v 2 into
Figure PCTCN2020128855-appb-000016
And update all
Figure PCTCN2020128855-appb-000017
The extraction cost of the connected effective edges and the optimal extraction position, and calculate the number of triangles in the tumor mesh after the least cost edge is removed;
步骤f5:重复步骤f1至f4直到现有面的数量小设定阈值。Step f5: Repeat steps f1 to f4 until the number of existing faces is small to set a threshold.
本申请实施例采取的另一技术方案为:一种在血管数字模型中生成肿瘤的系统,包括:Another technical solution adopted in the embodiment of the present application is: a system for generating tumors in a digital blood vessel model, including:
肿瘤位置选取模块:用于在血管数字模型上选取肿瘤位置;Tumor location selection module: used to select the tumor location on the blood vessel digital model;
近似半径计算模块:用于基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;Approximate radius calculation module: used to calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
肿瘤网格构建模块:用于以选取的肿瘤位置为球心生成一个虚拟球体,将所述虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;Tumor grid building module: used to generate a virtual sphere with the selected tumor position as the center of the sphere, collide the virtual sphere with the blood vessel digital model and delete the collision triangle, generate a cavity by growing toward the center of the virtual sphere, and pass Iterative triangle refinement method builds a smooth and regular tumor mesh model;
肿瘤网格形变模块:用于对所述肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;Tumor grid deformation module: used to edit the surface of the tumor grid model, select a certain number of control points, and construct irregular deformations on the tumor grid surface by maintaining rigid deformation;
网格光顺处理模块:用于对所述肿瘤网格模型与血管数字模型的连接处进行光顺处理;Grid smoothing processing module: used for smoothing the connection between the tumor grid model and the blood vessel digital model;
网格简化模块:用于对所述肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果。Grid simplification module: used to perform grid simplification with strict boundary preserving on the tumor grid model to obtain the result of tumor generation in the blood vessel digital model.
本申请实施例采取的又一技术方案为:一种电子设备,包括:Another technical solution adopted in the embodiments of the present application is: an electronic device, including:
至少一个处理器;以及At least one processor; and
与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
所述存储器存储有可被所述一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的在血管数字模型中生成肿瘤的方法的以下操作:The memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the above-mentioned method for generating a tumor in a blood vessel digital model. The following operations:
步骤a:在血管数字模型上选取肿瘤位置;Step a: Select the tumor position on the blood vessel digital model;
步骤b:基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;Step b: Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
步骤c:以选取的肿瘤位置为球心生成一个虚拟球体,将所述虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;Step c: Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
步骤d:对所述肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;Step d: Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
步骤e:对所述肿瘤网格模型与血管数字模型的连接处进行光顺处理;Step e: smoothing the connection between the tumor mesh model and the blood vessel digital model;
步骤f:对所述肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果。Step f: Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
相对于现有技术,本申请实施例产生的有益效果在于:本申请实施例的在血管数字模型中生成肿瘤的方法、系统及电子设备通过设计了一种血管肿瘤模型的自动生成及优化方法,用以丰富虚拟手术领域可采用的病例模型,并且使操作简单高效。相对于现有技术,本申请具有以下优点:Compared with the prior art, the beneficial effects produced by the embodiments of the present application are that the method, system and electronic device for generating tumors in the digital blood vessel model of the embodiments of the present application design an automatic generation and optimization method of the vascular tumor model. It is used to enrich the available case models in the field of virtual surgery, and make the operation simple and efficient. Compared with the prior art, this application has the following advantages:
一、本申请不存在病例数据来源受限问题,且几乎不需要任何学习成本即可使用,能在正常血管数字模型中几乎任何位置构造肿瘤,有较高的自由度;1. This application does not have the problem of limited source of case data, and it can be used without any learning cost. It can construct tumors at almost any position in the digital model of normal blood vessels, and has a high degree of freedom;
二、本申请可计算得到血管数字模型任意位置的近似半径,在生成肿瘤时可根据选中位置的血管模型半径自适应的设置肿瘤半径和孔洞半径,不必每一次手动设置;2. In this application, the approximate radius of any position of the blood vessel digital model can be calculated, and the tumor radius and hole radius can be set adaptively according to the radius of the blood vessel model at the selected position when generating the tumor, instead of manually setting each time;
三、本申请在通过经纬度采样生成肿瘤网格后,在肿瘤网格上随机选取一定数量的控制点,通过保刚性变形,在肿瘤表面构造出不规则的形变,能模拟更为丰富的肿瘤形态;3. After the tumor grid is generated by sampling the latitude and longitude in this application, a certain number of control points are randomly selected on the tumor grid, and by maintaining rigid deformation, irregular deformations are constructed on the tumor surface, which can simulate more abundant tumor morphologies ;
四、本申请在生成肿瘤网格后,通过两步网格光顺使肿瘤与血管模型连接处过渡更为平滑,更符合真实肿瘤与血管连接处的形态;4. After the tumor grid is generated in this application, the transition between the tumor and the blood vessel model is made smoother through the two-step grid smoothing, which is more in line with the morphology of the real tumor and the blood vessel connection;
五、本申请在生成肿瘤网格后,进行了严格保边界的网格简化,使肿瘤网格与血管网格的网格密度之间不会有过大的差异。5. After the tumor grid is generated in this application, the grid simplification with strict boundary preservation is carried out, so that there will be no excessive difference between the grid density of the tumor grid and the blood vessel grid.
附图说明Description of the drawings
图1是本申请实施例的在血管数字模型中生成肿瘤的方法的流程图;Fig. 1 is a flowchart of a method for generating a tumor in a blood vessel digital model according to an embodiment of the present application;
图2为生成的肿瘤网格模型中R与r的关系示意图;Figure 2 is a schematic diagram of the relationship between R and r in the generated tumor grid model;
图3(a)为肿瘤网格上的两个圆弧之间的网格示意图,图3(b)为将肿瘤网格分成3部分时其中一部分的网格示意图;Figure 3(a) is a schematic diagram of the grid between two arcs on the tumor grid, and Figure 3(b) is a schematic diagram of a part of the tumor grid when the tumor grid is divided into three parts;
图4是保刚性网格变形流程图;Fig. 4 is a flow chart of grid deformation to maintain rigidity;
图5为顶点v i与其对应单元C i示意图; Figure 5 is a schematic diagram of a vertex v i and its corresponding unit C i;
图6为肿瘤网格进行保刚性变形的过程示意图;Figure 6 is a schematic diagram of the process of rigidity-preserving deformation of the tumor mesh;
图7为第一步网格光顺操作流程示意图;Figure 7 is a schematic diagram of the first step grid smoothing operation process;
图8为肿瘤网格与血管数字模型的连接处网格光顺过程示意图;Figure 8 is a schematic diagram of the smoothing process of the grid at the junction of the tumor grid and the blood vessel digital model;
图9为网格简化流程图;Figure 9 is a simplified flow chart of the grid;
图10为在血管数字模型中生成肿瘤的最终效果示意图;Figure 10 is a schematic diagram of the final effect of generating a tumor in a blood vessel digital model;
图11是本申请实施例的在血管数字模型中生成肿瘤的系统的结构示意图;FIG. 11 is a schematic structural diagram of a system for generating a tumor in a digital blood vessel model according to an embodiment of the present application;
图12是本申请实施例提供的在血管数字模型中生成肿瘤的方法的硬件设备结构示意图。FIG. 12 is a schematic diagram of the hardware device structure of the method for generating a tumor in a blood vessel digital model provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions, and advantages of this application clearer, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
请参阅图1,是本申请实施例的在血管数字模型中生成肿瘤的方法的流程图。本申请实施例的在血管数字模型中生成肿瘤的方法包括以下步骤:Please refer to FIG. 1, which is a flowchart of a method for generating a tumor in a blood vessel digital model according to an embodiment of the present application. The method for generating a tumor in a digital blood vessel model of the embodiment of the present application includes the following steps:
步骤100:在血管数字模型上选取肿瘤位置;Step 100: Select the tumor position on the blood vessel digital model;
步骤100中,肿瘤位置选取方式具体为:在血管数字模型上点选一点,以该点的位置信息作为屏幕坐标信息;将该屏幕坐标信息转换为世界坐标信息,并将该世界坐标信息与虚拟相机的位置连成一条射线;计算与该射线相交的血管数字模型上的三角形面片,计算该三角形三个顶点的几何中心点的位置T c,该位置T c即在血管数字模型上选取的肿瘤位置。 In step 100, the specific method for selecting the tumor position is: click on a point on the blood vessel digital model, and use the position information of the point as the screen coordinate information; convert the screen coordinate information into world coordinate information, and combine the world coordinate information with the virtual The position of the camera is connected to form a ray; calculate the triangular facet on the blood vessel digital model that intersects the ray, calculate the position T c of the geometric center point of the three vertices of the triangle, the position T c is selected on the blood vessel digital model Tumor location.
步骤200:基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;Step 200: Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
步骤200中,通过基于平面的法式方程的等一系列简单计算,可以求得血管数字模型在任意位置的近似半径,后续在生成肿瘤时可根据近似半径自适应的设置肿瘤半径和孔洞半径。近似半径计算方式具体包括:In step 200, through a series of simple calculations based on a plane-based French equation, the approximate radius of the blood vessel digital model at any position can be obtained, and the tumor radius and the hole radius can be adaptively set according to the approximate radius when the tumor is generated subsequently. The approximate radius calculation methods include:
步骤201:以在血管数字模型上选取的肿瘤位置为中心,得到其周围半径为R内的m个三角面片,计算第1个三角面片的法向量与第2个三角面片的法向量的向量积
Figure PCTCN2020128855-appb-000018
计算第2个三角面片的法向量与第3个三角面片的法向量的向量积
Figure PCTCN2020128855-appb-000019
依此类推,可以计算得到m-1个向量积
Figure PCTCN2020128855-appb-000020
然后计算它们的均值
Figure PCTCN2020128855-appb-000021
Step 201: Take the tumor position selected on the blood vessel digital model as the center, obtain m triangle faces whose surrounding radius is R, calculate the normal vector of the first triangle face and the normal vector of the second triangle face Vector product of
Figure PCTCN2020128855-appb-000018
Calculate the vector product of the normal vector of the second triangular facet and the normal vector of the third triangular facet
Figure PCTCN2020128855-appb-000019
By analogy, m-1 vector products can be calculated
Figure PCTCN2020128855-appb-000020
Then calculate their mean
Figure PCTCN2020128855-appb-000021
步骤202:取在血管数字模型上选取的肿瘤位置坐标所在的三角面片f 0,计算其重心的坐标G 0(x 0,y 0,z 0),通过
Figure PCTCN2020128855-appb-000022
和G 0,得到一个经过G 0且垂直于
Figure PCTCN2020128855-appb-000023
的平面的点法式方程,即:
Step 202: Take the triangle f 0 where the tumor position coordinates selected on the blood vessel digital model are located, calculate the coordinates G 0 (x 0 , y 0 , z 0 ) of its center of gravity, and pass
Figure PCTCN2020128855-appb-000022
And G 0 , we get a pass through G 0 and perpendicular to
Figure PCTCN2020128855-appb-000023
The point French equation of the plane, namely:
A(x-x 0)+B(y-y 0)+C(z-z 0)=0      (1) A(xx 0 )+B(yy 0 )+C(zz 0 )=0 (1)
将该平面看作近似垂直于血管延伸方向。The plane is considered to be approximately perpendicular to the direction in which the blood vessel extends.
步骤203:设定一个合适的正实数α,在构成血管数字模型的所有三角面片中,找到所有重心坐标G i(x i,y i,z i)符合不等式-α≤A(x-x i)+B(y-y i)+C(z-z i)≤α的三角面片并构成集合F,计算F中所有三角面片重心坐标的平均值,得到一个点O 0Step 203: Set an appropriate positive real number α, and find all the barycentric coordinates G i (x i , y i , z i ) conform to the inequality-α ≤ A (xx i ) among all the triangular faces constituting the blood vessel digital model +B(yy i )+C(zz i )≤α and form a set F. Calculate the average value of the barycentric coordinates of all triangles in F to obtain a point O 0 ;
步骤204:计算集合F中所有三角面片的重心与点O 0之间的直线距离然后求平均值R 0,该平均值R 0即为血管数字模型在选取的肿瘤位置处的近似半径。 Step 204: Calculate the linear distance between the center of gravity of all triangles in the set F and the point O 0 and then calculate the average value R 0. The average value R 0 is the approximate radius of the blood vessel digital model at the selected tumor position.
步骤300:以选取的肿瘤位置为球心生成一个虚拟球体,将虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;Step 300: Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and constructed by an iterative triangle refinement method Smooth and regular tumor grid model;
步骤300中,肿瘤网格模型构建方法具体包括:In step 300, the method for constructing a tumor grid model specifically includes:
步骤301:以在血管数字模型上选取的肿瘤位置T c为球心,生成一个半径为r的虚拟球体,r=αR 0,α为0到1之间的值; Step 301: Taking the tumor position T c selected on the blood vessel digital model as the center of the sphere, a virtual sphere with a radius r is generated, r=αR 0 , and α is a value between 0 and 1;
步骤302:将虚拟球体与血管数字模型进行碰撞检测,得到所有与该虚拟球体相交的三角形集合S,求集合S中所有三角形面片的平均法向量D t,该法向量为肿瘤的生长方向; Step 302: Perform collision detection between the virtual sphere and the blood vessel digital model to obtain all the triangle sets S that intersect the virtual sphere, and find the average normal vector D t of all triangle faces in the set S, where the normal vector is the growth direction of the tumor;
步骤303:将集合S中的所有三角形面片从血管数字模型中删除,得到一个不规则的边界,该边界上的所有顶点集合为S bdStep 303: Delete all the triangular patches in the set S from the blood vessel digital model to obtain an irregular boundary, and the set of all vertices on the boundary is S bd ;
步骤304:将顶点集合S bd上的每一个顶点与球心T c进行连线,分别求得对应连线与虚拟球体的交点集合S intStep 304: Connect each vertex on the vertex set S bd to the center of the sphere T c , and obtain the intersection set S int of the corresponding link and the virtual sphere respectively;
步骤305:将顶点集合S bd和交点集合S int上的顶点进行三角化连接,构成一圈三角形网格,并将交点集合S int中的顶点作为肿瘤与血管相交位置的顶点; Step 305: Triangulate the vertices on the vertex set S bd and the intersection set S int to form a circle of triangle meshes, and use the vertices in the intersection set S int as the vertices where the tumor and the blood vessel intersect;
步骤306:计算肿瘤球心位置P T和肿瘤最高点位置P HStep 306: Calculate the tumor sphere center position P T and the tumor highest point position P H :
P T=T c+(R 2-r 2)D t  (2) P T =T c +(R 2 -r 2 )D t (2)
P H=P T+RD t  (3) P H =P T +RD t (3)
上述公式中,R为肿瘤半径,R=μr,μ为大于1的常数,r=αR 0,R 0为血管数字模型在选取的肿瘤位置处的近似半径,生成的肿瘤网格模型中R与r的关系如图2所示。 In the above formula, R is the radius of the tumor, R=μr, μ is a constant greater than 1, r=αR 0 , R 0 is the approximate radius of the blood vessel digital model at the selected tumor position. In the generated tumor grid model, R is equal to The relationship of r is shown in Figure 2.
步骤307:将交点集合S int中的顶点和肿瘤最高点位置P H进行连接,形成一个锥形的网格,组成该网格的三角形集合为S 0,对集合S 0中的每一个三角形进行细分操作,得到新的三角形集合S 1,然后对集合S 1中的每一个三角形进行同样的细分操作,该操作进行N轮,最终得到的三角形集合S N即为规则的肿瘤网格模型。 Step 307: the highest point of intersection of the tumor and the position of the vertex in the set of P H S int are connected to form a tapered grid, composed of triangles of the grid set S 0, set S 0 of each of the triangles, Subdivision operation, a new triangle set S 1 is obtained , and then the same subdivision operation is performed on each triangle in the set S 1. This operation is performed for N rounds, and the final triangle set S N is the regular tumor mesh model .
进一步地,本申请对三角形集合S i(i∈[0,N])的细分操作具体包括: Furthermore, the present application triangle set S i (i∈ [0, N ]) operating segments comprises:
(1)对于集合中的每一个三角形,如果三个顶点中有两个顶点(假设为顶点A和B)属于交点集合S int,则取除了由顶点A和B组成的边以外的另两个边的中点(假设为X和Y)相连,并取中点X和Y中的任意一个与顶点A和B中的任意一个相连,将原三角形分成3个,X和Y为新增的顶点;如果三角形的三个顶点中没有任何顶点属于顶点集合S int,则取三条边的中点(假设为X,Y,Z),并两两相连,将原三角形分割成4个三角形,X、Y和Z为新增的顶点。 (1) For each triangle in the set, if two of the three vertices (assuming vertices A and B) belong to the intersection set S int , then take the other two except the edge composed of vertices A and B The midpoints of the sides (assuming X and Y) are connected, and any one of the midpoints X and Y is connected to any one of the vertices A and B, and the original triangle is divided into three, X and Y are the new vertices ; If none of the three vertices of the triangle belong to the set of vertices S int , then take the midpoints of the three sides (assuming X, Y, Z) and connect them in pairs to divide the original triangle into 4 triangles, X, Y and Z are the newly added vertices.
(2)将新增的顶点X和Y或X、Y和Z分别移动到射线P TX和P TY或P TX、P TY和P TZ与虚拟球体的交点处,得到其最终的位置。 (2) Move the newly added vertices X and Y or X, Y and Z to the intersection of the ray P T X and P T Y or P T X, P T Y and P T Z and the virtual sphere respectively, and obtain its final s position.
步骤400:对肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;Step 400: Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
步骤400中,不规则的形变能模拟更为丰富的肿瘤形态。具体构造方式包括:In step 400, the irregular deformation can simulate a more abundant tumor shape. Specific construction methods include:
步骤401:设置输入网格,选取控制点并设置每个控制点对应的自由点集,设置控制点的固定位置约束,进行保刚性网格变形;Step 401: Set the input grid, select the control points and set the free point set corresponding to each control point, set the fixed position constraints of the control points, and perform the rigidity-preserving grid deformation;
步骤402:将生成的肿瘤网格模型作为网格变形操作的输入网格S;Step 402: Use the generated tumor mesh model as the input mesh S of the mesh deformation operation;
步骤403:选取控制点;结合经度纬度采样构造肿瘤网格的方法,容易得到肿瘤网格上的两个相邻圆弧之间的三角面片组成的条状网格M i(i=1,2,...,n,n集合P中的顶点个数),更进一步,可以得到由多个上述条状网格M i构成的集合。按此方法,将肿瘤网格分成m个部分,每个部分有
Figure PCTCN2020128855-appb-000024
个上述的条状网格,最后一部分有
Figure PCTCN2020128855-appb-000025
个上述条状网格。如图3所示,图3(a)为肿瘤网格上的两个圆弧之间的网格示意图,图3(b)为将肿瘤网格分成3部分时其中一部分的网格示意图。将肿瘤网格分成m个部分,在每个部分中随机选取q个控制点;对每一个控制点,在肿瘤网格上选取其周围一定范围内的三角面片,将这些三角面片的顶点作为该控制点对应的自由点集。
Step 403: Select control points; combined with the method of latitude and longitude sampling to construct the tumor grid, it is easy to obtain the strip grid M i (i=1, 2, ..., n, n number of sets of vertices P), and further, it can be set by a plurality of strip-shaped grid composed of M i. According to this method, divide the tumor grid into m parts, each part has
Figure PCTCN2020128855-appb-000024
One of the above strip grids, the last part has
Figure PCTCN2020128855-appb-000025
The above strip grids. As shown in Fig. 3, Fig. 3(a) is a schematic diagram of the grid between two arcs on the tumor grid, and Fig. 3(b) is a schematic diagram of a part of the tumor grid when the tumor grid is divided into three parts. Divide the tumor mesh into m parts, randomly select q control points in each part; for each control point, select triangles within a certain range around the tumor mesh, and divide the vertices of these triangles As the free point set corresponding to this control point.
步骤404:设置固定位置约束信息;将控制点的位置设置为:当前控制点沿该点法向或法向的反向移动λR距离后的位置;其中λ为介于大于0小于1的常数,R为肿瘤半径;用户可自定义λ,λ越大,肿瘤表面不规则形变的程度越大。Step 404: Set fixed position constraint information; set the position of the control point as: the position of the current control point after moving λR along the normal direction or the reverse of the normal direction of the point; where λ is a constant between greater than 0 and less than 1, R is the radius of the tumor; the user can customize λ, the larger the λ, the greater the degree of irregular deformation of the tumor surface.
步骤405:结合输入网格信息、控制点及其对应的自由点集信息以及固定位置约束信息进行保刚性网格变形。保刚性网格变形流程如图4所示,具体包括以下步骤:Step 405: Combine the input grid information, control points and their corresponding free point set information, and fixed position constraint information to perform rigidity-preserving grid deformation. The deformation process of the rigid mesh is shown in Figure 4, which specifically includes the following steps:
第一步:获取输入网格S的邻接信息,令顶点v i与其1-邻域三角面片构成一个单元C i,如图5所示;若单元C i进行了刚性变换,则变换前后的顶点位置关系可用一个旋转矩阵表示,即满足:p i′-p j′=R i(p i-p j),
Figure PCTCN2020128855-appb-000026
其中p i为顶点v i的位置;p i变形后的位置为p i′,R i为单元C i变换前后的旋转矩阵,N(i)为与顶点v i相邻的顶点集合。 当变形不是刚性的时候,依然可以找到最佳旋转矩阵R i,使得等式p i′-p j′=R i(p i-p j)左右两边差值最小。
Step 1: Obtain the adjacency information of the input mesh S, and make the vertex v i and its 1-neighbor triangle patch form a unit C i , as shown in Figure 5; if the unit C i undergoes a rigid transformation, then the before and after transformation The position relationship of the vertices can be represented by a rotation matrix, that is, it satisfies: p i ′-p j ′=R i (p i -p j ),
Figure PCTCN2020128855-appb-000026
Wherein p i is the position of the vertex v i; p i the position modification as p i ', R i is a rotation matrix before and after conversion cell C i, N (i) is the set of vertices adjacent to vertex v i. When the deformation is not rigid, you can still find the optimum rotation matrix R i, so that the equation p i '-p j' = about R i (p i -p j) on both sides of the minimum difference.
第二步:定义每一单元的刚性能量,求和得到整体刚性能量:Step 2: Define the rigid energy of each unit, and sum to obtain the overall rigid energy:
Figure PCTCN2020128855-appb-000027
Figure PCTCN2020128855-appb-000027
上公式中,S为输入网格,S′为变形后的输入网格;E(S′)为整个网格的刚性能量;n为输入网格S中顶点的个数,C i为顶点v i与其1-邻域三角面片构成的一个单元,C i′为变形后的该单元,E(C′)为一个单元的刚性能量,N(i)为与顶点v i相邻的顶点的集合,p i为顶点v i的坐标,p i变形后的坐标为p i′,p j为顶点v j的坐标,p j变形后的坐标为p j′,w ij为边e ij的权重,使用余切权值
Figure PCTCN2020128855-appb-000028
α ij和β ij是边e ij的两个对角;R i为单元C i变换前后的旋转矩阵。
In the above formula, S is the input mesh, S′ is the deformed input mesh; E(S′) is the rigid energy of the entire mesh; n is the number of vertices in the input mesh S, and C i is the vertex v i and its 1-neighbor triangular facet constitute a unit, C i ′ is the deformed unit, E(C′) is the rigid energy of a unit, N(i) is the vertex adjacent to vertex v i collection, p i is a vertex v i coordinates, coordinates of p i deformed p i ', p j is a vertex v j of the coordinates, the coordinates of the p j deformed p j', w ij is the weight of the edge e ij weight , Using cotangent weights
Figure PCTCN2020128855-appb-000028
α ij and β ij are the two opposite corners of the edge e ij ; R i is the rotation matrix before and after the transformation of the unit C i.
通过最小化刚性能量E(S′)可以实现网格的尽可能刚性变形。在E(S′)式中,只有顶点变型后坐标p i′和旋转矩阵R i是未知量。 By minimizing the rigid energy E(S'), the mesh can be deformed as rigidly as possible. In the E(S') formula, only the coordinates p i ′ and the rotation matrix R i after the vertex are deformed are unknown quantities.
第三步:确定变形后顶点坐标的初始猜测;对于选中的控制点,其初始猜测为之前设置的固定位置约束。对于自由点,通过最小化||Lp′-δ|| 2确定初始猜测,其中δ=Lp,p是用户输入的初始网格中顶点的坐标,p′为控制点坐标已经根据上述固定位置约束改变后的网格中顶点的坐标。||Lp′-δ|| 2要实现最小,则为Lp′=Lp,,其中矩阵L定义如下: Step 3: Determine the initial guess of the vertex coordinates after deformation; for the selected control point, the initial guess is the fixed position constraint set before. For free points, the initial guess is determined by minimizing ||Lp′-δ|| 2 , where δ=Lp, p is the coordinate of the vertex in the initial grid input by the user, and p′ is the coordinate of the control point which has been constrained according to the above fixed position The coordinates of the vertices in the changed mesh. ||Lp′-δ|| 2 To achieve the minimum, then Lp′=Lp, where the matrix L is defined as follows:
Figure PCTCN2020128855-appb-000029
Figure PCTCN2020128855-appb-000029
公式(5)中,w ij为边e ij的权重,使用余切权值
Figure PCTCN2020128855-appb-000030
N(i)为与顶点v i相邻的顶点集合。
In formula (5), w ij is the weight of edge e ij , and the weight of cotangent is used
Figure PCTCN2020128855-appb-000030
N (i) is the set of vertices adjacent to vertex v i.
根据Lp′=Lp求出网格S中自由点坐标的初始猜测,等式可改写为:AX free+BX fixed=Lp。其中A为矩阵L中自由顶点下标对应的列组成的矩阵,X free为自由顶点的坐标,是未知量,B为矩阵L中固定顶点下标对应的列组成的矩阵,X fixed为固定顶点的坐标,包括控制点和网格S中的剩余顶点。 According to Lp′=Lp, the initial guess of the free point coordinates in the grid S is obtained, and the equation can be rewritten as: AX free +BX fixed =Lp. Where A is the matrix composed of columns corresponding to the free vertex subscripts in matrix L, X free is the coordinates of the free vertex, which is an unknown quantity, B is the matrix composed of columns corresponding to the fixed vertex subscripts in matrix L, and X fixed is the fixed vertex The coordinates of, including the control points and the remaining vertices in mesh S.
通过进一步计算和化简,可得:A TAX free=A T(Lp-BX fixed),解该方程组即可得到X free,即为自由点的初始猜测。 Through further calculation and simplification, it can be obtained: A T AX free =A T (Lp-BX fixed ), and X free can be obtained by solving the equations, which is the initial guess of the free point.
最后,需要迭代更新旋转矩阵R i和顶点变型后顶点坐标p i′。 Finally, iteratively updated rotation matrix R i and the vertex coordinates of the vertices modifications p i '.
第四步:利用变形后顶点坐标p i′,使用奇异值分解记算出所有变形单元的最优旋转矩阵;对于某一单元C i,记e ij=p i-p j,相应的,在变形后的单元C i′中,记e ij′=p i′-p j′,用j简化表示集合j∈N(i)。则某一单元的刚性能量E(C′)经过化简后可以写为: The fourth step: use the post-deformation vertex coordinates p i ′ and use the singular value decomposition to calculate the optimal rotation matrix of all the deformed elements; for a certain element C i , mark e ij = p i -p j , correspondingly, in the deformation after cell C i ', note e ij' = p i '-p j', represents a collection of j∈N (i) with j simplified. Then the rigid energy E(C′) of a certain unit can be written as:
Figure PCTCN2020128855-appb-000031
Figure PCTCN2020128855-appb-000031
式中不包含R i的项在寻找最优旋转矩阵的过程中可以看作常量,因此可以删去不作讨论,此时上式可以写作: The term that does not include R i in the formula can be regarded as a constant in the process of finding the optimal rotation matrix, so it can be deleted without discussion. At this time, the above formula can be written as:
Figure PCTCN2020128855-appb-000032
Figure PCTCN2020128855-appb-000032
Figure PCTCN2020128855-appb-000033
已知当R iS i为对称半正定矩阵时,Tr(R iS′)可以得到最大值,因此可以从S i的奇异值分解S i=U iΣ iV i T中推导出R i
make
Figure PCTCN2020128855-appb-000033
It is known that when R i S i is a semi-definite symmetric matrix, Tr (R i S ') can be the maximum, can be from the decomposition of singular value S i S i = U i Σ i V i T R i deduced :
R i=V iU i T  (8) R i =V i U i T (8)
按照上述方法计算出每一个单元的旋转矩阵R i Calculate the rotation matrix R i of each unit according to the above method.
第五步:利用当前最优旋转矩阵,解线性方程组得到新的顶点坐标;当R i确定后,通过求解线性方程组
Figure PCTCN2020128855-appb-000034
得到使E(S′)最小的p′,对于每个p i′可以得到以下方程:
Step 5: Use the current optimal rotation matrix to solve the linear equations to obtain the new vertex coordinates; when R i is determined, solve the linear equations
Figure PCTCN2020128855-appb-000034
Obtain p′ that minimizes E(S′). For each p i ′, the following equation can be obtained:
Figure PCTCN2020128855-appb-000035
Figure PCTCN2020128855-appb-000035
上述方程左侧的线性组合就是p′的离散拉普拉斯-贝尔特拉米算子,因此方程组可以写为:Lp′=b;求解该方程组即可得到p′。The linear combination on the left side of the above equation is the discrete Laplacian-Beltrami operator of p′, so the system of equations can be written as: Lp′=b; p′ can be obtained by solving the system of equations.
第六步:迭代执行第四、五步,直到整体刚性能量小于设定阈值;下一次迭代中,将新求得的p′作为已知量,以此求解新的R和p′,如此反复,直到网格刚性能量小于用户指定的阈值为止。Step 6: Iteratively execute the fourth and fifth steps until the overall rigidity energy is less than the set threshold; in the next iteration, use the newly obtained p′ as a known quantity to solve for the new R and p′, and repeat , Until the grid rigidity energy is less than the threshold specified by the user.
肿瘤网格进行保刚性变形的过程如图6所示,其中(a)为设置固定位置约束,(b)为网格模型变形的初始猜测,(c)为迭代更新p和R一定次数后的网格模型。需要说明的是,本申请中控制点的选取过程,除了可以通过按一定方式随机选取控制点外,还可以通过用户鼠标点选的人机交互方式选取控制点;固定位置约束过程,除了可以设置固定的偏移量λR外,可以通过记录用户控制鼠标移动的距离来设置偏移量。The process of the tumor mesh for rigidity-preserving deformation is shown in Figure 6, where (a) is the fixed position constraint, (b) is the initial guess of the mesh model deformation, and (c) is the iterative update of p and R for a certain number of times. Grid model. It should be noted that in the process of selecting control points in this application, in addition to randomly selecting control points in a certain way, control points can also be selected through human-computer interaction with the user's mouse clicking; the fixed position constraint process can be set in addition to In addition to the fixed offset λR, the offset can be set by recording the distance the user controls the mouse to move.
步骤500:对肿瘤网格模型与血管数字模型的连接处进行光顺处理;Step 500: Smoothing the connection between the tumor mesh model and the blood vessel digital model;
步骤500中,光顺处理过程分为以下两步:In step 500, the smoothing process is divided into the following two steps:
第一步网格光顺:经过上述的经度纬度采样方法构造肿瘤后,容易得到肿瘤网格上靠近底部的三角面片(即肿瘤与血管数字模型连接处的三角面片)。此外,再选取血管网格模型上肿瘤孔洞边界的三角面片及其n-邻域三角面片。以上述三角面片组成的数字网格模型作为第一步网格光顺操作的输入。The first step is to smooth the grid: after the above-mentioned longitude and latitude sampling method is used to construct the tumor, it is easy to obtain the triangle surface near the bottom of the tumor grid (that is, the triangle surface where the tumor and the digital model of blood vessels are connected). In addition, select the triangle surface of the tumor hole boundary and its n-neighboring triangle surface on the vascular mesh model. The digital mesh model composed of the above-mentioned triangular faces is used as the input of the first mesh smoothing operation.
第一步网格光顺操作流程如图7所示,具体包括以下步骤:The first step of grid smoothing operation process is shown in Figure 7, which specifically includes the following steps:
步骤501:获取数字网格模型的邻接信息,记每一个顶点i的邻接点集合为N(i);Step 501: Obtain the adjacency information of the digital grid model, and record the set of adjacency points of each vertex i as N(i);
步骤502:计算每个顶点的各邻接点权值:Step 502: Calculate the weight of each neighboring point of each vertex:
Figure PCTCN2020128855-appb-000036
Figure PCTCN2020128855-appb-000036
公式(10)中,
Figure PCTCN2020128855-appb-000037
α ij和β ij是边(i,j)的两个对角。
In formula (10),
Figure PCTCN2020128855-appb-000037
α ij and β ij are two opposite corners of the edge (i, j).
步骤503:根据邻接信息和w ij计算数字网格模型中每个点的拉普拉斯坐标L(i): Step 503: Calculate the Laplacian coordinate L(i) of each point in the digital grid model according to the adjacency information and w ij:
Figure PCTCN2020128855-appb-000038
Figure PCTCN2020128855-appb-000038
公式(11)中,p i为顶点i的坐标,p j为顶点i的邻接点j的坐标。 In formula (11), p i is the coordinate of vertex i, and p j is the coordinate of point j adjacent to vertex i.
步骤504:将原始坐标p i更新为λL(i)+p i;其中λ为小于1正实数; Step 504: the original coordinates p i is updated to λL (i) + p i; where λ is a positive real number less than 1;
步骤505:将上述网格光顺步骤迭代进行m 1次,然后进行第二步光顺操作。 Step 505: Iterate the mesh smoothing step m 1 times, and then perform the second smoothing operation.
第二步网格光顺:再次选取肿瘤上所有的三角面片以及血管网格模型上肿瘤孔洞边界的三角面片及其n-邻域三角面片,以上述三角面片组成的数字网格模型作为网格光顺的输入,将上述网格光顺操作迭代进行m 2次,其中,m 1应远大于m 2。肿瘤网格与血管数字模型的连接处网格光顺过程如图8所示,图8(a)原始肿瘤网格,图8(b)为第一步光顺后的肿瘤网格,图8(c)第二步光顺后的肿瘤网格。 The second step is to smooth the mesh: select again all the triangles on the tumor and the triangles of the tumor hole boundary on the vascular mesh model and its n-neighboring triangles, and the digital grid composed of the above triangles The model is used as the input of mesh smoothing, and the above mesh smoothing operation is iteratively performed m 2 times, where m 1 should be much larger than m 2 . The smoothing process of the grid at the junction of the tumor grid and the blood vessel digital model is shown in Figure 8. Figure 8 (a) the original tumor grid, Figure 8 (b) is the tumor grid after the first step of smoothing, Figure 8 (c) The tumor grid after smoothing in the second step.
步骤600:对肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果。Step 600: Perform a strict boundary-preserving mesh simplification on the tumor mesh model, and obtain the result of generating the tumor in the blood vessel digital model.
步骤600中,生成肿瘤网格后,进行严格保边界的网格简化,使肿瘤网格与血管网格的网格密度之间不会有过大的差异。将整个肿瘤网格作为输入网格,进行严格保边界的QEM(二次误差度量)网格简化,流程如图9所示,具体包括以下步骤:In step 600, after the tumor grid is generated, a grid simplification with strict boundary preservation is performed, so that there will be no excessive difference between the grid density of the tumor grid and the blood vessel grid. The entire tumor grid is used as the input grid to perform strict boundary-preserving QEM (secondary error metric) grid simplification. The process is shown in Figure 9, which specifically includes the following steps:
步骤601:对所有的初始顶点计算误差矩阵Q,得到所有有效边(v 1,v 2)(有效边是指联通的边); Step 601: Calculate the error matrix Q for all initial vertices to obtain all valid edges (v 1 , v 2 ) (valid edges refer to the edges of China Unicom);
步骤601中,具体的,需要计算与一个顶点相邻的所有平面的平面方程ax+by+cz+d=0且a 2+b 2+c 2=1,保存参数a,b,c,d,构造向量p=(a,b,c,d) T,计算每个面的二次基本误差矩阵K pIn step 601, specifically, it is necessary to calculate the plane equations ax+by+cz+d=0 and a 2 + b 2 + c 2 =1 of all planes adjacent to a vertex, and save the parameters a, b, c, d , Construct a vector p = (a, b, c, d) T , calculate the quadratic basic error matrix K p of each face:
Figure PCTCN2020128855-appb-000039
Figure PCTCN2020128855-appb-000039
将一个顶点的所有K p求和即构成该点的误差矩阵Q。 Summing all K p of a vertex constitutes the error matrix Q of that point.
步骤602:对每一条有效边(v 1,v 2),计算最优抽取目标v以及抽取这条边的代价; Step 602: For each valid edge (v 1 , v 2 ), calculate the optimal extraction target v and the cost of extracting this edge;
步骤602中,如果边(v 1,v 2)为边界边,则将其抽取代价设为无限大。对于非边界有效边(v 1,v 2),假设其收缩至一点v,记
Figure PCTCN2020128855-appb-000040
其中Q 1和Q 2分别是v 1和v 2的误差矩阵,则该边的抽取代价应为
Figure PCTCN2020128855-appb-000041
对cost求导,并计算其导数为0时v的取值
Figure PCTCN2020128855-appb-000042
即解方程:
In step 602, if the edge (v 1 , v 2 ) is a boundary edge, the extraction cost is set to infinite. For the non-boundary effective edges (v 1 , v 2 ), suppose it shrinks to a point v, and mark
Figure PCTCN2020128855-appb-000040
Where Q 1 and Q 2 are the error matrices of v 1 and v 2 , respectively, and the extraction cost of this edge should be
Figure PCTCN2020128855-appb-000041
Differentiate cost and calculate the value of v when its derivative is 0
Figure PCTCN2020128855-appb-000042
That is to solve the equation:
Figure PCTCN2020128855-appb-000043
Figure PCTCN2020128855-appb-000043
公式(13)中,q ij为矩阵Q中的对应元素。如果系数矩阵可逆,那么通过求解上述方程就可以得到最优抽取目标v 0的坐标,如果系数矩阵不可逆,则令
Figure PCTCN2020128855-appb-000044
取v 1和v 2的中点。
In formula (13), q ij is the corresponding element in matrix Q. If the coefficient matrix is invertible, the coordinates of the optimal extraction target v 0 can be obtained by solving the above equation. If the coefficient matrix is not invertible, then let
Figure PCTCN2020128855-appb-000044
Take the midpoint of v 1 and v 2.
步骤603:将所有的边按照抽取代价cost的大小存入一个堆中;Step 603: Store all edges in a heap according to the extraction cost cost;
步骤604:每次移除抽取代价最小的边,将顶点v 1,v 2合并到
Figure PCTCN2020128855-appb-000045
并且更新所有与
Figure PCTCN2020128855-appb-000046
相连的有效边的抽取代价和最佳抽取位置,计算移除代价最小边后肿瘤网格中三角面片的数量。
Step 604: Remove the edge with the least extraction cost each time, and merge the vertices v 1 and v 2 into
Figure PCTCN2020128855-appb-000045
And update all
Figure PCTCN2020128855-appb-000046
The extraction cost of the connected effective edges and the optimal extraction position are calculated to calculate the number of triangles in the tumor mesh after the least cost edge is removed.
步骤605:重复上述步骤直到现有面的数量小设定阈值。Step 605: Repeat the above steps until the number of existing faces is small to set a threshold.
经过上述所有步骤后,在血管数字模型中生成肿瘤的最终效果如图10所示。After all the above steps, the final effect of generating a tumor in the blood vessel digital model is shown in Figure 10.
请参阅图11,是本申请实施例的在血管数字模型中生成肿瘤的系统的结构示意图。本申请实施例的在血管数字模型中生成肿瘤的系统包括肿瘤位置选取模块、近似半径计算模块、肿瘤网格构建模块、肿瘤网格形变模块、网格光顺处理模块和网格简化模块。Please refer to FIG. 11, which is a schematic structural diagram of a system for generating a tumor in a blood vessel digital model according to an embodiment of the present application. The system for generating a tumor in a blood vessel digital model in an embodiment of the present application includes a tumor position selection module, an approximate radius calculation module, a tumor grid construction module, a tumor grid deformation module, a grid smoothing processing module, and a grid simplification module.
肿瘤位置选取模块:用于在血管数字模型上选取肿瘤位置;其中,肿瘤位置选取方式具体为:在血管数字模型上点选一点,以该点的位置信息作为屏幕坐标信息;将该屏幕坐标信息转换为世界坐标信息,并将该世界坐标信息与虚拟相机的位置连成一条射线;计算与该射线相交的血管数字模型上的三角形面片,计算该三角形三个顶点的几何中心点的位置T c,该位置T c即在血管数字模型上选取的肿瘤位置。 Tumor position selection module: used to select the tumor position on the blood vessel digital model; the specific method of tumor position selection is: click on a point on the blood vessel digital model, and use the position information of the point as the screen coordinate information; this screen coordinate information Convert it into world coordinate information, and connect the world coordinate information and the position of the virtual camera into a ray; calculate the triangle face on the digital model of the blood vessel that intersects the ray, and calculate the position T of the geometric center point of the three vertices of the triangle c , the position T c is the tumor position selected on the blood vessel digital model.
近似半径计算模块:用于基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;近似半径计算方式具体为:Approximate radius calculation module: used to calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane; the approximate radius calculation method is specifically:
1、以在血管数字模型上选取的肿瘤位置为中心,得到其周围半径为R内的m个三角面片,计算第1个三角面片的法向量与第2个三角面片的法向量的向量积
Figure PCTCN2020128855-appb-000047
计算第2个三角面片的法向量与第3个三角面片的法向量的向量积
Figure PCTCN2020128855-appb-000048
依此类推,可以计算得到m-1个向量积
Figure PCTCN2020128855-appb-000049
然后计算它们的均值
Figure PCTCN2020128855-appb-000050
1. Take the tumor position selected on the blood vessel digital model as the center, get m triangle faces whose surrounding radius is R, and calculate the normal vector of the first triangle face and the normal vector of the second triangle face. Vector product
Figure PCTCN2020128855-appb-000047
Calculate the vector product of the normal vector of the second triangular facet and the normal vector of the third triangular facet
Figure PCTCN2020128855-appb-000048
By analogy, m-1 vector products can be calculated
Figure PCTCN2020128855-appb-000049
Then calculate their mean
Figure PCTCN2020128855-appb-000050
2、取在血管数字模型上选取的肿瘤位置坐标所在的三角面片f 0,计算其重心的坐标G 0(x 0,y 0,z 0),通过
Figure PCTCN2020128855-appb-000051
和G 0,得到一个经过G 0且垂直于
Figure PCTCN2020128855-appb-000052
的平面的点法式方程,即:
2. Take the triangle f 0 where the tumor position coordinates selected on the blood vessel digital model are located, calculate the coordinates G 0 (x 0 , y 0 , z 0 ) of its center of gravity, and pass
Figure PCTCN2020128855-appb-000051
And G 0 , we get a pass through G 0 and perpendicular to
Figure PCTCN2020128855-appb-000052
The point French equation of the plane, namely:
A(x-x 0)+B(y-y 0)+C(z-z 0)=0       (1) A(xx 0 )+B(yy 0 )+C(zz 0 )=0 (1)
将该平面看作近似垂直于血管延伸方向。The plane is considered to be approximately perpendicular to the direction in which the blood vessel extends.
3、设定一个合适的正实数α,在构成血管数字模型的所有三角面片中,找到所有重心坐标G i(x i,y i,z i)符合不等式-α≤A(x-x i)+B(y-y i)+C(z-z i)≤α的三角面片并构成集合F,计算F中所有三角面片重心坐标的平均值,得到一个点O 03. Set a suitable positive real number α, and find all the barycentric coordinates G i (x i , y i , z i ) in all the triangles that constitute the blood vessel digital model to conform to the inequality -α≤A(xx i )+ B(yy i )+C(zz i )≤α triangular faces are combined to form a set F, and the average value of the barycentric coordinates of all triangular faces in F is calculated to obtain a point O 0 ;
4、计算集合F中所有三角面片的重心与点O 0之间的直线距离然后求平均值R 0,该平均值R 0即为血管数字模型在选取的肿瘤位置处的近似半径。 4. Calculate the linear distance between the center of gravity of all triangles in the set F and the point O 0 and then calculate the average value R 0. The average value R 0 is the approximate radius of the blood vessel digital model at the selected tumor position.
肿瘤网格构建模块:用于以选取的肿瘤位置为球心生成一个虚拟球体,将虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;其肿瘤网格模型构建方法具体为:Tumor mesh building module: used to generate a virtual sphere with the selected tumor position as the center of the sphere, collide the virtual sphere with the blood vessel digital model and delete the collision triangle, generate a cavity in a way that grows toward the center of the virtual sphere, and iteratively The triangle refinement method constructs a smooth and regular tumor mesh model; the specific method for constructing the tumor mesh model is as follows:
1、以在血管数字模型上选取的肿瘤位置T c为球心,生成一个半径为r的虚拟球体,r=αR 0,α为0到1之间的值; 1. Using the tumor position T c selected on the blood vessel digital model as the center of the sphere, a virtual sphere with a radius of r is generated, r=αR 0 , and α is a value between 0 and 1;
2、将虚拟球体与血管数字模型进行碰撞检测,得到所有与该虚拟球体相交的三角形集合S,求集合S中所有三角形面片的平均法向量D t,该法向量为肿瘤的生长方向; 2. Perform collision detection between the virtual sphere and the blood vessel digital model, and obtain all triangle sets S that intersect with the virtual sphere, and find the average normal vector D t of all triangle faces in the set S, which is the growth direction of the tumor;
3、将集合S中的所有三角形面片从血管数字模型中删除,得到一个不规则的边界,该边界上的所有顶点集合为S bd3. Delete all the triangular patches in the set S from the blood vessel digital model to obtain an irregular boundary. The set of all vertices on the boundary is S bd ;
4、将顶点集合S bd上的每一个顶点与球心T c进行连线,分别求得对应连线与虚拟球体的交点集合S int4. Connect each vertex on the vertex set S bd to the center of the sphere T c , and obtain the intersection set S int of the corresponding link and the virtual sphere respectively;
5、将顶点集合S bd和交点集合S int上的顶点进行三角化连接,构成一圈三角形网格,并将交点集合S int中的顶点作为肿瘤与血管相交位置的顶点; 5. Triangulate the vertices on the vertex set S bd and the intersection set S int to form a circle of triangle meshes, and use the vertices in the intersection set S int as the vertices where the tumor and the blood vessel intersect;
6、计算肿瘤球心位置P T和肿瘤最高点位置P H6. Calculate the tumor sphere center position P T and the tumor highest point position P H :
P T=T c+(R 2-r 2)D t  (2) P T =T c +(R 2 -r 2 )D t (2)
P H=P T+RD t  (3) P H =P T +RD t (3)
上述公式中,R为肿瘤半径,R=μr,μ为大于1的常数,r=αR 0,R 0为血管数字模型在选取的肿瘤位置处的近似半径,生成的肿瘤网格模型中R与r的关系如图2所示。 In the above formula, R is the radius of the tumor, R=μr, μ is a constant greater than 1, r=αR 0 , R 0 is the approximate radius of the blood vessel digital model at the selected tumor position. In the generated tumor grid model, R is equal to The relationship of r is shown in Figure 2.
7、将交点集合S int中的顶点和肿瘤最高点位置P H进行连接,形成一个锥形的网格,组成该网格的三角形集合为S 0,对集合S 0中的每一个三角形进行细分操作,得到新的三角形集合S 1,然后对集合S 1中的每一个三角形进行同样的细分操作,该操作进行N轮,最终得到的三角形集合S N即为规则的肿瘤网格模型。 7. Connect the vertices in the intersection set S int and the highest point position P H of the tumor to form a cone-shaped grid. The triangle set that composes the grid is S 0 , and each triangle in the set S 0 is refined. A new triangle set S 1 is obtained by sub-operation, and then the same subdivision operation is performed on each triangle in the set S 1. This operation is performed for N rounds, and the finally obtained triangle set S N is a regular tumor mesh model.
进一步地,本申请对三角形集合S i(i∈[0,N])的细分操作具体包括: Furthermore, the present application triangle set S i (i∈ [0, N ]) operating segments comprises:
(1)对于集合中的每一个三角形,如果三个顶点中有两个顶点(假设为顶点A和B)属于交点集合S int,则取除了由顶点A和B组成的边以外的另两个边的中点(假设为X和Y)相连,并取中点X和Y中的任意一个与顶点A和B中的任意一个相连,将原三角形分成3个,X和Y为新增的顶点;如果三角形的三个顶点中没有任何顶点属于顶点集合S int,则取三条边的中点(假设为X,Y,Z),并两两相连,将原三角形分割成4个三角形,X、Y和Z为新增的顶点。 (1) For each triangle in the set, if two of the three vertices (assuming vertices A and B) belong to the intersection set S int , then take the other two except the edge composed of vertices A and B The midpoints of the sides (assuming X and Y) are connected, and any one of the midpoints X and Y is connected to any one of the vertices A and B, and the original triangle is divided into three, X and Y are the new vertices ; If none of the three vertices of the triangle belong to the set of vertices S int , then take the midpoints of the three sides (assuming X, Y, Z) and connect them in pairs to divide the original triangle into 4 triangles, X, Y and Z are the newly added vertices.
(2)将新增的顶点X和Y或X、Y和Z分别移动到射线P TX和P TY或P TX、P TY和P TZ与虚拟球体的交点处,得到其最终的位置。 (2) Move the newly added vertices X and Y or X, Y and Z to the intersection of the ray P T X and P T Y or P T X, P T Y and P T Z and the virtual sphere respectively, and obtain its final s position.
肿瘤网格形变模块:用于对肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;具体构造方式包括:Tumor grid deformation module: used to edit the surface of the tumor grid model, select a certain number of control points, and construct irregular deformations on the tumor grid surface by maintaining rigid deformation; specific construction methods include:
1、设置输入网格,选取控制点并设置每个控制点对应的自由点集,设置控制点的固定位置约束,进行保刚性网格变形;1. Set the input grid, select the control points and set the free point set corresponding to each control point, set the fixed position constraints of the control points, and carry out the rigidity-preserving grid deformation;
2、将生成的肿瘤网格模型作为网格变形操作的输入网格S;2. Use the generated tumor mesh model as the input mesh S of the mesh deformation operation;
3、选取控制点;结合经度纬度采样构造肿瘤网格的方法,容易得到肿瘤网格上的两个相邻圆弧之间的三角面片组成的条状网格M i(i=1,2,...,n,n集合P中的顶点个数),更进一步,可以得到由多个上述条状网格M i构成的集合。按此方法,将肿瘤网格分成m个部分,每个部分有
Figure PCTCN2020128855-appb-000053
个上述的条状网格,最后一部分有
Figure PCTCN2020128855-appb-000054
个上述条状网格。如图3所示,图3(a)肿瘤网格上的两个圆弧之间的网格示意图,图3(b)为将肿瘤网格分成3部分时其中一部分的网格示意图。将肿瘤网格分成m个部分,在每个部分中随机选取q个控制点;对每一个控制点,在肿瘤网格上选取其周围一定范围内的三角面片,将这些三角面片的顶点作为该控制点对应的自由点集。
3. Select the control points; combined with the method of longitude and latitude sampling to construct the tumor grid, it is easy to obtain the strip grid M i (i=1, 2) composed of triangles between two adjacent arcs on the tumor grid. , ..., n, n number of sets of vertices P), and further, it can be set by a plurality of strip-shaped grid composed of M i. According to this method, the tumor grid is divided into m parts, each part has
Figure PCTCN2020128855-appb-000053
One of the above strip grids, the last part has
Figure PCTCN2020128855-appb-000054
The above strip grids. As shown in Fig. 3, Fig. 3(a) is a schematic diagram of the grid between two arcs on the tumor grid, and Fig. 3(b) is a schematic diagram of a part of the tumor grid when the tumor grid is divided into three parts. Divide the tumor grid into m parts, randomly select q control points in each part; for each control point, select triangles within a certain range around the tumor grid, and divide the vertices of these triangles As the free point set corresponding to this control point.
4、设置固定位置约束信息;将控制点的位置设置为:当前控制点沿该点法向或法向的反向移动λR距离后的位置;其中λ为介于大于0小于1的常数,R为肿瘤半径;用户可自定义λ,λ越大,肿瘤表面不规则形变的程度越大。4. Set the fixed position constraint information; set the position of the control point as: the position of the current control point after moving λR along the normal direction or the reverse of the normal direction of the point; where λ is a constant between greater than 0 and less than 1, R It is the radius of the tumor; the user can customize λ, the larger the λ, the greater the degree of irregular deformation of the tumor surface.
5、结合输入网格信息、控制点及其对应的自由点集信息以及固定位置约束信息进行保刚性网格变形。保刚性网格变形流程具体包括:5. Combine input grid information, control points and their corresponding free point set information, and fixed position constraint information to perform rigid grid deformation. The rigid mesh deformation process includes:
第一步:获取输入网格S的邻接信息,令顶点v i与其1-邻域三角面片构成一个单元C i,如图5所示;若单元C i进行了刚性变换,则变换前后的顶点位置关系可用一个旋转矩阵表示,即满足:p i′-p j′=R i(p i-p j)
Figure PCTCN2020128855-appb-000055
其中p i为顶点v i的位置;p i变形后的位置为p i′,R i为单元C i变换前后的旋转矩阵,N(i)为与顶点v i相邻的顶点集合。当变形不是刚性的时候,依然可以找到最佳旋转矩阵R i,使得等式p i′-p j′=R i(p i-p j)左右两边差值最小。
Step 1: Obtain the adjacency information of the input mesh S, and make the vertex v i and its 1-neighbor triangle patch form a unit C i , as shown in Figure 5; if the unit C i undergoes a rigid transformation, then the before and after transformation The positional relationship of the vertices can be represented by a rotation matrix, that is, it satisfies: p i ′-p j ′=R i (p i -p j )
Figure PCTCN2020128855-appb-000055
Wherein p i is the position of the vertex v i; p i the position modification as p i ', R i is a rotation matrix before and after conversion cell C i, N (i) is the set of vertices adjacent to vertex v i. When the deformation is not rigid, you can still find the optimum rotation matrix R i, so that the equation p i '-p j' = about R i (p i -p j) on both sides of the minimum difference.
第二步:定义每一单元的刚性能量,求和得到整体刚性能量:Step 2: Define the rigid energy of each unit, and sum to obtain the overall rigid energy:
Figure PCTCN2020128855-appb-000056
Figure PCTCN2020128855-appb-000056
上公式中,S为输入网格,S′为变形后的输入网格;E(S′)为整个网格的刚性能量;n为输入网格S中顶点的个数,C i为顶点v i与其1-邻域三角面片构成的一个单元,C i′为变形后的该单元,E(C′)为一个单元的刚性能量,N(i)为与顶点v i相邻的顶点的集合,p i为顶点v i的坐标,p i变形后的坐标为p i′,p j为顶点v j的坐标,p j变形后的坐标为p j′,w ij为边e ij的权重,使用余切权值
Figure PCTCN2020128855-appb-000057
α ij和β ij是边e ij的两个对角;R i为单元C i变换前后的旋转矩阵。
In the above formula, S is the input mesh, S′ is the deformed input mesh; E(S′) is the rigid energy of the entire mesh; n is the number of vertices in the input mesh S, and C i is the vertex v i and its 1-neighbor triangular facet constitute a unit, C i ′ is the deformed unit, E(C′) is the rigid energy of a unit, N(i) is the vertex adjacent to vertex v i collection, p i is a vertex v i coordinates, coordinates of p i deformed p i ', p j is a vertex v j of the coordinates, the coordinates of the p j deformed p j', w ij is the weight of the edge e ij weight , Using cotangent weights
Figure PCTCN2020128855-appb-000057
α ij and β ij are the two opposite corners of the edge e ij ; R i is the rotation matrix before and after the transformation of the unit C i.
通过最小化刚性能量E(S′)可以实现网格的尽可能刚性变形。在E(S′)式中,只有顶点变型后坐标p i′和旋转矩阵R i是未知量。 By minimizing the rigid energy E(S'), the mesh can be deformed as rigidly as possible. In the E(S') formula, only the coordinates p i ′ and the rotation matrix R i after the vertex are deformed are unknown quantities.
第三步:确定变形后顶点坐标的初始猜测;对于选中的控制点,其初始猜测为之前设置的固定位置约束。对于自由点,通过最小化||Lp′-δ|| 2确定初始猜测,其中δ=Lp,p是用户输入的初始网格中顶点的坐标,p′为控制点坐标已经根据上述固定位置约束改变后的网格中顶点的坐标。||Lp′-δ|| 2要实现最小,则为Lp′=Lp,,其中矩阵L定义如下: Step 3: Determine the initial guess of the vertex coordinates after deformation; for the selected control point, the initial guess is the fixed position constraint set before. For free points, the initial guess is determined by minimizing ||Lp′-δ|| 2 , where δ=Lp, p is the coordinate of the vertex in the initial grid input by the user, and p′ is the coordinate of the control point which has been constrained according to the above fixed position The coordinates of the vertices in the changed mesh. ||Lp′-δ|| 2 To achieve the minimum, then Lp′=Lp, where the matrix L is defined as follows:
Figure PCTCN2020128855-appb-000058
Figure PCTCN2020128855-appb-000058
公式(5)中,w ij为边e ij的权重,使用余切权值
Figure PCTCN2020128855-appb-000059
N(i)为与顶点v i相邻的顶点集合。
In formula (5), w ij is the weight of edge e ij , and the weight of cotangent is used
Figure PCTCN2020128855-appb-000059
N (i) is the set of vertices adjacent to vertex v i.
根据Lp′=Lp求出网格S中自由点坐标的初始猜测,等式可改写为:AX free+BX fixed=Lp。其中A为矩阵L中自由顶点下标对应的列组成的矩阵,X free为自 由顶点的坐标,是未知量,B为矩阵L中固定顶点下标对应的列组成的矩阵,X fixed为固定顶点的坐标,包括控制点和网格S中的剩余顶点。 According to Lp′=Lp, the initial guess of the free point coordinates in the grid S is obtained, and the equation can be rewritten as: AX free +BX fixed =Lp. Where A is the matrix composed of columns corresponding to the free vertex subscripts in matrix L, X free is the coordinates of the free vertex, which is an unknown quantity, B is the matrix composed of columns corresponding to the fixed vertex subscripts in matrix L, and X fixed is the fixed vertex The coordinates of, including the control points and the remaining vertices in mesh S.
通过进一步计算和化简,可得:A TAX free=A T(Lp-BX fixed),解该方程组即可得到X free,即为自由点的初始猜测。 Through further calculation and simplification, it can be obtained: A T AX free =A T (Lp-BX fixed ), and X free can be obtained by solving the equations, which is the initial guess of the free point.
最后,需要迭代更新旋转矩阵R i和顶点变型后顶点坐标p i′。 Finally, iteratively updated rotation matrix R i and the vertex coordinates of the vertices modifications p i '.
第四步:利用变形后顶点坐标p i′,使用奇异值分解记算出所有变形单元的最优旋转矩阵;对于某一单元C i,记e ij=p i-p j,相应的,在变形后的单元C i′中,记e ij′=p i′-p j′,用j简化表示集合j∈N(i)。则某一单元的刚性能量E(C′)经过化简后可以写为: The fourth step: use the post-deformation vertex coordinates p i ′ and use the singular value decomposition to calculate the optimal rotation matrix of all the deformed elements; for a certain element C i , mark e ij = p i -p j , correspondingly, in the deformation after cell C i ', note e ij' = p i '-p j', represents a collection of j∈N (i) with j simplified. Then the rigid energy E(C′) of a certain unit can be written as:
Figure PCTCN2020128855-appb-000060
Figure PCTCN2020128855-appb-000060
式中不包含R i的项在寻找最优旋转矩阵的过程中可以看作常量,因此可以删去不作讨论,此时上式可以写作: The term that does not include R i in the formula can be regarded as a constant in the process of finding the optimal rotation matrix, so it can be deleted without discussion. At this time, the above formula can be written as:
Figure PCTCN2020128855-appb-000061
Figure PCTCN2020128855-appb-000061
Figure PCTCN2020128855-appb-000062
已知当R iS i为对称半正定矩阵时,Tr(R iS′)可以得到最大值,因此可以从S i的奇异值分解S i=U iΣ iV i T中推导出R i
make
Figure PCTCN2020128855-appb-000062
It is known that when R i S i is a semi-definite symmetric matrix, Tr (R i S ') can be the maximum, can be from the decomposition of singular value S i S i = U i Σ i V i T R i deduced :
R i=V iU i T  (8) R i =V i U i T (8)
按照上述方法计算出每一个单元的旋转矩阵R i Calculate the rotation matrix R i of each unit according to the above method.
第五步:利用当前最优旋转矩阵,解线性方程组得到新的顶点坐标;当R i确定后,通过求解线性方程组
Figure PCTCN2020128855-appb-000063
得到使E(S′)最小的p′,对于每个p i′可以得到以下方程:
Step 5: Use the current optimal rotation matrix to solve the linear equations to obtain the new vertex coordinates; when R i is determined, solve the linear equations
Figure PCTCN2020128855-appb-000063
Obtain p′ that minimizes E(S′). For each p i ′, the following equation can be obtained:
Figure PCTCN2020128855-appb-000064
Figure PCTCN2020128855-appb-000064
上述方程左侧的线性组合就是p′的离散拉普拉斯-贝尔特拉米算子,因此方程组可以写为:Lp′=b;求解该方程组即可得到p′。The linear combination on the left side of the above equation is the discrete Laplacian-Beltrami operator of p′, so the system of equations can be written as: Lp′=b; p′ can be obtained by solving the system of equations.
第六步:迭代执行第四、五步,直到整体刚性能量小于设定阈值;下一次迭代中,将新求得的p′作为已知量,以此求解新的R和p′,如此反复,直到网格刚性能量小于用户指定的阈值为止。Step 6: Iteratively execute the fourth and fifth steps until the overall rigidity energy is less than the set threshold; in the next iteration, use the newly obtained p′ as a known quantity to solve for the new R and p′, and repeat , Until the grid rigidity energy is less than the threshold specified by the user.
肿瘤网格进行保刚性变形的过程如图6所示,其中(a)为设置固定位置约束,(b)为网格模型变形的初始猜测,(c)为迭代更新p和R一定次数后的网格模型。需要说明的是,本申请中控制点的选取过程,除了可以通过按一定方式随机选取控制点外,还可以通过用户鼠标点选的人机交互方式选取控制点;固定位置约束过程,除了可以设置固定的偏移量λR外,可以通过记录用户控制鼠标移动的距离来设置偏移量。The process of the tumor mesh for rigidity-preserving deformation is shown in Figure 6, where (a) is the setting of fixed position constraints, (b) is the initial guess of the deformation of the mesh model, and (c) is the iterative update of p and R for a certain number of times. Grid model. It should be noted that in the process of selecting control points in this application, in addition to randomly selecting control points in a certain way, control points can also be selected through human-computer interaction with the user's mouse click; the fixed position constraint process can be set in addition to In addition to the fixed offset λR, the offset can be set by recording the distance the user controls the mouse to move.
网格光顺处理模块:用于对肿瘤网格模型与血管数字模型的连接处进行光顺处理;光顺处理过程分为以下两步:Grid smoothing processing module: used to smooth the connection between the tumor grid model and the blood vessel digital model; the smoothing processing process is divided into the following two steps:
第一步网格光顺:经过上述的经度纬度采样方法构造肿瘤后,容易得到肿瘤网格上靠近底部的三角面片(即肿瘤与血管数字模型连接处的三角面片)。此外,再选取血管网格模型上肿瘤孔洞边界的三角面片及其n-邻域三角面片。以上述三角面片组成的数字网格模型作为第一步网格光顺操作的输入。The first step is to smooth the grid: after the above-mentioned longitude and latitude sampling method is used to construct the tumor, it is easy to obtain the triangle surface near the bottom of the tumor grid (that is, the triangle surface where the tumor and the digital model of blood vessels are connected). In addition, select the triangle surface of the tumor hole boundary and its n-neighboring triangle surface on the vascular mesh model. The digital mesh model composed of the above-mentioned triangular faces is used as the input of the first mesh smoothing operation.
第一步网格光顺操作具体包括:The first step of grid smoothing operation includes:
1、获取数字网格模型的邻接信息,记每一个顶点i的邻接点集合为N(i);1. Obtain the adjacency information of the digital grid model, and record the set of adjacency points of each vertex i as N(i);
2、计算每个顶点的各邻接点权值:2. Calculate the weight of each adjacent point of each vertex:
Figure PCTCN2020128855-appb-000065
Figure PCTCN2020128855-appb-000065
公式(10)中,
Figure PCTCN2020128855-appb-000066
α ij和β ij是边(i,j)的两个对角。
In formula (10),
Figure PCTCN2020128855-appb-000066
α ij and β ij are two opposite corners of the edge (i, j).
3、根据邻接信息和w ij计算数字网格模型中每个点的拉普拉斯坐标L(i): 3. Calculate the Laplacian coordinate L(i) of each point in the digital grid model according to the adjacency information and w ij:
Figure PCTCN2020128855-appb-000067
Figure PCTCN2020128855-appb-000067
公式(11)中,p i为顶点i的坐标,p j为顶点i的邻接点j的坐标。 In formula (11), p i is the coordinate of vertex i, and p j is the coordinate of point j adjacent to vertex i.
4、将原始坐标p i更新为λL(i)+p i;其中λ为小于1正实数; 4, the original coordinate of p i is updated to λL (i) + p i; where λ is a positive real number less than 1;
5、将上述网格光顺步骤迭代进行m 1次,然后进行第二步光顺操作。 5. Iterate the mesh smoothing step m 1 times, and then perform the second smoothing operation.
第二步网格光顺:再次选取肿瘤上所有的三角面片以及血管网格模型上肿瘤孔洞边界的三角面片及其n-邻域三角面片,以上述三角面片组成的数字网格模型作为网格光顺的输入,将上述网格光顺操作迭代进行m 2次,其中,m 1应远大于m 2。肿瘤网格与血管数字模型的连接处网格光顺过程如图8所示,图8(a)原始肿瘤网格,图8(b)为第一步光顺后的肿瘤网格,图8(c)第二步光顺后的肿瘤网格。 The second step is to smooth the mesh: select again all the triangles on the tumor and the triangles of the tumor hole boundary on the vascular mesh model and its n-neighboring triangles, and the digital grid composed of the above triangles The model is used as the input of mesh smoothing, and the above mesh smoothing operation is iteratively performed m 2 times, where m 1 should be much larger than m 2 . The smoothing process of the grid at the junction of the tumor grid and the blood vessel digital model is shown in Figure 8. Figure 8 (a) the original tumor grid, Figure 8 (b) is the tumor grid after the first step of smoothing, Figure 8 (c) The tumor grid after smoothing in the second step.
网格简化模块:用于对肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果;生成肿瘤网格后,进行严格保边界的网格简化,使肿瘤网格与血管网格的网格密度之间不会有过大的差异。将整个肿瘤网格作为输入网格,进行严格保边界的QEM(二次误差度量)网格简化具体包括:Mesh simplification module: used to simplify the tumor mesh model with strict boundary preservation, and obtain the result of tumor generation in the blood vessel digital model; after generating the tumor mesh, perform strict boundary preservation mesh simplification to make the tumor network There will not be too much difference between the grid density of the grid and the blood vessel grid. The entire tumor grid is used as the input grid, and the QEM (quadratic error metric) grid simplification with strict boundary preservation includes:
1、对所有的初始顶点计算误差矩阵Q,得到所有有效边(v 1,v 2)(有效边是指联通的边);具体的,需要计算与一个顶点相邻的所有平面的平面方程ax+by+cz+d=0且a 2+b 2+c 2=1,保存参数a,b,c,d,构造向量p=(a,b,c,d) T,计算每个面的二次基本误差矩阵K p1. Calculate the error matrix Q for all initial vertices to obtain all effective edges (v 1 , v 2 ) (effective edges refer to connected edges); specifically, it is necessary to calculate the plane equation ax of all planes adjacent to a vertex +by+cz+d=0 and a 2 +b 2 +c 2 =1, save the parameters a, b, c, d, construct the vector p=(a, b, c, d) T , calculate the Quadratic basic error matrix K p :
Figure PCTCN2020128855-appb-000068
Figure PCTCN2020128855-appb-000068
将一个顶点的所有K p求和即构成该点的误差矩阵Q。 Summing all K p of a vertex constitutes the error matrix Q of that point.
2、对每一条有效边(v 1,v 2),计算最优抽取目标v以及抽取这条边的代价;如果边(v 1,v 2)为边界边,则将其抽取代价设为无限大。对于非边界有效边(v 1,v 2),假设其收缩至一点v,记
Figure PCTCN2020128855-appb-000069
其中Q 1和Q 2分别是v 1和v 2的误差矩阵,则该边的抽取代价应为
Figure PCTCN2020128855-appb-000070
对cost求导,并计算其导数为0时v的取值
Figure PCTCN2020128855-appb-000071
即解方程:
2. For each valid edge (v 1 , v 2 ), calculate the optimal extraction target v and the cost of extracting this edge; if the edge (v 1 , v 2 ) is a boundary edge, set its extraction cost to infinite Big. For the non-boundary effective edges (v 1 , v 2 ), suppose it shrinks to a point v, and mark
Figure PCTCN2020128855-appb-000069
Where Q 1 and Q 2 are the error matrices of v 1 and v 2 , respectively, and the extraction cost of this edge should be
Figure PCTCN2020128855-appb-000070
Differentiate cost and calculate the value of v when its derivative is 0
Figure PCTCN2020128855-appb-000071
That is to solve the equation:
Figure PCTCN2020128855-appb-000072
Figure PCTCN2020128855-appb-000072
公式(13)中,q ij为矩阵Q中的对应元素。如果系数矩阵可逆,那么通过求解上述方程就可以得到最优抽取目标v 0的坐标,如果系数矩阵不可逆,则令
Figure PCTCN2020128855-appb-000073
取v 1和v 2的中点。
In formula (13), q ij is the corresponding element in matrix Q. If the coefficient matrix is invertible, the coordinates of the optimal extraction target v 0 can be obtained by solving the above equation. If the coefficient matrix is not invertible, then let
Figure PCTCN2020128855-appb-000073
Take the midpoint of v 1 and v 2.
3、将所有的边按照抽取代价cost的大小存入一个堆中;3. Store all edges in a heap according to the extraction cost cost;
4、每次移除抽取代价最小的边,将顶点v 1,v 2合并到
Figure PCTCN2020128855-appb-000074
并且更新所有与
Figure PCTCN2020128855-appb-000075
相连的有效边的抽取代价和最佳抽取位置,计算移除代价最小边后肿瘤网格中三角面片的数量。
4. Each time the edge with the least extraction cost is removed, the vertices v 1 and v 2 are merged into
Figure PCTCN2020128855-appb-000074
And update all
Figure PCTCN2020128855-appb-000075
The extraction cost of the connected effective edges and the optimal extraction position are calculated to calculate the number of triangles in the tumor mesh after the least cost edge is removed.
5、重复上述步骤直到现有面的数量小设定阈值;5. Repeat the above steps until the number of existing faces is small and set the threshold;
本申请通过实验证明可行,且效率较高,在血管数字模型上生成肿瘤病变的时间在1s内。This application is proved to be feasible through experiments, and the efficiency is high, and the time for generating tumor lesions on the blood vessel digital model is within 1s.
图12是本申请实施例提供的在血管数字模型中生成肿瘤的方法的硬件设备结构示意图。如图12所示,该设备包括一个或多个处理器以及存储器。以一个处理器为例,该设备还可以包括:输入系统和输出系统。FIG. 12 is a schematic diagram of the hardware device structure of the method for generating a tumor in a blood vessel digital model provided by an embodiment of the present application. As shown in Figure 12, the device includes one or more processors and memory. Taking a processor as an example, the device may also include: an input system and an output system.
处理器、存储器、输入系统和输出系统可以通过总线或者其他方式连接,图12中以通过总线连接为例。The processor, the memory, the input system, and the output system may be connected by a bus or in other ways. In FIG. 12, the connection by a bus is taken as an example.
存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序、非暂态计算机可执行程序以及模块。处理器通过运行存储在存储器中的非暂态软件程序、指令以及模块,从而执行电子设备的各种功能应用以及数据处理,即实现上述方法实施例的处理方法。As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs, and modules. The processor executes various functional applications and data processing of the electronic device by running non-transitory software programs, instructions, and modules stored in the memory, that is, realizing the processing methods of the foregoing method embodiments.
存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施例中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至处理系统。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory may include a program storage area and a data storage area, where the program storage area can store an operating system and an application program required by at least one function; the data storage area can store data and the like. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely provided with respect to the processor, and these remote memories may be connected to the processing system through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
输入系统可接收输入的数字或字符信息,以及产生信号输入。输出系统可包括显示屏等显示设备。The input system can receive input digital or character information, and generate signal input. The output system may include display devices such as a display screen.
所述一个或者多个模块存储在所述存储器中,当被所述一个或者多个处理器执行时,执行上述任一方法实施例的以下操作:The one or more modules are stored in the memory, and when executed by the one or more processors, the following operations of any of the foregoing method embodiments are performed:
步骤a:在血管数字模型上选取肿瘤位置;Step a: Select the tumor position on the blood vessel digital model;
步骤b:基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;Step b: Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
步骤c:以选取的肿瘤位置为球心生成一个虚拟球体,将所述虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;Step c: Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
步骤d:对所述肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;Step d: Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
步骤e:对所述肿瘤网格模型与血管数字模型的连接处进行光顺处理;Step e: smoothing the connection between the tumor mesh model and the blood vessel digital model;
步骤f:对所述肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果。Step f: Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
上述产品可执行本申请实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请实施例提供的方法。The above-mentioned products can execute the methods provided in the embodiments of the present application, and have functional modules and beneficial effects corresponding to the execution methods. For technical details that are not described in detail in this embodiment, please refer to the method provided in the embodiment of this application.
本申请实施例提供了一种非暂态(非易失性)计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行以下操作:The embodiment of the present application provides a non-transitory (non-volatile) computer storage medium, the computer storage medium stores computer executable instructions, and the computer executable instructions can perform the following operations:
步骤a:在血管数字模型上选取肿瘤位置;Step a: Select the tumor position on the blood vessel digital model;
步骤b:基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;Step b: Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
步骤c:以选取的肿瘤位置为球心生成一个虚拟球体,将所述虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;Step c: Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
步骤d:对所述肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;Step d: Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
步骤e:对所述肿瘤网格模型与血管数字模型的连接处进行光顺处理;Step e: smoothing the connection between the tumor mesh model and the blood vessel digital model;
步骤f:对所述肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果。Step f: Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
本申请实施例提供了一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行以下操作:The embodiment of the present application provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer To make the computer do the following:
步骤a:在血管数字模型上选取肿瘤位置;Step a: Select the tumor position on the blood vessel digital model;
步骤b:基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;Step b: Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
步骤c:以选取的肿瘤位置为球心生成一个虚拟球体,将所述虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;Step c: Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
步骤d:对所述肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;Step d: Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
步骤e:对所述肿瘤网格模型与血管数字模型的连接处进行光顺处理;Step e: smoothing the connection between the tumor mesh model and the blood vessel digital model;
步骤f:对所述肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果。Step f: Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
本申请实施例的在血管数字模型中生成肿瘤的方法、系统及电子设备通过设计了一种血管肿瘤模型的自动生成及优化方法,用以丰富虚拟手术领域可采用的病例模型,并且使操作简单高效。相对于现有技术,本申请具有以下优点:The method, system and electronic device for generating tumors in digital blood vessel models in the embodiments of this application design an automatic generation and optimization method of blood vessel tumor models to enrich the available case models in the field of virtual surgery and make the operation simple Efficient. Compared with the prior art, this application has the following advantages:
一、本申请不存在病例数据来源受限问题,且几乎不需要任何学习成本即可使用,1. This application does not have the problem of limited source of case data, and it can be used without any learning costs.
能在正常血管数字模型中几乎任何位置构造肿瘤,有较高的自由度;The tumor can be constructed at almost any position in the digital model of normal blood vessels, with a high degree of freedom;
二、本申请可计算得到血管数字模型任意位置的近似半径,在生成肿瘤时可根据选中位置的血管模型半径自适应的设置肿瘤半径和孔洞半径,不必每一次手动设置;2. In this application, the approximate radius of any position of the blood vessel digital model can be calculated, and the tumor radius and hole radius can be set adaptively according to the radius of the blood vessel model at the selected position when generating the tumor, instead of manually setting each time;
三、本申请在通过经纬度采样生成肿瘤网格后,在肿瘤网格上随机选取一定数量的控制点,通过保刚性变形,在肿瘤表面构造出不规则的形变,能模拟更为丰富的肿瘤形态;3. After the tumor grid is generated by sampling the latitude and longitude in this application, a certain number of control points are randomly selected on the tumor grid, and by maintaining rigid deformation, irregular deformations are constructed on the tumor surface, which can simulate more abundant tumor morphologies ;
四、本申请在生成肿瘤网格后,通过两步网格光顺使肿瘤与血管模型连接处过渡更为平滑,更符合真实肿瘤与血管连接处的形态;4. After the tumor grid is generated in this application, the transition between the tumor and the blood vessel model is made smoother through the two-step grid smoothing, which is more in line with the morphology of the real tumor and the blood vessel connection;
五、本申请在生成肿瘤网格后,进行了严格保边界的网格简化,使肿瘤网格与血管网格的网格密度之间不会有过大的差异。5. After the tumor grid is generated in this application, the grid simplification with strict boundary preservation is carried out, so that there will be no excessive difference between the grid density of the tumor grid and the blood vessel grid.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本申请中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本申请所示的这些实施例,而是要符合与本申请所公开的原理和新颖特点相一致的最宽的范围。The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use this application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined in this application can be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application will not be limited to the embodiments shown in this application, but should conform to the widest scope consistent with the principles and novel features disclosed in this application.

Claims (11)

  1. 一种在血管数字模型中生成肿瘤的方法,其特征在于,包括以下步骤:A method for generating a tumor in a digital blood vessel model, which is characterized in that it comprises the following steps:
    步骤a:在血管数字模型上选取肿瘤位置;Step a: Select the tumor position on the blood vessel digital model;
    步骤b:基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;Step b: Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
    步骤c:以选取的肿瘤位置为球心生成一个虚拟球体,将所述虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;Step c: Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
    步骤d:对所述肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;Step d: Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
    步骤e:对所述肿瘤网格模型与血管数字模型的连接处进行光顺处理;Step e: smoothing the connection between the tumor mesh model and the blood vessel digital model;
    步骤f:对所述肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果。Step f: Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
  2. 根据权利要求1所述的在血管数字模型中生成肿瘤的方法,其特征在于,在所述步骤a中,所述肿瘤位置选取方式具体为:在血管数字模型上点选一点,以该点的位置信息作为屏幕坐标信息;将该屏幕坐标信息转换为世界坐标信息,并将该世界坐标信息与虚拟相机的位置连成一条射线;计算与该射线相交的血管数字模型上的三角形面片,计算该三角形三个顶点的几何中心点的位置T c,该位置T c即在血管数字模型上选取的肿瘤位置。 The method for generating a tumor in a blood vessel digital model according to claim 1, wherein, in the step a, the method of selecting the tumor position is specifically: clicking on a point on the blood vessel digital model, and then selecting a point on the blood vessel digital model. The position information is used as the screen coordinate information; the screen coordinate information is converted into world coordinate information, and the world coordinate information is connected with the position of the virtual camera to form a ray; the triangle patch on the digital model of the blood vessel that intersects the ray is calculated, and the calculation the geometric center position of the three vertices of the triangle T c, T c, ie the position selected on the digital model of the vascular tumor site.
  3. 根据权利要求2所述的在血管数字模型中生成肿瘤的方法,其特征在于,在所述步骤b中,所述近似半径计算方法具体包括:The method for generating a tumor in a digital blood vessel model according to claim 2, wherein, in the step b, the approximate radius calculation method specifically includes:
    步骤b1:以在血管数字模型上选取的肿瘤位置为中心,得到其周围半径为R内的m个三角面片,计算第1个三角面片的法向量与第2个三角面片的法向量的向量积
    Figure PCTCN2020128855-appb-100001
    计算第2 个三角面片的法向量与第3个三角面片的法向量的向量积
    Figure PCTCN2020128855-appb-100002
    依此类推,可以计算得到m-1个向量积
    Figure PCTCN2020128855-appb-100003
    然后计算它们的均值
    Figure PCTCN2020128855-appb-100004
    Step b1: Take the tumor position selected on the blood vessel digital model as the center, obtain m triangle faces whose surrounding radius is R, calculate the normal vector of the first triangle face and the normal vector of the second triangle face Vector product of
    Figure PCTCN2020128855-appb-100001
    Calculate the vector product of the normal vector of the second triangular face and the normal vector of the third triangular face
    Figure PCTCN2020128855-appb-100002
    By analogy, m-1 vector products can be calculated
    Figure PCTCN2020128855-appb-100003
    Then calculate their mean
    Figure PCTCN2020128855-appb-100004
    步骤b2:取在血管数字模型上选取的肿瘤位置坐标所在的三角面片f 0,计算其重心的坐标G 0(x 0,y 0,z 0),通过
    Figure PCTCN2020128855-appb-100005
    和G 0,得到一个经过G 0且垂直于
    Figure PCTCN2020128855-appb-100006
    的平面的点法式方程,即:
    Step b2: Take the triangle f 0 where the tumor position coordinates selected on the blood vessel digital model are located, calculate the coordinates G 0 (x 0 , y 0 , z 0 ) of its center of gravity, and pass
    Figure PCTCN2020128855-appb-100005
    And G 0 , we get a pass through G 0 and perpendicular to
    Figure PCTCN2020128855-appb-100006
    The point French equation of the plane, namely:
    A(x-x 0)+B(y-y 0)+C(z-z 0)=0 A(xx 0 )+B(yy 0 )+C(zz 0 )=0
    步骤b3:设定一个正实数α,在构成血管数字模型的所有三角面片中,找到所有重心坐标G i(x i,y i,z i)符合不等式-α≤A(x-x i)+B(y-y i)+C(z-z i)≤α的三角面片并构成集合F,计算F中所有三角面片重心坐标的平均值,得到一个点O 0Step b3: Set a positive real number α, and find all the barycentric coordinates G i (x i , y i , z i ) in all triangles that make up the blood vessel digital model to meet the inequality -α≤A(xx i )+B (yy i )+C(zz i )≤α and form a set F, calculate the average of the barycentric coordinates of all triangles in F, and get a point O 0 ;
    步骤b4:计算集合F中所有三角面片的重心与点O 0之间的直线距离然后求平均值R 0,该平均值R 0即为血管数字模型在选取的肿瘤位置处的近似半径。 Step b4: Calculate the linear distance between the center of gravity of all triangles in the set F and the point O 0 and then calculate the average value R 0 , and the average value R 0 is the approximate radius of the blood vessel digital model at the selected tumor position.
  4. 根据权利要求3所述的在血管数字模型中生成肿瘤的方法,其特征在于,在所述步骤c中,所述构建光滑且规则的肿瘤网格模型具体包括:The method for generating a tumor in a digital blood vessel model according to claim 3, wherein, in the step c, the constructing a smooth and regular tumor grid model specifically includes:
    步骤c1:以在血管数字模型上选取的肿瘤位置T c为球心,生成一个半径为r的虚拟球体,r=αR 0,α为0到1之间的值; Step c1: Taking the tumor position T c selected on the blood vessel digital model as the center of the sphere, a virtual sphere with a radius of r is generated, r=αR 0 , and α is a value between 0 and 1;
    步骤c2:将虚拟球体与血管数字模型进行碰撞检测,得到所有与该虚拟球体相交的三角形集合S,求集合S中所有三角形面片的平均法向量D t,该法向量为肿瘤的生长方向; Step c2: Perform collision detection between the virtual sphere and the blood vessel digital model to obtain all triangle sets S that intersect the virtual sphere, and find the average normal vector D t of all triangle faces in the set S, which is the growth direction of the tumor;
    步骤c3:将集合S中的所有三角形面片从血管数字模型中删除,得到一个不规则的边界,该边界上的所有顶点集合为S bdStep c3: Delete all the triangular faces in the set S from the blood vessel digital model to obtain an irregular boundary. The set of all vertices on the boundary is S bd ;
    步骤c4:将顶点集合S bd上的每一个顶点与球心T c进行连线,分别求得对应连线与虚拟球体的交点集合S intStep c4: Connect each vertex on the vertex set S bd with the center of the sphere T c , and obtain the intersection set S int of the corresponding link and the virtual sphere respectively;
    步骤c5:将顶点集合S bd和交点集合S int上的顶点进行三角化连接,构成一圈三角形网格,并将交点集合S int中的顶点作为肿瘤与血管相交位置的顶点; Step c5: Triangulate the vertices on the vertex set S bd and the intersection set S int to form a circle of triangle meshes, and use the vertices in the intersection set S int as the vertices where the tumor and the blood vessel intersect;
    步骤c6:计算肿瘤球心位置P T和肿瘤最高点位置P HStep c6: Calculate the tumor sphere center position P T and the tumor highest point position P H :
    P T=T c+(R 2-r 2)D t P T =T c +(R 2 -r 2 )D t
    P H=P T+RD t P H =P T +RD t
    上述公式中,R为肿瘤半径,R=μr,μ为大于1的常数,r=αR 0,R 0为血管数字模型在选取的肿瘤位置处的近似半径; In the above formula, R is the radius of the tumor, R=μr, μ is a constant greater than 1, r=αR 0 , R 0 is the approximate radius of the blood vessel digital model at the selected tumor position;
    步骤c7:将交点集合S int中的顶点和肿瘤最高点位置P H进行连接,形成一个锥形的网格,组成该网格的三角形集合为S 0,对集合S 0中的每一个三角形进行细分操作,得到新的三角形集合S 1,然后对集合S 1中的每一个三角形进行同样的细分操作,该操作进行N轮,最终得到的三角形集合S N即为规则的肿瘤网格模型。 Step c7: Connect the vertices in the intersection set S int and the highest point position P H of the tumor to form a cone-shaped grid. The triangle set that composes the grid is S 0 , and each triangle in the set S 0 is performed Subdivision operation, a new triangle set S 1 is obtained , and then the same subdivision operation is performed on each triangle in the set S 1. This operation is performed for N rounds, and the final triangle set S N is the regular tumor mesh model .
  5. 根据权利要求4所述的在血管数字模型中生成肿瘤的方法,其特征在于,所述每一个三角形进行细分操作具体包括:对于集合中的每一个三角形,如果三个顶点中有两个顶点A和B属于交点集合S int,则取除了由顶点A和B组成的边以外的另两个边的中点X和Y相连,并取中点X和Y中的任意一个与顶点A和B中的任意一个相连,将原三角形分成3个,X和Y为新增的顶点;如果三角形的三个顶点中没有任何顶点属于顶点集合S int,则取三条边的中点X,Y,Z,并两两相连,将原三角形分割成4个三角形,X、Y和Z为新增的顶点;将新增的顶点X和Y或X、Y和Z分别移动到射线P TX和P TY或P TX、P TY和P TZ与虚拟球体的交点处,得到其最终的位置。 The method for generating a tumor in a blood vessel digital model according to claim 4, wherein the subdivision operation for each triangle specifically includes: for each triangle in the set, if there are two vertices in the three vertices A and B belong to the intersection set S int , then take the midpoints X and Y of the other two edges except the edge composed of vertices A and B to connect, and take any one of the midpoints X and Y and vertices A and B If any of the three vertices of the triangle are connected, divide the original triangle into three, and X and Y are the new vertices; if none of the three vertices of the triangle belong to the vertex set S int , then take the midpoints X, Y, Z of the three sides , And connect two by two, divide the original triangle into 4 triangles, X, Y and Z are the new vertices; move the new vertices X and Y or X, Y and Z to the rays P T X and P T respectively At the intersection of Y or P T X, P T Y and P T Z with the virtual sphere, the final position is obtained.
  6. 根据权利要求4所述的在血管数字模型中生成肿瘤的方法,其特征在于,在所述步骤d中,所述在肿瘤网格表面构造出不规则的形变具体包括:The method for generating a tumor in a digital blood vessel model according to claim 4, wherein in the step d, the constructing an irregular deformation on the surface of the tumor grid specifically comprises:
    步骤d1:将生成的肿瘤网格模型作为网格变形操作的输入网格S;Step d1: Use the generated tumor mesh model as the input mesh S of the mesh deformation operation;
    步骤d2:将肿瘤网格分成m个部分,在每个部分中随机选取q个控制点;对每一个控制点,在肿瘤网格上选取其周围一定范围内的三角面片,将这些三角面片的顶点作为该控制点对应的自由点集;Step d2: Divide the tumor grid into m parts, randomly select q control points in each part; for each control point, select triangles within a certain range around the tumor grid, and divide these triangles The vertex of the slice is used as the free point set corresponding to the control point;
    步骤d3:将控制点的位置约束信息设置为:当前控制点沿该点法向或法向的反向移动λR距离后的位置;其中λ为介于大于0小于1的常数,R为肿瘤半径;Step d3: Set the position constraint information of the control point as: the position of the current control point after moving λR along the normal direction or the normal direction of the point; where λ is a constant between greater than 0 and less than 1, and R is the radius of the tumor ;
    步骤d4:结合输入网格信息、控制点及其对应的自由点集信息以及固定位置约束信息进行保刚性网格变形。Step d4: Combine input grid information, control points and their corresponding free point set information, and fixed position constraint information to perform rigidity-preserving grid deformation.
  7. 根据权利要求6所述的在血管数字模型中生成肿瘤的方法,其特征在于,保刚性网格变形具体包括:The method for generating a tumor in a digital blood vessel model according to claim 6, wherein the rigidity-preserving mesh deformation specifically includes:
    第一步:获取输入网格S的邻接信息,令顶点v i与其1-邻域三角面片构成一个单元C iStep 1: Obtain the adjacency information of the input mesh S, and make the vertex v i and its 1-neighboring triangle patch form a unit C i ;
    第二步:定义每一单元的刚性能量,求和得到整体刚性能量:Step 2: Define the rigid energy of each unit, and sum to obtain the overall rigid energy:
    Figure PCTCN2020128855-appb-100007
    Figure PCTCN2020128855-appb-100007
    上公式中,S为输入网格,S′为变形后的输入网格;E(S′)为整个网格的刚性能量;n为输入网格S中顶点的个数,C i为顶点v i与其1-邻域三角面片构成的一个单元,C i′为变形后的该单元,E(C′)为一个单元的刚性能量,N(i)为与顶点v i相邻的顶点的集合,p i为顶点v i的坐标,p i变形后的坐标为p i′,p j为顶点v j的坐标,p j变形后的坐标为p j′,w ij为边e ij的权重,使用余切权值
    Figure PCTCN2020128855-appb-100008
    α ij和β ij是边e ij的两个对角;R i为单元C i变换前后的旋转矩阵;
    In the above formula, S is the input mesh, S′ is the deformed input mesh; E(S′) is the rigid energy of the entire mesh; n is the number of vertices in the input mesh S, and C i is the vertex v i and its 1-neighbor triangular facet constitute a unit, C i ′ is the deformed unit, E(C′) is the rigid energy of a unit, N(i) is the vertex adjacent to vertex v i collection, p i is a vertex v i coordinates, coordinates of p i deformed p i ', p j is a vertex v j of the coordinates, the coordinates of the p j deformed p j', w ij is the weight of the edge e ij weight , Using cotangent weights
    Figure PCTCN2020128855-appb-100008
    α ij and β ij are the two opposite corners of the edge e ij ; R i is the rotation matrix before and after the transformation of the unit C i;
    第三步:确定变形后顶点坐标的初始猜测;对于选中的控制点,其初始猜测为之前设置的固定位置约束;对于自由点,通过最小化||Lp′-δ|| 2确定初始猜测,其中δ=Lp,p是用户输入的初始网格中顶点的坐标,p′为控制点坐标已经根据上述固定位置约束改变后的网格中顶点的坐标;||Lp′-δ|| 2要实现最小,则为Lp′=Lp,,其中矩阵L定义如下: Step 3: Determine the initial guess of the vertex coordinates after deformation; for the selected control point, its initial guess is the fixed position constraint set before; for free points, determine the initial guess by minimizing ||Lp′-δ|| 2, Where δ=Lp, p is the coordinates of the vertices in the initial grid input by the user, and p′ is the coordinates of the vertices in the grid after the control point coordinates have been changed according to the above fixed position constraints; ||Lp′-δ|| 2 Realize the smallest, then Lp′=Lp, where the matrix L is defined as follows:
    Figure PCTCN2020128855-appb-100009
    Figure PCTCN2020128855-appb-100009
    上述公式中,w ij为边e ij的权重,使用余切权值
    Figure PCTCN2020128855-appb-100010
    N(i)为与顶点v i相邻的顶点集合;通过进一步计算和化简,可得:A TAX free=A T(Lp-BX fixed),解该方程组即可得到X free,即为自由点的初始猜测;
    In the above formula, w ij is the weight of edge e ij , and the weight of cotangent is used
    Figure PCTCN2020128855-appb-100010
    N(i) is the set of vertices adjacent to the vertex v i ; through further calculation and simplification, it can be obtained: A T AX free =A T (Lp-BX fixed ), and X free can be obtained by solving the equations, namely Is the initial guess of the free point;
    第四步:利用变形后顶点坐标p i′,使用奇异值分解记算出所有变形单元的最优旋转矩阵; The fourth step: use the post-deformation vertex coordinates p i ′ and use the singular value decomposition to calculate the optimal rotation matrix of all deformed units;
    第五步:利用当前最优旋转矩阵,解线性方程组得到新的顶点坐标;当R i确定后,通过求解线性方程组
    Figure PCTCN2020128855-appb-100011
    得到使E(S′)最小的p′,对于每个p i′可以得到以下方程:
    Step 5: Use the current optimal rotation matrix to solve the linear equations to obtain the new vertex coordinates; when R i is determined, solve the linear equations
    Figure PCTCN2020128855-appb-100011
    Obtain p′ that minimizes E(S′). For each p i ′, the following equation can be obtained:
    Figure PCTCN2020128855-appb-100012
    Figure PCTCN2020128855-appb-100012
    上述方程左侧的线性组合就是p′的离散拉普拉斯-贝尔特拉米算子,因此方程组可以写为:Lp′=b;求解该方程组即可得到p′;The linear combination on the left side of the above equation is the discrete Laplacian-Beltrami operator of p′, so the system of equations can be written as: Lp′=b; p′ can be obtained by solving the system of equations;
    第六步:迭代执行第四、五步,直到整体刚性能量小于设定阈值。The sixth step: iteratively execute the fourth and fifth steps until the overall rigidity energy is less than the set threshold.
  8. 根据权利要求6所述的在血管数字模型中生成肿瘤的方法,其特征在于,在所述步骤e中,所述光顺处理过程包括:The method for generating a tumor in a digital blood vessel model according to claim 6, wherein, in the step e, the smoothing process includes:
    步骤e1:选取血管网格模型上肿瘤孔洞边界的三角面片及其n-邻域三角面片,以上述三角面片组成的数字网格模型作为第一步网格光顺操作的输入:Step e1: Select the triangle surface of the tumor hole boundary and its n-neighboring triangle surface on the vascular mesh model, and use the digital mesh model composed of the above triangle surface as the input of the first mesh smoothing operation:
    获取数字网格模型的邻接信息,记每一个顶点i的邻接点集合为N(i);Get the adjacency information of the digital grid model, and record the set of adjacency points of each vertex i as N(i);
    计算每个顶点的各邻接点权值:Calculate the weight of each adjacent point of each vertex:
    Figure PCTCN2020128855-appb-100013
    Figure PCTCN2020128855-appb-100013
    上述公式中,
    Figure PCTCN2020128855-appb-100014
    α ij和β ij是边(i,j)的两个对角;
    In the above formula,
    Figure PCTCN2020128855-appb-100014
    α ij and β ij are the two opposite corners of the edge (i, j);
    根据邻接信息和w ij计算数字网格模型中每个点的拉普拉斯坐标L(i): Calculate the Laplacian coordinate L(i) of each point in the digital grid model according to the adjacency information and w ij:
    Figure PCTCN2020128855-appb-100015
    Figure PCTCN2020128855-appb-100015
    上述公式中,p i为顶点i的坐标,p j为顶点i的邻接点j的坐标; In the above formula, p i is the coordinate of vertex i, and p j is the coordinate of the adjacent point j of vertex i;
    将原始坐标p i更新为λL(i)+p i;其中λ为小于1正实数; The original coordinate p i is updated to λL (i) + p i; where λ is a positive real number less than 1;
    将上述网格光顺步骤迭代进行m 1次; Perform the above grid smoothing step iteratively m 1 times;
    步骤e2:再次选取肿瘤上所有的三角面片以及血管网格模型上肿瘤孔洞边界的三角面片及其n-邻域三角面片,以上述三角面片组成的数字网格模型作为网格光顺的输入,将上述网格光顺操作迭代进行m 2次,其中,m 1应远大于m 2Step e2: Select again all the triangles on the tumor and the triangles of the tumor hole boundary on the vascular mesh model and its n-neighbor triangles, and use the digital mesh model composed of the above triangles as the mesh light For smooth input, perform the above mesh smoothing operation iteratively m 2 times, where m 1 should be much larger than m 2 .
  9. 根据权利要求8所述的在血管数字模型中生成肿瘤的方法,其特征在于,在所述步骤f中,所述对肿瘤网格模型进行严格保边界的网格简化具体包括:The method for generating a tumor in a digital blood vessel model according to claim 8, wherein, in the step f, the strict boundary-preserving mesh simplification of the tumor mesh model specifically comprises:
    步骤f1:对所有的初始顶点计算误差矩阵Q,得到所有有效边(v 1,v 2); Step f1: Calculate the error matrix Q for all initial vertices to obtain all valid edges (v 1 , v 2 );
    步骤f2:对每一条有效边(v 1,v 2),计算最优抽取目标v以及抽取这条边的代价; Step f2: For each valid edge (v 1 , v 2 ), calculate the optimal extraction target v and the cost of extracting this edge;
    步骤f3:将所有的边按照抽取代价cost的大小存入一个堆中;Step f3: Store all edges in a heap according to the extraction cost cost;
    步骤f4:每次移除抽取代价最小的边,将顶点v 1,v 2合并到
    Figure PCTCN2020128855-appb-100016
    并且更新所有与
    Figure PCTCN2020128855-appb-100017
    相连的有效边的抽取代价和最佳抽取位置,计算移除代价最小边后肿瘤网格中三角面片的数量;
    Step f4: Remove the edge with the least extraction cost each time, and merge the vertices v 1 and v 2 into
    Figure PCTCN2020128855-appb-100016
    And update all
    Figure PCTCN2020128855-appb-100017
    The extraction cost of the connected effective edges and the optimal extraction position, and calculate the number of triangles in the tumor mesh after the least cost edge is removed;
    步骤f5:重复步骤f1至f4直到现有面的数量小设定阈值。Step f5: Repeat steps f1 to f4 until the number of existing faces is small to set a threshold.
  10. 一种在血管数字模型中生成肿瘤的系统,其特征在于,包括:A system for generating a tumor in a digital blood vessel model, which is characterized in that it comprises:
    肿瘤位置选取模块:用于在血管数字模型上选取肿瘤位置;Tumor location selection module: used to select the tumor location on the blood vessel digital model;
    近似半径计算模块:用于基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;Approximate radius calculation module: used to calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
    肿瘤网格构建模块:用于以选取的肿瘤位置为球心生成一个虚拟球体,将所述虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;Tumor grid building module: used to generate a virtual sphere with the selected tumor position as the center of the sphere, collide the virtual sphere with the blood vessel digital model and delete the collision triangle, generate a cavity by growing toward the center of the virtual sphere, and pass Iterative triangle refinement method builds a smooth and regular tumor mesh model;
    肿瘤网格形变模块:用于对所述肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;Tumor grid deformation module: used to edit the surface of the tumor grid model, select a certain number of control points, and construct irregular deformations on the tumor grid surface by maintaining rigid deformation;
    网格光顺处理模块:用于对所述肿瘤网格模型与血管数字模型的连接处进行光顺处理;Grid smoothing processing module: used for smoothing the connection between the tumor grid model and the blood vessel digital model;
    网格简化模块:用于对所述肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果。Grid simplification module: used to perform grid simplification with strict boundary preserving on the tumor grid model to obtain the result of tumor generation in the blood vessel digital model.
  11. 一种电子设备,包括:An electronic device including:
    至少一个处理器;以及At least one processor; and
    与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
    所述存储器存储有可被所述一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述1至9任一项所述的在血管数字模型中生成肿瘤的方法的以下操作:The memory stores instructions that can be executed by the one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute any one of 1 to 9 above. The following operations of the method of generating tumors in the digital model:
    步骤a:在血管数字模型上选取肿瘤位置;Step a: Select the tumor position on the blood vessel digital model;
    步骤b:基于平面的点法式方程计算血管数字模型在肿瘤位置处的近似半径;Step b: Calculate the approximate radius of the blood vessel digital model at the tumor location based on the point method equation of the plane;
    步骤c:以选取的肿瘤位置为球心生成一个虚拟球体,将所述虚拟球体与血管数字模型进行碰撞后删除碰撞三角形,以向虚拟球体中心生长的方式生成空洞,并通过迭代的三角形细化方法构建光滑且规则的肿瘤网格模型;Step c: Generate a virtual sphere with the selected tumor position as the center of the sphere. After the virtual sphere collides with the blood vessel digital model, the collision triangle is deleted, and a cavity is generated by growing toward the center of the virtual sphere, and is refined by iterative triangles Method to construct a smooth and regular tumor grid model;
    步骤d:对所述肿瘤网格模型表面进行编辑,选取一定数量的控制点,通过保刚性变形,在肿瘤网格表面构造出不规则的形变;Step d: Edit the surface of the tumor mesh model, select a certain number of control points, and construct irregular deformations on the surface of the tumor mesh by maintaining rigid deformation;
    步骤e:对所述肿瘤网格模型与血管数字模型的连接处进行光顺处理;Step e: smoothing the connection between the tumor mesh model and the blood vessel digital model;
    步骤f:对所述肿瘤网格模型进行严格保边界的网格简化,得到肿瘤在血管数字模型中的生成结果。Step f: Perform a strict boundary-preserving mesh simplification on the tumor mesh model to obtain the result of tumor generation in the blood vessel digital model.
PCT/CN2020/128855 2019-11-21 2020-11-13 Method for generating tumor in digital blood vessel model, system, and electronic device WO2021098617A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911146350.8A CN110956698B (en) 2019-11-21 2019-11-21 Method, system and electronic device for generating tumor in blood vessel digital model
CN201911146350.8 2019-11-21

Publications (1)

Publication Number Publication Date
WO2021098617A1 true WO2021098617A1 (en) 2021-05-27

Family

ID=69977874

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/128855 WO2021098617A1 (en) 2019-11-21 2020-11-13 Method for generating tumor in digital blood vessel model, system, and electronic device

Country Status (2)

Country Link
CN (1) CN110956698B (en)
WO (1) WO2021098617A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114366295A (en) * 2021-12-31 2022-04-19 杭州脉流科技有限公司 Microcatheter path generation method, shaping method of shaped needle, computer device, readable storage medium and program product
CN116563490A (en) * 2023-03-27 2023-08-08 浙江大学 Full-automatic quadrilateral boundary layer grid generation method based on rigid mapping
CN117010042A (en) * 2023-09-28 2023-11-07 武汉必盈生物科技有限公司 Extension method and device for external fixation wrist of 3D printing
CN114996996B (en) * 2022-05-19 2024-05-17 电子科技大学 3D capillary growth method based on phase field model

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110956698B (en) * 2019-11-21 2023-02-10 中国科学院深圳先进技术研究院 Method, system and electronic device for generating tumor in blood vessel digital model

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103093503A (en) * 2013-02-08 2013-05-08 河北大学 Lung parenchyma area surface model establishment method based on computed tomography (CT) image
US20140032197A1 (en) * 2012-07-27 2014-01-30 Samsung Electronics Co., Ltd. Method and apparatus for creating model of patient specified target organ based on blood vessel structure
CN105243945A (en) * 2015-11-19 2016-01-13 王峻峰 Tumor grid organ model 3D printing method
CN105869218A (en) * 2016-03-28 2016-08-17 中国科学院深圳先进技术研究院 Method and apparatus for editing tumor lesion of blood vessel digital model
CN110956698A (en) * 2019-11-21 2020-04-03 中国科学院深圳先进技术研究院 Method, system and electronic device for generating tumor in blood vessel digital model

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106920282B (en) * 2015-12-25 2020-11-20 中国科学院深圳先进技术研究院 Editing method and system of blood vessel digital model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140032197A1 (en) * 2012-07-27 2014-01-30 Samsung Electronics Co., Ltd. Method and apparatus for creating model of patient specified target organ based on blood vessel structure
CN103093503A (en) * 2013-02-08 2013-05-08 河北大学 Lung parenchyma area surface model establishment method based on computed tomography (CT) image
CN105243945A (en) * 2015-11-19 2016-01-13 王峻峰 Tumor grid organ model 3D printing method
CN105869218A (en) * 2016-03-28 2016-08-17 中国科学院深圳先进技术研究院 Method and apparatus for editing tumor lesion of blood vessel digital model
CN110956698A (en) * 2019-11-21 2020-04-03 中国科学院深圳先进技术研究院 Method, system and electronic device for generating tumor in blood vessel digital model

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114366295A (en) * 2021-12-31 2022-04-19 杭州脉流科技有限公司 Microcatheter path generation method, shaping method of shaped needle, computer device, readable storage medium and program product
CN114996996B (en) * 2022-05-19 2024-05-17 电子科技大学 3D capillary growth method based on phase field model
CN116563490A (en) * 2023-03-27 2023-08-08 浙江大学 Full-automatic quadrilateral boundary layer grid generation method based on rigid mapping
CN116563490B (en) * 2023-03-27 2024-01-23 浙江大学 Full-automatic quadrilateral boundary layer grid generation method based on rigid mapping
CN117010042A (en) * 2023-09-28 2023-11-07 武汉必盈生物科技有限公司 Extension method and device for external fixation wrist of 3D printing
CN117010042B (en) * 2023-09-28 2023-12-29 武汉必盈生物科技有限公司 Extension method and device for external fixation wrist of 3D printing

Also Published As

Publication number Publication date
CN110956698A (en) 2020-04-03
CN110956698B (en) 2023-02-10

Similar Documents

Publication Publication Date Title
WO2021098617A1 (en) Method for generating tumor in digital blood vessel model, system, and electronic device
CN109285225B (en) Medical image-based virtual reality assisted surgery establishing method
CN109903396A (en) A kind of tooth three-dimensional model automatic division method based on surface parameterization
CN103745497B (en) Plant growth modeling method and system
WO2020108304A1 (en) Method for reconstructing face mesh model, device, apparatus and storage medium
CN107154038A (en) A kind of visual fracture of rib aided diagnosis method of rib
CN109191510B (en) 3D reconstruction method and device for pathological section
CN110889901B (en) Large-scene sparse point cloud BA optimization method based on distributed system
CN110176079A (en) A kind of three-dimensional model deformation algorithm based on quasi- Conformal
CN114792326A (en) Surgical navigation point cloud segmentation and registration method based on structured light
CN107610121A (en) A kind of initial pose establishing method of liver statistical shape model
CN114549540A (en) Method for automatically fusing oral scanning tooth data and CBCT (Cone Beam computed tomography) data and application thereof
JP5487264B2 (en) Biological data model creation method and apparatus
Cameron et al. Patient-Specific Anatomic Models-Geometric Surface Generation from Three-Dimensional Medical Images Using a Specified Polygonal Budget
JP2015128669A (en) Living body data model creation method and device, living body data model data structure, living body data model data storage device, three dimensional data model load distribution method, and device
US20230377104A1 (en) System and methods for filtering medical images
Selmi et al. 3D interactive ultrasound image deformation for realistic prostate biopsy simulation
CN107085866A (en) The analog simulation method and system of a kind of straight bone CT images of human body
CN113298919A (en) Skeleton extraction method of three-dimensional plant point cloud model
Nakashima et al. Interactive Deformation of Structurally Complex Heart Models Constructed from Medical Images.
Trabelsi et al. 3D Active Shape Model for CT-scan liver segmentation
Mingshi et al. Assisted system for precise surgery based on medical image computing and VR
Robb et al. Efficient shape-based algorithms for modeling patient specific anatomy from 3D medical images: applications in virtual endoscopy and surgery
CN110930389B (en) Region segmentation method, device and storage medium for three-dimensional medical model data
CN117437350B (en) Three-dimensional reconstruction system and method for preoperative planning

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20891260

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20891260

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20891260

Country of ref document: EP

Kind code of ref document: A1