Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, apparatus, computer device, and medium for generating a safe treatment area that can reduce the occurrence rate of complications.
In a first aspect, the present application provides a method of generating a safe treatment area, the method comprising:
acquiring a focus area of a target object and respective unit normal vectors of each contour point of the focus area;
Moving each contour point of the focus area along the corresponding unit normal vector by a preset distance to obtain a target point after each contour point moves, wherein the moving direction of each contour point is opposite to the moving direction of the focus area;
And obtaining a safe treatment area aiming at the focus area based on each target point, wherein the safe treatment area is used for carrying out needle arrangement planning on the focus area of the target object.
In one embodiment, the focus area is a two-dimensional focus area in a two-dimensional image, wherein the two-dimensional image is obtained by scanning the target object;
The step of moving each contour point of the focus area along the corresponding unit normal vector by a preset distance to obtain a target point after each contour point is moved, comprising:
Acquiring a first distance corresponding to each preset contour point;
And moving each contour point of the two-dimensional focus area along the corresponding unit normal vector by the first distance to obtain two-dimensional target points after each contour point moves, wherein each two-dimensional target point is used for generating a two-dimensional safe treatment area.
In one embodiment, the obtaining a safe treatment area for the focal area based on each of the target points includes:
a plurality of two-dimensional safe treatment areas are obtained based on the two-dimensional target points corresponding to the two-dimensional images of the two-dimensional focus areas respectively;
The method comprises the steps of acquiring a safe treatment area in a first n-frame two-dimensional image and a safe treatment area in a second n-frame two-dimensional image, wherein the first n-frame two-dimensional image is a first n-frame image of a two-dimensional image with the two-dimensional focus area, and the second n-frame two-dimensional image is a second n-frame image of a last frame image of the two-dimensional image with the two-dimensional focus area;
And generating a three-dimensional safe treatment area based on each two-dimensional safe treatment area, the safe treatment area in the first n frames of two-dimensional images and the safe treatment area in the last n frames of two-dimensional images.
In one embodiment, the acquiring the safe treatment area in the first n frames of two-dimensional images and the safe treatment area in the last n frames of two-dimensional images includes:
determining a first frame image and a tail frame image from the two-dimensional image with the two-dimensional focus area;
Generating an area corresponding to a safe treatment area in the first frame image in the first n frames of two-dimensional images adjacent to the first frame image, and taking the generated area as the safe treatment area in the first n frames of two-dimensional images;
in the latter n-frame two-dimensional image adjacent to the tail frame image, an area corresponding to the safety treatment area of the tail frame image is generated, and the generated area is used as the safety treatment area in the latter n-frame two-dimensional image.
In one embodiment, the obtaining a plurality of two-dimensional safe treatment areas based on the two-dimensional target points corresponding to the two-dimensional images of each two-dimensional focus area respectively includes:
acquiring an initial region in the two-dimensional image with the two-dimensional focus region based on the two-dimensional target point corresponding to the two-dimensional image with the two-dimensional focus region respectively;
And when the outline of the initial area exceeds the outline of the target object, replacing the outline of the exceeding part in the initial area with the outline of the target object to obtain a two-dimensional safe treatment area surrounding the two-dimensional focus area.
In one embodiment, the focal region is a three-dimensional focal region, and the unit normal vector is a unit normal vector of each contour point of the surface of the three-dimensional focal region;
The step of moving each contour point of the focus area along the corresponding unit normal vector by a preset distance to obtain a target point after each contour point is moved, comprising:
acquiring a second distance corresponding to each contour point of the surface of the preset three-dimensional focus area;
And moving each contour point on the surface of the three-dimensional focus area along the corresponding unit normal vector for a second distance to obtain three-dimensional target points after the contour points move, wherein each three-dimensional target point is used for generating a three-dimensional safe treatment area, and the three-dimensional target points after the contour points move are positioned in the contour of the target object.
In one embodiment, the obtaining the second distance corresponding to each contour point of the surface of the preset three-dimensional focal region includes:
presetting an initial distance of each contour point along the unit normal vector;
Based on the initial distance, the three-dimensional coordinates of each contour point and the unit normal vector of each contour point, respectively determining the three-dimensional coordinates of a temporary point after each contour point moves along the unit normal vector;
Acquiring a target ray composed of the three-dimensional coordinates of the temporary point and the unit normal vector of the contour point;
and when the number of the intersection points of the target ray and the outline of the target object is even, adjusting the initial distance until the number of the intersection points of the target ray and the outline of the target object is odd, and determining the adjusted initial distance as a second distance.
In a second aspect, the present application provides a device for generating a safe treatment area, the device comprising:
the data acquisition module is used for acquiring a focus area of the target object and respective unit normal vectors of each contour point of the focus area;
The moving module is used for moving each contour point of the focus area along the corresponding unit normal vector by a preset distance to obtain a target point after each contour point moves, wherein the moving direction of each contour point is opposite to the moving direction of the focus area;
The area generation module is used for obtaining a safe treatment area aiming at the focus area based on each target point, and the safe treatment area is used for carrying out needle arrangement planning on the focus of the target object.
In a third aspect, the present application provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method described above.
The method, the device, the computer equipment and the medium for generating the safe treatment area acquire the focus area of the target object and respective unit normal vector of each contour point of the focus area, move each contour point of the focus area along the corresponding unit normal vector by a preset distance to obtain target points after each contour point moves, move the contour points in the opposite direction to the focus area, obtain the safe treatment area aiming at the focus area based on each target point, and carry out needle arrangement on the focus area of the target object by the safe treatment area. The method can effectively enlarge the original focus area to form a larger safe treatment area with the same or basically same shape as the focus area, so that the needle distribution points can be planned in the safe treatment area under the condition that the focus still exists in the area outside the focus area, the extra damage to the target object is avoided, and the occurrence rate of complications is reduced.
Detailed Description
The present application 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 application 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 application.
The method for generating the safe treatment area provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Console 102 is coupled to terminal 104. The console 102 may be a device for generating a safe treatment area or a system for generating a safe treatment area. Specifically, the console 102 acquires a focus area of the target object and a unit normal vector of each contour point of the focus area. The console 102 moves each contour point of the focus area along the corresponding unit normal vector by a preset distance to obtain a target point after each contour point moves. The moving direction of each contour point is opposite to the direction of the focus area. The console 102 obtains a safe treatment area for the focal area based on each target point, and the safe treatment area can be used for performing needle layout on the focal area of the target object.
In one embodiment, as shown in fig. 2, a method for generating a safe treatment area is provided, and the method is applied to the console in fig. 1 for illustration, and includes the following steps:
S202, acquiring a focus area of the target object and respective unit normal vectors of each contour point of the focus area.
The target object refers to an object with lesions. Target objects include, but are not limited to, various organs, tissues, structures. The focal region can be identified from image data obtained by sagittal, coronal, and transverse scan of the target object. The manner of identifying the lesion area from the image data includes automatic identification and manual identification. The focal region is automatically identified, including but not limited to, inputting the image data into a segmentation model for focal region segmentation, resulting in a focal region in the image data. The manual identification of the focus area can be to check each frame of image data one by one and manually outline the focus area in each frame of image data. The focal region includes a two-dimensional focal region and a three-dimensional focal region.
Each contour point refers to each pixel point of the focus area boundary in the image data. The determination mode of the unit normal vector of each contour point comprises, but is not limited to, a surface gradient calculation mode and a least square method calculation mode.
Optionally, the console identifies the focal region from the scanned multi-frame image data by means of automatic identification. After the focal region is identified, the console calculates the unit normal vector of each contour point of the boundary of the focal region by using a surface gradient calculation mode, a least square calculation mode or other modes.
S204, moving each contour point of the focus area along the corresponding unit normal vector by a preset distance to obtain a target point after each contour point is moved. The moving direction of each contour point is opposite to the direction of the focus area.
The preset distance refers to a moving distance of the contour point along the direction of the unit normal vector. For example, if the preset distance corresponding to the contour point a is 2mm, the target point after the contour point a moves can be obtained by controlling the contour point a to move 2mm along the direction of the corresponding unit normal vector.
Each contour point has a corresponding unit normal vector and a corresponding preset distance, and the preset distance corresponding to each contour point may be the same or different.
The direction of movement of the contour points is opposite to the direction of the focal region, so that the safe treatment area can be ensured to be outside the focal region rather than inside the focal region. A schematic diagram of the movement of each contour point is shown in fig. 3. After the contour point moves, the size, shape and the like of the focus area are not changed.
Optionally, the console moves each contour point of the focus area along the corresponding unit normal vector in the opposite direction of the focus area according to the preset distance corresponding to each contour point, so as to obtain the target point after each contour point is moved.
S206, based on each target point, obtaining a safe treatment area aiming at the focus area. The safe treatment area is used for carrying out needle distribution planning on the focus of the target object.
Wherein, the safe treatment area refers to an area wrapping the focus area. When the focus area is three-dimensional, a triangulated mesh is generated according to the position coordinates of each target point by using a delaunay triangulation algorithm, so that a three-dimensional safe treatment area can be obtained. In the case where the lesion area is two-dimensional, a three-dimensional safe treatment area may be generated based on each two-dimensional safe treatment area for the two-dimensional lesion area.
Optionally, the console generates a three-dimensional safe treatment area for the lesion area based on each target point for a clothing planning based on the three-dimensional safe treatment area.
In the embodiment, a focus area of a target object and a unit normal vector of each contour point of the focus area are obtained, each contour point of the focus area is moved along the corresponding unit normal vector by a preset distance to obtain a target point after each contour point is moved, the moving direction of each contour point is opposite to the direction of the focus area, a safe treatment area aiming at the focus area is obtained based on each target point, and the safe treatment area is used for carrying out needle arrangement planning on the focus area of the target object. The method can effectively enlarge the original focus area and form a larger safe treatment area with the same or basically same shape as the focus area, so that the needle distribution points can be planned in the safe treatment area under the condition that the focus is still present in the area outside the focus area, the extra damage of a target object is avoided, and the occurrence rate of complications is reduced.
In one embodiment, the focal region is a two-dimensional focal region in a two-dimensional image. The two-dimensional image is obtained by scanning the target object. The number of two-dimensional images in which a two-dimensional lesion area exists is plural.
Moving each contour point of the focus area along a corresponding unit normal vector by a preset distance to obtain a target point after each contour point is moved, wherein the method comprises the following steps:
and acquiring a first distance corresponding to each preset contour point.
And moving each contour point of the two-dimensional focus area along the corresponding unit normal vector by a first distance to obtain a two-dimensional target point after each contour point is moved. Each two-dimensional target point is used to generate a two-dimensional safe treatment area.
The first distance may be preset according to a standard distance interval between the safe treatment area and the lesion area. For example, if the standard distance interval between the safe treatment area and the lesion area is set to 0mm to 10mm, any value from 0mm to 10mm may be taken as the first distance. The first distances corresponding to the contour points may be the same or different.
The first distance may also be obtained according to the number of intersections between the ray formed by the candidate points after the movement of the contour point and the unit normal vector and the contour of the target object. The method comprises the steps of presetting an initial first distance for each contour point to move along a unit normal vector, determining two-dimensional coordinates of candidate points after the contour points move along the unit normal vector based on the initial first distance, the two-dimensional coordinates of the contour points and the unit normal vector of the contour points, acquiring rays formed by the two-dimensional coordinates of the candidate points and the unit normal vector of the contour points, adjusting the initial first distance until the number of intersection points of the rays and the contour of a target object is an odd number when the number of intersection points of the rays and the contour of the target object is an even number, and determining the adjusted initial first distance as the first distance. Wherein the contour of the target object can be determined by a segmentation model or manually identified. For example, a plurality of frames of two-dimensional images where the target object is located are input into the segmentation model for segmentation, and the outline of the target object in each frame of two-dimensional images can be determined. After obtaining the outline of the target object, the console constructs a space conversion matrix from the pixel space of the data volume to the physical space of the world coordinate system according to the imported spatial transformation information in DICOM (DIGITAL IMAGING AND Communications IN MEDICINE, digital medical imaging communication standard) or nifi (Neuroimaging Informatics Technology INITIATIVE IMAGE, neuroimaging technical initiative format) data, and the space conversion matrix can be used for converting the two-dimensional pixel coordinates in the two-dimensional image into three-dimensional coordinates in the physical space. A two-dimensional safe treatment area refers to an area that is capable of enveloping a two-dimensional focal area. The two-dimensional safe treatment area may be presented in a two-dimensional image along with the two-dimensional lesion area. Techniques for generating a two-dimensional safe treatment region based on a plurality of two-dimensional target points include, but are not limited to, convex hull algorithms, alpha (Alpha) shapes, delaunay triangulation.
Optionally, in the case that the focal region is a two-dimensional focal region, the console randomly selects a numerical value as the first distance corresponding to the contour point in a standard distance interval between the safe treatment region and the focal region. Wherein each contour point has a corresponding first distance. And the control console moves each contour point of the two-dimensional focus area along the corresponding unit normal vector to the opposite direction of the two-dimensional focus area according to the first distance corresponding to each contour point of the boundary of the two-dimensional focus area, so as to obtain a two-dimensional target point after each contour point is moved, and the control console generates a two-dimensional safe treatment area according to each two-dimensional target point.
In this embodiment, on the basis that the focal region is a two-dimensional focal region in a two-dimensional image, each contour point of the two-dimensional focal region is moved by a first distance along a corresponding unit normal vector, so as to obtain a two-dimensional target point after each contour point is moved, thereby generating a two-dimensional safe treatment region according to the moved two-dimensional target point, and simultaneously, the processing and calculating resource requirements are lower, and the consumption of the calculating resource can be reduced.
In one embodiment, deriving a safe treatment area for the focal area based on each target point comprises:
And obtaining a plurality of two-dimensional safe treatment areas based on the two-dimensional target points corresponding to the two-dimensional images of each two-dimensional focus area.
And acquiring the safe treatment area in the first n frames of two-dimensional images and the safe treatment area in the last n frames of two-dimensional images. The first n frames of two-dimensional images are the first n frames of images of the first frame of two-dimensional images with two-dimensional focus areas, and the last n frames of two-dimensional images are the last n frames of images of the last frame of two-dimensional images with two-dimensional focus areas.
And generating a three-dimensional safe treatment area based on the safe treatment areas in each two-dimensional, the safe treatment areas in the first n frames of two-dimensional images and the safe treatment areas in the last n frames of two-dimensional images.
The two-dimensional target point corresponding to the two-dimensional image with the two-dimensional focus area refers to a two-dimensional target point after each contour point of the two-dimensional focus area in the two-dimensional image moves. A plurality of two-dimensional target points corresponding to each two-dimensional image with two-dimensional focus areas can be used for generating a two-dimensional safe treatment area. Further, the generation mode of the two-dimensional safe treatment areas can be that a convex hull algorithm is used for generating a minimum convex polygon corresponding to the two-dimensional image of each two-dimensional focus area based on the two-dimensional target point corresponding to the two-dimensional image of each two-dimensional focus area, and smoothing is carried out on the generated minimum convex polygon to obtain the two-dimensional safe treatment areas corresponding to the two-dimensional images of each two-dimensional focus area. The generated two-dimensional safe treatment area may be presented in a two-dimensional image along with the lesion area.
The first frame image refers to a first frame image in the two-dimensional images with the focus area in a plurality of frames, and the last frame image refers to a last frame image in the two-dimensional images with the focus area in a plurality of frames.
The safe treatment region in the first n frames of two-dimensional images may be generated from the safe treatment region presented in the first frame of images. The safe treatment region in the last n-frame two-dimensional image may be generated from the safe treatment region presented in the tail frame image.
The three-dimensional safe treatment area is generated by interpolation and surface reconstruction techniques. For example, the two-dimensional image, the first n two-dimensional images, and the last n two-dimensional images of each existing two-dimensional lesion area are spatially aligned, two-dimensional contour points of the safety treatment area in each two-dimensional image are converted into three-dimensional point clouds, depth information is given, deluxe triangulation is performed on the three-dimensional point clouds, a triangulated mesh is generated, and a three-dimensional safety treatment area is obtained based on the triangulated mesh. As a result of a large number of clinical studies, positive sites/lesions remain around 5-10mm outside the lesion area seen on nuclear magnetism. In order to have a better treatment effect on a focus area and not cause excessive damage to normal organ tissues, a safe treatment area is planned, and the effectiveness of ablation can be improved.
Optionally, the console uses a convex hull algorithm to generate a minimum convex polygon corresponding to each two-dimensional image with a two-dimensional focus area based on the two-dimensional target point corresponding to each two-dimensional image with a two-dimensional focus area, and performs smoothing processing on the generated minimum convex polygon to obtain a two-dimensional safe treatment area corresponding to each two-dimensional image with a two-dimensional focus area. The control console generates a safe treatment area according to the safe treatment area presented by the first frame image in the two-dimensional image with the two-dimensional focus area, generates a safe treatment area according to the safe treatment area presented by the last frame image in the two-dimensional image with the two-dimensional focus area, and generates a safe treatment area according to the last n frames of two-dimensional images. The console aligns the two-dimensional images with two-dimensional focus areas, the first n frames of two-dimensional images and the last n frames of two-dimensional images in space, converts two-dimensional contour points of a safety treatment area in each frame of two-dimensional images into three-dimensional point clouds, endows depth information, triangulates the three-dimensional point clouds in a Delaue manner, generates triangulated grids, and obtains the three-dimensional safety treatment area based on the triangulated grids.
In one embodiment, acquiring the safe-treatment region in the first n-frame two-dimensional image and the safe-treatment region in the last n-frame two-dimensional image includes:
From the two-dimensional images in which the two-dimensional lesion area exists, a first frame image and a last frame image are determined.
In the first n-frame two-dimensional image adjacent to the first frame image, an area corresponding to the safety treatment area in the first frame image is generated, and the generated area is taken as the safety treatment area in the first n-frame two-dimensional image.
In the latter n-frame two-dimensional image adjacent to the end frame image, an area corresponding to the safety treatment area of the end frame image is generated, and the generated area is taken as the safety treatment area in the latter n-frame two-dimensional image.
Wherein, the first frame image refers to the first frame image in the two-dimensional image with the two-dimensional focus area, and the last frame image in the two-dimensional image with the two-dimensional focus area. Because in the target object, a single focus is presented in a three-dimensional form, and the two-dimensional image with a two-dimensional focus area is obtained by continuously scanning the focus, the first two-dimensional image in the two-dimensional image with the two-dimensional focus area is the first frame image, and the last frame image is the last frame image. Because the safe treatment area is an area surrounding the lesion area but not exceeding the outline of the target object, and the last two-dimensional image in which the lesion appears is not the last two-dimensional image in which the safe treatment area appears, the safe treatment area is also generated in the first n two-dimensional images of the first frame image and the last n two-dimensional images of the last frame image.
The calculation mode of n in the first n frames of two-dimensional images and the last n frames of two-dimensional images is as follows:
where the ceil () function represents a round-up, SLICESPACEING represents the image spacing, i.e., the distance between two frames of images. SAFETYDISTANCE denotes the safe zone contour mean spacing, i.e., the mean distance between the contour of the focal zone and the contour of the safe treatment zone. In general, the safety zone profile average spacing is in the range of 5mm to 10 mm.
The safe treatment area in the first n frames of two-dimensional images can be automatically generated according to the shape and the area of the safe treatment area in the first frame of images. For example, according to the safe treatment area in the first frame image, an area which has the same shape as the safe treatment area of the first frame image but is smaller than the safe treatment area of the first frame image is generated in the first n frame two-dimensional image, and the generated area is the safe treatment area of the first n frame two-dimensional image. The area of the safe treatment area in the first n frames of two-dimensional images is gradually decreased, and the safe treatment area can be complemented with the two-dimensional image with the disappeared focus by generating the safe treatment area in the first n frames of two-dimensional images, so that the three-dimensional reconstruction of the safe treatment area is facilitated.
The safe treatment area in the last n frames of two-dimensional images can be automatically generated according to the shape and the area of the safe treatment area in the tail frame of images. For example, according to the safe treatment area in the tail frame image, an area which has the same shape as the safe treatment area of the tail frame image but is smaller than the safe treatment area of the tail frame image is generated in the latter n-frame two-dimensional image, and the generated area is the safe treatment area of the latter n-frame two-dimensional image. The area of the safe treatment area in the last n frames of two-dimensional images is gradually decreased, and the safe treatment area can be complemented with the two-dimensional image with the disappeared focus by generating the safe treatment area in the last n frames of two-dimensional images, so that the three-dimensional reconstruction of the safe treatment area is facilitated.
Optionally, the console determines a first frame image of the two-dimensional images in which the lesion area exists as a first frame image and a last frame image of the two-dimensional images in which the lesion area exists as a last frame image. The console generates safety treatment areas in the first n two-dimensional images respectively according to the shape and the area of the safety treatment areas in the first n two-dimensional images adjacent to the first frame image. The console generates safe treatment areas in the latter n two-dimensional images respectively according to the shapes and the areas of the safe treatment areas in the tail frame images in the latter n two-dimensional images adjacent to the tail frame images.
In this embodiment, the safety treatment area is generated in the first n two-dimensional images adjacent to the first frame image, and the safety treatment area is generated in the second n two-dimensional images adjacent to the last frame image, so that the two-dimensional images with the focus disappeared can be complemented by the safety treatment area, and the three-dimensional reconstruction of the safety treatment area is facilitated.
In one embodiment, obtaining a plurality of two-dimensional safe treatment areas based on two-dimensional target points corresponding to two-dimensional images of each existing two-dimensional lesion area, respectively, includes:
and obtaining an initial area in the two-dimensional image with the two-dimensional focus areas based on the two-dimensional target points corresponding to the two-dimensional images with the two-dimensional focus areas respectively.
And when the outline of the initial area exceeds the outline of the target object, replacing the outline of the exceeding part in the initial area with the outline of the target object to obtain a two-dimensional safe treatment area surrounding the two-dimensional focus area.
Wherein the contour of the initial region exceeds the contour of the target object, i.e. the contour of the target object is between the contour of the initial region and the contour of the lesion region. Because the needle deployment planning is performed based on the safe treatment area, if the safe treatment area exceeds the outline of the target object, needle deployment is performed outside the outline of the target object, so that normal tissue outside the target object is damaged, and the outline of the exceeding part in the initial area is replaced by the outline of the target object, so that the planned needle deployment points are ensured to be in the safe treatment area, namely, the planned needle deployment points are ensured to be inside the outline of the target object and not to exceed the outline of the target object. The schematic diagram before replacement is shown in fig. 4, the portion a is a portion where the outline of the initial area exceeds the outline of the target object, the portion B is a portion where the outline of the initial area does not exceed the outline of the target object, and the schematic diagram after replacement is shown in fig. 5.
Optionally, the console uses a convex hull algorithm to generate a minimum convex polygon corresponding to the two-dimensional image with the two-dimensional focus area based on the two-dimensional target point corresponding to the two-dimensional image with the two-dimensional focus area, and performs smoothing processing on the generated minimum convex polygon to obtain an initial area corresponding to the two-dimensional image with the two-dimensional focus area. And under the condition that the outline of the initial area exceeds the outline of the target object, the control console replaces the outline of the exceeding part in the initial area with the outline of the target object to obtain a two-dimensional safe treatment area surrounding the two-dimensional focus area.
In this embodiment, when the contour of the initial area exceeds the contour of the target object, the contour of the exceeding portion in the initial area is replaced with the contour of the target object, so that the situation that the needle laying point is arranged outside the contour of the target object when the needle laying planning is performed can be avoided, and normal tissues outside the target object can be prevented from being damaged when the needle is inserted.
In one embodiment, the focal region is a three-dimensional focal region and the unit normal vector is a unit normal vector for each contour point of the three-dimensional focal region surface.
Moving each contour point of the focus area along a corresponding unit normal vector by a preset distance to obtain a target point after each contour point is moved, wherein the method comprises the following steps:
and acquiring a second distance corresponding to each contour point of the surface of the preset three-dimensional focus area.
And moving each contour point on the surface of the three-dimensional focus area along the corresponding unit normal vector for a second distance to obtain a three-dimensional target point after each contour point is moved. Each three-dimensional target point is used to generate a three-dimensional safe treatment area. The three-dimensional target point after each contour point moves is positioned inside the contour of the target object.
Wherein, the three-dimensional focus area can be obtained by three-dimensional reconstruction. For example, a two-dimensional lesion area is identified from a plurality of frames of image data scanned from a target object, and then three-dimensional reconstruction is performed on the lesion area identified in each frame of image data, thereby obtaining a three-dimensional lesion area. The second distance is a distance that the contour point of the three-dimensional lesion area surface is to be moved from the current location. The coordinates of the three-dimensional target point after the contour point moves along the unit normal vector according to the second distance can be passedThe coordinates of the three-dimensional target point after the movement of the contour point are obtained, wherein (x ', y', z ') is the three-dimensional coordinates before the movement of the contour point, (a', b ', c') is the unit normal vector of the contour point, and t is the second distance. After any contour point in the focus area moves, the contour of the focus area is not changed. The three-dimensional coordinates of the contour points before moving can be obtained by converting the two-dimensional coordinates of the contour points by using a space conversion matrix.
The moving direction of each contour point on the surface of the three-dimensional focus area is opposite to the moving direction of the three-dimensional focus area.
In some embodiments, the unit normal vector of the contour points is a normalized normal vector. The unit normal vector of the contour points can be obtained by solving a surface equation, and the surface equation can be constructed by three-dimensional coordinates of a plurality of contour points of the three-dimensional focus area. The unit normal vector of the contour point is determined by a control console determining the contour pointWhereinThe control desk searches p planes from the front and back of the m-th layer plane, searches 2q+1 adjacent points in the searched 2p+1 planes by taking the current point as the center, and searches the 2q+1 adjacent points forward and backward, wherein the current point on each plane is determined based on the searching starting point on the adjacent planes so as to ensure the rationality of each current point selection and avoid abrupt jump or discontinuity, and the (2p+1) (2q+1) points are searched at the momentConsole solves curved surface by using least square methodUnknown coefficients of (a)Wherein x represents the x-th plane, y represents the y-th contour point on the x-th plane, and the control console obtains the normal vector of the contour point according to the solving result of each unknown coefficient as followsThe control console performs normalization processing on the normal vector of the contour point to obtain a unit normal vector of the contour point。
Optionally, the console obtains a second distance that each contour point on the surface of the three-dimensional focus area needs to move from the current position, and each contour point is moved by a corresponding second distance along the unit normal vector to obtain coordinates of the three-dimensional target point after each contour point moves.
In this embodiment, the contour point is moved along the unit normal vector according to the second distance, so that the original focus area can be effectively enlarged, and a safety treatment area which is larger and has a shape corresponding to the focus area is formed.
In one embodiment, obtaining the preset second distance includes:
The initial distance that each contour point moves along the unit normal vector is preset.
Based on the initial distance, the three-dimensional coordinates of each contour point and the unit normal vector of each contour point, the three-dimensional coordinates of the temporary point after each contour point moves along the unit normal vector are respectively determined.
And acquiring a target ray composed of the three-dimensional coordinates of the temporary point and the unit normal vector of the contour point.
And when the number of the intersection points of the target ray and the outline of the target object is even, adjusting the initial distance until the number of the intersection points of the target ray and the outline of the target object is odd, and obtaining the second distance.
The initial distance may be preset according to the average distance between the profiles of the safety zones. For example, when the average distance between the contours of the safety area is in the range of 5mm to 10mm, the initial distance may be preset to 10mm, or the initial distance may be preset to any one of 5mm to 10 mm. In a general scenario, the maximum value of the initial distance coincides with the maximum value of the average distance of the safety zone contours. Each contour point corresponds to an initial distance, and the initial distance corresponding to each contour point can be the same or different.
The three-dimensional coordinates of each contour point can be obtained through the two-dimensional coordinates of the contour point in the two-dimensional image and the space transformation matrix. The three-dimensional coordinates of the temporary point after the contour point moves along the unit normal vector can be obtained byObtained by the method, whereinIs the three-dimensional coordinates of the temporary point after the contour point is moved,Is the three-dimensional coordinates before the contour point moves,Is the unit normal vector of the contour point,Is the initial distance.
The target ray composed of the three-dimensional coordinates of the temporary point and the unit normal vector of the contour point can be expressed as,Representing contour pointsThe corresponding target ray; Representing contour pointsThree-dimensional coordinates of the temporary point after the movement; Representing contour pointsIs a unit normal vector of (2); An n-th contour point on a focus area representing an m-th layer plane in a three-dimensional focus area, i is a non-negative real number parameter for representing a distance of moving from a temporary point along a unit normal vector of the contour point, the point is exactly at the temporary point when i=0, and the point is located somewhere between the temporary point and the unit normal vector when i >0.
The contour of the target object refers to a three-dimensional contour. The unit normal vector of the outline point is always in the outline of the target object, if the temporary point is outside the outline of the target object, the target ray formed by the temporary point and the unit normal vector of the outline point is always in the outline of the target object, then the outline of the target object is penetrated out, the number of intersection points of the target ray and the outline of the target object is even, if the temporary point is on the target object, the target ray formed by the temporary point and the unit normal vector is directly penetrated out of the outline of the target object from the inside of the outline of the target object, the number of intersection points of the target ray and the outline of the target object is odd, and when the local ablation treatment instrument is used for ablation, the end points of the electrode of the local ablation treatment instrument need to be positioned in a safe treatment area or the outline of the target object, so that other objects are not damaged when the focus is ablated, and when the number of intersection points of the target ray and the outline of the target object is even, the initial distance needs to be adjusted until the number of intersection points of the target ray and the outline of the target object is odd.
The adjustment of the initial distance may be achieved by changing a fixed value or by changing an arbitrary value. For example, when the temporary point is determined to be outside the outline of the target object by the number of intersections, a fixed value is increased/decreased or an arbitrary value is increased/decreased on the basis of the initial distance, so that the adjustment of the initial distance can be realized. The fixed value and the size of any value can be set by themselves. For example, the average distance between the contours of the safety area is between 5mm and 10mm, the initial distance is from 10mm, and the adjustment is performed by taking 0.1 as a step length, that is, when the temporary point is determined to be outside the contour of the target object, the adjustment is reduced by 0.1 on the basis of the current initial distance until the number of intersection points of the target ray and the contour of the target object is odd.
Optionally, the console presets an initial distance along which the contour point moves along the unit normal vector according to the average distance of the contour of the safety zone. The console calculates three-dimensional coordinates of the temporary point after the contour point moves along the unit normal vector based on the initial distance, the three-dimensional coordinates of the contour point, and the unit normal vector of the contour point. The console composes the target ray based on the three-dimensional coordinates of the temporary point and the unit normal vector of the contour point, and determines the number of intersections of the target ray and the contour of the target object. When the number of the intersection points is even, the control console adjusts the initial distance of the contour points according to a preset fixed value or any value until the number of the intersection points of the target ray and the contour of the target object is odd, and determines the adjusted initial distance as the second distance.
In this embodiment, when the number of intersection points of the target ray and the contour of the target object is even, the initial distance is adjusted until the number of intersection points of the target ray and the contour of the target object is odd, so that it is ensured that the three-dimensional target point after the movement of the contour point is still in the contour of the target object, and therefore the safety treatment area generated based on the three-dimensional target point can not exceed the contour of the target object.
The application also provides an application scene, which applies the method for generating the safe treatment area. Specifically, the application of the method for generating the safe treatment area in the application scene is as follows:
The control desk identifies the focus area from the scanned multi-frame image data in an automatic identification mode. After the focal region is identified, the console calculates the unit normal vector of each contour point of the boundary of the focal region by using a surface gradient calculation mode, a least square calculation mode or other modes.
Under the condition that the focus area is a two-dimensional focus area, the control console randomly selects a numerical value as a first distance corresponding to the contour point in a standard distance interval between the safe treatment area and the focus area. Wherein each contour point has a corresponding first distance. And the control console moves each contour point of the focus area along the corresponding unit normal vector to the opposite direction of the focus area according to the first distance corresponding to each contour point of the boundary of the two-dimensional focus area to obtain a two-dimensional target point after each contour point moves, so that the control console generates a two-dimensional safe treatment area according to each two-dimensional target point. The console determines a first frame image in the two-dimensional image with the focus area as a first frame image and a last frame image in the two-dimensional image with the focus area as a last frame image. The console generates safety treatment areas in the first n two-dimensional images respectively according to the shape and the area of the safety treatment areas in the first n two-dimensional images adjacent to the first frame image. The console generates safe treatment areas in the latter n two-dimensional images respectively according to the shapes and the areas of the safe treatment areas in the tail frame images in the latter n two-dimensional images adjacent to the tail frame images. The console uses a convex hull algorithm to generate minimum convex polygons corresponding to the two-dimensional images of the two-dimensional focus areas based on the two-dimensional target points corresponding to the two-dimensional images of the two-dimensional focus areas respectively, and performs smoothing processing on the generated minimum convex polygons to obtain initial areas corresponding to the two-dimensional images of the two-dimensional focus areas. And under the condition that the outline of the initial area exceeds the outline of the target object, the control console replaces the outline of the exceeding part in the initial area with the outline of the target object to obtain a two-dimensional safe treatment area surrounding the two-dimensional focus area. The console aligns the two-dimensional images with two-dimensional focus areas, the first n frames of two-dimensional images and the last n frames of two-dimensional images in space, converts two-dimensional contour points of a safety treatment area in each frame of two-dimensional images into three-dimensional point clouds, endows depth information, triangulates the three-dimensional point clouds in a Delaue manner, generates triangulated grids, and obtains the three-dimensional safety treatment area based on the triangulated grids.
The control console presets the initial distance of the target point moving along the unit normal vector according to the average distance of the safety zone contours. The console calculates three-dimensional coordinates of the temporary point after the contour point moves along the unit normal vector based on the initial distance, the three-dimensional coordinates of the contour point, and the unit normal vector of the contour point. The console composes the target ray based on the three-dimensional coordinates of the temporary point and the unit normal vector of the contour point, and determines the number of intersections of the target ray and the contour of the target object. When the number of the intersection points is even, the control console adjusts the distance between the contour points according to a preset fixed value or any value until the number of the intersection points of the target ray and the contour of the target object is odd, and determines the adjusted initial distance as a second distance. And the control console respectively moves each contour point along the unit normal vector by a corresponding second distance to obtain the coordinates of the three-dimensional target point after each contour point is moved. The console generates a three-dimensional safe treatment area for the focus area according to the coordinates of each three-dimensional target point, so as to carry out needle arrangement planning based on the three-dimensional safe treatment area.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a safe treatment area generating device for realizing the above related safe treatment area generating method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiment of the device for generating one or more safe treatment areas provided below may refer to the limitation of the method for generating a safe treatment area hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 6, there is provided a safe treatment area generating apparatus, including:
The data acquisition module 602 is configured to acquire a focus area of the target object and a unit normal vector of each contour point of the focus area.
The moving module 604 is configured to move each contour point of the focal area along a corresponding unit normal vector by a preset distance, so as to obtain a target point after each contour point is moved. The moving direction of each contour point is opposite to the direction of the focus area.
The region generation module 606 is configured to obtain a safe treatment region for the focal region based on each target point. The safe treatment area is used for carrying out needle arrangement planning on the focus area of the target object.
In one embodiment, the focal region is a two-dimensional focal region in a two-dimensional image. The two-dimensional image is obtained by scanning the target object. The number of two-dimensional images in which a two-dimensional lesion area exists is plural. The mobile module includes:
the first distance acquisition unit is used for acquiring a first distance corresponding to each preset contour point.
And the first moving unit is used for moving each contour point of the two-dimensional focus area along the corresponding unit normal vector by a first distance to obtain a two-dimensional target point after each contour point is moved. Each two-dimensional target point is used to generate a two-dimensional safe treatment area.
In one embodiment, the region generation module includes:
the first region generation unit is used for obtaining a plurality of two-dimensional safe treatment regions based on the two-dimensional target points corresponding to the two-dimensional images of each two-dimensional focus region.
A first region acquisition unit configured to acquire a safe treatment region in the first n-frame two-dimensional image and a safe treatment region in the second n-frame two-dimensional image. The first n frames of two-dimensional images are the first n frames of images of the first frame of two-dimensional images with two-dimensional focus areas, and the last n frames of two-dimensional images are the last n frames of images of the last frame of two-dimensional images with two-dimensional focus areas.
And the second region generating unit is used for generating a three-dimensional safe treatment region based on the safe treatment regions in each two-dimensional, the safe treatment region in the first n frames of two-dimensional images and the safe treatment region in the last n frames of two-dimensional images.
In one embodiment, the first region acquisition unit includes:
An image determination subunit for determining a first frame image and a last frame image from the two-dimensional images in which the two-dimensional lesion area exists.
A first region generating subunit, configured to generate, in a first n-frame two-dimensional image adjacent to the first frame image, a region corresponding to the safe treatment region in the first frame image, and take the generated region as the safe treatment region in the first n-frame two-dimensional image.
And the second region generation subunit is used for generating a region corresponding to the safe treatment region of the tail frame image in the latter n frames of two-dimensional images adjacent to the tail frame image, and taking the generated region as the safe treatment region in the latter n frames of two-dimensional images.
In one embodiment, the first region generating unit includes:
the initial region generation subunit is used for obtaining the initial region in the two-dimensional image with the two-dimensional focus region based on the two-dimensional target point corresponding to the two-dimensional image with the two-dimensional focus region respectively.
And the region adjustment subunit is used for replacing the outline of the exceeding part in the initial region with the outline of the target object when the outline of the initial region exceeds the outline of the target object, so as to obtain a two-dimensional safe treatment region surrounding the two-dimensional focus region.
In one embodiment, the focal region is a three-dimensional focal region and the unit normal vector is a unit normal vector for each contour point of the three-dimensional focal region surface. The mobile module includes:
the second distance acquisition unit is used for acquiring the second distance corresponding to each contour point of the surface of the preset three-dimensional focus area.
And the second moving unit is used for moving each contour point on the surface of the three-dimensional focus area along the corresponding unit normal vector for a second distance to obtain a three-dimensional target point after each contour point is moved. Each three-dimensional target point is used to generate a three-dimensional safe treatment area. The three-dimensional target point after each contour point moves is positioned inside the contour of the target object.
In one embodiment, the second distance acquisition unit includes:
The initial distance acquisition subunit is used for presetting the initial distance of each contour point moving along the unit normal vector.
And the temporary point determining subunit is used for respectively determining the three-dimensional coordinates of the temporary point after each contour point moves along the unit normal vector based on the initial distance, the three-dimensional coordinates of each contour point and the unit normal vector of each contour point.
And the ray determination subunit is used for acquiring a target ray formed by the three-dimensional coordinates of the temporary point and the unit normal vector of the outline point.
And the distance adjustment subunit is used for adjusting the initial distance when the number of the intersection points of the target ray and the outline of the target object is even, until the number of the intersection points of the target ray and the outline of the target object is odd, and determining the adjusted initial distance as the second distance.
The above-described modules in the safety treatment region generation device may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a console, the internal structure of which may be as shown in FIG. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing a focus area, a unit normal vector of each contour point, a preset distance of each contour point, a target point after each contour point moves and a safe treatment area. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of generating a safe treatment area.
It will be appreciated by those skilled in the art that the structure shown in FIG. 7 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
The user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magneto-resistive random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.