A method, device and storage medium for determining an irregular space body
By performing super-voxel partitioning and clustering on the target volume data of irregular spatial volumes and determining the connected component labels of the voxels, the problems of low efficiency and accuracy in the existing technology are solved, and the efficient and accurate calculation of the number and volume of irregular spatial volumes is realized.
Patent Information
- Application Number
- CN202210762859.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-06-30
AI Technical Summary
Existing technologies have low efficiency and accuracy in determining the number and volume of irregular spatial bodies, especially in ultrasound detection where the measurement process of follicles is cumbersome and inaccurate.
By acquiring target volume data of irregular spatial bodies obtained from 3D scanning using medical equipment, the data is divided into multiple supervoxels. Features of the supervoxels are extracted and clustered. Based on the clustering results, the connected component labels of the voxels are determined, and the number and volume of the irregular spatial bodies are calculated.
It improves the efficiency and accuracy of determining the number and volume of irregular spatial objects, avoids repeated scanning of each irregular spatial object, and is suitable for three-dimensional scanning of irregularly shaped objects such as tumors, liver, follicles, etc.
Smart Images

Figure CN117372318B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network technology, and more specifically, to a method and apparatus for determining an irregular spatial volume, an electronic device, and a computer-readable storage medium. Background Technology
[0002] In the field of network technology, it is sometimes necessary to construct irregular spatial volumes and determine their volumes. For example, when reconstructing irregular spatial volumes corresponding to ultrasound-detected objects such as follicles using ultrasound equipment, it is necessary to determine their number and volume to provide data guidance for doctors.
[0003] In related technologies, a two-dimensional scanning method is typically used to obtain the maximum cross-section of each follicle. Follicles to be measured are then manually selected, and the size of each follicle is measured sequentially using the elliptic method. This method of manually selecting and measuring follicle size is tedious and has high repeatability. Furthermore, follicles are not necessarily standard ellipsoids, resulting in low accuracy in volume measurement. Therefore, the above method is inefficient and inaccurate in determining the number and volume of irregular spatial bodies.
[0004] Therefore, how to improve the efficiency and accuracy of determining the number and volume of irregular spatial bodies is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, electronic device, and computer-readable storage medium for determining irregular spatial bodies, thereby improving the efficiency and accuracy of determining the number and volume of irregular spatial bodies.
[0006] To achieve the above objectives, this application provides a method for determining an irregular spatial volume, comprising:
[0007] The target volume data of an irregular spatial body obtained by three-dimensional scanning of a medical device is acquired, and the target volume data is divided into multiple supervoxels; wherein each supervoxel includes multiple voxels;
[0008] Extract the features of the supervoxels, and perform clustering operations on the supervoxels based on the features of the supervoxels to divide the target volume data into multiple categories;
[0009] The connected component labels corresponding to the voxels are determined based on the clustering results.
[0010] The number of irregular spatial volumes is determined based on the number of different connected component markers in the target volume data;
[0011] The volume of the corresponding irregular spatial volume is calculated based on the number of identical connected component markers and the volume of a single voxel in the target volume data.
[0012] The target volume data is divided into multiple supervoxels, including:
[0013] The target volume data is divided into multiple cubic-shaped hypervoxels;
[0014] In each supervoxel, the voxel with the minimum gradient is determined as the cluster center. Target voxels with a distance less than a preset value from the cluster center are searched within a preset range around the cluster center, and these target voxels are merged into the supervoxel containing the cluster center.
[0015] The cluster center of each supervoxel is updated based on the coordinate and gray values of all voxels in each supervoxel;
[0016] The process of re-entering the preset range around the cluster center to search for target voxels whose distance from the cluster center is less than a preset value, and merging the target voxels into the super voxels where the cluster center is located, continues until the change range of the super voxels meets the preset requirements.
[0017] The process of searching for target voxels within a preset range around the cluster center that are less than a preset value from the cluster center includes:
[0018] The grayscale distance between each voxel within a preset range around the cluster center and the cluster center is calculated based on the grayscale value of each voxel within the preset range around the cluster center and the grayscale value of the cluster center.
[0019] The spatial distance between each voxel within a preset range around the cluster center and the cluster center is calculated based on the coordinate values of each voxel within the preset range around the cluster center and the coordinate values of the cluster center.
[0020] The comprehensive distance between each voxel within a preset range around the cluster center and the cluster center is calculated based on the grayscale distance and spatial distance between each voxel and the cluster center.
[0021] Voxels whose overall distance is less than a preset value are identified as target voxels.
[0022] The step of updating the cluster center of each supervoxel based on the coordinates and grayscale values of all voxels in each supervoxel includes:
[0023] Calculate the average coordinates and average grayscale values of all voxels in each hypervoxel based on the coordinates and grayscale values of all voxels in each hypervoxel;
[0024] The average coordinates and average grayscale values of each hypervoxel are used as the coordinates and grayscale values of the updated cluster center of each hypervoxel, respectively.
[0025] The step of extracting features from the hypervoxels and performing clustering operations on the hypervoxels based on these features includes:
[0026] Extract the features of the supervoxel; wherein the features include any one or a combination of any of the following: energy, entropy, differential torque, expected value of the voxel's gray value, and variance;
[0027] The extracted features of the hypervoxels are fused to obtain the fused features of the hypervoxels;
[0028] Clustering operations are performed on the supervoxels based on their fusion characteristics.
[0029] The step of fusing the extracted features of the hypervoxel to obtain the fused features of the hypervoxel includes:
[0030] The extracted features of the hypervoxel are weighted and fused based on the weights corresponding to each feature to obtain the fused features of the hypervoxel.
[0031] The step of clustering the supervoxels based on their features to divide the target volume data into multiple categories includes:
[0032] Initialize membership coefficients, and divide the target data into multiple categories based on the membership coefficients;
[0033] The features of each category are calculated based on the characteristics of each hypervoxel, the number of voxels contained in each hypervoxel, and the membership function;
[0034] The membership coefficient is updated based on the features of each category, the features of each hypervoxel, and the number of voxels contained in the hypervoxel;
[0035] Determine whether the difference between the updated membership function and the original membership function is less than or equal to the threshold or whether the number of updates has reached the maximum number of iterations;
[0036] If the difference between the updated membership function and the original membership function is greater than the threshold and the number of updates has not reached the maximum number of iterations, then the target data is reclassified into multiple categories based on the updated membership function. The features of each category are updated based on the features of each supervoxel, the number of voxels contained in each supervoxel, and the updated membership function. The membership coefficients are updated based on the updated features of each category, the features of each supervoxel, and the number of voxels contained in each supervoxel. The process then re-enters the step of determining whether the difference between the updated membership function and the original membership function is less than or equal to the threshold or whether the number of updates has reached the maximum number of iterations.
[0037] The step of determining the connected component label corresponding to the voxel based on the clustering result includes:
[0038] The voxels in the target data are traversed sequentially to determine whether there are any target adjacent voxels that belong to the same category as the voxel and have been marked.
[0039] If they exist, then if there is one target neighbor voxel, the connected component label of the voxel is determined as the connected component label of the target neighbor voxel; if there are multiple target neighbor voxels, the minimum connected component label of the multiple target neighbor voxels is determined, the connected component label of the voxel is determined as the minimum connected component label, and the inheritance relationship between the minimum connected component label and the other connected component labels of the target neighbor voxels is established.
[0040] If it does not exist, then the connected component label of the voxel is determined to be a new connected component label;
[0041] The voxels in the target data are traversed again, and the connected component labels of voxels with inheritance relationships are updated to the smallest connected component label in the corresponding inheritance relationship.
[0042] The process of acquiring the target body data of the irregular spatial body obtained by three-dimensional scanning of the medical device further includes:
[0043] Determine the spherical neighborhood of each pixel in the target volume data, calculate the average gray value of all pixels in the spherical neighborhood, and replace the gray value of each pixel in the target volume data with the average gray value of all adjacent pixels in the corresponding spherical neighborhood.
[0044] To achieve the above objectives, this application provides a device for determining an irregular spatial volume, comprising:
[0045] The segmentation module is used to acquire target volume data of an irregular spatial body obtained by three-dimensional scanning of a medical device, and to segment the target volume data into multiple supervoxels; wherein each supervoxel includes multiple voxels;
[0046] The clustering module is used to extract the features of the supervoxels and perform clustering operations on the supervoxels based on the features of the supervoxels to divide the target volume data into multiple categories.
[0047] The first determining module is used to determine the connected component label corresponding to the voxel based on the clustering results;
[0048] The second determining module is used to determine the number of irregular spatial volumes based on the number of different connected component markers in the target volume data;
[0049] The calculation module is used to calculate the volume of the corresponding irregular space volume based on the number of identical connected component labels and the volume of a single voxel.
[0050] To achieve the above objectives, this application provides an electronic device, comprising:
[0051] Memory, used to store computer programs;
[0052] A processor, used to implement the steps of the method for determining an irregular spatial volume as described above when executing the computer program.
[0053] To achieve the above objectives, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for determining an irregular spatial volume as described above.
[0054] As can be seen from the above scheme, the method for determining an irregular spatial volume provided in this application includes: acquiring target volume data of an irregular spatial volume obtained by three-dimensional scanning of a medical device, and dividing the target volume data into multiple supervoxels; wherein each supervoxel includes multiple voxels; extracting features of the supervoxels, performing clustering operations on the supervoxels based on the features of the supervoxels to divide the target volume data into multiple categories; determining the connected component labels corresponding to the voxels based on the clustering results; determining the number of irregular spatial volumes according to the number of different connected component labels in the target volume data; and calculating the volume of the corresponding irregular spatial volume according to the number of identical connected component labels in the target volume data and the volume of a single voxel.
[0055] The method for determining irregular spatial volumes provided in this application identifies the number of connected components and the number of voxels contained in each connected component by marking the connected components of voxels in the target volume data. Based on the number of connected components, the number of irregular spatial volumes in the target volume data is determined. The volume of the corresponding irregular spatial volume is calculated based on the number of voxels in each connected component and the volume of a single voxel. Compared to measuring the volume of each irregular spatial volume using the elliptic method, this method eliminates the need to sequentially scan the maximum cross-section of each irregular spatial volume, and the measured irregular spatial volumes are not limited to standard ellipsoids, thus improving the efficiency and accuracy of determining the number and volume of irregular spatial volumes. This application also discloses an apparatus for determining irregular spatial volumes, an electronic device, and a computer-readable storage medium, which achieve the same technical effects.
[0056] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application 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 only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. The drawings are used to provide a further understanding of this disclosure and constitute a part of the specification. They are used together with the following detailed description to explain this disclosure, but do not constitute a limitation of this disclosure. In the drawings:
[0058] Figure 1 This is a flowchart illustrating a method for determining an irregular spatial volume according to an exemplary embodiment;
[0059] Figure 2 This is a schematic diagram illustrating a connected component label according to an exemplary embodiment;
[0060] Figure 3 This is a schematic diagram illustrating an inheritance relationship according to an exemplary embodiment;
[0061] Figure 4 This is a schematic diagram illustrating another connected component label according to an exemplary embodiment;
[0062] Figure 5 This is a schematic diagram illustrating another type of connected component labeling according to an exemplary embodiment;
[0063] Figure 6 This is a schematic diagram illustrating another inheritance relationship according to an exemplary embodiment;
[0064] Figure 7 This is a structural diagram illustrating an apparatus for determining an irregular spatial volume according to an exemplary embodiment;
[0065] Figure 8 This is a structural diagram of an electronic device according to an exemplary embodiment. Detailed Implementation
[0066] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Furthermore, in the embodiments of this application, "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0067] The method for determining the volume of irregular spatial bodies provided in this application embodiment can be applied to the following scenario: This scenario includes a medical device and an electronic device, which are connected via a network. The medical device collects three-dimensional scanning signals from irregularly shaped objects such as tumors, livers, follicles, uteruses, and bladders. Based on these signals, it obtains volume data of the irregular spatial bodies corresponding to the objects and transmits it to the electronic device. The electronic device is capable of processing volume data; it can be a terminal device or a server. When it is a terminal device, it can be a medical device, a personal computer, a tablet computer, a smartphone, etc. The electronic device determines the number of irregular spatial bodies and the volume of each irregular spatial body from the target volume data containing these irregular spatial bodies and returns this information to the medical device. The medical device displays the number of irregular spatial bodies and the volume of each irregular spatial body. In specific application scenarios, only the medical device may be used; that is, the medical device determines the number of irregular spatial bodies and the volume of each irregular spatial body from the target volume data containing these irregular spatial bodies and displays the data.
[0068] This application discloses a method for determining irregular spatial bodies, which improves the efficiency and accuracy of determining the number and volume of irregular spatial bodies.
[0069] See Figure 1 A flowchart illustrating a method for determining an irregular spatial volume according to an exemplary embodiment, as shown below. Figure 1 As shown, it includes:
[0070] S101: Acquire target volume data of an irregular spatial body obtained by three-dimensional scanning of a medical device, and divide the target volume data into multiple supervoxels; wherein, each supervoxel includes multiple voxels;
[0071] In specific implementation, target volume data of irregular spatial bodies obtained by 3D scanning with medical equipment is acquired, and the target volume data is filtered to reduce noise. Preferably, after acquiring the target volume data of irregular spatial bodies obtained by 3D scanning with medical equipment, the method further includes: determining the spherical neighborhood of each pixel in the target volume data, calculating the average gray value of all pixels in the spherical neighborhood, and replacing the gray value of each pixel in the target volume data with the average gray value of all adjacent pixels in the corresponding spherical neighborhood. In specific implementation, each voxel in the target volume data is traversed, and its gray value is replaced with the average gray value of all adjacent pixels in its spherical neighborhood. Further, based on the position and gray value of each voxel in the target volume data, the target volume data is divided into multiple supervoxels, and each supervoxel includes multiple voxels.
[0072] As a feasible implementation method, the target volume data is divided into multiple supervoxels, including: dividing the target volume data into multiple cubic-shaped supervoxels; determining the voxel with the minimum gradient value in each supervoxel as the cluster center; searching for target voxels within a preset range around the cluster center whose distance from the cluster center is less than a preset value; merging the target voxels into the supervoxel containing the cluster center; updating the cluster center of each supervoxel based on the coordinate values and grayscale values of all voxels in each supervoxel; re-entering the steps of searching for target voxels within the preset range around the cluster center whose distance from the cluster center is less than a preset value, and merging the target voxels into the supervoxel containing the cluster center, until the change range of the supervoxels meets the preset requirements.
[0073] In practice, for target volume data containing N voxels, the preset number of super voxels is L. During initial partitioning, the volume is divided equally along the length, width, and height directions. Each super voxel is a cube with a side length of L. The voxel with the minimum gradient in each supervoxel is selected as the initial cluster center. The gradient is calculated using the following formula:
[0074]
[0075] Among them, G (x,y,z) Let g be the gradient of voxel (x,y,z). (x,y,z) is the gray value of the voxel (x,y,z).
[0076] Then, a search is performed within a preset range around the cluster center, which can be a bounding box with a size of 2S×2S×2S. Each voxel within the preset range is traversed, and a target voxel whose distance from the cluster center is less than a preset value is searched. This target voxel is then merged into the supervoxel containing the cluster center.
[0077] It should be noted that the distance between two voxels can be expressed as spatial distance and grayscale distance. That is, as a feasible implementation method, searching for target voxels within a preset range around the cluster center whose distance to the cluster center is less than a preset value includes: calculating the grayscale distance between each voxel within the preset range around the cluster center and the cluster center based on the grayscale value of each voxel within the preset range around the cluster center and the grayscale value of the cluster center; calculating the spatial distance between each voxel within the preset range around the cluster center and the cluster center based on the coordinate values of each voxel within the preset range around the cluster center and the coordinate values of the cluster center; calculating the comprehensive distance between each voxel within the preset range around the cluster center and the cluster center based on the grayscale distance and spatial distance; and identifying voxels whose comprehensive distance is less than the preset value as target voxels.
[0078] Optionally, the comprehensive distance between each voxel within a preset range around the cluster center and the cluster center is calculated based on the grayscale distance and spatial distance between each voxel within a preset range around the cluster center. This includes: taking the square root of the grayscale value of the cluster center and the grayscale values of the voxels within the preset range around it as the grayscale distance; calculating the physical distance based on the coordinate values of the cluster center and the coordinate values of the voxels within the preset range around it as the spatial distance; then setting an adjustment parameter; and combining the grayscale distance and the spatial distance to obtain the comprehensive distance.
[0079] In practical implementation, the grayscale distance between the cluster center and the voxels within a preset range around it is: Where i and j represent the cluster center and the voxels within a preset range around it, respectively, and g i and g j These represent the grayscale values of the voxels within a preset range surrounding the cluster center. The spatial distance between the cluster center and the voxels within the preset range is: Among them, (x i ,y i ,z i ) and (x j ,y j ,z j ) represent the coordinates of the cluster center and the voxels within a preset range around it, respectively. The combined distance between the cluster center and the voxels within the preset range around it is:
[0080] Where 'a' is the adjustment parameter.
[0081] Furthermore, after traversing every voxel within a preset range for each cluster center, updated supervoxels are obtained. The cluster center of each supervoxel is then updated based on the coordinates and grayscale values of all voxels within that updated supervoxel. In specific implementation, the average coordinates and average grayscale values of all voxels within each supervoxel are calculated. These average coordinates and average grayscale values are then used as the coordinates and grayscale values of the updated cluster center for each supervoxel. That is, the coordinates of the updated cluster center are the average coordinates calculated above, and the grayscale values are the average grayscale values calculated above. It is understood that the updated cluster center is not necessarily a real voxel in the target data, but rather a calculated voxel. The above search and merging process is repeated based on the updated cluster centers until all supervoxels no longer change.
[0082] S102: Extract the features of the supervoxels, and perform clustering operations on the supervoxels based on the features of the supervoxels to divide the target volume data into multiple categories;
[0083] In this step, the features of the supervoxel are first extracted, which may include energy, entropy, differential torque, expected value of the voxel's gray value, variance, etc.
[0084] Among them, the expected value E of the gray values of all voxels in the l-th supervoxel. (l) The calculation formula is: S l Let l be the total number of voxels contained in the l-th supervoxel. σ represents the gray value of the k-th voxel within the l-th supervoxel. σ is the expected value σ of the gray values of all voxels within the l-th supervoxel. 2(l) The calculation formula is: The energy ν of the lth supervox (l) The calculation formula is: p (l) (g) represents the intensity distribution within the l-th supervoxel, and the entropy τ of the l-th supervoxel. (l) The calculation formula is: The differential torque ρ of the l-th supervoxel (l) The calculation formula is: H is the number of classes in the histogram.
[0085] Secondly, the features of the extracted supervoxels are fused to obtain the fused features of the supervoxels. Then, clustering is performed on the supervoxels based on the fused features. As a feasible implementation, fusing the features of the extracted supervoxels to obtain the fused features includes: weighted fusion of the features of the extracted supervoxels based on the weights corresponding to each feature. In specific implementations, the weights of expectation, variance, energy, entropy, and differential torque can be manually set, for example, a, b, c, d, and e respectively, then the fused feature C = aE + bσ. 2 +cν+dτ+eρ. The specific values of these weights are not limited in the embodiments of this application.
[0086] In a preferred embodiment, the step of clustering the supervoxes based on their features to divide the target data into multiple categories includes: initializing membership coefficients; dividing the target data into multiple categories based on the membership coefficients; calculating the features of each category based on the features of each supervoxe, the number of voxels contained in each supervoxe, and the membership function; updating the membership coefficients based on the features of each category, the features of each supervoxe, and the number of voxels contained in each supervoxe; and determining whether the difference between the updated membership function and the membership function before the update is less than or equal to a threshold or whether the maximum number of updates has been reached. If the difference between the updated membership function and the original membership function is greater than the threshold and the number of updates has not reached the maximum number of iterations, then the target volume data is reclassified into multiple categories based on the updated membership function. The features of each category are updated based on the features of each supervoxel, the number of voxels contained in each supervoxel, and the updated membership function. The membership coefficients are updated based on the updated features of each category, the features of each supervoxel, and the number of voxels contained in each supervoxel. The process then re-enters the step of determining whether the difference between the updated membership function and the original membership function is less than or equal to the threshold or whether the number of updates has reached the maximum number of iterations.
[0087] In practical implementation, the clustering objective function is:
[0088] Among them, u kl S represents the membership coefficient between the l-th supervoxel and the k-th category, where m is a preset power value. l C represents the number of pixels in the l-th supervoxel region. l Represents the characteristics of the l-th supervoxel, C k Let K represent the feature of the k-th category, where 1 ≤ k ≤ K, and K is the total number of categories.
[0089] The clustering objective is to minimize the value of the above objective function, which can be solved using the Lagrange multiplier method:
[0090]
[0091]
[0092] In the specific implementation, a threshold ε is set, the number of iterations is initialized to t=0, the maximum number of iterations is T, and the membership coefficients are randomly initialized. The target data is divided into multiple categories based on the membership coefficients. If the membership coefficients of the l-th supervoxel and the k-th category are greater than a preset value, the voxels in the l-th supervoxel are assigned to the k-th category. The features of each category are calculated based on the features of each supervoxel, the number of voxels contained in each supervoxel, and the initialized membership function, i.e., the features of each category are calculated according to equation (1). Then, the membership coefficients are updated based on the features of each category, the features of each supervoxel, and the number of voxels contained in the supervoxel, i.e., the membership coefficients are updated according to equation (2). If t > T, the algorithm stops, resulting in K categories; otherwise, t = t + 1, and the target data is reclassified into multiple categories based on the updated membership function, and the process re-enters the step of calculating the features of each category according to equation (1). Optionally, the number of categories divided during the update process can be consistent with the initially determined number of categories. That is, in this embodiment, the total number of categories remains unchanged. After the membership coefficients are updated, each supervoxel is reclassified. A supervoxel may initially belong to category A, but after the update, it may belong to category B. Through the above-mentioned reclassification of categories, accurate classification of supervoxels can be achieved, thereby achieving accurate classification of the target data.
[0093] It should be noted that the total number of categories K is a preset parameter, at least 2, meaning the target volume data is divided into two categories: foreground and background regions. Of course, K can also be set to a value greater than 2. In this case, the foreground region will be divided into multiple categories. To ensure that voxels within the same irregular spatial volume are classified into the same category, K ≤ M + 1, where M is the number of irregular spatial volumes contained in the target volume data.
[0094] S103: Determine the connected component labels corresponding to the voxels based on the clustering results;
[0095] Understandably, based on the clustering results of the previous step, the foreground and background regions in the target volume data can be determined. In this step, for the voxels in the foreground region, the connected components are labeled based on the clustering results, that is, the same connected component labels are assigned to voxels that belong to the same category and are connected.
[0096] As a possible implementation, this step may include: sequentially traversing the voxels in the target volume data, determining whether there are any target neighboring voxels belonging to the same category as the voxel and already marked; if so, if there is one target neighboring voxel, determining the connected component label of the voxel as the connected component label of the target neighboring voxel; if there are multiple target neighboring voxels, determining the minimum connected component label of the multiple target neighboring voxels, determining the connected component label of the voxel as the minimum connected component label, and establishing an inheritance relationship between the minimum connected component label and other connected component labels of the target neighboring voxels; if not, determining the connected component label of the voxel as a new connected component label; traversing the voxels in the target volume data again, updating the connected component labels of voxels with inherited connected component labels to the minimum connected component label in the corresponding inheritance relationship.
[0097] In practice, each voxel in the target volume data is traversed sequentially along the length, width, and height directions. For voxels in the foreground region, connected component labels are assigned. An example is given using the first layer of voxels along the length direction. Figure 2 As shown, black represents the background area, while white and shaded areas represent the foreground area. The white and shaded areas represent different categories. Starting with voxel (0,0), labeling proceeds from top to bottom and left to right. For voxel (0,0), since none of its neighboring voxels have already been labeled, a new connected component label (e.g., 1) is assigned to voxel (0,1). For voxel (0,1), since one of its neighboring voxels belongs to the same category as voxel (0,1) and has already been labeled, a connected component label (1) is assigned to voxel (0,1). For voxel (0,2), being the background area, no connected component label is assigned. For voxel (1,3), although one of its neighboring voxels has already been labeled (0,3), they belong to different categories; therefore, a new connected component label (e.g., 3) is assigned to voxel (1,3). For voxel (2,3), there are two adjacent voxels of the same category as voxel (2,3) that have already been labeled: voxel (2,2) and voxel (1,3). Assign voxel (2,3) the smallest connected component label among them, which is 1. Establish an inheritance relationship between connected component label 1 and connected component label 3, that is, connected component label 1 is the parent connected component label, and connected component label 3 is the child connected component label, as follows: Figure 3 As shown. The connected components are labeled in the manner described above, and the result is as follows. Figure 4 As shown. Then, traverse the voxels in the foreground region again, updating the connected component labels of voxels with inheritance relationships to the smallest connected component label in the corresponding inheritance relationship. Figure 4In the middle, the connected component label of voxel (1,3) needs to be updated to 1, and the result is as follows. Figure 5 As shown.
[0098] It should be noted that, Figure 3 The inheritance relationship shown is just a simple example. In real-world applications, there may be more complex multi-level inheritance relationships, such as... Figure 6 As shown, when updating the connected component labels, the connected component labels of voxels with inheritance relationships need to be updated to the smallest connected component label in the corresponding inheritance relationship. That is, after the update, only connected component labels 1, 3 and 4 exist.
[0099] S104: Determine the number of irregular spatial volumes based on the number of different connected component markers in the target volume data;
[0100] In this step, the number of different connected component labels in the target volume data is determined as the number of irregular spatial volumes contained in the target volume data. Figure 5 In the example shown, the number of irregular spatial volumes is 6.
[0101] S105: Calculate the volume of the corresponding irregular spatial volume based on the number of identical connected component markers and the volume of a single voxel in the target volume data.
[0102] In this step, the volume of the corresponding irregular spatial volume can be calculated by counting the number of identical connected component markers in the target volume data. Specifically, if the number of identical connected component markers is M, the volume of a single voxel is v cm. 3 Where v is related to the probe and front-end configuration parameters, and the volume of the irregular space corresponding to this connected component is M × v cm. 3 .
[0103] The method for determining irregular spatial volumes provided in this application identifies the number of connected components and the number of voxels contained in each connected component by marking the connected components of voxels in the target volume data. Based on the number of connected components, the method determines the number of irregular spatial volumes in the target volume data. The volume of the corresponding irregular spatial volume is calculated using the number of voxels in each connected component and the volume of a single voxel. Compared to measuring the volume of each irregular spatial volume using the elliptic method, this method eliminates the need to sequentially scan the maximum cross-section of each irregular spatial volume, and the measured irregular spatial volumes are not limited to standard ellipsoids, thus improving the efficiency and accuracy of determining the number and volume of irregular spatial volumes.
[0104] This application discloses a method for determining an irregular spatial body. The following description uses the application of this method to an ultrasonic device as an example. The method includes:
[0105] The ultrasonic signal of the object being tested is acquired, and the ultrasonic volume data of the corresponding spatial volume of the object is obtained based on the ultrasonic signal. When the object being tested has an irregular shape, the spatial volume of the object is designated as an irregular spatial volume.
[0106] The ultrasound data containing N voxels is divided into L supervoxels; wherein the size of each supervoxel is S×S×S.
[0107] Within each supervoxel, the voxel with the minimum gradient is identified as the cluster center. The grayscale distance between each voxel within a preset range surrounding the cluster center and the cluster center is calculated based on the grayscale values of each voxel within that range and the cluster center itself. The spatial distance between each voxel within the preset range surrounding the cluster center and the cluster center is calculated based on the coordinate values of each voxel within that range and the cluster center itself. The combined distance between each voxel within the preset range surrounding the cluster center and the cluster center is calculated based on both the grayscale distance and the spatial distance. Voxels with a combined distance less than a preset value are identified as target voxels and merged into the supervoxel containing the cluster center.
[0108] Calculate the average coordinates and average grayscale values of all voxels in each supervoxel based on their coordinates and grayscale values; use the average coordinates and average grayscale values of each supervoxel as the coordinates and grayscale values of the updated cluster center for each supervoxel.
[0109] The process of re-entering the preset range around the cluster center to search for target voxels that are less than a preset value away from the cluster center, and merging the target voxels into the super voxels where the cluster center is located, continues until all the super voxels no longer change.
[0110] Extract the features of the supervoxel; wherein the features include any one or a combination of any of the following: energy, entropy, differential torque, expected value of the voxel's gray value, and variance;
[0111] The extracted features of the hypervoxel are weighted and fused based on the weights corresponding to each feature to obtain the fused features of the hypervoxel.
[0112] Initialize membership coefficients, and divide the target data into multiple categories based on the membership coefficients;
[0113] The fusion feature of each category is calculated based on the fusion feature of each hypervoxel, the number of voxels contained in each hypervoxel, and the membership function;
[0114] The membership coefficient is updated based on the fusion features of each category, the fusion features of each hypervoxel, and the number of voxels contained in the hypervoxel.
[0115] Determine whether the difference between the updated membership function and the original membership function is less than or equal to the threshold or whether the number of updates has reached the maximum number of iterations;
[0116] If the difference between the updated membership function and the original membership function is greater than the threshold and the number of updates has not reached the maximum number of iterations, then the target volume data is reclassified into multiple categories based on the updated membership function. The fusion features of each category are updated based on the fusion features of each supervoxel, the number of voxels contained in each supervoxel, and the updated membership function. The membership coefficients are updated based on the updated fusion features of each category, the fusion features of each supervoxel, and the number of voxels contained in each supervoxel. The process then re-enters the step of determining whether the difference between the updated membership function and the original membership function is less than or equal to the threshold or whether the number of updates has reached the maximum number of iterations.
[0117] The voxels in the ultrasound body data are traversed sequentially to determine whether there is a target adjacent voxel that belongs to the same category as the voxel and has been marked.
[0118] If they exist, then if there is one target neighbor voxel, the connected component label of the voxel is determined as the connected component label of the target neighbor voxel; if there are multiple target neighbor voxels, the minimum connected component label of the multiple target neighbor voxels is determined, the connected component label of the voxel is determined as the minimum connected component label, and the inheritance relationship between the minimum connected component label and the other connected component labels of the target neighbor voxels is established.
[0119] If it does not exist, then the connected component label of the voxel is determined to be a new connected component label;
[0120] The voxels in the ultrasound body data are traversed again, and the connected component labels of voxels with inheritance relationships are updated to the smallest connected component label in the corresponding inheritance relationship.
[0121] The number of irregular spatial volumes is determined based on the number of different connected component markers in the ultrasound body data;
[0122] The volume of the corresponding irregular spatial volume is calculated based on the number of identical connected component markers and the volume of a single voxel in the ultrasound volume data.
[0123] The following describes an application embodiment of the method for determining the volume of an irregular spatial body provided in this application.
[0124] An ultrasound device acquires ultrasound signals from follicles, and based on these ultrasound signals, obtains ultrasound data containing N voxels corresponding to the follicles and sends it to an electronic device.
[0125] The electronic device performs the following steps:
[0126] 1. Preset the number of hypervoxels L, and calculate... The ultrasound data is divided into L hypervoxels of size S×S×S, and the gradient of each hypervoxel is calculated in each hypervoxel:
[0127]
[0128] The voxel with the minimum gradient is determined as the initial cluster center. Within a bounding box of size 2S×2S×2S around the cluster center, voxels are traversed, and the distance D between each voxel within the bounding box and the cluster center is calculated. s :
[0129]
[0130] in,
[0131] Voxels within the bounding box whose distance from the cluster center is within a preset value are identified as target voxels and merged into the supervoxel containing that cluster center. The cluster center is updated; the coordinates of the updated cluster center are the average coordinates of all voxels in the supervoxel, and the grayscale value is the average grayscale value of all voxels in the supervoxel. Based on the updated cluster center, the above search and merging process is repeated until all supervoxels no longer change.
[0132] 2. Extracting features from supervoxels: energy, entropy, differential torque, expected value and variance of voxel grayscale values.
[0133] Among them, the expected value E of the gray values of all voxels in the l-th supervoxel. (l) The calculation formula is: S l Let l be the total number of voxels contained in the l-th supervoxel. σ represents the gray value of the k-th voxel within the l-th supervoxel. σ is the expected value σ of the gray values of all voxels within the l-th supervoxel. 2(l) The calculation formula is: The energy ν of the lth supervox (l) The calculation formula is: p (l) (g) represents the intensity distribution within the l-th supervoxel, and the entropy τ of the l-th supervoxel. (l) The calculation formula is: The differential torque ρ of the l-th supervoxel (l) The calculation formula is: H is the number of classes in the histogram.
[0134] Calculate the fusion characteristics of the supervoxels: C = aE + bσ 2 +cν+dτ+eρ, where a, b, c, d, and e correspond to the weights of expectation, variance, energy, entropy, and differential torque, respectively.
[0135] 3. Set a threshold ε, initialize the number of iterations t=0, set the maximum number of iterations to T, and randomly initialize the membership coefficients. according to The ultrasound body data is divided into multiple categories. The characteristics of each category are calculated according to equation (1), and the membership coefficients are updated according to equation (2). If t > T, the algorithm stops and K categories are obtained; otherwise, t = t + 1, the ultrasound data are reclassified into multiple categories according to the updated membership function, and the process of calculating the features of each category according to equation (1) is restarted.
[0136]
[0137]
[0138] 4. Iterate through the voxels in the ultrasound body data sequentially, and determine whether there are any target neighboring voxels that belong to the same category as the voxel and have already been marked. If there is, if there is one target neighboring voxel, determine the connected component label of the voxel as the connected component label of the target neighboring voxel. If there are multiple target neighboring voxels, determine the minimum connected component label of the multiple target neighboring voxels, and determine the connected component label of the voxel as the minimum connected component label, and establish the inheritance relationship between the minimum connected component label and the other connected component labels of the target neighboring voxels. If there is no such relationship, determine the connected component label of the voxel as a new connected component label. Iterate through the voxels in the ultrasound body data again, and update the connected component labels of voxels with inheritance relationships to the minimum connected component label in the corresponding inheritance relationship.
[0139] 5. The number of different connected component markers in the ultrasound body data is used to determine the number of follicles contained in the ultrasound body data. If the number of identical connected component markers is M, and the volume of a single voxel is v cm⁻¹ 3 Where v is related to the probe and front-end configuration parameters, and the volume of the follicle corresponding to this connected component is M × v cm. 3 .
[0140] The following describes a device for determining an irregular spatial body according to an embodiment of this application. The device for determining an irregular spatial body described below and the method for determining an irregular spatial body described above can be referred to each other.
[0141] See Figure 7 A structural diagram of a device for determining an irregular spatial volume according to an exemplary embodiment is shown, as follows: Figure 7 As shown, it includes:
[0142] The segmentation module 701 is used to acquire target volume data of an irregular spatial body obtained by three-dimensional scanning of a medical device, and to segment the target volume data into multiple supervoxels; wherein each supervoxel includes multiple voxels;
[0143] Clustering module 702 is used to extract the features of the supervoxels and perform clustering operations on the supervoxels based on the features of the supervoxels to divide the target volume data into multiple categories.
[0144] The first determining module 703 is used to determine the connected component label corresponding to the voxel based on the clustering result;
[0145] The second determining module 704 is used to determine the number of irregular spatial volumes based on the number of different connected component markers in the target volume data;
[0146] The calculation module 705 is used to calculate the volume of the corresponding irregular space volume based on the number of identical connected component labels and the volume of a single voxel.
[0147] The irregular spatial volume determination device provided in this application determines the number of connected regions and the number of voxels contained in each connected region by marking the connected regions to which voxels in the target volume data belong. Based on the number of connected regions, the device determines the number of irregular spatial volumes in the target volume data. The volume of the corresponding irregular spatial volume is calculated based on the number of voxels in each connected region and the volume of a single voxel. Compared to measuring the volume of each irregular spatial volume using the elliptic method, this method eliminates the need to sequentially scan the maximum cross-section of each irregular spatial volume, and the measured irregular spatial volumes are not limited to standard ellipsoids, thus improving the efficiency and accuracy of determining the number and volume of irregular spatial volumes.
[0148] In one embodiment, the partitioning module 701 is specifically used for:
[0149] The acquisition unit is used to acquire target data of irregular spatial bodies obtained by three-dimensional scanning of medical equipment.
[0150] The partitioning unit is used to divide the target volume data into multiple cubic-shaped supervoxels;
[0151] A determination unit is used to identify the voxel with the minimum gradient value in each supervoxel as the cluster center;
[0152] The search unit is used to search for target voxels within a preset range around the cluster center that are less than a preset value away from the cluster center, and to merge the target voxels into the supervoxel where the cluster center is located;
[0153] An update unit is used to update the cluster center of each supervoxel based on the coordinate values and grayscale values of all voxels in each supervoxel; and to restart the workflow of the search unit until the change range of the supervoxel meets the preset requirements.
[0154] In one embodiment, the search unit is specifically configured to: calculate the grayscale distance between each voxel within a preset range around the cluster center and the cluster center based on the grayscale value of each voxel within a preset range around the cluster center and the grayscale value of the cluster center; calculate the spatial distance between each voxel within a preset range around the cluster center and the cluster center based on the coordinate values of each voxel within a preset range around the cluster center and the coordinate values of the cluster center; calculate the comprehensive distance between each voxel within a preset range around the cluster center and the cluster center based on the grayscale distance and spatial distance between each voxel within a preset range around the cluster center and the cluster center; identify voxels whose comprehensive distance is less than a preset value as target voxels, and merge the target voxels into the supervoxel containing the cluster center.
[0155] In one embodiment, the updating unit is specifically used to: calculate the average coordinate value and average gray value of all voxels in each supervoxel based on the coordinate values and gray values of all voxels in each supervoxel; and use the average coordinate value and average gray value corresponding to each supervoxel as the coordinate value and gray value of the updated cluster center of each supervoxel.
[0156] In one embodiment, the clustering module 702 includes:
[0157] An extraction unit is used to extract features of the supervoxel; wherein the features include any one or a combination of any of the following: energy, entropy, differential torque, expected value of the voxel's gray value, and variance;
[0158] A fusion unit is used to fuse the various features of the extracted hypervoxel to obtain the fused features of the hypervoxel;
[0159] Clustering unit, used to perform clustering operation on the supervoxels based on the fusion features of the supervoxels.
[0160] In one embodiment, the fusion unit is specifically used to: perform weighted fusion of the extracted features of the supervoxel based on the weights corresponding to each feature to obtain the fused features of the supervoxel.
[0161] In one embodiment, the clustering module 702 is specifically used for: initializing membership coefficients; dividing the target data into multiple categories based on the membership coefficients; calculating the features of each category based on the features of each supervoxel, the number of voxels contained in each supervoxel, and the membership function; updating the membership coefficients based on the features of each category, the features of each supervoxel, and the number of voxels contained in each supervoxel; determining whether the difference between the updated membership function and the membership function before the update is less than or equal to a threshold or whether the number of updates has reached the maximum number of iterations; if the difference between the updated membership function and the membership function before the update is less than or equal to a threshold, the clustering module 702 is used for: initializing membership coefficients; dividing the target data into multiple categories based on the membership coefficients; calculating the features of each category based on the features of each supervoxel, the number of voxels contained in each supervoxel, and the number of voxels contained in each supervoxel; determining whether the difference between the updated membership function and the membership function before the update is less than or equal to a threshold or whether the number of updates has reached the maximum number of iterations; and determining whether the difference between the updated membership function and the membership function before the update is less than or equal to a threshold. If the difference in the membership function is greater than the threshold and the number of updates has not reached the maximum number of iterations, then the target volume data is reclassified into multiple categories based on the updated membership function. The features of each category are updated based on the features of each supervoxel, the number of voxels contained in each supervoxel, and the updated membership function. The membership coefficients are updated based on the updated features of each category, the features of each supervoxel, and the number of voxels contained in each supervoxel. Then, the process re-enters the step of determining whether the difference between the updated membership function and the membership function before the update is less than or equal to the threshold or whether the number of updates has reached the maximum number of iterations.
[0162] In one embodiment, the first determining module 703 is specifically configured to: sequentially traverse the voxels in the target volume data, determine whether there are any target neighboring voxels that belong to the same category as the voxel and have been marked; if there are, if there is one target neighboring voxel, determine the connected component label of the voxel as the connected component label of the target neighboring voxel; if there are multiple target neighboring voxels, determine the minimum connected component label of the multiple target neighboring voxels, determine the connected component label of the voxel as the minimum connected component label, and establish an inheritance relationship between the minimum connected component label and other connected component labels of the target neighboring voxels; if there are no, determine the connected component label of the voxel as a new connected component label; traverse the voxels in the target volume data again, and update the connected component labels of voxels with inheritance relationships to the minimum connected component label in the corresponding inheritance relationship.
[0163] In one embodiment, it further includes:
[0164] The filtering module is used to determine the spherical neighborhood of each pixel in the target data, calculate the average gray value of all pixels in the spherical neighborhood, and replace the gray value of each pixel in the target data with the average gray value of all adjacent pixels in the corresponding spherical neighborhood.
[0165] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0166] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiments of this application, the embodiments of this application also provide an electronic device. Figure 8 This is a structural diagram of an electronic device according to an exemplary embodiment, such as... Figure 8 As shown, the electronic device includes:
[0167] Communication interface 1 enables information exchange with other devices, such as network devices;
[0168] Processor 2 is connected to communication interface 1 to enable information interaction with other devices. When running a computer program, it executes the method for determining irregular spatial volumes provided by one or more of the aforementioned technical solutions. The computer program is stored in memory 3.
[0169] Of course, in practical applications, the various components in an electronic device are coupled together through bus system 4. It can be understood that bus system 4 is used to achieve communication and connection between these components. In addition to the data bus, bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 8 The general will label all buses as Bus System 4.
[0170] The memory 3 in this embodiment is used to store various types of data to support the operation of the electronic device. Examples of such data include any computer program used to operate on the electronic device.
[0171] It is understood that memory 3 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 3 described in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0172] The methods disclosed in the embodiments of this application can be applied to processor 2, or implemented by processor 2. Processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 2 or by instructions in the form of software. The processor 2 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 2 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 3. Processor 2 reads the program in memory 3 and completes the steps of the aforementioned method in combination with its hardware.
[0173] When processor 2 executes the program, it implements the corresponding processes in the various methods of the embodiments of this application. For the sake of brevity, these will not be described in detail here.
[0174] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 3 that stores a computer program, which can be executed by a processor 2 to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0175] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0176] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, 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 an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0177] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for determining an irregular spatial volume, characterized in that, include: The target volume data of an irregular spatial body obtained by three-dimensional scanning of a medical device is acquired, and the target volume data is divided into multiple supervoxels; wherein each supervoxel includes multiple voxels; Extract the features of the supervoxels, and perform clustering operations on the supervoxels based on the features of the supervoxels to divide the target volume data into multiple categories; The connected component labels corresponding to the voxels are determined based on the clustering results. The number of irregular spatial volumes is determined based on the number of different connected component markers in the target volume data; The volume of the corresponding irregular spatial volume is calculated based on the number of identical connected component markers and the volume of a single voxel in the target volume data. The step of determining the connected component label corresponding to the voxel based on the clustering result includes: The voxels in the target data are traversed sequentially to determine whether there are any target adjacent voxels that belong to the same category as the voxel and have been marked. If they exist, then if there is one target neighbor voxel, the connected component label of the voxel is determined as the connected component label of the target neighbor voxel; if there are multiple target neighbor voxels, the minimum connected component label of the multiple target neighbor voxels is determined, the connected component label of the voxel is determined as the minimum connected component label, and the inheritance relationship between the minimum connected component label and the other connected component labels of the target neighbor voxels is established. If it does not exist, then the connected component label of the voxel is determined to be a new connected component label; The voxels in the target data are traversed again, and the connected component labels of voxels with inheritance relationships are updated to the smallest connected component label in the corresponding inheritance relationship.
2. The method for determining an irregular spatial volume according to claim 1, characterized in that, The target volume data is divided into multiple supervoxels, including: The target volume data is divided into multiple cubic-shaped hypervoxels; In each supervoxel, the voxel with the minimum gradient is determined as the cluster center. Target voxels with a distance less than a preset value from the cluster center are searched within a preset range around the cluster center, and these target voxels are merged into the supervoxel containing the cluster center. The cluster center of each supervoxel is updated based on the coordinate and gray values of all voxels in each supervoxel; The process of re-entering the preset range around the cluster center to search for target voxels whose distance from the cluster center is less than a preset value, and merging the target voxels into the super voxels where the cluster center is located, continues until the change range of the super voxels meets the preset requirements.
3. The method for determining an irregular spatial volume according to claim 2, characterized in that, Searching for target voxels within a preset range around the cluster centers that are less than a preset value from the cluster centers includes: The grayscale distance between each voxel within a preset range around the cluster center and the cluster center is calculated based on the grayscale value of each voxel within the preset range around the cluster center and the grayscale value of the cluster center. The spatial distance between each voxel within a preset range around the cluster center and the cluster center is calculated based on the coordinate values of each voxel within the preset range around the cluster center and the coordinate values of the cluster center. The comprehensive distance between each voxel within a preset range around the cluster center and the cluster center is calculated based on the grayscale distance and spatial distance between each voxel and the cluster center. Voxels whose overall distance is less than a preset value are identified as target voxels.
4. The method for determining an irregular spatial volume according to claim 3, characterized in that, The step of updating the cluster center of each supervoxel based on the coordinates and grayscale values of all voxels in each supervoxel includes: Calculate the average coordinates and average grayscale values of all voxels in each hypervoxel based on the coordinates and grayscale values of all voxels in each hypervoxel; The average coordinates and average grayscale values of each hypervoxel are used as the updated cluster center coordinates and grayscale values of each hypervoxel.
5. The method for determining an irregular spatial volume according to claim 1, characterized in that, The step of extracting features from the hypervoxels and performing clustering operations on the hypervoxels based on these features includes: Extract the features of the supervoxel; wherein the features include any one or a combination of any of the following: energy, entropy, differential torque, expected value of the voxel's gray value, and variance; The extracted features of the hypervoxels are fused to obtain the fused features of the hypervoxels; Clustering operations are performed on the supervoxels based on their fusion characteristics.
6. The method for determining an irregular spatial volume according to claim 5, characterized in that, The process of fusing the extracted features of the hypervoxel to obtain the fused features of the hypervoxel includes: The extracted features of the hypervoxel are weighted and fused based on the weights corresponding to each feature to obtain the fused features of the hypervoxel.
7. The method for determining an irregular spatial volume according to claim 1, characterized in that, The clustering operation on the supervoxels based on their features to divide the target volume data into multiple categories includes: Initialize membership coefficients, and divide the target data into multiple categories based on the membership coefficients; The features of each category are calculated based on the characteristics of each hypervoxel, the number of voxels contained in each hypervoxel, and the membership function; The membership coefficient is updated based on the features of each category, the features of each hypervoxel, and the number of voxels contained in the hypervoxel; Determine whether the difference between the updated membership function and the original membership function is less than or equal to the threshold or whether the number of updates has reached the maximum number of iterations; If the difference between the updated membership function and the original membership function is greater than the threshold and the number of updates has not reached the maximum number of iterations, then the target data is reclassified into multiple categories based on the updated membership function. The features of each category are updated based on the features of each supervoxel, the number of voxels contained in each supervoxel, and the updated membership function. The membership coefficients are updated based on the updated features of each category, the features of each supervoxel, and the number of voxels contained in each supervoxel. The process then re-enters the step of determining whether the difference between the updated membership function and the original membership function is less than or equal to the threshold or whether the number of updates has reached the maximum number of iterations.
8. The method for determining an irregular spatial volume according to claim 1, characterized in that, After acquiring the target body data of the irregular spatial body obtained by the medical device through three-dimensional scanning, the method further includes: Determine the spherical neighborhood of each pixel in the target volume data, calculate the average gray value of all pixels in the spherical neighborhood, and replace the gray value of each pixel in the target volume data with the average gray value of all adjacent pixels in the corresponding spherical neighborhood.
9. A device for determining an irregular spatial volume, characterized in that, include: The segmentation module is used to acquire target volume data of an irregular spatial body obtained by three-dimensional scanning of a medical device, and to segment the target volume data into multiple supervoxels; wherein each supervoxel includes multiple voxels; The clustering module is used to extract the features of the supervoxels and perform clustering operations on the supervoxels based on the features of the supervoxels to divide the target volume data into multiple categories. The first determining module is used to determine the connected component label corresponding to the voxel based on the clustering results; The second determining module is used to determine the number of irregular spatial volumes based on the number of different connected component markers in the target volume data; The calculation module is used to calculate the volume of the corresponding irregular spatial volume based on the number of identical connected component labels and the volume of a single voxel; Specifically, the first determining module is used to: sequentially traverse the voxels in the target volume data, determine whether there are any target neighboring voxels that belong to the same category as the voxel and have been marked; if there are, then if there is one target neighboring voxel, determine the connected component label of the voxel as the connected component label of the target neighboring voxel; if there are multiple target neighboring voxels, determine the minimum connected component label of the multiple target neighboring voxels, determine the connected component label of the voxel as the minimum connected component label, and establish an inheritance relationship between the minimum connected component label and the other connected component labels of the target neighboring voxels; if there are no, then determine the connected component label of the voxel as a new connected component label; traverse the voxels in the target volume data again, and update the connected component labels of voxels with inheritance relationships to the minimum connected component label in the corresponding inheritance relationship.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the method for determining an irregular spatial volume as described in any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for determining an irregular spatial volume as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Three-dimensional surface reconstruction method, three-dimensional surface reconstruction device, ultrasonic equipment and storage medium
CN111053574A
Image segmentation method and apparatus, and storage medium and terminal device
WO2020233084A1
