Method and device for calculating volume of electron density isosurface point cloud
By layering and segmenting the electron density isosurface point cloud, and using the nearest point search method and polygon interior point algorithm to calculate the cross-sectional area, the problem of large calculation error of irregular geometric volume in the prior art is solved, and higher accuracy and efficiency are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN UNIV
- Filing Date
- 2022-07-18
- Publication Date
- 2026-06-09
AI Technical Summary
Existing methods for calculating the volume of irregular geometries suffer from large errors, long computation times, and high complexity. In particular, when measuring the volume of electron density isosurface point clouds on molecular van der Waals surfaces, existing algorithms struggle to accurately segment contour boundaries, leading to significant errors.
The nearest point search method is used to layer and segment the electron density isosurface point cloud. The sign of the area is determined by the polygon interior point algorithm. The cross-sectional area of each slice is calculated and accumulated to calculate the volume.
It improves the accuracy of contour boundary segmentation, reduces the error in point cloud volume measurement, and improves computational efficiency and accuracy.
Smart Images

Figure CN115170642B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of point cloud volume measurement technology, and more specifically, to a method and apparatus for calculating the volume of point clouds on electron density isosurfaces. Background Technology
[0002] Volume is a crucial attribute parameter of objects in three-dimensional space, and volume calculation is a fundamental aspect of object morphology analysis. Volume calculation involves both regular and irregular geometric shapes. Among these, the volume measurement of irregular geometric shapes remains a common and unresolved challenge due to the lack of universally applicable calculation methods. Three-dimensional laser scanning can quickly acquire point cloud data containing information about the object's surface structure. This yields a three-dimensional closed surface model or multi-layered two-dimensional contour boundary of the object. Both methods can calculate the volume of irregular objects, representing two technical approaches: reverse modeling and slicing. The former provides accurate and reliable volume calculations, but requires scanning, point cloud, and surface fitting stages to generate the target model, and still necessitates topology checks and hole filling, making the calculation process resource-intensive and time-consuming. The latter simplifies a three-dimensional surface problem into multiple two-dimensional curve problems, reducing spatial complexity and significantly lowering computation time at the cost of a small amount of accuracy. Therefore, the slicing method, due to its intuitiveness and ease of programming, is widely used in engineering projects, such as measuring the volume of irregular tree canopies, the volume of commodity packaging, the capacity of oil tanks and caverns, and the displacement of ships. Furthermore, in theoretical research, such as computational chemistry, the study of the electrostatic potential on the van der Waals surface of molecules can be used to predict reaction sites, predict molecular properties, and explain weak intermolecular interactions. The volume of the van der Waals surface (hereinafter referred to as the molecular electron density isosurface) is an important parameter.
[0003] In volume measurement using the slicing method, the "slice area calculation" requires correctly sorting irregular points on the cross-section to generate contour boundaries, which is crucial for obtaining accurate volume values. Among existing boundary sorting algorithms, polar coordinate sorting is unsuitable for extremely concave polygons; contour sorting based on the minimum included angle principle and concave point interpolation still fail when dealing with complex contours; α-shape point cloud contour extraction tends to inflate contour volumes; and bidirectional nearest-point search performs well, but like the former two, it is still limited to sorting single contour boundaries, such as piers, oil tanks, and ships. When using the idea of classification before sorting, algorithms like K-means clustering and spectral clustering, which require prior knowledge of the number of categories, are unsuitable for such cases. Digital image methods can segment multiple contours, but they have strict requirements on grid size, and two vector-grid transformations introduce new errors. While polygon splitting and recombining methods can distinguish multiple contours, their reliability decreases when there are many randomly distributed contours on the slice due to the statistical method of splitting abnormal edges. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method and apparatus for calculating the volume of point cloud of electron density isosurface, which can improve the accuracy of contour boundary segmentation and thus reduce the error of point cloud volume measurement.
[0005] This application provides a method for calculating the volume of an electron density isosurface point cloud, comprising the following steps:
[0006] The obtained electron density isosurface point cloud is layered to obtain the contour point cloud of each slice;
[0007] Based on the nearest point search method, the contour point cloud of each slice is segmented into different contours to obtain at least one number of contours.
[0008] The cross-sectional area of each slice layer is obtained by summing the areas enclosed by all contours of each slice layer; wherein, the area enclosed by each contour can be positive or negative, and the sign of the area enclosed by the contour is determined by the polygon interior point algorithm.
[0009] The volume of the electron density isosurface point cloud is calculated based on the cross-sectional area of each slice.
[0010] In some embodiments, the electron density isosurface point cloud is obtained in the following manner:
[0011] Density functional theory calculations are performed on the molecular structure to obtain wavefunction results, and a grid file is generated based on the wavefunction results; wherein, the grid file includes an electron density grid file and an electrostatic potential grid file;
[0012] The grid file is converted into an electron density isosurface point cloud based on the MC algorithm.
[0013] In some embodiments, the nearest-point search method is used to segment the contour point cloud of each slice into different contours to obtain at least one number of contours, including the following steps:
[0014] Determine the initial starting point of the contour point cloud in each slice;
[0015] Within a set radius, search for the nearest point to the initial starting point that is not connected to any other point, connect the points to the initial starting point, and use the connected point as the new starting point.
[0016] Within a set radius, search for the nearest point to the new starting point that is not connected to any other point, and connect them. Continue in this manner until all points within the set radius are connected to other points. Then connect the new starting point to the original starting point to form a closed contour line.
[0017] Check if there are unconnected points in the contour point cloud of each slice. If so, redetermine the initial starting point according to the above steps to form another closed contour line; otherwise, end.
[0018] In some embodiments, the contours of each slice are either contained or disjoint, wherein the area enclosed by the contours that are contained can be positive or negative.
[0019] In some embodiments, the sign of the area enclosed by the contour is determined by the following method:
[0020] Calculate the area enclosed by each contour in each slice layer;
[0021] The positional state between contours in each slice is determined based on the polygon interior point determination algorithm, and the number of contours contained in each slice is recorded.
[0022] The sign of the area enclosed by each contour in each slice is determined by the area enclosed by each contour and the number of contours contained in each contour.
[0023] In some embodiments, calculating the volume of the electron density isosurface point cloud based on the cross-sectional area of each slice includes the following steps:
[0024] The volume of each slice is calculated based on the layer thickness of the electron density isosurface point cloud and the cross-sectional area of each slice.
[0025] The volume of the electron density isosurface point cloud is obtained by summing the calculated volumes of each slice.
[0026] In some embodiments, the step of layering the acquired electron density isosurface point cloud to obtain the contour point cloud of each slice includes the following steps:
[0027] After the obtained electron density isosurface point cloud is layered, preprocessing is performed based on the MC algorithm to remove points that are not on the contour, resulting in the contour point cloud of each slice.
[0028] In some embodiments, a device for calculating the volume of an electron density isosurface point cloud is also provided, comprising:
[0029] The layering module is used to layer the acquired electron density isosurface point cloud to obtain the contour point cloud of each slice.
[0030] The segmentation module is used to segment the contour point cloud of each slice obtained by the nearest point search method to obtain at least one number of contours.
[0031] The first calculation module is used to sum the areas enclosed by all contours of each slice layer to obtain the cross-sectional area of that slice layer; wherein, the area enclosed by each contour can be positive or negative, and the sign of the area enclosed by the contour is determined according to the polygon interior point algorithm.
[0032] The second calculation module is used to calculate the volume of the electron density isosurface point cloud based on the cross-sectional area of each slice.
[0033] In some embodiments, an electronic device is also provided, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for calculating the volume of the electron density isosurface point cloud as described above are performed.
[0034] In some embodiments, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, performs the steps of the method for calculating the volume of the electron density isosurface point cloud as described in any of the preceding embodiments.
[0035] The present application discloses a method and apparatus for calculating the volume of an electron density isosurface point cloud. The method involves layering the acquired electron density isosurface point cloud to obtain the contour point cloud of each layer; segmenting the contour point cloud of each layer using the nearest point search method to obtain at least one number of contours; summing the areas enclosed by all contours of each layer to obtain the cross-sectional area of that layer; and calculating the volume of the electron density isosurface point cloud based on the cross-sectional area of each layer. The use of the nearest point search method for segmenting different contours improves the accuracy of contour boundary segmentation, thereby reducing the error in point cloud volume measurement. Attached Figure Description
[0036] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart illustrating the method for calculating the point cloud volume of the electron density isosurface as described in an embodiment of this application is shown;
[0038] Figure 2 A schematic diagram of the Cat6 point cloud described in an embodiment of this application is shown;
[0039] Figure 3A schematic diagram of the structure of the scanning target described in an embodiment of this application is shown;
[0040] Figure 4 This document illustrates a flowchart of the process for obtaining electron density isosurface point clouds according to an embodiment of this application.
[0041] Figure 5 This illustration shows a schematic diagram of the contour lines processed by the MC algorithm according to an embodiment of this application;
[0042] Figure 6 This illustration shows a schematic diagram of the three-layer slice point cloud projection described in an embodiment of this application;
[0043] Figure 7 The embodiments described in this application are shown. Figure 6 A schematic diagram of the segmented contour obtained after the projection of the mid-layer slice point cloud is processed by the nearest point search method.
[0044] Figure 8 A schematic diagram of the positional relationship of the multiple contours described in an embodiment of this application is shown;
[0045] Figure 9 This illustration shows a comparison of the results obtained by contour segmentation of Cat6 point cloud slices using different algorithms as described in the embodiments of this application.
[0046] Figure 10 A schematic diagram of the scanned object described in the embodiments of this application is shown;
[0047] Figure 11 The illustration shows a comparison of the results obtained by contour segmentation of scanned point cloud slices using different algorithms as described in the embodiments of this application.
[0048] Figure 12 A schematic diagram of the structure of the calculation device for the point cloud volume of the electron density isosurface described in an embodiment of this application is shown;
[0049] Figure 13 A schematic diagram of the structure of the electronic device described in an embodiment of this application is shown. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0051] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0052] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0053] When using the slicing method to measure the volume of point clouds of irregular objects, existing polygon decomposition and reconstruction methods struggle to accurately segment closely spaced contours, leading to reduced calculation accuracy. To address this issue, this application proposes a method, apparatus, electronic device, and storage medium for calculating the volume of point clouds based on electron density isosurfaces. These methods achieve high-accuracy boundary segmentation, thereby reducing the average relative error in volume measurement.
[0054] See the instruction manual appendix Figure 1 This application provides a method for calculating the volume of an electron density isosurface point cloud, comprising the following steps:
[0055] S1. The obtained electron density isosurface point cloud is layered to obtain the contour point cloud of each slice.
[0056] S2. Based on the nearest point search method, the contour point cloud of each slice is segmented into different contours to obtain at least one number of contours.
[0057] S3. Sum the areas enclosed by all contours of each slice to obtain the cross-sectional area of that slice; wherein, the area enclosed by each contour can be positive or negative, and the sign of the area enclosed by the contour is determined by the polygon interior point algorithm.
[0058] S4. Calculate the volume of the electron density isosurface point cloud based on the cross-sectional area of each slice.
[0059] In step S1, the electron density isosurface point cloud is obtained in the following way:
[0060] Density functional theory calculations are performed on the molecular structure to obtain wavefunction results, and a grid file is generated based on the wavefunction results; wherein, the grid file includes an electron density grid file and an electrostatic potential grid file;
[0061] The grid file is converted into an electron density isosurface point cloud based on the MC algorithm.
[0062] In this application, the electron density isosurface point cloud of the chiral bis(nitrogen-oxygen) metal complex catalyst-substrate binding model (hereinafter referred to as Cat6 point cloud) was selected as the experimental object. Its surface exhibits large variations and complex layering; see the appendix of the specification for details. Figure 2 The instruction manual includes Figure 2 (a) in the image is the rendered Cat6 point cloud, and (b) is the 3D surface model of the Cat6 point cloud.
[0063] For details, please refer to the instruction manual appendix. Figure 3 In one embodiment, the process for obtaining the electron density isosurface point cloud is as follows: First, the chemical molecular structure is optimized using Gaussian software, and density functional calculations are performed to obtain the wavefunction results. Then, the wavefunction analysis software Multiwfn is used to generate electron density grid files and electrostatic potential grid files (a grid file is a file that records the values of a specific function at uniformly distributed points in three-dimensional space), as shown in the appendix to the specification. Figure 3 As shown in (a) above. Grid data starts from point (x). start ,y start ,z start Starting with h and Y Slice and X Slice It extends in the Z, Y, and X directions at intervals, eventually filling the cuboid; each of the three directions has n. Z n Y and n X There are n points within the cuboid. X n Y n Z Several points. Based on the relationship between the electron density and isosurface at each point, the Marching Cubes (MC) algorithm is used to reconstruct the data, as shown in the attached manual. Figure 3In step (b), the electron density point cloud is finally bilinearly interpolated based on the electrostatic potential grid file. Then, OpenGL is used to render the electrostatic potential values at the vertices of the triangles to obtain the result shown in the attached manual. Figure 3 (c) in the middle.
[0064] Furthermore, point cloud data is typically acquired using 3D laser scanning, but the layering method differs between the data in this application and the data obtained through 3D laser scanning. For the laser scanning data, the number of layers is:
[0065]
[0066] In the formula, z min and z max It is attached to the instruction manual. Figure 3 The minimum and maximum values of the point cloud in the Z direction are shown in (b); h is the interval of the point cloud slices. It rounds up; n P +1 represents the number of point cloud slices, where the volume calculation uses the first n slices. P The slices of each layer are summed.
[0067]
[0068] In the formula, l is the slice number; z l It is the position of the slice plane.
[0069] For the molecular electron density isosurface point cloud in this application, its number of layers is:
[0070]
[0071] In the formula, z start It is the minimum value of point cloud D in the Z direction in the grid file; "round(·)" is the rounding function. M +1 represents the number of point cloud slices. The resulting layered positions are distributed as follows:
[0072]
[0073] Furthermore, in this application, in order to obtain high-quality contour point clouds, after the obtained electron density isosurface point cloud is layered, preprocessing is performed based on the MC algorithm to remove points that are not on the contour, thus obtaining the contour point cloud of each slice.
[0074] The basic idea of the McLeod algorithm is to traverse all voxels (cubes consisting of 8 points) in the grid data, classify them into one of 15 known relationships based on the relationship between their vertex values and isosurface thresholds, and then reconstruct the object's surface by inserting triangles. (See attached instruction manual.) Figure 3In the top two layers of the molecular isosurface point cloud (b), by observing the positional relationship between points inside the isosurface and points on the reconstructed isosurface in the electron density lattice point cloud, a preprocessing method for projected points on slices of this type of point cloud is summarized, which can effectively remove points that are not on the contour. The process is detailed in the appendix of the instruction manual. Figure 4 :
[0075] Instruction manual attached Figure 4 In (a), light-colored dots represent points in the lattice point cloud within the surface, dark-colored dots represent the reconstructed electron density isosurface point cloud, and the black box contains the instruction manual appendix. Figure 4 (b) shows the point cloud of the top two layers, where the reconstructed dark points either overlap with or are outside the light points. Scattered between the two layers of red points are some blue points, which are the vertices of triangles obtained through MC interpolation. (See attached instruction manual.) Figure 4 (c) is a schematic diagram showing the result after connecting these triangles. (See attached instruction manual.) Figure 4 Image (d) is a top-down view diagram, where the dark lines indicate the reference to the instruction manual. Figure 4 The outline drawn in (c) shows that none of the points on the outline fall on the chessboard grid (projected along the Z-axis, the points in a certain layer of the grid file resemble the distribution of points on a Go board). (See the attached manual.) Figure 4 The voxel cases listed in (e) can be used for interpretation, where the dark dots represent points outside the isosurface of the grid point cloud. Based on their distribution, triangles of different numbers and positions are inserted into the voxel and projected along the Z-axis. The points that fall on the grid points are all located on the edges between the upper and lower layers of the voxel, and the points that form the contour line are those points on the upper and lower layers of the voxel.
[0076] Therefore, for the point cloud obtained by the MC algorithm, we can obtain a high-quality contour line by layering it according to formula (4) and then removing the points that fall on the chessboard grid. We select three layers from the point cloud above, and the contour distribution is shown in the appendix of the instruction manual. Figure 5 As shown, the instruction manual is attached. Figure 5 (a) is the projection of the point cloud of the third layer slice; (b) is the projection of the point cloud of the thirtieth layer slice; (c) is the projection of the point cloud of the thirty-second layer slice.
[0077] In step S2, the Improve Nearest Point Search (INPS) method is used to segment different contours in the contour point cloud of each slice. The INPS method described in this application distinguishes different contours based on the principle of single use of local points: for an ideal contour point set, each point only needs to be connected with the two points closest to it to obtain a closed contour line. Therefore, when all points near a given point have been used (connected), it is determined that one contour connection has been completed, and the connection begins from the next unused point. Specifically, first, the initial starting point of the contour point cloud in each slice is determined; then, within a set radius, a point to be connected that is closest to the initial starting point and not connected to any other point is searched, connected, and this point is used as the new starting point; then, within the set radius, a point to be connected that is closest to the new starting point and not connected to any other point is searched, connected, and so on, until all points within the set radius are connected to other points. The new starting point is then connected to the initial starting point to form a closed contour line; finally, it is checked whether there are any unconnected points in the contour point cloud of each slice. If so, the initial starting point is re-determined according to the above steps to form another closed contour line; otherwise, the process ends.
[0078] In one embodiment, contour search is performed through the following steps:
[0079] P1. Find the point p with the minimum value on the X-axis. s As a starting point, its usage is recorded as 1, let p last and p s For the same point;
[0080] P2. Using r as the radius, search for points that fall within the circle, excluding points with condition 1, and find points that are parallel to p. last The nearest point p next Set its usage to 1 and connect p. last and p next and p next As the new p last ;
[0081] P3. Determine if a contour search is complete. If the usage status of all points within the circle is 1, then connect p. last and p s Otherwise, repeat step P2;
[0082] P4. Determine whether all contour searches have been completed. If there are still unused points, repeat step P1; otherwise, the contour search ends.
[0083] The search radius r has a relatively small impact on the search results. Misconnections only occur when the quality of the projected points on the cross-section is poor (i.e., the distance between two points in the contour is greater than the distance from that point to the starting point of the next contour). In the point cloud used in this application, r = kh. Multiple experiments have shown that contour segmentation results are good when k is between 3 and 5 (generally, the better the point cloud quality, the smaller the value of k). (See attached specification). Figure 5 (a) The result after algorithm processing is shown in the attached instruction manual. Figure 6 As shown. The distribution of multi-contour points in the i-th layer slice is as follows:
[0084]
[0085] In the formula, P i P is the set of all contours in the i-th layer; i j p is the set of m points at the midpoint of the j-th contour on the i-th slice. a Let {x} be a vertex in the contour. a ,y a ,z a} represents the coordinates of that vertex.
[0086] In steps S3 and S4, the cross-sectional area of the i-th slice is:
[0087]
[0088] In the formula, For contour P i j The area enclosed; S i Let be the cross-sectional area of the i-th layer. The calculation method is as follows:
[0089]
[0090] In the formula, |·| represents the determinant operation. The final electron density isosurface point cloud volume V can be calculated as:
[0091]
[0092] In the formula, V i It is the volume of the i-th slice.
[0093] It is necessary to note that in step S3, there are inclusion or separation relationships between the contours of each slice layer; please refer to the appendix of the instruction manual. Figure 7 , represents the positional relationship of polygons 1 to 4. The area enclosed by contours with inclusion relationships can be positive or negative, so S in formula (7) iThe determination of the containment relationship between contours has been passed. Specifically, firstly, the area of each contour is calculated using the Gaussian area formula; then, the PIP algorithm is used to determine the positional status between contours. Each contour is compared with contours other than itself for containment relationship. If a contour is contained by other contours, the containment count is incremented by 1. Finally, the sign of the contour area is determined using the following formula:
[0094]
[0095] In the formula, count(P) i j ) is the outline P i j The number of times it is included. See the instruction manual appendix. Figure 7 Contour 2 is contained only by contour 1, so its area is negative, while contour 3 is contained twice, so its area is still positive.
[0096] Furthermore, the calculation method proposed in this application is compared with existing algorithms. Specifically, the volume calculated by the reverse modeling method is accurate and reliable, and can be used as the true value of the point cloud volume in this paper, serving as a basis for verifying the improved algorithm. Therefore, this paper uses Geomagic Wrap 2017 software to calculate the true values of the point cloud volume and cross-sectional area. Experiments are conducted using Matlab to implement the calculation method of this application and the methods in existing technologies, and the application scenarios and calculation accuracy are compared and analyzed.
[0097] The Cat6 point cloud data is shown in Table 1. The contour segmentation coefficients for the two algorithms are shown in Table 2. Six representative locations from the Cat6 point cloud are selected for demonstration, and the results are shown in the appendix to the instruction manual. Figure 8 As shown, the instruction manual is attached. Figure 8 (a) shows the contour segmentation result obtained by the existing bidirectional nearest search method, (b) shows the contour segmentation result obtained by the existing PSR algorithm, and (c) shows the contour segmentation result obtained by the INPS algorithm of this application; the area and error analysis are shown in Table 3.
[0098]
[0099]
[0100] Table 1
[0101] Method Parameter k Existing technology PSR 2.5 This application INPS 3
[0102] Table 2
[0103]
[0104] Table 3
[0105] Furthermore, to verify the effectiveness and robustness of the calculation method in this application, experiments were conducted using publicly available 3D laser scanning data (published by the Stanford University Computer Graphics Laboratory) by Stanford Bunny and Happy Buddha (due to the low density of the original point cloud, resulting in poor slice quality, the original point cloud was upsampled). See the appendix to the specification. Figure 9 The instruction manual is attached. Figure 9 Image (a) shows Bunny's physical object and 3D surface model, as per the instruction manual. Figure 9 (b) shows the physical and surface models of Buddha. Compared to molecular point clouds, the boundary shapes of single contours in these two sets of data are more complex, but the number of contours on the slices is smaller. The data information of the two sets of point clouds is shown in Table 4. The parameters used in processing the public point clouds using the proposed algorithm, namely the layer thickness and contour segmentation coefficient values, are shown in Table 5. The processed results are shown in the appendix to the specification. Figure 10 Included with instruction manual Figure 11 As shown, (a) are contour segmentation results obtained by the bidirectional nearest search method in the prior art, and (b) are contour segmentation results obtained by the INPS algorithm of this application. The relative error results of the area at the six slice positions are shown in Tables 6 and 7.
[0106]
[0107] Table 4
[0108] Test Data Parameter k Projection thickness / mm Stanford Bunny 5 0.0531928 Happy Buddha 4 0.0167866
[0109] Table 5
[0110]
[0111] Table 6
[0112]
[0113] Table 7
[0114] According to the instruction manual Figure 8 , 10 From 11, and Tables 3, 6, and 7, we can conclude that:
[0115] (1) Applicability. The INPS method used in this application demonstrates good contour segmentation results for both point clouds processed by the MC algorithm and point clouds obtained by laser scanning, with roughly the same error in cross-sectional area. Compared with the PSR method used in the prior art, the INPS method used in this application exhibits better performance in molecular potential point clouds, as indicated in the appendix to the specification. Figure 8As shown in Figures 1, 2, 5, and 6 of (a), the INPS method used in this application results in fewer false connections than the PSR method used in the prior art. On publicly available datasets, the INPS method used in this application performs comparably to the PSR method used in the prior art.
[0116] (2) Robustness. (See attached instruction manual) Figure 8 In this application, the INPS algorithm is more stable than the existing PSR algorithm. (See attached specification.) Figure 8 In Figures 1, 2, 5, and 6 shown in (b), the existing PSR technique exhibits varying degrees of misconnection. This is because the large number of contours in these four figures leads to a corresponding increase in misconnected line segments between contours, resulting in a larger calculated standard deviation. Consequently, some misconnected line segments between closely spaced contours cannot be eliminated. The advantage of the INPS technique used in this application is that, within the search range of a point within a contour, as long as the distance to that point within the contour is less than the distance to any point on other contours, misconnection will not occur. Even in the specification appendix with poor cross-sectional projection point quality... Figure 10 Included with instruction manual Figure 11 Furthermore, there is virtually no chance of false connections. Additionally, the INPS used in this application allows for a more flexible selection of coefficients based on the criteria for determining the completion of a contour search.
[0117] Then, the point cloud volume is calculated. The measurement results obtained by INPS used in this application and PSR algorithm used in the prior art are shown in Table 8.
[0118]
[0119] Table 8
[0120] Table 8 shows that:
[0121] (1) Accuracy. Both algorithms achieved errors within 0.1% for the three sets of point clouds, and the error of the INPS algorithm in this application was slightly lower than the PSR of the prior art. For example, as shown in the appendix to the specification... Figure 8 In the process, the existing PSR algorithm fails to correct misconnected line segments for some closely spaced contours, resulting in an overestimation of the area of the contour at that cross-section. Comparison with Table 8 shows that for Cat6 point cloud volume calculations, the volume obtained by the INPS algorithm is smaller than that obtained by the existing PSR algorithm, which is consistent with the actual situation.
[0122] (2) Efficiency. From the algorithm flow analysis, the existing PSR algorithm, which is an improved version of the bidirectional nearest neighbor search method, requires sorting all points in the cross-section using the bidirectional nearest neighbor search method at the beginning. In contrast, the INPS algorithm in this application classifies the points during the same sorting process. This is because the INPS algorithm classifies the points based on the data obtained during the sorting process. The existing PSR algorithm focuses on splitting and recombining abnormally long edges based on statistical data. Therefore, the INPS algorithm in this application has lower complexity than the existing PSR algorithm. Furthermore, experiments show that the accuracy of the INPS algorithm in this application is slightly higher than that of the existing PSR algorithm.
[0123] As can be seen, the method for calculating the volume of point cloud of electron density isosurface proposed in this application can perform excellent segmentation of multiple contours for both specific data and public datasets. It has universality and good anti-interference ability. Moreover, it has higher accuracy, stronger robustness and lower algorithm complexity compared with existing technology algorithms.
[0124] Based on the same inventive concept, this application also provides a device for calculating the volume of electron density isosurface point cloud. Since the principle of the device in this application is similar to the above-mentioned method for calculating the volume of electron density isosurface point cloud in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0125] As per the instruction manual Figure 12 As shown in the illustration, this application also provides a device for calculating the volume of an electron density isosurface point cloud, comprising:
[0126] The layering module 1201 is used to layer the acquired electron density isosurface point cloud to obtain the contour point cloud of each slice.
[0127] The segmentation module 1202 is used to segment the contour point cloud of each slice obtained by the nearest point search method to obtain at least one number of contours.
[0128] The first calculation module 1203 is used to sum the areas enclosed by all contours of each slice layer to obtain the cross-sectional area of the slice layer; wherein, the area enclosed by each contour can be positive or negative, and the positive or negative sign of the area enclosed by the contour is determined according to the polygon interior point algorithm.
[0129] The second calculation module 1204 is used to calculate the volume of the electron density isosurface point cloud based on the cross-sectional area of each slice.
[0130] The device for calculating the volume of an electron density isosurface point cloud as described in this application divides the acquired electron density isosurface point cloud into layers to obtain the contour point cloud of each layer; it segments the contour point cloud of each layer into different contours based on the nearest point search method to obtain at least one number of contours; it sums the areas enclosed by all contours of each layer to obtain the cross-sectional area of that layer; and it calculates the volume of the electron density isosurface point cloud based on the cross-sectional area of each layer. By using the nearest point search method to segment different contours, the accuracy of contour boundary segmentation can be improved, thereby reducing the error in point cloud volume measurement.
[0131] Based on the same concept of the present invention, as shown in the appendix to the specification. Figure 13 As shown in the embodiment of this application, an electronic device 1300 is provided. The electronic device 1300 includes: at least one processor 1301, at least one network interface 1304 or other user interface 1303, a memory 1305, and at least one communication bus 1302. The communication bus 1302 is used to enable communication between these components. The electronic device 1300 may optionally include the user interface 1303, including a display (e.g., touchscreen, LCD, CRT, holographic imaging, or projector), a keyboard, or a clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0132] Memory 1305 may include read-only memory and random access memory, and provides instructions and data to processor 1301. A portion of memory 1305 may also include non-volatile random access memory (NVRAM).
[0133] In some implementations, memory 1305 stores executable modules or data structures, or subsets thereof, or extended sets thereof:
[0134] Operating system 13051 contains various system programs used to implement various basic business functions and handle hardware-based tasks;
[0135] Application module 13052 contains various applications, such as desktop launcher, media player, and browser, to implement various application services.
[0136] In this embodiment of the application, the processor 1301 executes steps such as a method for calculating the volume of an electron density isosurface point cloud by calling a program or instruction stored in the memory 1305.
[0137] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs steps such as those in a method for calculating the volume of an electron density isosurface point cloud.
[0138] Specifically, the storage medium can be a general-purpose storage medium, such as a portable disk or hard disk. When the computer program on the storage medium is run, it can execute the above-mentioned method for calculating the volume of an electron density isosurface point cloud, which can improve the accuracy of contour boundary segmentation and thus reduce the error in point cloud volume measurement.
[0139] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0140] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0141] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0142] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0143] Finally, it should be noted that the above embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method for calculating the volume of point cloud from an electron density isosurface, characterized in that, The method includes the following steps: The acquired electron density isosurface point cloud is layered to obtain the contour point cloud of each slice. The electron density isosurface point cloud is obtained as follows: a density functional approximation is performed on the molecular structure to obtain the wavefunction result, and a grid file is generated based on the wavefunction result; wherein, the grid file includes an electron density grid file and an electrostatic potential grid file; the grid file is converted into an electron density isosurface point cloud based on the MC algorithm. Based on the nearest-neighbor search method, the contour point cloud of each slice is segmented into different contours to obtain at least one number of contours. The process includes the following steps: determining the initial starting point of the contour point cloud in each slice; searching for a point within a set radius that is closest to the initial starting point and not connected to any other point, connecting it, and using this point as the new starting point; searching for a point within a set radius that is closest to the new starting point and not connected to any other point, connecting it, and so on until all points within the set radius are connected to other points, connecting the new starting point to the initial starting point to form a closed contour line; detecting whether there are unconnected points in the contour point cloud of each slice; if so, re-determining the initial starting point according to the above steps to form another closed contour line; otherwise, ending the process. The cross-sectional area of each slice layer is obtained by summing the areas enclosed by all contours of each slice layer; wherein, the area enclosed by each contour can be positive or negative, and the sign of the area enclosed by the contour is determined by the polygon interior point algorithm. The volume of the electron density isosurface point cloud is calculated based on the cross-sectional area of each slice.
2. The method for calculating the volume of an electron density isosurface point cloud according to claim 1, characterized in that, The contours of each slice are either contained or separated, wherein the area enclosed by the contours that are contained can be positive or negative.
3. The method for calculating the volume of an electron density isosurface point cloud according to claim 2, characterized in that, The sign of the area enclosed by the contour is determined by the following method: Calculate the area enclosed by each contour in each slice layer; The positional state between contours in each slice is determined based on the polygon interior point determination algorithm, and the number of contours contained in each slice is recorded. The sign of the area enclosed by each contour in each slice is determined by the area enclosed by each contour and the number of contours contained in each contour.
4. The method for calculating the volume of an electron density isosurface point cloud according to claim 3, characterized in that, The calculation of the volume of the electron density isosurface point cloud based on the cross-sectional area of each slice includes the following steps: The volume of each slice is calculated based on the layer thickness of the electron density isosurface point cloud and the cross-sectional area of each slice. The volume of the electron density isosurface point cloud is obtained by summing the calculated volumes of each slice.
5. The method for calculating the volume of an electron density isosurface point cloud according to claim 4, characterized in that, The process of layering the acquired electron density isosurface point cloud to obtain the contour point cloud of each slice includes the following steps: After the obtained electron density isosurface point cloud is layered, preprocessing based on the MC algorithm is performed to remove points that are not on the contour, resulting in the contour point cloud of each slice.
6. A device for calculating the volume of point cloud of electron density isosurface, characterized in that, include: A layering module is used to layer the acquired electron density isosurface point cloud to obtain the contour point cloud of each slice. The electron density isosurface point cloud is obtained by: performing density functional analysis on the molecular structure to obtain the wavefunction result, and generating a grid file based on the wavefunction result; wherein the grid file includes an electron density grid file and an electrostatic potential grid file; and converting the grid file into an electron density isosurface point cloud based on the MC algorithm. The segmentation module is used to segment the contour point cloud of each slice based on the nearest point search method to obtain at least one number of contours. The process includes: determining the initial starting point of the contour point cloud in each slice; searching for a point within a set radius that is closest to the initial starting point and not connected to any other point, connecting it, and using this point as the new starting point; searching for a point within a set radius that is closest to the new starting point and not connected to any other point, connecting it, and so on until all points within the set radius are connected to other points, connecting the new starting point to the initial starting point to form a closed contour line; detecting whether there are unconnected points in the contour point cloud of each slice; if so, re-determining the initial starting point according to the above steps to form another closed contour line; otherwise, ending the process. The first calculation module is used to sum the areas enclosed by all contours of each slice layer to obtain the cross-sectional area of that slice layer; wherein, the area enclosed by each contour can be positive or negative, and the sign of the area enclosed by the contour is determined according to the polygon interior point algorithm. The second calculation module is used to calculate the volume of the electron density isosurface point cloud based on the cross-sectional area of each slice.
7. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the method for calculating the volume of the electron density isosurface point cloud as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method for calculating the volume of the electron density isosurface point cloud as described in any one of claims 1 to 5.