Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
As described in the foregoing background art, the technical problem of reduced surgical accuracy caused by damage to soft tissues and ligaments due to an excessive range of motion of the osteotomy swing saw in the related art.
In order to effectively solve the problems in the related art, the invention provides an osteotomy plane boundary control method, an electronic device and a storage medium, and the method, the electronic device and the storage medium are specifically described below.
It should be noted that "connection lines" (such as boundary connection lines, connection lines between left end points and right end points) in the following embodiments include, but are not limited to, line segments, broken lines, curves, and the like.
Example 1
FIG. 2 is a flowchart illustrating a method of osteotomy plane boundary control, see FIG. 2, according to an exemplary embodiment, the method comprising:
step S1, calculating the distance from the center point of the osteotomy swing saw to the boundary connecting line of the osteotomy plane, selecting the inward vector weighted summation of two sides with the shortest distance as the searching direction, and performing step-by-step searching;
step S2, after each step search is completed, updating the coordinates of the search points, and determining an arc track when the tail end of the osteotomy pendulum saw is positioned in a boundary connecting line of an osteotomy plane according to the updated search coordinate points;
step S3, judging whether the arc track is intersected with the boundary connecting line of the osteotomy plane, if not, completing searching, outputting the current searching coordinate point as the safety coordinate of the central point of the osteotomy pendulum saw, jumping to step S4, if so, returning to step S1, recalculating the searching direction, and performing step-by-step searching;
S4, calculating an arc track planned in the period according to the safety coordinates and a planning direction vector of the osteotomy pendulum saw;
And S5, judging whether the circular arc track planned in the previous period is intersected with the boundary connecting line of the osteotomy plane when being translated to the circular arc track position planned in the current period, if so, calculating a movement vector when the circular arc track planned in the previous period is translated to the intersection position, outputting the safety coordinate of the central point of the osteotomy pendulum saw planned in the previous period and the sum of the movement vector as the safety coordinate of the central point of the osteotomy pendulum saw planned in the current period, and if not, outputting the current search coordinate point as the safety coordinate of the central point of the osteotomy pendulum saw planned in the current period.
In the technical solution provided in this embodiment, in specific practice, the controller of the medical apparatus runs in the controller of the medical apparatus, or the controller of the medical apparatus runs in an electronic device connected to the controller, and executes a corresponding method by calling a program stored in the electronic device.
The medical instrument may in particular be an orthopaedic surgical robot which may be suitable for use in procedures including, but not limited to, knee replacement procedures. The method can be suitable for the osteotomy plane boundary control in Total Knee Arthroplasty (TKA), can also be used for the osteotomy plane boundary control in unicondylar arthroplasty (UKA), or can be generalized to boundary control of any operative plane position.
It can be appreciated that, according to the technical scheme provided by the embodiment, by calculating the distance from the central point of the osteotomy pendulum saw to the boundary connecting line of the osteotomy plane, the inward vectors of the two sides with the shortest distance are selected to be weighted and summed, and used as the searching direction to perform step searching, so as to quickly find the safe position closest to the plane position boundary (i.e. in accordance with the expected movement direction and gesture) and located in the plane boundary, and then the safe position is issued to the mechanical arm to drive the operation tool to move, thereby accurately and safely helping doctors to realize the osteotomy operation on the femur and the tibia. Solves the technical problem of soft tissue and ligament injury and operation precision reduction caused by overlarge movement range of the osteotomy pendulum saw in the prior art.
When the technical scheme provided by the embodiment is applied to the knee joint replacement operation robot, a doctor can be accurately and easily controlled to assist in performing osteotomy operation in the knee joint replacement operation, meanwhile, the boundary safety of the pendulum saw is ensured, the accuracy and success rate of the knee joint replacement operation are improved, and the burden of the doctor is lightened.
In order to further solve the problem that jump possibly exists in the safety position inside the osteotomy plane in the continuous control period, the situation that the end model of the data is arranged to cross the uppermost concave boundary shown in fig. 6 in the actual execution process is further solved, the algorithm further carries out boundary judgment based on the safety position planned in the previous period and the safety position obtained by the step search, and the finally output safety position of the algorithm is ensured to be always in the safety boundary of the osteotomy plane in the actual execution process.
Further, when the osteotomy plane is a concave-convex plane or other irregular planes, the boundary control method provided by the invention considers the physical model of the osteotomy in the actual end translation during the working of the osteotomy data, and reduces the error of the algorithm to the greatest extent. The position of the surgical tool is controlled from the planning level not to exceed the plane boundary, and the track in the actual execution process is considered, so that the planning is further corrected, and the surgical tool is ensured to be always positioned in the irregular plane boundary in the control process.
Referring to fig. 3, the knee replacement surgical robot may include a motion control PC, a robotic arm, a six-dimensional force sensor, a tool (osteotomy swing saw), and an optical positioning sensor.
Referring to fig. 3, a six-dimensional force sensor is arranged at the tail end of the mechanical arm, and the force sensor is fixedly connected with the osteotomy pendulum saw. The doctor directly carries out interactive operation with the osteotomy pendulum saw in the art, then the motion control PC can be according to six-dimensional force sensor perception doctor interactive force, carries out power control through the specific size control arm of interactive force for the controlled interactive motion of osteotomy pendulum saw in the osteotomy plane. The optical positioning sensor is responsible for sensing the relative position relation between the patient and the tool in real time so that the motion control PC calculates and updates the plane pose information in real time.
It can be appreciated that by applying the technical scheme provided by the embodiment, when a doctor performs planar osteotomy on femur or tibia of a patient, and when the doctor needs to dynamically adjust the position of the osteotomy pendulum saw in a plane, the mechanical arm can limit a safety area dynamically adjusted by the doctor, so that the posterior cruciate ligament and the medial and lateral collateral ligaments of the patient are protected from being damaged, and the safety of the planar osteotomy is ensured.
Fig. 4 is a schematic view of an end control model of an osteotomy swing saw, see fig. 4,As a direction vector of the pendulum saw,To the end point coordinates of the pendulum saw when in neutral position,The terminal control model of (2) can be regarded as Arc, the parameter r is Arc radius, and the parameterIs the center of a circular arc, its parametersThe left and right limit end point directions of the circular arc and the X-axis clamping angle are respectively. When the end point coordinates of the pendulum sawVector of directionWhen determining, the Arc and the parameters thereof can be uniquely determined according to the mechanical structure of the pendulum saw.
Fig. 5 is a schematic view of the boundary of the osteotomy plane, see fig. 5, in the osteotomy plane,As a boundary point of the line of sight,Is a polyline segment between boundary points. The initial and final boundary points extend backwards and infinitely along the initial and final fold line sections and are connected at infinity to form a plane position boundary. The polygon formed by the boundary folding line segments can be any concave-convex shape, and the method proposed by the embodiment does not limit the convexity of the boundary.
Fig. 6 is a schematic view of osteotomy plane boundary control, see fig. 6, in the osteotomy plane,For the position of the osteotomy pendulum saw (which may be beyond the boundary) planned by the physician's operating force,Is a safe position (guaranteed to be within the boundary) of the osteotomy swing saw. The safe position can control the tail end of the swing saw to move in the boundary of the plane position in the osteotomy plane, so that the posterior cruciate ligament and the medial collateral ligament of a patient are not damaged while the osteotomy task is finished, and the safety of the operation and the postoperative recovery effect of the patient are improved.
In specific practice, referring to fig. 7, the step S1 includes:
S11, acquiring planning coordinates of a center point of the osteotomy swing saw Planning direction vector of osteotomy pendulum sawBoundary point set of osteotomy planeBoundary line set composed of boundary point setSingle step size;
Step S12, traversing the boundary connecting wire setEach boundary line of the line is takenCalculating the center point of the osteotomy swing sawTo each boundary lineDistance of (2)And, the nearest point coordinates;
Step S13, calculating the center point of the osteotomy swing sawTo boundary wireSearching for index number of two boundary lines with shortest distance;
Step S14, judging the center point of the osteotomy pendulum sawWhether or not to locate at the boundary line setIf yes, initializing a planning coordinate with a searching coordinate point equal to the center point of the osteotomy pendulum sawOtherwise, initializing the search coordinate point to be equal to the nearest point coordinate on the boundary line with the shortest distance;
Step S15, calculating the search directionWhereinRepresenting the set of boundary linesDirection vectors (unit vectors) within the constituted directional boundary, pairs ofAnd performing unitization operation to make the unitization operation be a unit vector.
In specific practice, the step S2 includes:
Step S21, step searching is carried out along the searching direction, and after each step searching is completed, the searching coordinate point is updated to be the sum of the original searching coordinate point and the step amount in the searching direction ;
Step S22, searching coordinate points according to the updated dataPlanning direction vector of the osteotomy pendulum sawAnd determining the arc track when the tail end of the osteotomy swing saw is positioned in the boundary connecting line of the osteotomy plane.
In specific practice, the step S3 includes:
Step S31, traversing the boundary connection set Each boundary line of the line is takenCalculating the connection line between the arc track and each boundaryIf the current coordinate point is not intersected, completing searching, and outputting the current searching coordinate point as a safety coordinate of the center point of the osteotomy pendulum sawIf the two parts are intersected, continuing the next step;
Step S32, traversing the boundary connection line set Each boundary line of the line is takenCalculating the current search coordinate pointTo each boundary lineDistance of (2)And, the nearest point coordinates;
Step S33, traversing the current searching coordinate pointDistance to boundary line, searching index number of two boundary lines with shortest distanceThe process returns to step S15.
In specific practice, the maximum step searching times can be controlled by adjusting the stepping amount (generally controlling the stepping amount to be more than 1/20 and less than 1/10 of the width between the left limit and the right limit of the osteotomy pendulum saw), so as to restrict the searching time and ensure the time consumption of algorithm execution.
By the position boundary control method, when the position of the surgical tool planned by the operation force of the doctor exceeds the boundary, the position is corrected within the boundary range and accords with the position of the expected direction, so that the movement of the mechanical arm is controlled, and the operation of the doctor is adapted.
In specific practice, referring to fig. 8, in the step S12, the distance from the center point of the osteotomy pendulum saw to each boundary line is calculated, and the coordinates of the closest point include:
judging the position relationship between the center point of the bone cutting swing saw and any boundary connecting line;
If the projection of the center point of the osteotomy pendulum saw on the boundary line falls on the left extension line of the boundary line (in this case, the position of the center point of the osteotomy pendulum saw is shown as a point P1 in fig. 8), the coordinate of the left end point Pa of the boundary line is determined as the nearest point coordinate, and the distance between the center point P1 of the osteotomy pendulum saw and the left end point Pa is the distance from the center point of the osteotomy pendulum saw to the boundary line;
if the projection of the center point of the osteotomy pendulum saw on the boundary line falls on the right extension line of the boundary line (in this case, the position of the center point of the osteotomy pendulum saw is shown as a point P3 in fig. 8), the coordinate of the right end point Pb of the boundary line is determined as the nearest point coordinate, and the distance between the center point P3 of the osteotomy pendulum saw and the right end point Pb is the distance from the center point of the osteotomy pendulum saw to the boundary line;
If the projection of the center point of the osteotomy pendulum saw on the boundary line falls on the boundary line (in this case, the position of the center point of the osteotomy pendulum saw is shown as a point P2 in fig. 8), the projection point is determined as the nearest point coordinate, and the distance between the center point P2 of the osteotomy pendulum saw and the projection point is the distance from the center point of the osteotomy pendulum saw to the boundary line.
Referring to fig. 8, the determining the positional relationship between the center point of the osteotomy pendulum saw and any boundary line includes:
Determining a left end point Pa of the boundary connecting line as a vector starting point, wherein the vector direction of the boundary connecting line is that the left end point Pa points to a right end point Pb;
Calculate the left end Pa and the center point P of the osteotomy swing saw (P may be 、、A point in (a) and a projection in the vector direction of the boundary line;
if the length of the projection is less than or equal to 0, determining that the projection of the center point P of the osteotomy swing saw on the boundary connecting line falls on the left extension line of the boundary connecting line;
If the length of the projection is greater than 0 and less than or equal to the vector length d of the boundary connecting line, judging that the projection of the center point P of the osteotomy pendulum saw on the boundary connecting line falls on the boundary connecting line;
if the length of the projection is greater than the vector length d of the boundary connecting line, the projection of the center point P of the osteotomy swing saw on the boundary connecting line is judged to fall on the right extension line of the boundary connecting line.
The above is expressed by a data formula, assuming that the center point of the osteotomy pendulum saw is P #、、) Boundary connecting line is a point of origin、Line segment, distance pointThe nearest pointThe following formula is adopted for calculation:
Wherein, the
Then pointTo the from point、The shortest distance of the composed line segments is calculated by the following formula:
In specific practice, referring to fig. 9, the determining in step S14 whether the center point of the osteotomy pendulum saw is located in the boundary line set includes:
s141, generating a ray to infinity along any direction by taking the center point P of the osteotomy pendulum saw as a starting point ;
Step S142, traversing the boundary point setEach boundary point of (1) is takenJudging the rayWhether or not to pass the boundary pointIf yes, returning to the step S141, otherwise, performing the next step;
step S143, traversing the boundary connecting wire set Each boundary line of the line is takenJudging the rayWhether or not to connect with the boundaryOverlapping, if yes, returning to the step S141, otherwise, carrying out the next step;
Step S144, traversing the boundary connection set Each boundary line in (1) calculating the rayConnecting with boundaryNumber of intersecting points;
Step S145, if the number of intersection pointsIf the number is odd, judging that the center point P of the osteotomy swing saw is positioned in the boundary connecting line setIf the number of the intersection pointsIf the number is even, judging that the center point P of the osteotomy swing saw is positioned outside the boundary connecting line set。
In practical application, the ray may be equivalent to a line segment between the ray origin and a point at infinity in the ray direction, and then the intersection calculation between the ray and the line segment in S14 may be converted into the intersection detection of the line segment.
In specific practice, the step S31 of traversing each boundary line in the boundary line set, calculating whether the arc track intersects with each boundary line includes:
Judging whether the radius of a circle where the arc track is located is larger than the linear distance from the circle center to the boundary connecting line or not for any boundary connecting line, if yes, judging that the circle where the arc track is located has no intersection point with the boundary connecting line, otherwise, judging that the circle where the arc track is located has an intersection point with the boundary connecting line;
if the circle where the arc track is located and the boundary connecting line are judged to have an intersection point, judging whether the intersection point is on the boundary connecting line or not;
if one intersection point is positioned on the boundary connecting line, the circle where the arc track is positioned is judged to have one intersection point with the boundary connecting line, and if the two intersection points are positioned on the boundary connecting line, the circle where the arc track is positioned is judged to have two intersection points with the boundary connecting line;
If it is determined that an intersection point exists between the circle where the circular arc track is located and the boundary line, or two intersection points exist between the circle where the circular arc track is located and the boundary line, for each intersection point, calculating a four-quadrant arctangent function of a direction vector of the circle center pointing to the intersection point;
and if the value of the four-quadrant arc tangent function is between the left limit angle and the right limit angle of the arc track, judging that the arc track is intersected with the boundary connecting line, otherwise, judging that the arc track is not intersected with the boundary connecting line.
Referring to fig. 11, assuming that the current boundary line is a line segment ab, calculating whether the arc track intersects each boundary line includes:
1) Judging whether the radius r of the circle is larger than the distance from the center of the circle to the straight line or not by the following formula :
The direction vector of the straight line where the line segment ab is located is:
The direction vector of the endpoint a of the line segment ab pointing to the circle center c is as follows:
the unit vector of line segment ab is:
the end point a of the line segment ab points to the direction vector of the drop foot h as follows:
the distance between the circle center c and the drop foot h is as follows:
If it is If the Arc radius is larger than the Arc radius r, the Arc and the line ab have no intersection point;
If it is And 2) calculating if the radius is smaller than the radius r of the circular arc.
2) By the following formula, it is determined whether or not an intersection f exists between the line segment and the circle (f represents any intersection in FIG. 11)):
The distance between the drop foot h and any intersection point f is as follows:
the end point a of the line segment ab points to the intersection point The direction vector of (2) is:
the end point a of the line segment ab points to the intersection point The direction vector of (2) is:
Point(s) 、Two intersection points exist for a straight line and a circle, for each intersection point f
If two points are present、All are positioned outside the line segment ab, and the Arc and the line segment ab have no intersection point;
If it is 、One of the two is positioned on the line segment ab, and the other is positioned outside the line segment ab, so that an intersection point exists between the circle and the line segment ab, and 3) calculation is performed;
If it is 、And 3) calculating if the two points are located on the line segment ab, and the circle and the line segment ab have two intersection points.
3) Judging whether the intersection point f is positioned on the Arc of Arc or not according to the following formula:
whether the line segment ab has several intersections with the circle, for each intersection f, the following calculations are performed:
the center c points to the direction vector of the intersection point f:
Four-quadrant arctangent function of intersection point f:
Wherein, the Representing a four-quadrant arctangent function.
。
Referring to fig. 12, in specific practice, the step S5 includes:
Step S51, planning the arc track of the previous cycle And its parameters%) Performing uniform n-point interpolation (n is more than or equal to 1) to obtain a uniform point set distributed sequentially on the circular arc track planned in the previous cycleStoring the uniform point set as a first uniform point set;
Step S52, planning the circular arc track of the cycle And the parameters thereof are subjected to uniform n-point interpolation (n is more than or equal to 1) to obtain a uniform point set distributed sequentially on the circular arc track planned in the periodStoring the uniform point set as a second uniform point set;
step S53, according to the first uniform point set And a second uniform point setObtaining a line segment set when the circular arc track planned in the previous period translates to the circular arc track position planned in the current period;
Step S54, traversing the boundary wire setEach boundary line (taken) The line segment setEach line segment (take) Calculating whether the boundary connecting line and the line segment intersect, if so, marking the intersection and calculating the intersection point coordinates, and calculating the movement vector of each point in the first uniform point set translating to the intersection point position according to the intersection point coordinates and the point coordinates in the first uniform point set to generate a movement vector set (namely judging one by oneAnd (3) withIf the two intersecting points intersect, an intersecting mark flag=true is set if the two intersecting points intersect, and the intersecting point is obtainedCalculating a motion vectorObtaining a motion vector set D);
Step S55, if the intersection mark exists, traversing the motion vector set, and determining the motion vector corresponding to the minimum vector modulo length in the motion vector set as the motion vector (i.e. traversing vector set) when the circular arc track planned in the previous cycle translates to the intersection point position Taking outFinding the minimum vector modulo lengthCorresponding serial numberMotion vector to nearest intersection boundary=True, return);
Step S56, if the intersection mark does not exist, it is determined that the circular arc track planned in the previous cycle does not intersect with the boundary line of the osteotomy plane when translating to the circular arc track planned in the current cycle (i.e. if the flag is not set to true, the circular arc track does not intersect with the boundary line in the moving process, and the flag=false is output).
In specific practice, said calculating whether said border line and said line segment intersect comprises:
For any boundary connecting line and any line segment, calculating a connecting line vector between the right end point of the boundary connecting line and the left end point of the line segment, and a first rotation direction between the connecting line vectors of the right end point and the left end point of the boundary connecting line;
Calculating a connection vector between the right end point of the boundary connection line and the right end point of the line segment, and a second rotation direction between the connection vector between the right end point and the left end point of the boundary connection line;
if the product of the first rotation direction and the second rotation direction is greater than 0, the boundary connecting line is judged to be disjoint with the line segment.
For any boundary connecting line and any line segment, calculating a connecting line vector between the right end point of the line segment and the left end point of the boundary connecting line and a third rotation direction between the line segment vectors;
Calculating a connection line vector between the right end point of the line segment and the right end point of the boundary connection line, and a fourth rotation direction between the line segment vector;
If the product of the third rotation direction and the fourth rotation direction is greater than 0, the boundary connecting line is judged to be disjoint with the line segment.
Further, the calculating the intersection point coordinates includes:
For any boundary connecting line and any line segment, calculating the relative distance between the intersection point and any endpoint on the boundary connecting line according to the first rotation direction, the third rotation direction and the fourth rotation direction;
And determining the sum of the endpoint coordinates and the relative distance as an intersection point coordinate.
To facilitate understanding of the process of calculating whether the boundary line and the line segment intersect and the intersection point coordinates, the left end point of any line segment is now taken as the left end pointAnd the right end point of the line segment isThe left end point of any boundary connecting line isThe right end point isFor example, referring to fig. 9, the explanation is as follows:
Is provided with To characterize the function of the direction of vector rotation, points、Form line segments, points、And if the line segments are formed, the following algorithm can be adopted to rapidly judge whether the two line segments are intersected:
Wherein, the
Referring to FIG. 10, theThe function is defined as:
two vectors 、The rotation direction between the two is calculated by the following method:
Wherein, the
A floating point number of very small numbers is generally 0.000001.
In the case of two intersecting line segments, the intersection point can be calculatedCoordinates:
。
It can be understood that, by the technical scheme provided by the embodiment, through the boundary control of the osteotomy plane, when the position of the surgical tool planned by the doctor operation force exceeds the boundary, the position is corrected to be within the designated boundary range and the position accords with the expected direction, thereby improving the success rate of the surgery.
In addition, the boundary control method of the osteotomy plane provided by the embodiment does not limit the convexity of the boundary, supports the custom boundary type according to the anatomy structure of the patient, can protect the posterior cruciate ligament and the medial collateral ligament of the patient from being damaged, and avoids unnecessary excessive cutting of soft tissues and ligaments.
Furthermore, according to the technical scheme provided by the embodiment, the safe position of the surgical tool is calculated according to the position of the surgical tool and the boundary of the safe surgical area planned by the operation force of a doctor, and the safe position of the surgical tool is issued to the mechanical arm to drive the surgical tool to move, so that the osteotomy of the femur and the tibia is accurately and safely realized. And only the expected position, the expected direction and the safety boundary of the osteotomy pendulum saw are needed, the current position and the current direction of the osteotomy pendulum saw are not needed to be acquired, the influence of the time lag of the system on the control is reduced, and the given safety direction of the osteotomy pendulum saw can be ensured to accord with the expected direction.
Example two
A method of osteotomy plane boundary control is shown in accordance with another exemplary embodiment, the method comprising:
S11, acquiring planning coordinates of a center point of the osteotomy swing saw Planning direction vector of osteotomy pendulum sawBoundary point set of osteotomy planeBoundary line set composed of boundary point setSingle step size;
Step S12, traversing the boundary connecting wire setEach boundary line of the line is takenCalculating the center point of the osteotomy swing sawTo each boundary lineDistance of (2)And, the nearest point coordinates;
Step S13, calculating the center point of the osteotomy swing sawTo boundary wireSearching for index number of two boundary lines with shortest distance;
Step S14, judging the center point of the osteotomy pendulum sawWhether or not to locate at the boundary line setIf yes, initializing a planning coordinate with a searching coordinate point equal to the center point of the osteotomy pendulum sawOtherwise, initializing the search coordinate point to be equal to the nearest point coordinate on the boundary line with the shortest distance;
Step S15, calculating the search directionWhereinRepresenting the set of boundary linesDirection vectors (unit vectors) within the constituted directional boundary, pairs ofPerforming unitization operation to make the unitization operation be a unit vector;
Step S21, step searching is carried out along the searching direction, and after each step searching is completed, the searching coordinate point is updated to be the sum of the original searching coordinate point and the step amount in the searching direction ;
Step S22, searching coordinate points according to the updated dataPlanning direction vector of the osteotomy pendulum sawDetermining an arc track when the tail end of the osteotomy swing saw is positioned in a boundary connecting line of an osteotomy plane;
Step S31, traversing the boundary connection set Each boundary line of the line is takenCalculating the arc trackIf the current coordinate point is not intersected, completing searching, and outputting the current searching coordinate point as a safety coordinate of the center point of the osteotomy pendulum sawIf the two parts are intersected, continuing the next step;
Step S32, traversing the boundary connection line set Each boundary line of the line is takenCalculating the current search coordinate pointTo each boundary lineDistance of (2)And, the nearest point coordinates;
Step S33, traversing the current searching coordinate pointDistance to boundary line, searching index number of two boundary lines with shortest distanceReturning to step S15;
step S4, according to the safety coordinates Planning direction vector of osteotomy pendulum sawCalculating the arc track of the periodic plan;
Step S51, planning the arc track of the previous cycleAnd its parameters%) Performing uniform n-point interpolation (n is more than or equal to 1) to obtain a uniform point set distributed sequentially on the circular arc track planned in the previous cycleStoring the uniform point set as a first uniform point set;
Step S52, planning the circular arc track of the cycle And the parameters thereof are subjected to uniform n-point interpolation (n is more than or equal to 1) to obtain a uniform point set distributed sequentially on the circular arc track planned in the periodStoring the uniform point set as a second uniform point set;
step S53, according to the first uniform point set And a second uniform point setObtaining a line segment set when the circular arc track planned in the previous period translates to the circular arc track position planned in the current period;
Step S54, traversing the boundary wire setEach boundary line (taken) The line segment setEach line segment (take) Calculating whether the boundary connecting line and the line segment intersect, if so, marking the intersection and calculating the intersection point coordinates, and calculating the movement vector of each point in the first uniform point set translating to the intersection point position according to the intersection point coordinates and the point coordinates in the first uniform point set to generate a movement vector set (namely judging one by oneAnd (3) withIf the two intersecting points intersect, an intersecting mark flag=true is set if the two intersecting points intersect, and the intersecting point is obtainedCalculating a motion vectorObtaining a motion vector set D);
Step S55, if there is an intersection mark, determining the minimum value in the motion vector set as the motion vector when the circular arc track planned in the previous cycle translates to the intersection point position (i.e. calculating the nearest distance between the circular arc track planned in the previous cycle and the intersection point) And the output flag=true,);
Step S56, if the intersection mark does not exist, it is determined that the circular arc track planned in the previous cycle does not intersect with the boundary line of the osteotomy plane when translating to the circular arc track planned in the current cycle (i.e. if the flag is not set to true, the circular arc track does not intersect with the boundary line in the moving process, and the flag=false is output).
In the technical solution provided in this embodiment, in specific practice, the controller of the medical apparatus runs in the controller of the medical apparatus, or the controller of the medical apparatus runs in an electronic device connected to the controller, and executes a corresponding method by calling a program stored in the electronic device.
The medical instrument may in particular be an orthopaedic surgical robot which may be suitable for use in procedures including, but not limited to, knee replacement procedures. The method can be suitable for the osteotomy plane boundary control in Total Knee Arthroplasty (TKA), can also be used for the osteotomy plane boundary control in unicondylar arthroplasty (UKA), or can be generalized to boundary control of any operative plane position.
It can be appreciated that, according to the technical scheme provided by the embodiment, by calculating the distance from the central point of the osteotomy pendulum saw to the boundary connecting line of the osteotomy plane, the inward vectors of the two sides with the shortest distance are selected to be weighted and summed, and used as the searching direction to perform step searching, so as to quickly find the safe position closest to the plane position boundary (i.e. in accordance with the expected movement direction and gesture) and located in the plane boundary, and then the safe position is issued to the mechanical arm to drive the operation tool to move, thereby accurately and safely helping doctors to realize the osteotomy operation on the femur and the tibia. Solves the technical problem of soft tissue and ligament injury and operation precision reduction caused by overlarge movement range of the osteotomy pendulum saw in the prior art.
When the technical scheme provided by the embodiment is applied to the knee joint replacement operation robot, a doctor can be accurately and easily controlled to assist in performing osteotomy operation in the knee joint replacement operation, meanwhile, the boundary safety of the pendulum saw is ensured, the accuracy and success rate of the knee joint replacement operation are improved, and the burden of the doctor is lightened.
In addition, the boundary control method of the osteotomy plane provided by the embodiment does not limit the convexity of the boundary, supports the custom boundary type according to the anatomy structure of the patient, can protect the posterior cruciate ligament and the medial collateral ligament of the patient from being damaged, and avoids unnecessary excessive cutting of soft tissues and ligaments.
Furthermore, according to the technical scheme provided by the embodiment, the safe position of the surgical tool is calculated according to the position of the surgical tool and the boundary of the safe surgical area planned by the operation force of a doctor, and the safe position of the surgical tool is issued to the mechanical arm to drive the surgical tool to move, so that the osteotomy of the femur and the tibia is accurately and safely realized. And only the expected position, the expected direction and the safety boundary of the osteotomy pendulum saw are needed, the current position and the current direction of the osteotomy pendulum saw are not needed to be acquired, the influence of the time lag of the system on the control is reduced, and the given safety direction of the osteotomy pendulum saw can be ensured to accord with the expected direction.
In order to further solve the problem that jump possibly exists in the safety position inside the osteotomy plane in the continuous control period, the situation that the end model of the data is arranged to cross the uppermost concave boundary shown in fig. 6 in the actual execution process is further solved, the algorithm further carries out boundary judgment based on the safety position planned in the previous period and the safety position obtained by the step search, and the finally output safety position of the algorithm is ensured to be always in the safety boundary of the osteotomy plane in the actual execution process.
Further, when the osteotomy plane is a concave-convex plane or other irregular plane, the boundary control method provided by the embodiment considers the physical model of the osteotomy in the actual end translation during the working of the osteotomy, so that the error of the algorithm is reduced to the greatest extent. The position of the surgical tool is controlled from the planning level not to exceed the plane boundary, and the track in the actual execution process is considered, so that the planning is further corrected, and the surgical tool is ensured to be always positioned in the irregular plane boundary in the control process.
Example III
Based on the same concept, referring to fig. 13, an osteotomy plane boundary control device 100 is shown according to an exemplary embodiment, comprising:
the searching module 101 is used for calculating the distance from the central point of the osteotomy pendulum saw to the boundary connecting line of the osteotomy plane, selecting the inward vector weighted summation of two sides with the shortest distance as the searching direction, and performing step-by-step searching;
the determining module 102 is configured to update the coordinates of the search points after each step search is completed, and determine an arc track when the end of the osteotomy pendulum saw is located in the boundary line of the osteotomy plane according to the updated search coordinates;
the judging module 103 is used for judging whether the arc track is intersected with the boundary connecting line of the osteotomy plane, if not, completing searching, outputting the current searching coordinate point as the safety coordinate of the central point of the osteotomy pendulum saw, and outputting the current searching coordinate point to the calculating module;
The calculation module 104 is configured to calculate an arc track planned in the period according to the safety coordinates and a planning direction vector of the osteotomy swing saw;
The output module 105 is configured to determine whether the circular arc trajectory planned in the previous cycle intersects with a boundary line of the osteotomy plane when translating to the circular arc trajectory position planned in the current cycle, calculate a motion vector when translating to the intersection point position of the circular arc trajectory planned in the previous cycle, output a sum of a safety coordinate of the central point of the osteotomy pendulum saw planned in the previous cycle and the motion vector as a safety coordinate of the central point of the osteotomy pendulum saw planned in the current cycle, and output the current search coordinate point as a safety coordinate of the central point of the osteotomy pendulum saw planned in the current cycle if the circular arc trajectory planned in the current cycle does not intersect.
It should be noted that, the implementation manner and beneficial effects of each module may be referred to the description of the related steps of the foregoing embodiment, which is not repeated in this embodiment.
It can be appreciated that, according to the technical scheme provided by the embodiment, by calculating the distance from the central point of the osteotomy pendulum saw to the boundary connecting line of the osteotomy plane, the inward vectors of the two sides with the shortest distance are selected to be weighted and summed, and used as the searching direction to perform step searching, so as to quickly find the safe position closest to the plane position boundary (i.e. in accordance with the expected movement direction and gesture) and located in the plane boundary, and then the safe position is issued to the mechanical arm to drive the operation tool to move, thereby accurately and safely helping doctors to realize the osteotomy operation on the femur and the tibia. Solves the technical problem of soft tissue and ligament injury and operation precision reduction caused by overlarge movement range of the osteotomy pendulum saw in the prior art.
Example IV
Referring to fig. 14, an electronic device is shown according to an exemplary embodiment, comprising:
A processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702 and the memory 703 complete communication with each other through the communication bus 704;
a memory 703 for storing a computer program;
The processor 701 is configured to implement the above-described method when executing the program stored in the memory.
It can be appreciated that, according to the technical scheme provided by the embodiment, by calculating the distance from the central point of the osteotomy pendulum saw to the boundary connecting line of the osteotomy plane, the inward vectors of the two sides with the shortest distance are selected to be weighted and summed, and used as the searching direction to perform step searching, so as to quickly find the safe position closest to the plane position boundary (i.e. in accordance with the expected movement direction and gesture) and located in the plane boundary, and then the safe position is issued to the mechanical arm to drive the operation tool to move, thereby accurately and safely helping doctors to realize the osteotomy operation on the femur and the tibia. Solves the technical problem of soft tissue and ligament injury and operation precision reduction caused by overlarge movement range of the osteotomy pendulum saw in the prior art.
Example five
A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the above-described method is shown according to an exemplary embodiment.
It can be appreciated that, according to the technical scheme provided by the embodiment, by calculating the distance from the central point of the osteotomy pendulum saw to the boundary connecting line of the osteotomy plane, the inward vectors of the two sides with the shortest distance are selected to be weighted and summed, and used as the searching direction to perform step searching, so as to quickly find the safe position closest to the plane position boundary (i.e. in accordance with the expected movement direction and gesture) and located in the plane boundary, and then the safe position is issued to the mechanical arm to drive the operation tool to move, thereby accurately and safely helping doctors to realize the osteotomy operation on the femur and the tibia. Solves the technical problem of soft tissue and ligament injury and operation precision reduction caused by overlarge movement range of the osteotomy pendulum saw in the prior art.
Of course, those skilled in the art will appreciate that implementing all or part of the above-described methods may be implemented by a computer program for instructing relevant hardware (e.g., a processor, a controller, etc.), where the program may be stored in a computer-readable storage medium, and where the program may include the steps of the above-described method embodiments when executed. The storage medium may be a memory, a magnetic disk, an optical disk, or the like.
The above-described embodiments of the present invention do not limit the scope of the present invention. Any other corresponding changes and modifications made in accordance with the technical idea of the present invention shall be included in the scope of the claims of the present invention.