Collision detection method and electronic device
Patent Information
- Application Number
- CN202410005293.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-01-02
AI Technical Summary
由此,存在对碰撞点进行检测的计算量大,所需消耗的计算资源多,以及计算效率低的问题
[0017]根据本公开提供的碰撞检测方法及电子设备,由于根据软组织模型的包围盒的信息和手术器械的碰撞检测球的信息,对软组织模型和手术器械进行了第一碰撞检测,在第一碰撞检测的结果为软组织模型和手术器械碰撞的情况下,再根据碰撞检测球的信息和软组织模型的外接球的信息,对软组织模型和手术器械进行第二碰撞检测,在第二碰撞检测的结果仍为软组织模型和手术器械碰撞的情况下,再一次根据碰撞检测球的信息和软组织模型的信息,进行第三碰撞检测,得到第三碰撞检测结果,实现了根据每一次的碰撞检测结果来判断是否要进行下一次的碰撞检测,从对碰撞进行粗略的检测到对碰撞进行精确的检测,将碰撞检测分层、分级、分区域,从而减少对手术器械和软组织模型间的检测的计算量,提高碰撞检测的效率和碰撞检测的速度,及时的对处于训练中的医生进行碰撞反馈,多次且逐步精细的碰撞检测也使碰撞检测的结果更加准确,减少碰撞检测的错误率,提高对手术器械和软组织模型间的碰撞检测的准确性,以及,手术器械上的碰撞检测球的位置是由研发人员和医生根据经验和试验结果共同确定的,因此,保障了手术器械上的碰撞检测球的位置的准确性,进一步的提高了碰撞检测的准确性。
Smart Images

Figure CN117831369B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the fields of virtual reality technology and medical technology, and in particular to a collision detection method and electronic device. Background Technology
[0002] A surgical simulator is a tool that helps doctors train their surgical skills in a virtual environment. By detecting collisions between surgical instruments and soft tissues, it helps doctors master and manipulate various soft tissues. For example, methods such as Bounding Volume Hierarchies (BVH), spatial partitioning, image-space techniques, continuous collision detection, and discrete collision detection can be used to detect collisions between surgical instruments and soft tissues.
[0003] Building upon this, to achieve more realistic collision effects, it is necessary to accurately detect the collision point between the soft tissue model and the surgical instruments, and then drive the movement of the soft tissue model based on this collision point. This results in a large computational load for collision point detection, high computational resource consumption, and low computational efficiency. Summary of the Invention
[0004] In view of the above problems, this disclosure provides a collision detection method and electronic device.
[0005] According to a first aspect of this disclosure, a collision detection method is provided, comprising: performing a first collision detection on a soft tissue model and a surgical instrument based on information of the bounding box of a soft tissue model and information of a collision detection ball of a surgical instrument, to obtain a first collision detection result, wherein the surgical instrument is an instrument model that operates on the soft tissue model, and the collision detection ball is set at a critical collision position of the surgical instrument determined by an object; if the first collision detection result indicates a collision between the soft tissue model and the surgical instrument, performing a second collision detection on the soft tissue model and the surgical instrument based on information of the collision detection ball and information of the circumscribed ball of the soft tissue model, to obtain a second collision detection result; if the second collision detection result indicates a collision between the soft tissue model and the surgical instrument, performing a third collision detection on the soft tissue model and the surgical instrument based on information of the collision detection ball and information of the soft tissue model, to obtain a third collision detection result.
[0006] According to embodiments of this disclosure, there are multiple collision detection spheres and multiple circumscribed spheres. A second target collision detection sphere and a target circumscribed sphere are in a collision relationship. The information of the collision detection spheres includes the center coordinates of the second target collision detection sphere. The soft tissue model includes multiple tetrahedral models, with a target tetrahedral model corresponding to the second target circumscribed sphere. The information of the soft tissue model includes the information of the four planes of the target tetrahedral model and the volume of the target tetrahedral model. Based on the information of the collision detection spheres and the information of the soft tissue model, a third collision detection is performed between the soft tissue model and the surgical instrument. The third collision detection result is obtained by: constructing four collision detection models corresponding to the four planes based on the center coordinates of the second target collision detection sphere and the information of the four planes. The collision detection model is a tetrahedron, and the bottom face of the collision detection model is one of the four planes. The planes corresponding to the four collision detection models are different, and the vertex of the collision detection model is the center of the collision detection sphere; determining the volume of the four collision detection models; and performing a third collision detection on the soft tissue model and surgical instruments based on the volume of the four collision detection models and the volume of the target tetrahedron model to obtain the third collision detection result.
[0007] According to embodiments of this disclosure, a third collision detection is performed on a soft tissue model and a surgical instrument based on the volumes of four collision detection models and the volume of a soft tissue model to obtain a third collision detection result. This includes: calculating the sum of volumes based on the volumes of the four collision detection models; calculating the volume difference based on the volume of the soft tissue model and the sum of volumes; and generating a third collision detection result characterizing the collision between the soft tissue model and the surgical instrument if the volume difference falls within a predetermined range.
[0008] According to embodiments of this disclosure, there are multiple bounding boxes and multiple collision detection spheres. A first target collision detection sphere among the multiple collision detection spheres has a collision relationship with a target bounding box among the multiple bounding boxes. The information of the collision detection spheres includes the center coordinates and radius of the first target collision detection sphere. The information of the circumscribed spheres includes the center coordinates and radius of the first target circumscribed sphere located within the target bounding box. Based on the information of the collision detection spheres and the information of the circumscribed spheres of the soft tissue model, a second collision detection is performed on the soft tissue model and the surgical instrument to obtain a second collision detection result. This includes: determining the distance between the first target collision detection sphere and the first target circumscribed sphere based on the center coordinates of the first target collision detection sphere and the center coordinates of the first target circumscribed sphere; and performing a second collision detection on the soft tissue model and the surgical instrument based on the distance, the radius of the first target collision detection sphere, and the radius of the first target circumscribed sphere to obtain a second collision detection result.
[0009] According to embodiments of this disclosure, a second collision detection is performed on a soft tissue model and a surgical instrument based on a distance, the radius of a first target collision detection sphere, and the radius of a first target circumscribed sphere to obtain a second collision detection result. This includes: calculating the radius sum based on the radius of the first target collision detection sphere and the radius of the first target circumscribed sphere; and generating a second collision detection result characterizing the collision between the soft tissue model and the surgical instrument when the distance is less than the radius sum.
[0010] According to embodiments of this disclosure, the information of the collision detection sphere includes the coordinates of its center, and the information of the bounding box includes the coordinate range of the space enclosed by the bounding box. Based on the bounding box information of the soft tissue model and the collision detection sphere information of the surgical instrument, a first collision detection is performed on the soft tissue model and the surgical instrument to obtain a first collision detection result. This includes: determining the positional relationship between the collision detection sphere and the bounding box based on the coordinates of the center of the collision detection sphere and the coordinate range information of the bounding box; and generating a first collision detection result characterizing the collision between the soft tissue model and the surgical instrument when the positional relationship indicates that the center of the collision detection sphere is located within the bounding box.
[0011] According to embodiments of this disclosure, the method further includes: acquiring a soft tissue model file in stereolithography format; converting the stereolithography format soft tissue model file to obtain a soft tissue model file in product model information exchange standard format; processing the soft tissue model file in product model information exchange standard format using a three-dimensional finite element mesh generation tool to obtain information about a tetrahedral model; and processing the information about the tetrahedral model using a model visualization engine to obtain a soft tissue model.
[0012] According to an embodiment of this disclosure, there are multiple collision detection balls; the method further includes: determining the number of threads of the graphics processor based on the number of multiple collision detection balls; and calling the threads of the graphics processor corresponding to the number of threads to perform a second collision detection operation and a third collision detection operation using the threads of the graphics processor.
[0013] According to embodiments of this disclosure, the method further includes: using a K-dimensional tree algorithm to divide the space in which the soft tissue model is located to generate a bounding box.
[0014] A second aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the methods described above.
[0015] A third aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the methods described above.
[0016] A fourth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0017] According to the collision detection method and electronic device provided in this disclosure, a first collision detection is performed on the soft tissue model and the surgical instrument based on the bounding box information of the soft tissue model and the collision detection sphere information of the surgical instrument. If the result of the first collision detection is that the soft tissue model and the surgical instrument collide, a second collision detection is performed on the soft tissue model and the surgical instrument based on the information of the collision detection sphere and the circumscribed sphere of the soft tissue model. If the result of the second collision detection is still that the soft tissue model and the surgical instrument collide, a third collision detection is performed again based on the information of the collision detection sphere and the information of the soft tissue model, and a third collision detection result is obtained. This realizes the ability to determine whether to perform the next collision detection based on the result of each collision detection. Collision detection progresses from coarse to precise collision detection, layering, grading, and regionalizing collision detection to reduce computational burden on surgical instruments and soft tissue models, thereby improving efficiency and speed. Timely collision feedback is provided to doctors during training, and multiple, progressively refined collision detections increase accuracy, reducing error rates and enhancing the overall accuracy of collision detection between surgical instruments and soft tissue models. Furthermore, the position of the collision detection ball on the surgical instrument is jointly determined by researchers and doctors based on experience and experimental results, ensuring the accuracy of the ball's placement and further improving overall collision detection accuracy. Attached Figure Description
[0018] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0019] Figure 1 The diagram illustrates an application scenario of the collision detection method and electronic device according to embodiments of the present disclosure.
[0020] Figure 2 A flowchart illustrating a collision detection method according to an embodiment of the present disclosure is shown schematically.
[0021] Figure 3 A schematic diagram of a surgical instrument model according to an embodiment of the present disclosure is shown.
[0022] Figure 4 A schematic diagram of a surgical instrument model with multiple collision detection balls added according to an embodiment of the present disclosure is shown.
[0023] Figure 5A flowchart illustrating the process of obtaining a soft tissue model according to an embodiment of the present disclosure is shown schematically.
[0024] Figure 6 A schematic diagram of a tetrahedral model according to an embodiment of the present disclosure is shown.
[0025] Figure 7 A flowchart illustrating the process of obtaining a third collision detection result according to an embodiment of the present disclosure is shown schematically;
[0026] Figure 8 A schematic diagram illustrating a computational tetrahedral model according to an embodiment of the present disclosure is shown.
[0027] Figure 9 A schematic diagram of a visualized soft tissue model according to an embodiment of the present disclosure is shown;
[0028] Figure 10 The illustration shows a schematic diagram of generating bounding boxes by processing a soft tissue model using a K-dimensional tree algorithm according to an embodiment of the present disclosure;
[0029] Figure 11 A schematic diagram illustrating the generation of a collision ball according to an embodiment of the present disclosure is shown.
[0030] Figure 12 A flowchart illustrating the complete process of a collision detection method according to an embodiment of the present disclosure is shown schematically.
[0031] Figure 13 A schematic block diagram of a collision detection device according to an embodiment of the present disclosure is shown; and
[0032] Figure 14 A block diagram schematically illustrates an electronic device suitable for implementing a collision detection method according to an embodiment of the present disclosure. Detailed Implementation
[0033] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0034] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0035] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0036] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).
[0037] In the technical solution disclosed herein, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse.
[0038] In practical applications, surgical simulators are used to help doctors train surgical skills in virtual environments. They typically detect collisions between the instruments the surgeon is operating and soft tissues, thus aiding training and enabling proficient manipulation of various soft tissues. Existing technologies commonly employ methods such as Bounding Volume Hierarchies (BVH), spatial partitioning, image-space techniques, continuous collision detection, and discrete collision detection to detect collisions between the surgeon's instruments and soft tissues, thereby assisting doctors in surgical training within a virtual environment.
[0039] However, in some embodiments, the methods for detecting the interaction and collision between instruments and soft tissue have different applicability in different application scenarios and cannot be applied to facilitate surgical training for doctors in all scenarios. Therefore, doctors need to use surgical simulators for virtual surgical training in specific scenarios.
[0040] Therefore, to make the collision effect more realistic, it is necessary to accurately detect the collision point between the surgical instrument and the soft tissue model. However, detecting this collision point consumes a lot of computational resources.
[0041] In view of this, embodiments of the present disclosure provide a collision detection method, comprising: performing a first collision detection on a soft tissue model and a surgical instrument based on information of the bounding box of a soft tissue model and information of a collision detection ball of a surgical instrument, to obtain a first collision detection result, wherein the surgical instrument is an instrument model that operates on the soft tissue model, and the collision detection ball is set at a key collision position of the surgical instrument determined by the object; if the first collision detection result indicates a collision between the soft tissue model and the surgical instrument, performing a second collision detection on the soft tissue model and the surgical instrument based on information of the collision detection ball and information of the circumscribed ball of the soft tissue model, to obtain a second collision detection result; if the second collision detection result indicates a collision between the soft tissue model and the surgical instrument, performing a third collision detection on the soft tissue model and the surgical instrument based on information of the collision detection ball and information of the soft tissue model, to obtain a third collision detection result.
[0042] Figure 1 The diagram illustrates an application scenario of collision detection according to an embodiment of the present disclosure.
[0043] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0044] Users can interact with server 105 via network 104 using at least one of the first terminal device 101, second terminal device 102, and third terminal device 103 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, second terminal device 102, and third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0045] For example, a user can use the surgical simulator installed in the first terminal device 101, the second terminal device 102, and the third terminal device 103 to send a simulation request to the server 105 equipped with the surgical simulator system.
[0046] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0047] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0048] For example, server 105 can be a distributed server, a cloud server, or a centralized server. Server 105 can simultaneously run both older and newer versions of the business system and test methods for storing business data.
[0049] It should be noted that the collision detection method provided in this embodiment can generally be executed by server 105. Correspondingly, the collision detection device provided in this embodiment can generally be located in server 105. The collision detection method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the collision detection device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0050] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0051] The following will be based on Figure 1 The described scene, through Figures 2 to 12 The collision detection method of the disclosed embodiments will be described in detail.
[0052] Figure 2 A flowchart illustrating a collision detection method according to an embodiment of the present disclosure is shown schematically.
[0053] like Figure 2 As shown, the collision detection method of this embodiment includes operations S210 to S230.
[0054] In operation S210, based on the bounding box information of the soft tissue model and the collision detection ball information of the surgical instrument, a first collision detection is performed on the soft tissue model and the surgical instrument to obtain the first collision detection result.
[0055] According to embodiments of this disclosure, the surgical instrument is an instrument model that operates on a soft tissue model, and a collision detection ball is set at a critical collision location of the surgical instrument determined by the object.
[0056] According to embodiments of this disclosure, a soft tissue model represents a visual soft tissue structure simulated in a surgical simulator.
[0057] According to embodiments of this disclosure, the bounding box representation of the soft tissue model represents the geometry existing outside the soft tissue after the soft tissue model is spatially partitioned in the surgical simulator. The volume of the bounding box can be set according to requirements, which will not be elaborated here.
[0058] According to embodiments of this disclosure, a surgical simulator can determine whether a surgical instrument has collided based on the location of a collision detection ball set on the surgical instrument.
[0059] According to embodiments of this disclosure, when the collision detection ball is located within the bounding box, a collision between the collision detection ball and the bounding box can be determined, and a first collision detection result characterizing the collision between the soft tissue model and the surgical instrument can be generated. Conversely, when the collision detection ball is not located within the bounding box, a non-collision between the collision detection ball and the bounding box can be determined, and a first collision detection result characterizing the non-collision between the soft tissue model and the surgical instrument can be generated.
[0060] According to embodiments of this disclosure, a collision detection sphere located within a bounding box can be identified as a first target collision detection sphere. Furthermore, the bounding box including the first target collision detection sphere is identified as a target bounding box that collides with the first target collision detection sphere. The first target collision detection sphere can be at least one, and the target bounding box can be at least one.
[0061] In operation S220, if the first collision detection result characterizes the collision between the soft tissue model and the surgical instrument, a second collision detection is performed on the soft tissue model and the surgical instrument based on the information of the collision detection ball and the information of the circumscribed ball of the soft tissue model, and a second collision detection result is obtained.
[0062] According to embodiments of this disclosure, the information of the collision detection ball may include information such as the radius and volume of the collision detection ball, but is not limited to the above information.
[0063] According to embodiments of this disclosure, the information of the circumscribed sphere of the soft tissue model may include information such as the radius and volume of the circumscribed sphere, but is not limited to the above information.
[0064] According to embodiments of this disclosure, a soft tissue model may include multiple tetrahedral models. The circumsphere of the soft tissue model can be the circumsphere of the tetrahedral models, that is, each tetrahedral model has a corresponding circumsphere.
[0065] According to embodiments of this disclosure, a first target circumsphere can be determined as the circumsphere located within the target bounding box of a soft tissue model. There can be at least one first target circumsphere in each target bounding box.
[0066] According to embodiments of this disclosure, the collision status between the soft tissue model and the surgical instrument can be determined based on the distance between the first target collision detection sphere and the first target circumscribed sphere. For example, the radius of the first target collision detection sphere and the radius of the first target circumscribed sphere can be added together to obtain a sum of radii. If the distance between the first target collision detection sphere and the first target circumscribed sphere is less than the sum of radii, a second collision detection result characterizing the collision between the soft tissue model and the surgical instrument can be generated. If the distance between the first target collision detection sphere and the first target circumscribed sphere is greater than or equal to the sum of radii, a second collision detection result characterizing that the soft tissue model and the surgical instrument did not collide can be generated.
[0067] According to embodiments of this disclosure, a first target collision detection sphere and a first target circumscribed sphere whose distance is less than the sum of their radii can be respectively identified as a second target collision detection sphere and a second target circumscribed sphere, and a collision relationship can be determined between the second target collision detection sphere and the second target circumscribed sphere.
[0068] In operation S230, when the second collision detection result characterizes the collision between the soft tissue model and the surgical instrument, a third collision detection is performed on the soft tissue model and the surgical instrument based on the information of the collision detection ball and the information of the soft tissue model, and the third collision detection result is obtained.
[0069] According to embodiments of this disclosure, four new collision detection models can be constructed based on the center of the second target collision detection sphere and the four planes of the tetrahedral model corresponding to the circumscribed sphere of the second target. These four planes are the four surfaces of the tetrahedral model. A third collision detection result characterizing the collision between the soft tissue model and the surgical instrument can be generated if the sum of the volumes of the four collision detection models is less than or equal to the volume of the soft tissue model. Alternatively, a third collision detection result characterizing the non-collision between the soft tissue model and the surgical instrument can be generated if the sum of the volumes of the four collision detection models is greater than the volume of the soft tissue model.
[0070] According to embodiments of this disclosure, when the third collision detection result characterizes the collision between the soft tissue model and the surgical instrument, the collision point between the soft tissue model and the surgical instrument can be determined based on the position of the center of the second target collision detection ball.
[0071] According to embodiments of this disclosure, a first collision detection is performed on the soft tissue model and the surgical instrument based on the bounding box information of the soft tissue model and the collision detection ball information of the surgical instrument. If the result of the first collision detection is a collision between the soft tissue model and the surgical instrument, a second collision detection is performed based on the collision detection ball information and the information of the outer sphere of the soft tissue model. If the result of the second collision detection is still a collision between the soft tissue model and the surgical instrument, a third collision detection is performed again based on the collision detection ball information and the information of the soft tissue model, resulting in a third collision detection result. This achieves the goal of determining whether to perform the next collision detection based on the result of each collision detection, from collision... The collision detection process progresses from coarse to precise, layering, grading, and regionalizing to reduce computational burden and improve efficiency and speed. Timely collision feedback is provided to trainees, and repeated, progressively refined collision detection results in greater accuracy, reducing error rates and enhancing the overall accuracy of collision detection between instruments and soft tissue models. Furthermore, the position of the collision detection ball on the surgical instrument is determined through a combination of experimental results from researchers and surgeons' experience, ensuring accuracy and further improving overall collision detection accuracy.
[0072] According to embodiments of this disclosure, if the first collision detection result indicates that the surgical instrument and the soft tissue model did not collide, there is no need to perform the second and third collision detections. Similarly, if the second collision detection result indicates that the surgical instrument and the soft tissue model did not collide, there is no need to perform the third collision detection.
[0073] Figure 3 A schematic diagram of a surgical instrument model according to an embodiment of the present disclosure is shown.
[0074] like Figure 3 As shown in Example 300, a surgical instrument model is illustrated, which is used by a surgeon during training in a surgical simulator. The surgeon performs surgical operations on a soft tissue model by manipulating the surgical instrument model, achieving the effect of training in a virtual environment.
[0075] Figure 4 A schematic diagram of a surgical instrument model with multiple collision detection balls added according to an embodiment of the present disclosure is shown.
[0076] like Figure 4As shown in Example 400, a surgical instrument with collision detection balls was designed based on multiple tests conducted by researchers and the surgical experience of doctors. The multiple collision detection balls on the surgical instrument are positioned in areas where they are likely to collide with the soft tissue model, thereby improving the accuracy of collision detection between the surgical instrument and the soft tissue model.
[0077] Figure 5 A flowchart illustrating the process of obtaining a soft tissue model according to an embodiment of the present disclosure is shown.
[0078] like Figure 5 As shown, the collision detection method of this embodiment includes operations S510 to S540.
[0079] In the S510 operation, a soft tissue model file in stereolithography format is obtained.
[0080] According to embodiments of this disclosure, the soft tissue model file in stereolithography format can be obtained from CT (Computed Tomography).
[0081] In the S520 operation, the soft tissue model file in stereolithography format is converted to obtain a soft tissue model file in the product model information exchange standard format.
[0082] According to embodiments of this disclosure, the format of a stereolithography-formatted soft tissue model file can be converted into a .STP format file.
[0083] In operating S530, the three-dimensional finite element mesh generation tool is used to process the soft tissue model file in the product model information exchange standard format to obtain the information of the tetrahedral model.
[0084] According to embodiments of this disclosure, the three-dimensional finite element mesh generation tool processing product can be a GMSH tool, etc.
[0085] In the operation of S540, the information of the tetrahedral model is processed using the model visualization engine to obtain the soft tissue model.
[0086] According to embodiments of this disclosure, the model visualization engine can be the Unity engine.
[0087] According to an embodiment of this disclosure, based on a preoperative CT scan, a soft tissue model (STL model) is obtained. The STL model file is converted into an STP format file, and the STP file is imported into GMSH software to generate a tetrahedral model and its data. Unity is used to read the model data and generate a visualization model. At the same time, the surgical instruments are imported into Unity, and several collision detection spheres are generated at key parts of the surgical instruments, wherein the center of the collision detection sphere is located at the edge of the surgical instruments.
[0088] According to embodiments of this disclosure, a soft tissue model file in stereolithography format is obtained. The file format of the stereolithography-formatted soft tissue model file is converted to obtain a soft tissue model file in the product model information exchange standard format. Then, a three-dimensional finite element network generation tool is used to process the soft tissue model file in the product model information exchange standard format to obtain a tetrahedral model of the soft tissue and tetrahedral model information of the soft tissue. Then, a visualization engine is used to process the tetrahedral model information to obtain a soft tissue model that can be applied to virtual training. This realizes the construction of a soft tissue model used for training in a surgical simulator. Accurately constructing a soft tissue model can help doctors conduct virtual training and improve the accuracy of collision detection of surgical instruments.
[0089] According to embodiments of this disclosure, the information of the collision detection ball includes the coordinates of the center of the collision detection ball, and the information of the bounding box includes the coordinate range information of the space enclosed by the bounding box.
[0090] According to embodiments of this disclosure, a first collision detection is performed on the soft tissue model and the surgical instrument based on the bounding box information of the soft tissue model and the collision detection ball information of the surgical instrument, to obtain a first collision detection result, including:
[0091] According to embodiments of this disclosure, the positional relationship between the collision detection ball and the bounding box is determined based on the center coordinate information of the collision detection ball and the coordinate range information of the bounding box.
[0092] According to embodiments of this disclosure, based on the coordinate range information of the bounding box containing the center coordinates of the collision detection ball, it is determined whether the collision detection ball is within the bounding box, thus obtaining the positional relationship between the collision detection ball and the bounding box.
[0093] According to embodiments of this disclosure, when the center of the collision detection sphere representing the positional relationship is located within the bounding box, a first collision detection result representing the collision between the soft tissue model and the surgical instrument is generated.
[0094] According to embodiments of this disclosure, when the center of the collision detection ball representing the positional relationship is not located within the bounding box, the first collision detection result is that no collision occurred between the soft tissue model and the surgical instrument, and there is no need to perform a second or third collision detection.
[0095] According to embodiments of this disclosure, the positional relationship between the collision detection sphere and the bounding box is determined based on the center coordinates of the collision detection sphere and the coordinate range of the bounding box. If the positional relationship is determined, a first collision detection result is generated. If the first collision detection result indicates a collision between the surgical instrument and the soft tissue model, a second collision detection is performed; otherwise, no second collision detection is required. This achieves preliminary detection of the collision relationship between the collision detection sphere and the bounding box. Based on the preliminary, coarse detection result indicating a collision, a further refined detection is performed; otherwise, no detection is required, saving computational resources and improving collision detection efficiency.
[0096] Figure 6 A schematic diagram of a tetrahedral model according to an embodiment of the present disclosure is shown.
[0097] like Figure 6 As shown in Example 600, four collision detection models are illustrated based on the center of the collision detection sphere and four planes respectively.
[0098] According to embodiments of this disclosure, there are multiple bounding boxes and multiple collision detection spheres. The first target collision detection sphere among the multiple collision detection spheres has a collision relationship with the target bounding box among the multiple bounding boxes. The information of the collision detection sphere includes the center coordinate information and radius of the first target collision detection sphere. The information of the circumscribed sphere includes the center coordinate information and radius of the first target circumscribed sphere located in the target bounding box.
[0099] According to embodiments of this disclosure, a second collision detection is performed on the soft tissue model and surgical instruments based on information from the collision detection ball and information from the circumscribed ball of the soft tissue model, to obtain a second collision detection result, including:
[0100] According to an embodiment of this disclosure, the distance between the first target collision detection ball and the first target circumscribed ball is determined based on the center coordinate information of the first target collision detection ball and the center coordinate information of the first target circumscribed ball.
[0101] For example, the center coordinates of the collision detection sphere are (x1, y1, z1), and the center coordinates of the circumscribed sphere are (x0, y0, z0). The Euclidean distance between these two coordinates is calculated as follows:
[0102] According to embodiments of this disclosure, a second collision detection is performed on the soft tissue model and surgical instruments based on the distance, the radius of the first target collision detection sphere, and the radius of the first target circumscribed sphere, to obtain a second collision detection result.
[0103] According to the embodiments of this disclosure, the radius of the circumscribed sphere can be calculated using formulas (1) to (3).
[0104] (x-x0) 2 +(y-y0) 2 +(z-z0) 2 =R 2 (1);
[0105] Where R represents the radius of the circumscribed sphere, x0 is the coordinate of the center of the circumscribed sphere on the x-axis, y0 is the coordinate of the center of the circumscribed sphere on the y-axis, and z0 is the coordinate of the center of the circumscribed sphere on the z-axis.
[0106]
[0107] x 2 +y 2 +z 2 +ax+by+cz+d=0 (3);
[0108] Substituting the coordinates of the four vertices of the tetrahedron into formula (3) yields the specific values of a, b, c, and d, where a, b, c, and d are the coefficients in formula (3).
[0109] According to the embodiments of this disclosure, the coordinates of the center of the circumscribed sphere are obtained from formulas (1) to (3). The radius of the circumscribed sphere is shown in formula (4).
[0110]
[0111] According to embodiments of this disclosure, the distance between the first target collision detection ball and the first target circumscribed ball is determined based on the information of the collision detection ball and the information of the circumscribed ball of the soft tissue model. Based on the distance between the first target collision detection ball and the first target circumscribed ball, the radius of the first target collision detection ball, and the radius of the first target circumscribed ball, a second collision detection is performed to obtain the collision result between the surgical instrument and the soft tissue model. This enables more precise detection of the position between the surgical instrument and the soft tissue model when the first collision result is that the surgical instrument and the soft tissue model collide.
[0112] According to embodiments of this disclosure, a second collision detection is performed on the soft tissue model and surgical instruments based on the distance, the radius of the first target collision detection sphere, and the radius of the first target circumscribed sphere, to obtain a second collision detection result, including:
[0113] According to an embodiment of this disclosure, the radius and radius sum are calculated based on the radius of the first target collision detection ball and the radius of the first target circumscribed ball.
[0114] For example, the radius of the first target collision detection ball is R1, the radius of the first target circumscribed ball is R, and the sum of the radii is R1 + R.
[0115] According to embodiments of this disclosure, when the distance is less than the radius, a second collision detection result characterizing the collision between the soft tissue model and the surgical instrument is generated.
[0116] According to embodiments of this disclosure, when the distance is less than the radius, the second collision detection result is that the surgical instrument collides with the soft tissue model; when the distance is equal to or greater than the radius, the second collision detection result is that no collision occurs between the surgical instrument and the soft tissue model.
[0117] According to an embodiment of this disclosure, if the second collision detection result indicates a collision between the surgical instrument and the soft tissue model, a third collision detection is performed.
[0118] According to the embodiments of this disclosure, the radius of the first target collision detection ball and the radius of the first target circumscribed ball are added together to obtain the radius sum. It is then determined whether the distance is less than the radius sum. If the distance is less than the radius sum, a second detection result of a collision between the surgical instrument and the soft tissue model is obtained. This achieves more accurate collision detection between the surgical instrument and the soft tissue model based on the first collision detection, and determines the distance between the collision detection ball and the soft tissue model.
[0119] Figure 7 A flowchart illustrating the process of obtaining a third collision detection result according to an embodiment of the present disclosure is shown.
[0120] like Figure 7 As shown, the collision detection method of this embodiment includes operations S710 to S730.
[0121] According to embodiments of this disclosure, there are multiple collision detection spheres and multiple circumscribed spheres. A collision relationship exists between the second target collision detection sphere among the multiple collision detection spheres and the second target circumscribed sphere among the multiple circumscribed spheres. The information of the collision detection spheres includes the center coordinates of the second target collision detection sphere. The soft tissue model includes multiple tetrahedral models, with the target tetrahedral model among the multiple tetrahedral models corresponding to the second target circumscribed sphere. The information of the soft tissue model includes the information of the four planes of the target tetrahedral model and the volume of the target tetrahedral model.
[0122] According to embodiments of this disclosure, a third collision detection is performed on the soft tissue model and surgical instruments based on information from the collision detection ball and information from the soft tissue model to obtain a third collision detection result, including:
[0123] In operation S710, based on the center coordinates of the second target collision detection sphere and the information of the four planes, four collision detection models corresponding to the four planes are constructed.
[0124] According to an embodiment of this disclosure, the collision detection model is a tetrahedron, the bottom surface of the collision detection model is one of four planes, and each of the four planes corresponding to the four collision detection models is different. The vertex of the collision detection model is the center of the collision detection sphere.
[0125] According to embodiments of this disclosure, the information of the four planes may include the vertex coordinates of each of the four planes, but is not limited to the above information.
[0126] According to embodiments of this disclosure, the collision detection model characterizes a tetrahedral model obtained from the center of the collision detection sphere and three vertices of any one of the four planes.
[0127] According to the embodiments of this disclosure, the four collision detection models corresponding to the four planes are constructed by using the center of the collision detection sphere and the three vertices of each of the four planes to obtain four tetrahedral models.
[0128] In operation S720, the volumes of the four collision detection models are determined. According to embodiments of this disclosure, the volumes of the four collision detection models are calculated using the volume formula for a tetrahedron.
[0129] According to an embodiment of this disclosure, the volume formula of a tetrahedron is shown in formula (5).
[0130]
[0131] Among them, V tet The volume of the collision detection model is represented by , a represents the vector from the vertex of the collision detection model to the first vertex of the bottom surface of the collision detection model, b represents the vector from the vertex of the collision detection model to the second vertex of the bottom surface of the collision detection model, and c represents the vector from the vertex of the collision detection model to the third vertex of the bottom surface of the collision detection model. The meanings of the symbols a, b, and c here are different from the meanings of the symbols a, b, and c in formula (3).
[0132] In operation S730, a third collision detection is performed on the soft tissue model and surgical instruments based on the volumes of the four collision detection models and the target tetrahedral model, and the third collision detection result is obtained.
[0133] According to embodiments of this disclosure, the third collision detection is a fine-grained detection method. It employs a discrete collision detection method to detect whether the center of the collision detection sphere enters the interior of the soft tissue model tetrahedron. The centroid method is used to detect whether a point is within the soft tissue model tetrahedron. Four new tetrahedrons are formed by connecting the center of the collision detection sphere to the four points of the tetrahedron. When the collision detection sphere is inside a tetrahedron, the sum of the volumes of the four newly formed tetrahedrons is the same as the volume of the original tetrahedron. When the values are the same, the collision detection sphere is considered to be inside the tetrahedron, and a collision occurs.
[0134] According to embodiments of this disclosure, the center of gravity of the collision detection sphere is used to determine whether its center is within the soft tissue model. Based on the coordinate information of the center of the second target collision detection sphere and the information of the four planes, four collision detection models are constructed. The volumes of the four collision detection models are calculated to determine their volumes. Based on the volumes of the four collision detection models and the volume of the target tetrahedral model, a third collision detection is performed to obtain the collision detection results between the surgical instrument and the soft tissue model. This achieves a third collision detection between the surgical instrument and the soft tissue model, ensuring the accuracy of the collision detection and further enabling precise collision detection between the surgical instrument and the soft tissue model.
[0135] Figure 8 A schematic diagram of a computational tetrahedral model according to an embodiment of the present disclosure is shown.
[0136] like Figure 8 As shown in Embodiment 800, a tetrahedron is formed by connecting four vertices: vertex A, vertex B, vertex C, and vertex D to each other. Vertex A and vertex B form edge a, vertex A and vertex C form edge b, and vertex A and vertex D form edge c. The volume of the tetrahedron can be calculated based on the lengths of edge a, edge b, edge c, and the tetrahedron formula.
[0137] According to embodiments of this disclosure, a third collision detection is performed on the soft tissue model and surgical instruments based on the volumes of four collision detection models and the volume of the soft tissue model, resulting in a third collision detection result, including:
[0138] According to embodiments of this disclosure, the sum of volumes is calculated based on the volumes of four collision detection models.
[0139] According to embodiments of this disclosure, the volume is represented by adding the volumes of four collision detection models together.
[0140] According to embodiments of this disclosure, the volume difference is calculated based on the volume of the target tetrahedral model and the sum of its volumes.
[0141] According to embodiments of this disclosure, when the volume difference falls within a predetermined range, a third collision detection result characterizing the collision between the soft tissue model and the surgical instrument is generated.
[0142] According to embodiments of this disclosure, when the volume difference is within a predetermined range, the third collision result is the result of a collision between the soft tissue model and the surgical instrument; when the volume difference is not within the predetermined range, the third collision result is the result that no collision occurred between the soft tissue model and the surgical instrument.
[0143] According to embodiments of this disclosure, the sum of the volumes of four collision detection models obtained from the center of the collision detection sphere and the four planes is calculated. Based on the volume of the target tetrahedral model and the sum of the volumes of the four collision detection models, a volume difference is calculated. It is determined whether the volume difference falls within a predetermined range. If the volume difference falls within the predetermined range, the generated third collision detection result indicates that the surgical instrument collides with the soft tissue model. If the volume difference does not fall within the predetermined range, the generated third collision detection result indicates that no collision occurs between the surgical instrument and the soft tissue model. This achieves precise detection between the surgical instrument and the soft tissue model, improving the accuracy of collision detection.
[0144] Figure 9 A schematic diagram of a visualized soft tissue model according to an embodiment of the present disclosure is shown.
[0145] like Figure 9 As shown in Example 900, a visualized soft tissue model in a surgical simulator is generated after the operations described in S510 to S540 above.
[0146] According to embodiments of this disclosure, there are multiple collision detection balls.
[0147] According to embodiments of this disclosure, the number of threads of the graphics processor is determined based on the number of multiple collision detection balls.
[0148] According to embodiments of this disclosure, a thread of the graphics processor corresponding to the number of threads is invoked to perform a second collision detection operation and a third collision detection operation using the threads of the graphics processor.
[0149] According to embodiments of this disclosure, the number of first threads in the graphics processor used to perform the second collision detection operation can be determined based on the number of first target collision detection balls. The second collision detection operation can then be performed by calling the threads of the graphics processor according to the number of first threads.
[0150] According to embodiments of this disclosure, the number of second threads in the graphics processor used to perform the third collision detection operation can be determined based on the number of second target collision detection balls. The third collision detection operation can then be performed by calling the graphics processor's threads according to the number of second threads.
[0151] According to embodiments of this disclosure, the number of threads of the graphics processing unit (GPU) is determined based on the number of multiple collision detection balls. Then, only the threads corresponding to the number of threads are called to execute the second and third collision detection operations. This achieves precise calling of the threads that need to be run, saves the computational load of collision detection, and improves computational efficiency.
[0152] According to embodiments of this disclosure, a K-dimensional tree algorithm can be used to divide the space in which the soft tissue model resides, generating bounding boxes. The size of the bounding boxes can be set according to requirements.
[0153] According to embodiments of this disclosure, the KD-Tree algorithm is used to spatially partition the soft tissue model to obtain a soft tissue model containing several bounding boxes. Based on the location of the surgical instrument, it is determined which bounding box the surgical instrument is currently in, and then collision detection is performed. This reduces the amount of computation, improves the accuracy of collision detection, and further improves the efficiency of collision detection.
[0154] Figure 10 The illustration shows a schematic diagram of generating bounding boxes by processing a soft tissue model using a K-dimensional tree algorithm according to an embodiment of the present disclosure.
[0155] like Figure 10 As shown in Example 1000, the soft tissue model is spatially partitioned using the K-dimensional tree algorithm to obtain multiple bounding boxes of different shapes. Some bounding boxes are located outside the entire soft tissue model, while others are located locally within the soft tissue model.
[0156] Figure 11 A schematic diagram illustrating the generation of a collision ball according to an embodiment of the present disclosure is shown.
[0157] like Figure 11 As shown in Example 1100, after processing the soft tissue model file of the product model information exchange standard format using a three-dimensional finite element mesh generation tool, multiple tetrahedral models were obtained, and multiple circumscribed spheres were generated based on the multiple tetrahedral models.
[0158] Figure 12 A flowchart illustrating the complete process of a collision detection method according to an embodiment of the present disclosure is shown.
[0159] like Figure 12As shown in Example 1200, soft tissue organ processing includes: firstly, obtaining a soft tissue organ model S1201 from a preoperative CT scan; then, converting the STL model to an STP model S1202, i.e., converting the STL model to an STP model; generating volume model data S1203 using GMSH software, i.e., processing the STP model to obtain a volume model and volume model data; processing the model data using Unity to generate a visualization model S1204, i.e., processing the volume model data using Unity to generate a visualization of the soft tissue organ model; and finally, generating a collision body 1205 by combining the model structure with the KD-Tree method, i.e., performing tree algorithm processing on the obtained visualization of the soft tissue organ model to divide the soft tissue organ model into a soft tissue model containing several bounding boxes.
[0160] Then, in embodiment 1200, it is also shown that the processing of the surgical instrument includes: a digital twin model of the surgical instrument S1206, that is, generating a virtual surgical instrument used by the doctor, and then generating collision balls S1207 for key parts of the instrument, that is, generating multiple collision balls on the virtual surgical instrument, the collision balls being distributed in areas where the surgical instrument used by the doctor is likely to collide with the soft tissue model.
[0161] Furthermore, in Embodiment 1200, it is also shown that a doctor performs surgical training in a surgical simulator with a pre-generated soft tissue model and surgical instruments. During the doctor's training process, the surgical simulator performs collision detection to determine whether the surgical instruments operated by the doctor collide with the soft tissue model. The collision detection process includes: firstly, performing a first-layer collision detection S1208; if the result of the first-layer collision detection indicates that the surgical instruments collide with the soft tissue model, performing a second-layer collision detection S1209; in the second-layer collision detection, tetrahedral network information S1211 obtained during the generation of volume model data using GMSH software is used to determine whether the surgical instruments collide with the soft tissue model; if the result of the second-layer collision detection indicates that the surgical instruments collide with the soft tissue model, performing a third-layer collision detection S1210; in the third-layer collision detection, circumscribed spheres S1212 generated based on the tetrahedral data are used to determine for the third time whether the surgical instruments collide with the soft tissue model.
[0162] Based on the above collision detection method, this disclosure also provides a collision detection device. The following will be combined with... Figure 13 The device is described in detail.
[0163] Figure 13 A schematic block diagram of a collision detection apparatus according to an embodiment of the present disclosure is shown.
[0164] like Figure 13 As shown, the collision detection device 1300 of this embodiment includes a first detection module 1310, a second detection module 1320 and a third detection module 1330.
[0165] The first detection module 1310 is used to perform a first collision detection on the soft tissue model and the surgical instrument based on the bounding box information of the soft tissue model and the collision detection ball information of the surgical instrument, and obtain a first collision detection result. The surgical instrument is an instrument model that operates on the soft tissue model, and the collision detection ball is set at a key collision position of the surgical instrument determined by the object. In one embodiment, the first detection module 1310 can be used to perform the operation S210 described above, which will not be repeated here.
[0166] The second detection module 1320 is used to perform a second collision detection on the soft tissue model and the surgical instrument based on the information of the collision detection ball and the information of the circumscribed ball of the soft tissue model, when the first collision detection result indicates a collision between the soft tissue model and the surgical instrument, thereby obtaining a second collision detection result. In one embodiment, the second detection module 1320 can be used to perform the operation S220 described above, which will not be repeated here.
[0167] The third detection module 1330 is used to perform a third collision detection on the soft tissue model and the surgical instrument based on the information of the collision detection ball and the information of the soft tissue model, when the second collision detection result characterizes the collision between the soft tissue model and the surgical instrument, to obtain a third collision detection result. In one embodiment, the third detection module 1330 can be used to perform the operation S230 described above, which will not be repeated here.
[0168] According to embodiments of this disclosure, the third detection module 1330 includes: a first construction submodule, a first determination submodule, and a first collision detection submodule.
[0169] The first construction submodule is used to construct four collision detection models corresponding to the four planes based on the center coordinate information of the second target collision detection sphere and the information of the four planes. The collision detection model is a tetrahedron, the bottom face of the collision detection model is one of the four planes, and the planes corresponding to the four collision detection models are different. The vertex of the collision detection model is the center of the collision detection sphere.
[0170] The first determination submodule is used to determine the volume of the four collision detection models.
[0171] The first collision detection submodule is used to perform a third collision detection on the soft tissue model and surgical instruments based on the volumes of the four collision detection models and the target tetrahedral model, and obtain the third collision detection result.
[0172] According to embodiments of this disclosure, the first collision detection submodule includes: a first calculation unit, a second calculation unit, and a first generation unit.
[0173] The first calculation unit is used to calculate the sum of volumes based on the volumes of the four collision detection models.
[0174] The second calculation unit is used to calculate the volume difference based on the volume and the sum of the volumes of the target tetrahedral model.
[0175] The first generation unit is used to generate a third collision detection result characterizing the collision between the soft tissue model and the surgical instrument, provided that the volume difference is within a predetermined difference range.
[0176] According to an embodiment of this disclosure, the second detection module 1320 includes: a second determination submodule and a second collision detection submodule.
[0177] The second determining submodule is used to determine the distance between the first target collision detection ball and the first target circumscribed ball based on the center coordinate information of the first target collision detection ball and the center coordinate information of the first target circumscribed ball.
[0178] The second collision detection submodule is used to perform a second collision detection on the soft tissue model and surgical instruments based on the distance, the radius of the first target collision detection sphere, and the radius of the first target circumscribed sphere, and obtain the second collision detection result.
[0179] According to embodiments of this disclosure, the second collision detection submodule includes: a third calculation unit and a second generation unit.
[0180] The third calculation unit is used to calculate the radius and the radius of the first target collision detection ball based on the radius of the first target circumscribed ball.
[0181] The second generation unit is used to generate a second collision detection result characterizing the collision between the soft tissue model and the surgical instrument when the distance is less than the radius.
[0182] According to an embodiment of this disclosure, the first detection module 1310 includes a third determination submodule and a third collision detection submodule.
[0183] The third determination submodule is used to determine the positional relationship between the collision detection sphere and the bounding box based on the center coordinate information of the collision detection sphere and the coordinate range information of the bounding box.
[0184] The third collision detection submodule is used to generate the first collision detection result representing the collision between the soft tissue model and the surgical instrument, provided that the center of the collision detection sphere, which represents the positional relationship, is located within the bounding box.
[0185] According to embodiments of this disclosure, the collision detection device 1300 further includes: a first acquisition module, a first format conversion module, a first three-dimensional processing module, and a first visualization processing module.
[0186] The first acquisition module is used to acquire soft tissue model files in stereolithography format.
[0187] The first format conversion module is used to convert the stereolithography format soft tissue model file to a product model information exchange standard format soft tissue model file.
[0188] The first 3D processing module is used to process soft tissue model files in the standard format of product model information exchange using a 3D finite element mesh generation tool to obtain information about the tetrahedral model.
[0189] The first visualization processing module is used to process the information of the tetrahedral model using the model visualization engine to obtain the soft tissue model.
[0190] According to embodiments of this disclosure, there are multiple collision detection balls.
[0191] According to embodiments of this disclosure, the collision detection device 1300 further includes a first determination module and a first invocation module.
[0192] The first determining module is used to determine the number of threads of the graphics processor based on the number of multiple collision detection balls.
[0193] The first calling module is used to call the threads of the graphics processor corresponding to the number of threads, so as to utilize the threads of the graphics processor to perform the second collision detection operation and the third collision detection operation.
[0194] According to an embodiment of this disclosure, the collision detection device 1300 further includes a first division module.
[0195] The first partitioning module is used to partition the space in which the soft tissue model is located using the K-dimensional tree algorithm, generating bounding boxes.
[0196] According to embodiments of this disclosure, any plurality of modules among the first detection module 1310, the second detection module 1320, and the third detection module 1330 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the first detection module 1310, the second detection module 1320, and the third detection module 1330 can be at least partially implemented as a hardware circuit, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented by any other reasonable means of integrating or packaging the circuit, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the first detection module 1310, the second detection module 1320, and the third detection module 1330 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0197] Figure 14 A block diagram schematically illustrates an electronic device suitable for implementing a collision detection method according to an embodiment of the present disclosure.
[0198] like Figure 14 As shown, an electronic device 1400 according to an embodiment of the present disclosure includes a processor 1401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1402 or a program loaded from a storage portion 1408 into a random access memory (RAM) 1403. The processor 1401 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1401 may also include onboard memory for caching purposes. The processor 1401 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0199] RAM 1403 stores various programs and data required for the operation of electronic device 1400. Processor 1401, ROM 1402, and RAM 1403 are interconnected via bus 1404. Processor 1401 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1402 and / or RAM 1403. It should be noted that the programs may also be stored in one or more memories other than ROM 1402 and RAM 1403. Processor 1401 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0200] According to embodiments of this disclosure, the electronic device 1400 may further include an input / output (I / O) interface 1405, which is also connected to a bus 1404. The electronic device 1400 may also include one or more of the following components connected to the input / output (I / O) interface 1405: an input section 1406 including a keyboard, mouse, etc.; an output section 1407 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network interface card such as a LAN card, modem, etc. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the input / output (I / O) interface 1405 as needed. A removable medium 1411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1410 as needed so that computer programs read from it can be installed into the storage section 1408 as needed.
[0201] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0202] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 1402 and / or RAM 1403 and / or one or more memories other than ROM 1402 and RAM 1403 described above.
[0203] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the collision detection method provided in the embodiments of this disclosure.
[0204] When the computer program is executed by the processor 1401, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0205] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1409, and / or installed from the removable medium 1411. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0206] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1409, and / or installed from the removable medium 1411. When the computer program is executed by the processor 1401, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0207] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0208] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0209] It should be noted that, unless it is explicitly stated that there is a sequential order of execution between different operations, or that there is a sequential order of execution between different operations in terms of technical implementation, the execution order between multiple operations may not be significant, and multiple operations may be executed simultaneously.
[0210] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0211] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A collision detection method, comprising: Based on the bounding box information of the soft tissue model and the collision detection sphere information of the surgical instrument, a first collision detection is performed on the soft tissue model and the surgical instrument to obtain a first collision detection result. The surgical instrument is an instrument model that operates on the soft tissue model in a virtual scene. The collision detection sphere is set at a key collision position of the surgical instrument determined by the object, and the center of the collision detection sphere is located at the edge of the surgical instrument. The information of the collision detection sphere includes the coordinates of its center, and the information of the bounding box includes the coordinate range of the space enclosed by the bounding box. The process of performing the first collision detection on the soft tissue model and the surgical instrument to obtain a first collision detection result includes: determining the positional relationship between the collision detection sphere and the bounding box based on the center coordinates of the collision detection sphere and the coordinate range of the bounding box; and generating a first collision detection result characterizing the collision between the soft tissue model and the surgical instrument when the positional relationship indicates that the center of the collision detection sphere is located within the bounding box. If the first collision detection result indicates a collision between the soft tissue model and the surgical instrument, a second collision detection is performed on the soft tissue model and the surgical instrument based on the information of the collision detection sphere and the information of the circumscribed sphere of the soft tissue model, resulting in a second collision detection result. The collision detection spheres are multiple, the bounding boxes are multiple, and the collision detection sphere located within a bounding box is a first target collision detection sphere. The bounding box containing the first target collision detection sphere is a target bounding box that collides with the first target collision detection sphere. There is a collision relationship between the first target collision detection sphere and the target bounding boxes among the multiple collision detection spheres. The information of the collision detection sphere includes the center coordinates and radius of the first target collision detection sphere. The information of the circumscribed sphere includes the center coordinates and radius of the first target circumscribed sphere located within the target bounding box. Based on the information of the collision detection spheres and the information of the circumscribed sphere of the soft tissue model, a second collision detection is performed on the soft tissue model and the surgical instrument, resulting in a second collision detection result. The information of the sphere is used to perform a second collision detection on the soft tissue model and the surgical instrument to obtain a second collision detection result, including: determining the distance between the first target collision detection sphere and the first target circumscribed sphere based on the center coordinates of the first target collision detection sphere and the center coordinates of the first target circumscribed sphere; performing a second collision detection on the soft tissue model and the surgical instrument based on the distance, the radius of the first target collision detection sphere, and the radius of the first target circumscribed sphere to obtain a second collision detection result; wherein, performing a second collision detection on the soft tissue model and the surgical instrument based on the distance, the radius of the first target collision detection sphere, and the radius of the first target circumscribed sphere to obtain a second collision detection result includes: calculating the radius sum based on the radius of the first target collision detection sphere and the radius of the first target circumscribed sphere; if the distance is less than the radius sum, generating a second collision detection result characterizing the collision between the soft tissue model and the surgical instrument; When the second collision detection result indicates a collision between the soft tissue model and the surgical instrument, a third collision detection is performed on the soft tissue model and the surgical instrument based on the information of the collision detection ball and the information of the soft tissue model to obtain a third collision detection result. The circumscribed spheres are multiple, with a first target collision detection sphere and a first target circumscribed sphere having a distance less than the sum of their radii, respectively serving as a second target collision detection sphere and a second target circumscribed sphere. A collision relationship exists between the second target collision detection spheres and the second target circumscribed spheres among the multiple circumscribed spheres. The information of each collision detection sphere includes the center coordinates of the second target collision detection sphere. The soft tissue model includes multiple tetrahedral models, with a target tetrahedral model among the multiple tetrahedral models corresponding to the second target circumscribed sphere. The information of each soft tissue model includes the information of the four planes of the target tetrahedral model and the volume of the target tetrahedral model. The step of performing a third collision detection on the soft tissue model and the surgical instrument based on the information of the collision detection ball and the information of the soft tissue model, and obtaining the third collision detection result, includes: Based on the center coordinates of the second target collision detection sphere and the information of the four planes, four collision detection models corresponding to the four planes are constructed. The collision detection model is a tetrahedron, and the base of the collision detection model is one of the four planes. The collision detection model represents a tetrahedron model obtained based on the center of the second target collision detection sphere and three vertices of any one of the four planes. The vertex of the collision detection model is the center of the second target collision detection sphere. Determine the volume of the four collision detection models; Based on the volumes of the four collision detection models and the target tetrahedron model, a third collision detection is performed on the soft tissue model and the surgical instrument to obtain the third collision detection result. The step of performing a third collision detection on the soft tissue model and the surgical instrument based on the volumes of the four collision detection models and the target tetrahedron model to obtain the third collision detection result includes: Based on the volumes of the four collision detection models, the sum of the volumes is calculated. The volume difference is calculated based on the volume of the target tetrahedral model and the sum of the volumes. If the volume difference is within a predetermined range, a third collision detection result is generated to characterize the collision between the soft tissue model and the surgical instrument. The method further includes: Obtain soft tissue model files in stereolithography format; The stereolithography-formatted soft tissue model file is converted to a product model information exchange standard format soft tissue model file; The soft tissue model file in the product model information exchange standard format is processed using a three-dimensional finite element mesh generation tool to obtain the information of the tetrahedral model; The information of the tetrahedral model is processed using a model visualization engine to obtain the soft tissue model; The method further includes: The space in which the soft tissue model is located is divided using the K-dimensional tree algorithm to generate the bounding box; The method further includes: Based on the number of the first target collision detection balls, determine the number of the first threads in the graphics processor used to perform the second collision detection operation, and call the threads of the graphics processor according to the number of the first threads to perform the second collision detection operation; Based on the number of the second target collision detection balls, determine the number of second threads in the graphics processor used to perform the third collision detection operation, and call the threads of the graphics processor according to the number of second threads to perform the third collision detection operation.
2. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to claim 1.
Citation Information
Patent Citations
Endoscope minimally invasive surgery 3D simulation system based on 3D force feedback technology
CN103903487A
Operation simulation method and device
CN108777001A
Method and system for VR collision detection
WO2023005007A1