Three-dimensional electron density fitting analysis method, device, equipment, medium and product
By acquiring three-dimensional electron density stereo data, generating isosurfaces, and extracting geometric parameters for fitting various geometric bodies, the problem of single fitting standard and insufficient accuracy in existing technologies is solved, and high-precision fitting and comprehensive evaluation of complex three-dimensional electron density shapes are achieved.
Patent Information
- Application Number
- CN202510869820.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-31
AI Technical Summary
Existing technologies are ill-suited to the analytical needs of complex three-dimensional electron density shapes, and their fitting standards are limited, resulting in insufficient fitting accuracy and evaluation.
By acquiring three-dimensional electron density stereo data, traversing each voxel to determine the vertex of the isosurface, generating isosurfaces, calculating volume and surface area, extracting geometric parameters, performing geometric fitting, evaluating the degree of fitting, and supporting fitting of various models such as spheres, ellipsoids, cylinders, and cubes.
It improves the accuracy and adaptability of three-dimensional electron density fitting analysis, realizes diversified fitting standards and comprehensive evaluation, and enhances the efficiency of fitting analysis.
Smart Images

Figure CN120874152A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a three-dimensional electron density fitting analysis method, apparatus, equipment, medium, and product. Background Technology
[0002] In the fields of biomolecular structure analysis, materials science, and nanotechnology, small-angle scattering (SAS) is widely used for structural analysis of samples at the nanoscale. For the description of shape characteristics, theoretical scattering curve models of ideal shapes are often fitted with experimental curves.
[0003] However, this traditional fitting method has the following problems: (1) Most tools (such as SASVIEW and SASFIT) only support fitting of scattering curves, which is difficult to adapt to the analysis needs of complex electron density shapes; (2) The existing methods evaluate the degree of fitting based only on the fitting residuals of the curve fitting, and the fitting standard is singular.
[0004] Therefore, how to perform fitting analysis on complex three-dimensional electron density shapes to improve the accuracy of three-dimensional electron density fitting analysis and comprehensively evaluate the degree of fitting is an urgent problem to be solved. Summary of the Invention
[0005] This invention provides a three-dimensional electron density fitting analysis method, apparatus, equipment, medium, and product to address the shortcomings of existing technologies, such as difficulty in adapting to the analysis needs of complex electron density shapes and the single fitting standard for evaluating the degree of fitting. It enhances the adaptability to complex three-dimensional electron density shapes, improves the accuracy of three-dimensional electron density fitting analysis, and enables a comprehensive evaluation of the degree of fitting.
[0006] This invention provides a three-dimensional electron density fitting analysis method, comprising: Acquire three-dimensional electron density stereo data; the three-dimensional electron density stereo data includes the coordinates and electron density values corresponding to multiple voxels; Traverse each voxel, determine the isosurface vertex where the electron density value is equal to the preset isosurface threshold, generate the isosurface of the three-dimensional electron density volume view data based on the isosurface vertex, and calculate the volume and surface area of the three-dimensional electron density profile shape formed by the isosurface. Geometric features are extracted from the three-dimensional electron density profile shape to obtain geometric parameters; Based on the geometric parameters, a geometric body is fitted to obtain a geometric body fitting model, and the volume and surface area of the geometric body fitting model are calculated. The degree of fit between the geometric fitting model and the three-dimensional electron density contour shape is evaluated based on the volume ratio and surface area ratio of the geometric fitting model and the three-dimensional electron density stereo data.
[0007] According to the present invention, a three-dimensional electron density fitting analysis method is provided, wherein traversing each voxel to determine the isosurface vertex whose electron density value is equal to a preset isosurface threshold, and generating the isosurface of the three-dimensional electron density stereoscopic data based on the isosurface vertex, includes: Traverse the edges of each voxel and obtain the electron density values of the two vertices connected by the current edge; If the electron density value of one vertex connected to the current edge is greater than the preset isosurface threshold, and the electron density value of another vertex is less than the preset isosurface threshold, the isosurface vertex on the current edge is determined by linear interpolation. After the traversal is completed, triangular patches are generated based on the vertices of the isosurface to obtain the isosurface of the three-dimensional electron density stereoscopic data.
[0008] According to a three-dimensional electron density fitting analysis method provided by the present invention, the calculation of the volume and surface area of the three-dimensional electron density profile shape formed by the isosurface includes: The volume of a single voxel is calculated based on the reciprocal of the length of the voxel in the three directional dimensions. The volume of the three-dimensional electron density profile shape is obtained by multiplying the number of voxels with electron density values greater than the preset isosurface threshold with the volume of a single voxel. Calculate the area of each triangular facet based on the coordinates of the vertices of the three isosurfaces of each facet. The surface area of the three-dimensional electron density profile shape is obtained by summing the areas of all triangular facets.
[0009] According to the present invention, a three-dimensional electron density fitting and analysis method is provided, wherein the geometric parameters include the principal axis direction, the initial semi-axis length, the maximum radius, the direction of the maximum diameter, and the midpoint coordinates; the geometric feature extraction of the three-dimensional electron density contour shape to obtain the geometric parameters includes: Calculate the mean coordinates of the vertices of the isosurface and determine the coordinates of the mean vertex; Based on the coordinates of the mean vertex, the coordinates of the isosurface vertex are centered to obtain centered vertex coordinates, and the covariance matrix is calculated based on the centered vertex coordinates. The covariance matrix is subjected to eigenvalue decomposition to obtain eigenvectors and eigenvalues. The principal axis direction is extracted based on the eigenvectors, and the initial semi-axis length is determined based on the square root of the eigenvalues. Calculate the convex hull of the vertices of the isosurface to obtain multiple convex hull vertices; Calculate the pairwise distance between each pair of convex hull vertices, and determine the maximum pairwise distance and the two target convex hull vertices corresponding to the maximum pairwise distance; The direction and midpoint coordinates of the maximum diameter are determined based on the coordinates of the two target convex hull vertices, and the maximum radius is determined based on the maximum pairwise distance.
[0010] According to the present invention, a three-dimensional electron density fitting analysis method is provided, wherein the geometric fitting model includes at least one of a sphere fitting model, an ellipsoidal fitting model, a cylinder fitting model, and a cube fitting model; the step of performing geometric fitting based on the geometric parameters to obtain the geometric fitting model includes: An optimization algorithm is used to optimize and solve the first objective function to obtain the optimized semi-axis length. The objective of the first objective function is to adjust the initial semi-axis length to minimize the weighted sum of the volume difference and surface area difference between the ellipsoid fitting model and the three-dimensional electron density profile shape. An optimization algorithm is used to optimize and solve the second objective function to obtain the optimized projection height and projection radius; the objective of the second objective function is to minimize the weighted sum of the volume difference and surface area difference between the cylindrical fitting model and the three-dimensional electron density profile shape; A sphere fitting model is obtained by fitting a sphere based on the midpoint coordinates of the maximum diameter and the maximum radius. Based on the optimized semi-axis length, an ellipsoid fitting model is obtained by fitting an ellipsoid. Based on the direction of the maximum diameter, the optimized projection height, and the projection radius, a cylinder fitting model is obtained; A cube model is obtained by fitting a cube based on the side length of the smallest circumscribed cube of the isosurface vertex.
[0011] According to a three-dimensional electron density fitting analysis method provided by the present invention, the method further includes: Render the geometry fitting model in the 3D drawing area; In response to the adjustment operation of the rendering effect adjustment control in the tab interface, the rendering effect of the geometry fitting model is adjusted. In response to a click on the parameter export control in the tab interface, export the tab parameters.
[0012] The present invention also provides a three-dimensional electron density fitting analysis device, comprising: The data acquisition module is used to acquire three-dimensional electron density stereoscopic data; the three-dimensional electron density stereoscopic data includes the coordinates and electron density values corresponding to multiple voxels; The isosurface extraction module is used to traverse each voxel, determine the isosurface vertices where the electron density value is equal to the preset isosurface threshold, generate the isosurface of the three-dimensional electron density volume view data based on the isosurface vertices, and calculate the volume and surface area of the three-dimensional electron density profile shape formed by the isosurfaces. The geometry extraction module is used to extract geometric features from the three-dimensional electron density contour shape to obtain geometric parameters; The geometry fitting module is used to perform geometry fitting based on the geometric parameters, obtain a geometry fitting model, and calculate the volume and surface area of the geometry fitting model. The fitting analysis module is used to evaluate the degree of fit between the geometric fitting model and the three-dimensional electron density stereo data based on the volume ratio and surface area ratio of the geometric fitting model and the three-dimensional electron density profile shape.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the three-dimensional electron density fitting analysis method as described above.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the three-dimensional electron density fitting analysis method as described above.
[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the three-dimensional electron density fitting analysis method as described above.
[0016] The three-dimensional electron density fitting analysis method, apparatus, device, medium, and product provided by this invention acquire three-dimensional electron density stereoscopic data including the coordinates and electron density values corresponding to multiple voxels. It then traverses each voxel to determine the vertices of the isosurfaces where the electron density value equals a preset isosurface threshold. Based on these vertices, it generates isosurfaces from the three-dimensional electron density stereoscopic data, thereby transforming the three-dimensional electron density stereoscopic data into a three-dimensional electron density contour shape composed of isosurfaces that can be used for subsequent fitting analysis. This achieves the fitting of the three-dimensional electron density contour of the scatterer. By extracting the geometric parameters of the three-dimensional electron density contour shape for geometric fitting, it supports fitting various geometric models such as spheres, ellipsoids, cylinders, and cubes, thus achieving diversified model fitting for complex three-dimensional electron density shapes. This enhances the adaptability to complex three-dimensional electron density shapes and improves the accuracy of three-dimensional electron density fitting analysis. By automatically comparing the volume and surface area parameters of the geometric fitting model with the original three-dimensional electron density stereoscopic data, it not only provides a more comprehensive evaluation of the fitting degree from multiple dimensions, making the fitting standards more diverse, but also improves the efficiency of fitting analysis. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is one of the flowcharts of the three-dimensional electron density fitting analysis method provided in the embodiments of the present invention.
[0019] Figure 2 This is a schematic diagram of the isosurface provided in an embodiment of the present invention.
[0020] Figure 3 This is a schematic diagram of multi-geometry fitting provided in an embodiment of the present invention.
[0021] Figure 4 This is a schematic diagram of the interactive interface provided in an embodiment of the present invention.
[0022] Figure 5 This is the second schematic flowchart of the three-dimensional electron density fitting analysis method provided in the embodiments of the present invention.
[0023] Figure 6 This is a schematic diagram of the structure of the three-dimensional electron density fitting analysis device provided in the embodiment of the present invention.
[0024] Figure 7 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0026] In the description of embodiments of the present invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Those skilled in the art will understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0027] Figure 1 This is one of the flowcharts illustrating the three-dimensional electron density fitting analysis method provided in this embodiment of the invention. (Refer to...) Figure 1 This invention provides a three-dimensional electron density fitting analysis method, which may specifically include the following steps: Step 101: Obtain three-dimensional electron density stereo data; the three-dimensional electron density stereo data includes the coordinates and electron density values corresponding to multiple voxels.
[0028] It should be noted that the execution subject of the three-dimensional electron density fitting analysis method provided in the embodiments of the present invention can be an electronic device, a component in an electronic device, an integrated circuit, or a chip. The electronic device can be a mobile electronic device or a non-mobile electronic device. For example, a mobile electronic device can be a mobile phone, tablet computer, laptop computer, PDA, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc., while a non-mobile electronic device can be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. The embodiments of the present invention do not specifically limit this. The following embodiments of the present invention describe the execution subject using a server as the execution subject.
[0029] In some embodiments, a user can select an electron density file stored in a specific format via a graphical user interface. The server can read the electron density file selected by the user, load the 3D electron density stereoscopic data, perform data validity verification on the 3D electron density stereoscopic data, and then perform subsequent fitting analysis based on the 3D electron density stereoscopic data that has passed the data validity verification.
[0030] Three-dimensional electron density stereoscopic data can refer to a data set obtained by sampling and recording the electron density distribution in three-dimensional space. A voxel is a basic unit in three-dimensional space, which can be a small cube or cuboid. It can occupy a specific spatial position in a three-dimensional mesh and store the electron density value at that spatial position. In this embodiment of the invention, the three-dimensional electron density stereoscopic data can include the three-dimensional mesh spatial coordinates and electron density values corresponding to multiple voxels.
[0031] In some embodiments, after acquiring the three-dimensional electron density stereoscopic data, the original electron density values in the three-dimensional electron density stereoscopic data can first be normalized to linearly map the original electron density values to the [0, 1] interval, thereby generating a three-dimensional mesh based on the normalized data for subsequent geometric calculations and visualization. The normalization formula can be as follows: ; in, This is the normalized electron density value. This is the original electron density value. It is the minimum of all original electron density values. It is the maximum value among all original electron density values.
[0032] The embodiments of the present invention normalize the original electron density values in the three-dimensional electron density stereo data, which helps to ensure data consistency and generate a three-dimensional mesh to support subsequent geometric calculations and visualization.
[0033] Step 102: Traverse each voxel, determine the isosurface vertex where the electron density value is equal to the preset isosurface threshold, generate the isosurface of the three-dimensional electron density stereo data based on the isosurface vertex, and calculate the volume and surface area of the three-dimensional electron density profile shape formed by the isosurface.
[0034] In some embodiments, the normalized 3D electron density stereoscopic data may include the 3D grid spatial coordinates and normalized electron density values corresponding to each of the N voxels. The mass-weighted average coordinates can be calculated based on the 3D grid spatial coordinates and normalized electron density values corresponding to each of the N voxels to obtain the centroid of the 3D electron density stereoscopic data. The formula for calculating the centroid coordinates is as follows: ; ; ; in, These are the three-dimensional grid space coordinates corresponding to the i-th voxel; It is the normalized electron density value corresponding to the i-th voxel; It is the coordinate of the centroid along the x-axis. It is the coordinate of the centroid along the y-axis. These are the coordinates of the centroid along the z-axis. The spatial coordinates of the centroid are... .
[0035] In some embodiments, the centroid can be used as a reference point for isosurface extraction. The centroid coordinates can help determine the position of the isosurface relative to the entire three-dimensional electron density stereo dataset, i.e., shape positioning information can be provided through centroid calculation.
[0036] In some embodiments, each voxel can be traversed to determine the isosurface vertices whose electron density values are equal to a preset isosurface threshold; by connecting the isosurface vertices (fv.vertices), triangular facets (fv.faces) are generated; by the topological structure of the three vertices of each triangular facet connected within the voxel, the shape of the isosurface is defined, thereby generating the isosurface of the three-dimensional electron density stereoscopic data.
[0037] Figure 2 This is a schematic diagram of the isosurface provided in an embodiment of the present invention. In some embodiments, reference is made to... Figure 2 (a) The isosurface can be continuous, in which case a three-dimensional electron density profile shape can be obtained; refer to Figure 2 (b) The isosurface can also be discontinuous, in which case at least two relatively independent three-dimensional electron density profile shapes can be obtained.
[0038] In some embodiments, when the isosurfaces are continuous, the volume and surface area of the three-dimensional electron density profile shape formed by the isosurfaces can be calculated; when the isosurfaces are discontinuous, the volume and surface area of each relatively independent three-dimensional electron density profile shape can be calculated separately, and the sum of the volumes and the sum of the surface areas of the three-dimensional electron density profile shapes can be calculated to obtain the total volume and total surface area of the three-dimensional electron density profile shape formed by the isosurfaces.
[0039] In this embodiment of the invention, by extracting the isosurfaces of the three-dimensional electron density stereo data, the three-dimensional electron density profile shape composed of the isosurfaces is obtained, thereby converting the three-dimensional electron density stereo data into an analyzable surface (i.e., the three-dimensional electron density profile shape), which is beneficial for subsequent fitting analysis of the three-dimensional electron density stereo data using the relevant information of the analyzable surface.
[0040] Step 103: Extract geometric features from the three-dimensional electron density profile shape to obtain geometric parameters.
[0041] In this embodiment of the invention, the geometric parameters may include the direction of the principal axis, the initial semi-axis length, the maximum radius, the direction of the maximum diameter, and the coordinates of the midpoint.
[0042] In some embodiments, principal component analysis (PCA) can be performed on the isosurface vertices of the three-dimensional electron density stereo data to extract the principal axis directions and obtain the initial semi-axis lengths (a, b, c).
[0043] In some embodiments, the convex hull of the isosurface vertex can be calculated, the convex hull vertex can be obtained, and the direction of the maximum radius and the maximum diameter and the coordinates of the midpoint of the maximum diameter can be determined based on the maximum pairwise distance between the convex hull vertices.
[0044] Step 104: Perform geometric fitting based on the geometric parameters to obtain a geometric fitting model, and calculate the volume and surface area of the geometric fitting model.
[0045] In this embodiment of the invention, the geometric fitting model may include at least one of a sphere fitting model, an ellipsoid fitting model, a cylinder fitting model, and a cube fitting model.
[0046] In this embodiment of the invention, by extracting the geometric parameters of the three-dimensional electron density profile shape composed of isosurfaces for geometric fitting, it is possible to support the fitting of various models such as spheres, ellipsoids, cylinders, and cubes, thereby achieving diversified fitting of complex three-dimensional electron density shapes, significantly improving the adaptability to complex three-dimensional electron density shapes, and outperforming existing single-model fitting methods.
[0047] Step 105: Based on the volume ratio and surface area ratio of the geometric fitting model and the three-dimensional electron density profile shape, evaluate the degree of fit between the geometric fitting model and the three-dimensional electron density stereo data.
[0048] In this embodiment of the invention, for each geometric fitting model, the volume ratio and surface area ratio of the geometric fitting model to the three-dimensional electron density profile shape can be automatically calculated.
[0049] In this embodiment of the invention, the volume and surface area of the three-dimensional electron density profile shape formed by isosurfaces can be used as the volume and surface area of the three-dimensional electron density volumetric data. By comparing the volume ratio and surface area ratio of the geometric fitting model with the three-dimensional electron density profile shape, the degree of fitting between the geometric fitting model and the three-dimensional electron density volumetric data can be quantitatively evaluated. Compared with existing methods for evaluating the degree of fitting, this invention has the function of automatically comparing the volume and surface area parameters of the geometric fitting model with the original three-dimensional electron density volumetric data, with diversified fitting standards and higher analysis efficiency.
[0050] This invention acquires three-dimensional electron density stereoscopic data, including coordinates and electron density values corresponding to multiple voxels. It then traverses each voxel to determine the vertices of isosurfaces where the electron density value equals a preset isosurface threshold. Based on these vertices, it generates isosurfaces from the three-dimensional electron density stereoscopic data, transforming the data into a three-dimensional electron density contour shape composed of isosurfaces suitable for subsequent fitting analysis. This achieves the fitting of the scatterer's three-dimensional electron density contour. By extracting the geometric parameters of the three-dimensional electron density contour shape for geometric fitting, it supports fitting various geometric models such as spheres, ellipsoids, cylinders, and cubes. This enables diverse model fitting for complex three-dimensional electron density shapes, enhancing the adaptability and improving the accuracy of three-dimensional electron density fitting analysis. Furthermore, by automatically comparing the volume and surface area parameters of the geometric fitting model with the original three-dimensional electron density stereoscopic data, it not only provides a more comprehensive evaluation of the fitting degree from multiple dimensions, diversifying fitting standards, but also improves the efficiency of fitting analysis.
[0051] In one optional embodiment, the step of traversing each voxel to determine the isosurface vertex whose electron density value is equal to a preset isosurface threshold, and generating the isosurface of the three-dimensional electron density stereoscopic data based on the isosurface vertex, may specifically include: Step S11: Traverse the edges of each voxel and obtain the electron density values of the two vertices connected by the current edge; Step S12: If the electron density value of one vertex connected to the current edge is greater than the preset isosurface threshold, and the electron density value of another vertex is less than the preset isosurface threshold, the isosurface vertex on the current edge is determined by linear interpolation. Step S13: After traversal is completed, triangular patches are generated based on the vertices of the isosurface to obtain the isosurface of the three-dimensional electron density stereoscopic data.
[0052] In this embodiment of the invention, the isosurface function can be used to extract isosurfaces and generate vertex (fv.vertices) and triangle (fv.faces) data.
[0053] In some embodiments, a voxel can have 12 edges and 8 vertices, with each edge connecting two vertices. Each edge of each voxel can be traversed to obtain the electron density values of the two vertices connected by the current edge. If the data values of the two vertices connected by an edge are greater than and less than a preset isosurface threshold, respectively, it indicates that there is a point on this edge with an electron density value equal to the preset isosurface threshold. The position of the isosurface point on this edge can then be calculated using linear interpolation, and this isosurface point is determined as an isosurface vertex. If the data values of the two vertices connected by an edge are both less than the preset isosurface threshold, or both are greater than the preset isosurface threshold, then no isosurface point is generated on this edge. If the electron density value of a vertex of a voxel is equal to the preset isosurface threshold, then that vertex can be determined as an isosurface vertex.
[0054] After traversing every edge of all voxels, all isosurface vertices are obtained. Triangular patches are generated by connecting three isosurface vertices. These triangular patches define the topology of the isosurfaces, that is, the topology of the connection between the three vertices of each triangular patch within the voxel, thus obtaining the isosurfaces of the three-dimensional electron density stereoscopic data.
[0055] In some embodiments, the validity of the isosurface can be verified. If no isosurface vertices are generated, a threshold adjustment prompt can be generated to remind the user to adjust the preset isosurface threshold.
[0056] In one optional embodiment, calculating the volume and surface area of the three-dimensional electron density profile shape formed by the isosurfaces may specifically include: Step S21: Calculate the volume of a single voxel based on the reciprocal of the length of the voxel in the three directional dimensions; Step S22: Calculate the product between the number of voxels with electron density values greater than the preset isosurface threshold and the volume of a single voxel to obtain the volume of the three-dimensional electron density profile shape; Step S23: Calculate the area of each triangular facet based on the coordinates of the vertices of the three isosurfaces of each triangular facet. Step S24: Calculate the sum of the areas of all triangular facets to obtain the surface area of the three-dimensional electron density profile shape.
[0057] In some embodiments, it can be assumed that the voxels are uniformly distributed, and the volume of a single voxel can be calculated using the following formula: ; in, The volume of a single voxel. , , These can be the lengths of the voxel along the x-axis, y-axis, and z-axis, respectively.
[0058] For example, if a voxel has a length of 10 units in the x-axis direction (i.e., the length of the voxel in the x-axis direction is 10), a length of 10 units in the y-axis direction, and a length of 10 units in the z-axis direction, then the volume of each voxel is... Cubic unit.
[0059] In some embodiments, the volume of the three-dimensional electron density profile shape can be obtained by counting the number of voxels whose electron density values are greater than a preset isosurface threshold, multiplying this number by the volume of a single voxel, and then calculating the volume of the three-dimensional electron density profile shape. The formula for calculating the volume of the three-dimensional electron density profile shape is as follows: ; in, The volume of the three-dimensional electron density profile shape. This represents the number of voxels whose electron density value is greater than a preset isosurface threshold. The volume of a single voxel.
[0060] In some embodiments, based on the triangular patches of the isosurface, the coordinates of the three vertices of each triangular patch can be obtained by traversing them. The surface area of each triangular patch can be calculated using the modulus of the cross product. The sum of the areas of all triangular patches is then calculated to obtain the surface area of the three-dimensional electron density profile shape. The formula for calculating the surface area of the three-dimensional electron density profile shape can be as follows: ; ; in, , , The three vertices of the i-th triangular facet can be represented separately. Spatial coordinates are , Spatial coordinates are , Spatial coordinates are , , m is the number of triangular facets that make up the isosurface; The surface area of the three-dimensional electron density profile shape; Let be the area of the i-th triangular facet. This is calculated using vectors. and The area of the i-th triangular facet can be obtained by taking the cross product of the vectors, dividing the magnitude of the cross product vector by 2.
[0061] In one optional embodiment, the geometric parameters include the principal axis direction, initial semi-axis length, maximum radius, maximum diameter direction, and midpoint coordinates; the extraction of geometric features from the three-dimensional electron density profile shape to obtain the geometric parameters may specifically include: Step S31: Calculate the mean coordinates of the vertices of the isosurface and determine the mean vertex; Step S32: Based on the coordinates of the mean vertex, the coordinates of the isosurface vertex are centered to obtain the centered vertex coordinates, and the covariance matrix is calculated based on the centered vertex coordinates. Step S33: Perform eigenvalue decomposition on the covariance matrix to obtain eigenvectors and eigenvalues, extract the principal axis direction based on the eigenvectors, and determine the initial semi-axis length based on the square root of the eigenvalues; Step S34: Calculate the convex hull of the isosurface vertices to obtain multiple convex hull vertices; Step S35: Calculate the pairwise distance between each pair of convex hull vertices, and determine the maximum pairwise distance and the two target convex hull vertices corresponding to the maximum pairwise distance; Step S36: Determine the direction and midpoint coordinates of the maximum diameter based on the coordinates of the two target convex hull vertices, and determine the maximum radius based on the maximum paired distance.
[0062] Geometric parameters are feature quantities used to describe geometric shapes, and can be used to describe feature information such as shape, size, and spatial positioning. In this embodiment of the invention, geometric features can be extracted from the three-dimensional electron density profile shape to obtain geometric parameters such as the principal axis direction, initial semi-axis length, maximum radius, maximum diameter direction, and midpoint coordinates.
[0063] In some embodiments, the average coordinates of all isosurface vertices in the x, y, and z directions can be calculated to determine the coordinates of the mean vertex. The calculation formula can be as follows: ; in, Let be the coordinate vector of the i-th isosurface vertex. n is the number of vertices on the isosurface. These are the coordinates of the mean vertex.
[0064] In some embodiments, the coordinates of each isosurface vertex can be centered based on the coordinates of the mean vertex to obtain the centered vertex coordinates for each isosurface vertex. The centered vertex coordinates can be calculated as follows: ; in, Let be the coordinate vector of the vertex of the i-th isosurface. The coordinates of the mean vertex. The coordinates of the centered vertex are obtained after centering the i-th isosurface vertex.
[0065] In this embodiment of the invention, PCA analysis is performed to calculate the covariance matrix and perform eigenvalue decomposition of the centered data. The principal axis direction and initial semi-axis length are extracted based on the eigenvectors, thus outputting the principal axis direction and initial semi-axis length for subsequent fitting of ellipsoids and cylinders. This embodiment of the invention uses PCA to extract the principal axis direction, which helps enhance the stability of the geometric fitting model.
[0066] In some embodiments, the mean coordinates of all centralized vertices can be calculated, and the covariance matrix can be calculated based on the mean coordinates of the centralized vertices. The covariance matrix can be as follows: ; in, Let covariance matrix be the variance matrix. These are the coordinates of the centered vertex obtained after centering the i-th isosurface vertex. Let T be the mean coordinates of the centered vertex, T be the transpose operation, and n be the number of vertices.
[0067] In some embodiments, by performing eigenvalue decomposition on the covariance matrix, the corresponding eigenvectors and eigenvalues can be obtained. The direction of the eigenvector (i.e., the direction in which the eigenvector points in three-dimensional space) can be used as the principal axis direction, and the square root of the eigenvalue can be used as the initial semi-axis length.
[0068] A convex hull can refer to a convex polyhedron containing the vertices of the isosurface. In this embodiment of the invention, the convex hull of the isosurface vertices can be calculated using the convex hull function to obtain the convex hull vertices, thereby extracting boundary information through convex hull calculation; calculating each pair of vertices of the convex hull (assuming it is P) i and P j Find the paired distances between the points, identify the maximum paired distance and its corresponding point, and then calculate the midpoint of the maximum diameter and the maximum radius.
[0069] In some embodiments, the pairwise distance between each pair of convex hull vertices can be calculated using the following formula: ; in, and These are the vertices of a pair of convex hulls. P i and another convex hull vertex P j The coordinates; Vertices of the convex hull P i and P jThe pairwise distance between vertices; i, j = 1, 2, ..., m, and j > i, to avoid duplicate calculations, where m is the number of vertices in the convex hull.
[0070] In some embodiments, the direction of the vector formed by the two convex hull vertices corresponding to the maximum pairwise distance can be determined as the direction of the maximum diameter (the maximum diameter is the maximum pairwise distance). The midpoint coordinates and maximum radius of the maximum diameter can be calculated using the following formulas: ; ; in, and Let represent the coordinates of the two convex hull vertices (i.e., the target convex hull vertices) corresponding to the maximum pairwise distance. The coordinates of the midpoint of the maximum diameter are... For the maximum diameter, The maximum radius.
[0071] Existing fitting algorithms (such as the Nelder-Mead algorithm and the Levenberg-Marquardt algorithm) rely on manual adjustment of fitting parameters and lack automated optimization mechanisms, resulting in low fitting efficiency, large errors, high computational costs, and significant convergence difficulties and excessively long data processing times for simple model fitting of a single curve. This invention combines PCA analysis and convex hull analysis (maximum diameter calculation) to extract geometric parameters for geometric body fitting. The initialized geometric parameters are more accurate, which can improve the accuracy and stability of the geometric body fitting model and is beneficial for optimizing algorithm efficiency.
[0072] In one optional embodiment, the geometric fitting model may include at least one of a sphere fitting model, an ellipsoid fitting model, a cylinder fitting model, and a cube fitting model; the step of fitting the geometric body based on the geometric parameters to obtain the geometric fitting model may specifically include: Step S41: The first objective function is optimized using an optimization algorithm to obtain the optimized semi-axis length. The objective of the first objective function is to adjust the initial semi-axis length to minimize the weighted sum of the volume difference and surface area difference between the ellipsoid fitting model and the three-dimensional electron density profile shape. Step S42: The second objective function is optimized using an optimization algorithm to obtain the optimized projection height and projection radius; the objective of the second objective function is to minimize the weighted sum of the volume difference and surface area difference between the cylindrical fitting model and the three-dimensional electron density profile shape. Step S43: Perform sphere fitting based on the midpoint coordinates of the maximum diameter and the maximum radius to obtain a sphere fitting model; Step S44: Based on the optimized semi-axis length, perform ellipsoid fitting to obtain an ellipsoid fitting model; Step S45: Based on the direction of the maximum diameter, the optimized projection height, and the projection radius, perform cylinder fitting to obtain a cylinder fitting model; Step S46: Perform cube fitting based on the side length of the smallest circumscribed cube of the isosurface vertex to obtain a cube model.
[0073] In some embodiments, the center of the sphere fitted by the sphere can be taken as the midpoint of the maximum diameter of the 3D electron density stereoscopic data, and the radius of the sphere can be taken as the maximum radius. The volume and surface area of the sphere can be calculated, and the volume ratio and surface area ratio of the sphere fitted model to the 3D electron density stereoscopic data can be calculated. The volume and surface area of the sphere fitted model can be calculated in the following ways: ; ; in, Let the volume of the sphere fitting model be . The surface area of the sphere fitting model. The radius is [0, 1].
[0074] Subsequently, the volume ratio and surface area ratio of the sphere fitting model and the three-dimensional electron density stereoscopic data can be calculated.
[0075] In some embodiments, after performing principal component analysis (PCA) on the isosurface vertices of the 3D electron density stereoscopic data, initial semi-axis lengths (a, b, c) in three dimensions can be obtained. An optimization algorithm can be used to solve for the first objective function to obtain the optimized semi-axis lengths. The optimization objective of the first objective function is to minimize the weighted sum of the volume and surface area differences between the ellipsoidal fitting model and the 3D electron density profile shape by adjusting the initial semi-axis lengths. The first objective function can be defined as follows: ; in, Let the first objective function be... and These are the weighting parameters for volume difference and surface area difference, respectively. The volume of the ellipsoid fitting model. The volume of the three-dimensional electron density profile shape. The surface area of the ellipsoid fitting model. The surface area of the three-dimensional electron density profile shape.
[0076] In some embodiments, optimization algorithms such as the fminsearch function can be used to optimize the semi-axis scaling factor of the ellipsoid to obtain the optimized semi-axis lengths (a, b, c) in the three dimensions. opt b opt c opt This allows for the calculation of the volume and surface area of the ellipsoidal fitting model based on the optimized semi-axis length. ; ; in, To determine the volume of the optimized ellipsoid fitting model, For the surface area of the optimized ellipsoid fitting model, a opt b opt c opt These are the semi-axis lengths in the three optimized dimensions.
[0077] Subsequently, the volume ratio and surface area ratio of the ellipsoid fitting model to the three-dimensional electron density volumetric data, as well as the axial ratio of the ellipsoid, can be calculated. .
[0078] In some embodiments, the direction of the maximum diameter calculated based on the convex hull vertex can be used as the cylinder axis, and the direction of the maximum diameter of the 3D electron density stereoscopic data can be used as the cylinder axis to calculate the initial projection height (projection data range) and the initial projection radius (root mean square of the vertical direction). An optimization algorithm can be used to optimize and solve the second objective function to obtain the optimized projection height and projection radius. The optimization objective of the second objective function is to minimize the weighted sum of the volume difference and surface area difference between the cylinder fitting model and the 3D electron density profile shape by adjusting the initial projection height and initial projection radius. The second objective function can be defined as follows: ; in, The second objective function is... and These are the weighting parameters for volume difference and surface area difference, respectively. Let the volume of the cylinder fitting model be... The volume of the three-dimensional electron density profile shape. The surface area of the fitted model of the cylinder. The surface area of the three-dimensional electron density profile shape.
[0079] In some embodiments, the height and radius of the cylinder can be optimized using the fminsearch function (i.e., an optimization algorithm) to obtain the optimized projected height and radius, and then the volume and surface area of the cylinder fitting model can be calculated based on the optimized projected height and radius: ; ; in, To determine the volume of the optimized cylinder fitting model, The surface area of the optimized cylindrical fitting model. The optimized projection radius, This is the optimized projection height.
[0080] Subsequently, the ratio of the cylinder fitting model to the three-dimensional electron density stereo data (i.e., the three-dimensional electron density profile shape) can be calculated, as well as the height-to-diameter ratio of the cylinder fitting model.
[0081] In some embodiments, the minimum bounding cube of the isosurface points can be calculated, and the volume and surface area of the cube-fitted model can be calculated based on the side lengths (i.e., length, width, and height) of the minimum bounding cube. The formulas for calculating the volume and surface area of the cube-fitted model can be as follows: ; ; in, The volume of the fitted model for the cube. The surface area of the cube fitting model. These are the length, width, and height of the smallest bounding cube, respectively.
[0082] The sphere fitting in this embodiment of the invention is based on the maximum diameter, and the fitting method is simple and efficient; the ellipsoid fitting is initialized by PCA and the volume and surface area difference is optimized, which can adapt to asymmetrical shapes; the cylinder fitting is fitted along the direction of the maximum diameter and the height-to-diameter ratio is optimized, which can adapt to slender structures; the cube fitting is based on the minimum bounding box (i.e. the minimum bounding cube), which can adapt to regular shapes.
[0083] This invention uses the fminsearch function as an optimization algorithm to minimize the objective function (weighted difference between volume and surface area), which can optimize the initial geometric parameters, thus ensuring fitting accuracy and stability, and adapting to various computing environments.
[0084] The embodiments of the present invention comprehensively extract shape geometric parameters and provide parameters such as volume, surface area, axial ratio, and height-to-diameter ratio, which is beneficial to meeting the diverse needs of biomolecule and material analysis.
[0085] In an optional embodiment, the method may further include: Step S51: Render the geometry fitting model in the three-dimensional drawing area; Step S52: In response to the control operation of the rendering effect adjustment control in the tab interface, adjust the rendering effect of the geometry fitting model. Step S53: In response to a click operation on the parameter export control in the tab interface, export the tab parameters.
[0086] In some embodiments, a main viewport can be created, which may include a 3D drawing area and tab interfaces corresponding to each fitted shape. The fitted shapes may include 3D electron density profile shapes, spheres, ellipsoids, cylinders, cubes, etc.
[0087] Figure 3 This is a schematic diagram of multi-geometry fitting provided in an embodiment of the present invention. (Refer to...) Figure 3 (a)- Figure 3 (d) In some embodiments, a fitting model of the three-dimensional electron density profile shape and various geometric bodies can be rendered in the drawing area, such as a fitting model of the three-dimensional electron density profile shape with a sphere, an ellipsoid, a cylinder, or a cube. Specifically, isosurfaces can be generated based on triangular facets to render the three-dimensional electron density profile shape; the fitting models of geometric bodies such as spheres, ellipsoids, cylinders, and cubes can be set to semi-transparent, and the line of maximum diameter and the midpoint of maximum diameter can be marked.
[0088] Figure 4 This is a schematic diagram of the interactive interface provided in an embodiment of the present invention. (Refer to...) Figure 4 (a)- Figure 4 (e) In some embodiments, the interactive interface may include tab interfaces corresponding to the three-dimensional electron density profile shape, sphere fitting model, ellipsoid fitting model, cylinder fitting model, and cube fitting model, respectively. Each tab interface corresponding to a fitting shape may provide interactive controls. The interactive controls may include rendering effect adjustment controls and parameter export controls. The rendering effect adjustment controls may include a visibility checkbox (for controlling the display / hiding of the corresponding geometry), a color button (for popping up a color selector to dynamically update the geometry color), a transparency slider (for adjusting the geometry transparency, which can be 0 to 1), and a result display box (for displaying parameters such as volume, surface area, and ratio (not editable)); the rendering effect of the geometry fitting model may be adjusted in response to the adjustment operation of the rendering effect adjustment controls. The parameter export controls may include a copy button for copying the current tab parameters to the clipboard; all tab parameters may be copied to the clipboard in response to a click operation on the parameter export controls.
[0089] In some embodiments, callback functions can be used to respond to user actions, update the drawing and status in real time, and improve the user experience.
[0090] In some embodiments, the calculated results of the fitted shape, such as volume, surface area, geometric parameters, and ratios, can be automatically stored. Users can view specific parameters through tabs or export them to external documents using the copy function, thereby achieving parameter management.
[0091] This invention enables visualization of the fitted shape by rendering a geometric fitting model and a three-dimensional electron density contour shape in a three-dimensional drawing area; by combining three-dimensional rendering with a semi-transparent effect, the degree of fitting between the real three-dimensional electron density shape and the geometric fitting model can be intuitively compared; and by separating parameter control from calculation results through a tab design, interaction efficiency can be improved.
[0092] To address the problem that existing fitting tools lack a visual interface, preventing users from adjusting geometric properties (such as transparency and color) or comparing the fitting effects of different models in real time, this invention provides an intuitive visual interface. The tabbed interface offers controls for visibility, color, and transparency, allowing users to adjust visualization parameters (such as color, transparency, and visibility) and dynamically compare fitting effects. This tabbed design enables dynamic adjustment and real-time comparison of geometric parameters, improving analytical intuitiveness and efficiency, and achieving high interactivity.
[0093] The embodiments of the present invention can realize convenient data management, simplify parameter export through single tab and global copy functions, reduce manual recording time, and improve analysis efficiency.
[0094] The embodiments of the present invention can realize the overlay rendering of multiple geometries in the rendering area of the main view window. Combined with the maximum diameter annotation, the shape features are intuitively displayed, making it convenient for users to verify the fitting results, and the visualization effect is excellent.
[0095] Figure 5 This is the second schematic flowchart of the three-dimensional electron density fitting analysis method provided in this embodiment of the invention. (Refer to...) Figure 5 In some embodiments, users can select an electron density file in .mrc format via a graphical interface; the system can read the .mrc electron density file, load the three-dimensional electron density stereo data, and verify the data validity of the .mrc file. If the data validity verification fails, a "User canceled selection" message is displayed, ending the fitting analysis process; if the data validity verification passes, the .mrc file can be read, the stereo data can be normalized, and the mass-weighted average coordinates can be calculated based on the normalized data to obtain the centroid of the stereo data, and isosurfaces can be extracted to verify the validity of the isosurfaces (i.e., to determine whether the isosurfaces have vertices).
[0096] If the isosurface has no vertices, a "Vertex Not Found" message is displayed, prompting the user to adjust the isovalue; if the isosurface has vertices, shape analysis is performed, the volume of the three-dimensional electron density profile shape formed by the isosurface is calculated by voxel counting, the surface area of the three-dimensional electron density profile shape is calculated using the area of the isosurface triangular patches, the maximum diameter is found by calculating the pairwise distances between convex hulls, and PCA is performed on the isosurface vertices to calculate the principal axes.
[0097] After shape analysis is completed, multiple geometries such as spheres, ellipsoids, cylinders, and cubes can be fitted in parallel. Once the geometry fitting is complete, the fitting can be visualized and the fitting model parameters can be interacted with. The MRC shape (Multiconfiguration Reference Configuration) (i.e., the 3D electron density profile shape) can be drawn, as well as the fitted geometry shape. The shape parameters of each fitted shape can be calculated to analyze the degree of fit. Simultaneously, users can adjust parameters such as the visibility, color, and transparency of the fitted shape through interactive options on the interface.
[0098] The embodiments of the present invention can significantly improve the accuracy of electron density analysis through multi-geometric model fitting, interactive visualization and parameter management, and help users to scientifically interpret experimental data.
[0099] The three-dimensional electron density fitting analysis device provided by the present invention is described below. The three-dimensional electron density fitting analysis device described below can be referred to in correspondence with the three-dimensional electron density fitting analysis method described above.
[0100] Figure 6 This is a schematic diagram of the structure of the three-dimensional electron density fitting and analysis device provided in an embodiment of the present invention. (Refer to...) Figure 6 This invention provides a three-dimensional electron density fitting analysis device, which may specifically include the following modules: Data acquisition module 610 is used to acquire three-dimensional electron density stereo data; the three-dimensional electron density stereo data includes the coordinates and electron density values corresponding to multiple voxels; The isosurface extraction module 620 is used to traverse each voxel, determine the isosurface vertex whose electron density value is equal to the preset isosurface threshold, generate the isosurface of the three-dimensional electron density volume view data based on the isosurface vertex, and calculate the volume and surface area of the three-dimensional electron density profile shape formed by the isosurface. The geometry extraction module 630 is used to extract geometric features from the three-dimensional electron density contour shape to obtain geometric parameters; The geometry fitting module 640 is used to perform geometry fitting based on the geometric parameters, obtain a geometry fitting model, and calculate the volume and surface area of the geometry fitting model. The fitting analysis module 650 is used to evaluate the degree of fit between the geometric fitting model and the three-dimensional electron density stereo data based on the volume ratio and surface area ratio of the geometric fitting model and the three-dimensional electron density profile shape.
[0101] This invention acquires three-dimensional electron density stereoscopic data, including coordinates and electron density values corresponding to multiple voxels. It then traverses each voxel to determine the vertices of isosurfaces where the electron density value equals a preset isosurface threshold. Based on these vertices, it generates isosurfaces from the three-dimensional electron density stereoscopic data, transforming the data into a three-dimensional electron density contour shape composed of isosurfaces suitable for subsequent fitting analysis. This achieves the fitting of the scatterer's three-dimensional electron density contour. By extracting the geometric parameters of the three-dimensional electron density contour shape for geometric fitting, it supports fitting various geometric models such as spheres, ellipsoids, cylinders, and cubes. This enables diverse model fitting for complex three-dimensional electron density shapes, enhancing the adaptability and improving the accuracy of three-dimensional electron density fitting analysis. Furthermore, by automatically comparing the volume and surface area parameters of the geometric fitting model with the original three-dimensional electron density stereoscopic data, it not only provides a more comprehensive evaluation of the fitting degree from multiple dimensions, diversifying fitting standards, but also improves the efficiency of fitting analysis.
[0102] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communications bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other through the communications bus 740. The processor 710 can call logic instructions in the memory 730 to execute a three-dimensional electron density fitting analysis method. This method includes: acquiring three-dimensional electron density stereoscopic data; the three-dimensional electron density stereoscopic data includes the coordinates and electron density values corresponding to multiple voxels; traversing each voxel to determine the vertex of the isosurface where the electron density value equals a preset isosurface threshold; generating the isosurface of the three-dimensional electron density stereoscopic data based on the isosurface vertex, and calculating the volume and surface area of the three-dimensional electron density contour shape formed by the isosurface; extracting geometric features from the three-dimensional electron density contour shape to obtain geometric parameters; performing geometric body fitting based on the geometric parameters to obtain a geometric body fitting model, and calculating the volume and surface area of the geometric body fitting model; and evaluating the degree of fitting between the geometric body fitting model and the three-dimensional electron density stereoscopic data based on the volume ratio and surface area ratio of the geometric body fitting model and the three-dimensional electron density contour shape.
[0103] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, 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 described in the various embodiments of the present invention. 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.
[0104] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the three-dimensional electron density fitting analysis method provided by the above methods. The method includes: acquiring three-dimensional electron density stereoscopic data; the three-dimensional electron density stereoscopic data includes the coordinates and electron density values corresponding to multiple voxels; traversing each voxel to determine the isosurface vertex where the electron density value is equal to a preset isosurface threshold; generating the isosurface of the three-dimensional electron density stereoscopic data based on the isosurface vertex, and calculating the volume and surface area of the three-dimensional electron density contour shape formed by the isosurface; extracting geometric features from the three-dimensional electron density contour shape to obtain geometric parameters; performing geometric body fitting based on the geometric parameters to obtain a geometric body fitting model, and calculating the volume and surface area of the geometric body fitting model; and evaluating the degree of fitting between the geometric body fitting model and the three-dimensional electron density stereoscopic data based on the volume ratio and surface area ratio of the geometric body fitting model and the three-dimensional electron density contour shape.
[0105] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a three-dimensional electron density fitting analysis method provided by the methods described above. This method includes: acquiring three-dimensional electron density stereoscopic data; the three-dimensional electron density stereoscopic data includes coordinates and electron density values corresponding to multiple voxels; traversing each voxel to determine the vertex of the isosurface where the electron density value is equal to a preset isosurface threshold; generating an isosurface of the three-dimensional electron density stereoscopic data based on the isosurface vertex; and calculating the volume and surface area of the three-dimensional electron density contour shape formed by the isosurface; extracting geometric features from the three-dimensional electron density contour shape to obtain geometric parameters; performing geometric body fitting based on the geometric parameters to obtain a geometric body fitting model, and calculating the volume and surface area of the geometric body fitting model; and evaluating the degree of fitting between the geometric body fitting model and the three-dimensional electron density stereoscopic data based on the volume ratio and surface area ratio of the geometric body fitting model to the three-dimensional electron density contour shape.
[0106] The device embodiments described above are merely illustrative. 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0107] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications 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 the present invention.
Claims
1. A three-dimensional electron density fitting analysis method, characterized in that, include: Acquire three-dimensional electron density stereo data; the three-dimensional electron density stereo data includes the coordinates and electron density values corresponding to multiple voxels; Traverse each voxel, determine the isosurface vertex where the electron density value is equal to the preset isosurface threshold, generate the isosurface of the three-dimensional electron density volume view data based on the isosurface vertex, and calculate the volume and surface area of the three-dimensional electron density profile shape formed by the isosurface. Geometric features are extracted from the three-dimensional electron density profile shape to obtain geometric parameters; Based on the geometric parameters, a geometric body is fitted to obtain a geometric body fitting model, and the volume and surface area of the geometric body fitting model are calculated. The degree of fit between the geometric fitting model and the three-dimensional electron density contour shape is evaluated based on the volume ratio and surface area ratio of the geometric fitting model and the three-dimensional electron density stereo data.
2. The three-dimensional electron density fitting analysis method according to claim 1, characterized in that, The process of traversing each voxel to determine the isosurface vertex whose electron density value equals a preset isosurface threshold, and generating the isosurface of the three-dimensional electron density stereoscopic data based on the isosurface vertex, includes: Traverse the edges of each voxel and obtain the electron density values of the two vertices connected by the current edge; If the electron density value of one vertex connected to the current edge is greater than the preset isosurface threshold, and the electron density value of another vertex is less than the preset isosurface threshold, the isosurface vertex on the current edge is determined by linear interpolation. After the traversal is completed, triangular patches are generated based on the vertices of the isosurface to obtain the isosurface of the three-dimensional electron density stereoscopic data.
3. The three-dimensional electron density fitting analysis method according to claim 2, characterized in that, The calculation of the volume and surface area of the three-dimensional electron density profile shape formed by the isosurfaces includes: The volume of a single voxel is calculated based on the reciprocal of the length of the voxel in the three directional dimensions. The volume of the three-dimensional electron density profile shape is obtained by multiplying the number of voxels with electron density values greater than the preset isosurface threshold with the volume of a single voxel. Calculate the area of each triangular facet based on the coordinates of the vertices of the three isosurfaces of each facet. The surface area of the three-dimensional electron density profile shape is obtained by summing the areas of all triangular facets.
4. The three-dimensional electron density fitting analysis method according to claim 1, characterized in that, The geometric parameters include the principal axis direction, initial semi-axis length, maximum radius, maximum diameter direction, and midpoint coordinates; the geometric feature extraction of the three-dimensional electron density profile shape to obtain the geometric parameters includes: Calculate the mean coordinates of the vertices of the isosurface and determine the coordinates of the mean vertex; Based on the coordinates of the mean vertex, the coordinates of the isosurface vertex are centered to obtain centered vertex coordinates, and the covariance matrix is calculated based on the centered vertex coordinates. The covariance matrix is subjected to eigenvalue decomposition to obtain eigenvectors and eigenvalues. The principal axis direction is extracted based on the eigenvectors, and the initial semi-axis length is determined based on the square root of the eigenvalues. Calculate the convex hull of the vertices of the isosurface to obtain multiple convex hull vertices; Calculate the pairwise distance between each pair of convex hull vertices, and determine the maximum pairwise distance and the two target convex hull vertices corresponding to the maximum pairwise distance; The direction and midpoint coordinates of the maximum diameter are determined based on the coordinates of the two target convex hull vertices, and the maximum radius is determined based on the maximum pairwise distance.
5. The three-dimensional electron density fitting analysis method according to claim 4, characterized in that, The geometric fitting model includes at least one of a sphere fitting model, an ellipsoid fitting model, a cylinder fitting model, and a cube fitting model; the step of fitting the geometric body based on the geometric parameters to obtain the geometric fitting model includes: An optimization algorithm is used to optimize and solve the first objective function to obtain the optimized semi-axis length. The objective of the first objective function is to adjust the initial semi-axis length to minimize the weighted sum of the volume difference and surface area difference between the ellipsoid fitting model and the three-dimensional electron density profile shape. An optimization algorithm is used to optimize and solve the second objective function to obtain the optimized projection height and projection radius; the objective of the second objective function is to minimize the weighted sum of the volume difference and surface area difference between the cylindrical fitting model and the three-dimensional electron density profile shape; A sphere fitting model is obtained by fitting a sphere based on the midpoint coordinates of the maximum diameter and the maximum radius. Based on the optimized semi-axis length, an ellipsoid fitting model is obtained by fitting an ellipsoid. Based on the direction of the maximum diameter, the optimized projection height, and the projection radius, a cylinder fitting model is obtained; A cube model is obtained by fitting a cube based on the side length of the smallest circumscribed cube of the isosurface vertex.
6. The three-dimensional electron density fitting analysis method according to claim 1, characterized in that, The method further includes: Render the geometry fitting model in the 3D drawing area; In response to the adjustment operation of the rendering effect adjustment control in the tab interface, the rendering effect of the geometry fitting model is adjusted. In response to a click on the parameter export control in the tab interface, export the tab parameters.
7. A three-dimensional electron density fitting analysis device, characterized in that, include: The data acquisition module is used to acquire three-dimensional electron density stereoscopic data; the three-dimensional electron density stereoscopic data includes the coordinates and electron density values corresponding to multiple voxels; The isosurface extraction module is used to traverse each voxel, determine the isosurface vertices where the electron density value is equal to the preset isosurface threshold, generate the isosurface of the three-dimensional electron density volume view data based on the isosurface vertices, and calculate the volume and surface area of the three-dimensional electron density profile shape formed by the isosurfaces. The geometry extraction module is used to extract geometric features from the three-dimensional electron density contour shape to obtain geometric parameters; The geometry fitting module is used to perform geometry fitting based on the geometric parameters, obtain a geometry fitting model, and calculate the volume and surface area of the geometry fitting model. The fitting analysis module is used to evaluate the degree of fit between the geometric fitting model and the three-dimensional electron density stereo data based on the volume ratio and surface area ratio of the geometric fitting model and the three-dimensional electron density profile shape.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the three-dimensional electron density fitting analysis method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the three-dimensional electron density fitting analysis method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the three-dimensional electron density fitting analysis method as described in any one of claims 1 to 6.