Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides an automatic edge-cutting generation method based on the normal direction of a triangular patch, which can directly generate a cutting edge with a given size outside a tumor.
In order to achieve the purpose, the invention adopts the following technical scheme:
the automatic edge cutting generation method based on the normal direction of the occupied triangular patch comprises the following steps,
s1, acquiring a three-dimensionally reconstructed occupancy model;
s2, generating an outward vector on the triangular face of the occupancy model;
and S3, taking the end point of the vector as the end point of a new triangular patch, and three-dimensionally reconstructing the new model, wherein the reconstructed model is the same section as the cutting edge.
Further, the step S2 specifically includes the following steps:
s21, setting three vertexes A (x) of the triangular patch
1 ,y
1 ,z
1 ),B(x
2 ,y
2 ,z
2 ),C(x
3 ,y
3 ,z
3 ) A, B, C may form 3 vectors, a vector
(Vector)
Sum vector
If the normal vector coordinate of the plane is (m, n, p), the following can be obtained according to the space analytic geometry knowledge:
(x 2 -x 1 )m+(y 2 -y 1 )n+(z 2 -z 1 )p=0;
(x 3 -x 1 )m+(y 3 -y 1 )n+(z 3 -z 1 )p=0;
(x 3 -x 2 )m+(y 3 -y 2 )n+(z 3 -z 2 )p=0;
solving the simultaneous linear equation to obtain the normal vector coordinates (m, n, p) of the plane;
s22, calculating the centroid of the triangle, and calculating the centroid Q (x) according to the formula of calculating the centroid of the space triangle 0 ,y 0 ,z 0 ):
Further, the step S3 specifically includes the following steps:
s31, knowing the centroid Q and the normal vector of the space triangle, and making a linear equation which passes through the point and has the direction parallel to the normal vector:
s32, calculating the coordinate with the distance S between the point Q and the straight line,
two points in space Q (x) 0 ,y 0 ,z 0 ) Distance formula from w (x, y, z): (x-x) 0 ) 2 +(y-y 0 ) 2 +(z-z 0 ) 2 =S 2 ;
Will be provided with
And
substituting into the formula;
obtaining:
substituting the two formulas to obtain y and x, and obtaining a point which is a cutting edge w away from the triangular patch;
and S33, forming a closed curved surface with the distance S from the occupied place by the collection of the points w, namely, forming a tangent plane which is the same as the tangent edge.
Further, the length of the vector in S2 is the distance from the cut edge boundary to the occupancy model boundary.
Further, the vector length is 2CM.
Further, the placeholder model comprises a tumor placeholder model.
By adopting the technical scheme of the invention, the invention has the beneficial effects that: compared with the prior art, the method can automatically form the required cutting edge, is simple and convenient to operate and high in accuracy, the cutting edge can be obtained only by taking the vector end point as the vertex of the triangle of the new face slice, convenience can be effectively brought to an operation planner, and the method is beneficial to application and popularization.
Detailed Description
Specific embodiments of the present invention will be further described with reference to the accompanying drawings.
The occupied three-dimensional reconstruction structure is characterized in that the surface of the occupied three-dimensional reconstruction structure is covered by triangular patches. The excision of the placeholder needs to be at a distance from the placeholder called the margin of cut. The invention uses a triangular centroid point to grow a vertical line perpendicular to a triangular patch, such as the vertical line perpendicular to the triangular patch shown in figure 1, and takes a point which is away from the centroid as the length of a tangential edge on a straight line, and finally, the points of all the triangular patches form a curved surface, namely, a pre-tangential plane of the given tangential edge.
As shown in the figure, the automatic edge-cutting generation method based on the normal direction of the occupancy triangle patch comprises the following steps,
s1, acquiring a three-dimensionally reconstructed occupancy model;
s2, generating an outward vector on the triangular face of the occupancy model;
and S3, taking the end point of the vector as the end point of a new triangular patch, and three-dimensionally reconstructing the new model, wherein the reconstructed model is the same section as the cutting edge.
The S2 specifically comprises the following steps:
s21, setting a triangleThree vertices A (x) of a patch
1 ,y
1 ,z
1 ),B(x
2 ,y
2 ,z
2 ),C(x
3 ,y
3 ,z
3 ) A, B, C may form 3 vectors, a vector
(Vector)
Sum vector
The normal vector coordinate of the plane is (m, n, p), and the normal vector coordinate can be obtained according to the space analytic geometry knowledge:
(x 2 -x 1 )m+(y 2 -y 1 )n+(z 2 -z 1 )p=0;
(x 3 -x 1 )m+(y 3 -y 1 )n+(z 3 -z 1 )p=0;
(x 3 -x 2 )m+(y 3 -y 2 )n+(z 3 -z 2 )p=0;
solving the simultaneous linear equation to obtain the normal vector coordinates (m, n, p) of the plane;
s22, calculating the centroid of the triangle, and calculating the centroid Q (x) according to the formula of calculating the centroid of the space triangle 0 ,y 0 ,z 0 ):
The S3 specifically comprises the following steps:
s31, knowing the centroid Q and the normal vector of the space triangle, and making a linear equation which passes through the point and has the direction parallel to the normal vector:
s32, calculating the coordinate with the distance S between the point Q and the straight line,
two points in space Q (x) 0 ,y 0 ,z 0 ) Distance from w (x, y, z) formula: (x-x) 0 ) 2 +(y-y 0 ) 2 +(z-z 0 ) 2 =S 2 ;
Will be provided with
And
substituting into the formula;
obtaining:
substituting the two formulas to obtain y and x, and obtaining a point which is far away from the triangular patch and is the cutting edge w;
and S33, forming a closed curved surface with the distance S from the occupied place by the collection of the points w, namely, forming a tangent plane which is the same as the tangent edge.
And the length of the vector in the S2 is the distance from the cutting edge boundary to the occupation model boundary. Typically, the distance from the cutting edge to the footprint is set to 2CM, thus setting the vector length to 2CM. The occupancy model comprises a tumor occupancy model.
In the present invention, occupancy refers to occupancy lesion, which is a term used in medical imaging diagnostics and usually appears in examination results such as X-ray, B-ultrasound, and CT. It means that there is a "extra thing" in the examined region, which can make the surrounding tissues pressed and displaced. Space occupying lesions generally refer to tumors (benign, malignant), parasites, etc., without involvement of the etiology of the disease.
The space occupying model is a three-dimensional stereo model established according to space occupying lesion (tumor and the like).
The incisal edges refer to the edges where the tissue of the placeholder is excised.
The triangular patch refers to a triangular patch block used for representing a triangular mesh under a three-dimensional modeling stl format.
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.