Musculoskeletal ultrasound muscle morphology feature extraction and symmetry analysis method and system

CN122928962APending Publication Date: 2026-10-16TONGJI HOSPITAL ATTACHED TO TONGJI MEDICAL COLLEGE HUAZHONG SCI TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611225866.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0003]传统肌骨超声肌肉形态特征提取与对称性分析多依赖人工选取或预设规则确定边界与参考结构,操作过程中容易受操作者经验、探头轻微旋转与压迫程度差异影响,导致边界落点不稳定,肌肉厚度、长度、截面积等参数在不同检查时段出现不可忽略的波动,随访对比时难以确认差异来源属于真实生理变化或标注偏差,对称性判断常以固定参考结构或单一对称轴假设为前提,当成像平面存在倾斜、肌肉走向与图像坐标轴不一致时,对称关系判读容易发生错配,出现同一肌肉在不同帧或不同侧别上对齐失败的情况,进而把姿态差异误判为形态不对称,传统流程偏向整体区域的一次性评估,缺乏沿肌肉延展方向的连续一致性核验能力,局部萎缩、局部水肿或筋膜附近局灶性结构变化容易被整体平均效应掩盖,报告中只能给出粗粒度结论,无法指出异常集中区段,临床复核与康复评估需要额外人工逐段比对,举例而言,髂腰肌或腓肠肌在某一段存在局部纤维回声改变时,整体厚度指标仍可能接近正常范围,对称性结论呈现正常或轻度异常,导致早期变化识别滞后,影响训练调整与病程监测的及时性

Benefits of technology

[0052] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122928962A_ABST
    Figure CN122928962A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of medical image feature extraction, in particular to a muscle-bone ultrasound muscle morphology feature extraction and symmetry analysis method and system, comprising the following steps: collecting a two-dimensional gray ultrasound image of a muscle and denoising and enhancing, extracting a muscle boundary to generate a mask according to a gray gradient mutation, extracting boundary coordinates to calculate a main distribution trend to determine a main axis, rotating and correcting along the main axis to segment a section, mirror registering two sections to form an overlapping distribution, and calculating a consistency index to determine a section symmetry result, in the present application, the muscle and fascia interface are identified by gray change and a stable area expression is formed, reducing boundary uncertainty, a unified extension direction is determined as a reference axis according to the boundary distribution, ensuring comparability under different imaging postures, continuous sections are divided along the reference direction and mirror corresponding analysis is performed, so that the symmetry judgment has section-level positioning capability, the section results are integrated to form a distributed conclusion, and local abnormality identification and follow-up comparison are supported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical image feature extraction technology, and in particular to a method and system for extracting and analyzing the morphological features of muscles and bones using ultrasound. Background Technology

[0002] The field of medical image feature extraction technology mainly involves structural analysis, morphological description, and feature quantification of image data acquired by medical imaging equipment. Its core aspects include the identification of tissue boundaries in medical images, the determination of region contours, the calculation of morphological parameters, and the analysis based on image structural relationships. This technical field typically involves preprocessing two-dimensional or multi-dimensional medical images, segmenting features, calculating structural relationships, and forming image feature representations that can be used for medical analysis and evaluation. Traditional musculoskeletal ultrasound muscle morphological feature extraction and symmetry analysis refers to methods for analyzing the morphological structure of muscle tissue in musculoskeletal ultrasound images. The technical aspects it addresses are obtaining muscle regions from ultrasound images and describing their morphological features and the symmetry relationships of corresponding left-right or top-bottom structures. Traditional methods typically rely on the grayscale distribution, edge contours, and geometric structure relationships of muscle regions in ultrasound images. Muscle region boundaries are determined manually or by pre-defined rules, and morphological parameters such as muscle thickness, length, and cross-sectional area are calculated. Symmetry judgment and analysis are then performed based on the positional relationship of the corresponding muscle region in the image, the axis of symmetry, or a reference structure.

[0003] Traditional musculoskeletal ultrasound methods for extracting muscle morphological features and analyzing symmetry often rely on manual selection or pre-defined rules to determine boundaries and reference structures. This is easily influenced by operator experience, slight probe rotation, and variations in pressure, leading to unstable boundary placement and significant fluctuations in parameters such as muscle thickness, length, and cross-sectional area at different examination times. During follow-up comparisons, it is difficult to determine whether these differences stem from genuine physiological changes or labeling bias. Symmetry assessments often presuppose a fixed reference structure or a single axis of symmetry. When the imaging plane is tilted or the muscle orientation is inconsistent with the image coordinate axes, misinterpretation of symmetry relationships can easily occur, resulting in the same muscle being aligned in different frames or on different sides. In cases of failure, postural differences may be misjudged as morphological asymmetry. Traditional procedures tend to be a one-time assessment of the entire area, lacking the ability to verify the continuity and consistency along the muscle extension direction. Local atrophy, local edema, or focal structural changes near the fascia are easily masked by the overall averaging effect. The report can only provide coarse-grained conclusions and cannot point out the areas of concentrated abnormality. Clinical review and rehabilitation assessment require additional manual comparison of each segment. For example, when there are local fiber echo changes in a certain segment of the iliopsoas or gastrocnemius muscle, the overall thickness index may still be close to the normal range. The symmetry conclusion may show normal or mild abnormality, resulting in a lag in the identification of early changes and affecting the timeliness of training adjustments and disease monitoring. Summary of the Invention

[0004] To address the technical problems existing in the prior art, embodiments of the present invention provide a method for extracting muscle morphological features and performing symmetry analysis using musculoskeletal ultrasound, comprising the following steps:

[0005] S1: Acquire two-dimensional grayscale ultrasound images of the target muscle, statistically analyze pixel grayscale distribution and perform noise reduction and enhancement, extract muscle boundaries based on grayscale gradient abrupt changes at the interface between muscle tissue and fascia, mark the enclosed area after connectivity and closure processing, and generate a binary mask of the muscle region.

[0006] S2: Extract the boundary pixel coordinates from the binary mask of the muscle region, calculate the main distribution trend of the boundary pixel coordinates in the imaging plane, determine the muscle extension direction and set it as a unified reference axis, and construct the muscle principal axis direction vector.

[0007] S3: Constrain the direction of the binary mask of the muscle region according to the direction vector of the muscle principal axis and perform rotation correction. Divide the muscle region into continuous segments along the principal axis, locate the image symmetry axis, mirror one side of the segment, and determine the spatial correspondence with the corresponding segment on the other side to form a spatially overlapping distribution of muscle segments.

[0008] S4: Calculate the consistency index of the corresponding muscle regions on both sides of the segment based on the spatial overlap distribution of the muscle segments, determine the symmetry status of the segment by combining the threshold, integrate the segment results in the order of the main axis and record them, and output the symmetry determination result of the muscle segment.

[0009] S5: Call the muscle segment symmetry determination results, summarize the segment determination status, summarize the segment distribution and abnormal concentration locations and proportions in the main axis direction, and generate muscle morphology symmetry determination results.

[0010] As a further aspect of the present invention, the binary mask for the muscle region includes a foreground mask matrix, a background mask matrix, and an effective mask range identifier; the muscle principal axis direction vector specifically includes a reference axis definition, a direction angle parameter, and a unit vector component; the spatial overlap distribution of muscle segments includes an overlap region set, a spatial correspondence mapping table, and an overlap degree distribution matrix; the symmetry determination result of the muscle segment includes a segment symmetry status label, a segment determination score, and a segment integration sequence identifier; the symmetry determination result of the muscle morphology includes an overall symmetry level, an overview of the principal axis segment distribution, and an overall morphological difference indicator.

[0011] As a further aspect of the present invention, the specific steps of S1 are as follows:

[0012] S101: Acquire a two-dimensional grayscale image of the target muscle captured by the ultrasound probe during musculoskeletal ultrasound examination. Read the grayscale value pixel by pixel in the two-dimensional grayscale image, record the grayscale intensity according to the pixel coordinate order, index and arrange the pixels, call the image width and height parameters to complete the index mapping, form the correspondence between grayscale value and spatial position, count the frequency of grayscale level occurrence within the grayscale value set and calculate the pixel proportion, and generate the pixel grayscale distribution ratio value.

[0013] S102: Based on the pixel grayscale distribution ratio, detect the grayscale difference between adjacent pixels in the row and column directions, compare the grayscale difference with the set grayscale change threshold point by point in the muscle tissue and fascia interface area, filter the pixel positions that continuously exceed the threshold and record their coordinates, form a set of closed contour lines in the image based on the coordinates, and generate the muscle boundary coordinate set value.

[0014] S103: Based on the set of muscle boundary coordinates, determine whether each pixel coordinate in the two-dimensional image is inside the closed contour line. Pixels inside the closed contour line are assigned an internal label value, and the remaining pixels are assigned an external label value. Reconstruct the pixel matrix according to the original image size, verify the integrity of the matrix, and obtain the binary mask of the muscle region.

[0015] As a further aspect of the present invention, the specific steps of S2 are as follows:

[0016] S201: Obtain the binary mask of the muscle region, select the pixel position marked as the foreground in the mask, perform the detection of the pixel values ​​in the upper, lower, left and right neighborhoods, call the relationship of pixel value changes in the upper, lower, left and right, judge the boundary conditions and filter the boundary pixel points, record the corresponding row and column index of the boundary pixel in the ultrasound imaging plane, and obtain the boundary pixel coordinate set.

[0017] S202: Based on the boundary pixel coordinate set, calculate the projection span of the coordinates in the horizontal and vertical directions according to the numerical distribution of the coordinate points in the imaging plane, compare the magnitude of the span values ​​in the two directions, determine the axis corresponding to the extension direction, record the angle value range corresponding to the direction, and generate the angle range of the extension direction.

[0018] S203: Based on the angle range of the extension direction, the unit vector generation rule is called for the center angle value of the range to convert the angle value into a planar direction component. The proportion of the direction vector component in the corresponding orthogonal coordinate system is calculated and uniformly mapped to the reference axis coordinate representation to establish the muscle principal axis direction vector.

[0019] As a further aspect of the present invention, the specific steps of S3 are as follows:

[0020] S301: Based on the muscle principal axis direction vector, constrain the direction of the binary mask of the muscle region, obtain the set of binary mask pixels of the muscle region in the same musculoskeletal ultrasound image, call the principal axis direction vector component, determine the consistency of the pixel coordinates with the principal axis direction vector, filter the pixels that meet the consistency of direction conditions, reconstruct the mask region based on the filtering results, and generate the direction constraint mask angle distribution value.

[0021] S302: Based on the orientation constraint mask angle distribution value, the mask area is projected along the main axis direction to obtain the pixel density sequence corresponding to the projection position. It is determined whether the pixel density difference between adjacent projection positions meets the continuity threshold. Projection positions that meet the continuity judgment condition are merged into the same segment to form a set of segments arranged along the main axis direction, and the position interval value of the continuous segment along the main axis is obtained.

[0022] S303: For the position interval values ​​of the continuous segment of the main axis, detect the left and right spatial symmetry of the pixel distribution in the same musculoskeletal ultrasound image, obtain the position coordinates of the axis of symmetry, map the coordinates of one side segment to the mirror according to the axis of symmetry, call the coordinate set of the mapped segment and the other side segment, calculate the pixel spatial overlap ratio between the corresponding segments, and determine the correspondence based on the overlap ratio threshold to generate the spatial overlap distribution of muscle segments.

[0023] As a further aspect of the present invention, the specific steps of S4 are as follows:

[0024] S401: Based on the spatial overlap distribution of muscle segments, obtain the overlap area value and overlap ratio value of the corresponding muscle regions on the left and right sides. Extract the spatial proportion of the left and right regions in the same segment and perform numerical pairing. Extract the spatial proportion value of the left and right regions in the same segment. Perform numerical pairing on the spatial proportion values ​​of the left and right regions. Call the paired overlap ratio value to perform difference calculation and generate segment spatial overlap difference value.

[0025] S402: Based on the difference value of spatial overlap of the segments, call the consistency threshold and compare them one by one to determine the size of the difference value and the consistency threshold. Output the corresponding consistency or inconsistency judgment mark for the muscle segment, and summarize the judgment mark set of the segment to obtain the segment consistency judgment state set.

[0026] S403: The segment consistency determination state set is arranged according to the muscle principal axis order, the determination states are continuously recorded and segment sequence identifiers are formed, and muscle segment symmetry determination results are generated.

[0027] As a further aspect of the present invention, the specific steps of S5 are as follows:

[0028] S501: Call the muscle segment symmetry determination result, obtain the segment left and right symmetry determination mark value, read the symmetry determination mark value for the segment and map the value, complete the segment state determination according to the symmetry consistency threshold and record the corresponding state code, and generate the segment symmetry state value.

[0029] S502: Based on the symmetrical state value of the segment, obtain the corresponding position index of the segment in the main axis direction, perform sequential arrangement on the state code and position index, summarize the segment state according to the main axis direction order and count the number of continuous distributions, and generate the main axis segment distribution coefficient.

[0030] S503: Based on the distribution coefficient of the main axis segment, call the segment status code and the main axis position order, determine the consistency of the segment distribution and calculate the overall deviation ratio value, complete the overall summarization based on the corresponding judgment interval of the ratio value, and generate the muscle morphology symmetry judgment result.

[0031] As a further aspect of the present invention, the target muscle refers to a single muscle tissue object that is selected by the operator or automatically located by a preset muscle anatomy model before musculoskeletal ultrasound examination and subjected to morphological symmetry analysis.

[0032] The muscle tissue-fascia interface refers to the image transition region with obvious gray-level abrupt changes or gray-level gradient changes formed between the muscle tissue region and the adjacent fascial structure in a two-dimensional ultrasound grayscale image.

[0033] Gray-level variation refers to the gray-level difference, gray-level gradient, or abrupt change in gray-level distribution between adjacent pixels or regions in an ultrasound image.

[0034] Muscle boundaries refer to the closed contours formed by multiple continuously distributed boundary pixels in a two-dimensional ultrasound image.

[0035] The muscle region binary mask refers to a binary image with the same size as the original two-dimensional ultrasound grayscale image. The pixels corresponding to the muscle region are assigned a first preset value, and the pixels corresponding to the non-muscle region are assigned a second preset value.

[0036] Boundary pixel coordinates refer to the coordinate data extracted from the binary mask of the muscle region, used to represent the position of the muscle boundary pixels in the two-dimensional pixel coordinate system of the ultrasound image;

[0037] Spatial distribution refers to the overall orientation, arrangement trend, and main directional characteristics of the boundary pixel coordinates within the ultrasound imaging plane;

[0038] The extension direction refers to the direction in which the muscle extends in the image, determined by the principal direction distribution or major axis characteristics of the boundary pixel coordinates in the ultrasound imaging plane.

[0039] A unified reference axis refers to a reference coordinate axis set according to the direction of muscle extension or the direction of the muscle principal axis in the same musculoskeletal ultrasound image.

[0040] The muscle principal axis direction vector is a direction vector used to represent the muscle extension direction, calculated based on the boundary pixel coordinate space distribution.

[0041] As a further aspect of the present invention, a segment refers to a local muscle region unit formed by continuously dividing the binary mask of the muscle region along the main axis of the muscle region according to a preset length, number of pixels or proportional relationship.

[0042] The position of the axis of symmetry refers to the position of the symmetrical reference axis determined in the same musculoskeletal ultrasound image based on the geometric center, principal axis direction, or overall morphological characteristics of the muscle region, and used for mirror mapping.

[0043] Spatial overlap distribution refers to the spatial overlap or correspondence between a segment on one side of a muscle region and its corresponding segment on the other side in the ultrasound imaging plane after mirroring the segment along the axis of symmetry.

[0044] Spatial consistency refers to the state in which corresponding muscle segments on the left and right or up and down meet preset similarity criteria in terms of area size, shape, location distribution, or degree of overlap.

[0045] The determination state refers to the segment symmetry judgment result obtained based on the spatial consistency analysis of muscle segments, including at least one of the following state indicators: symmetrical, asymmetrical, or partially symmetrical.

[0046] The result of muscle morphological symmetry determination refers to the comprehensive determination result formed after integrating the determination states corresponding to each muscle segment.

[0047] The musculoskeletal ultrasound muscle morphology feature extraction and symmetry analysis system includes: an image grayscale positioning module for performing S1: acquiring a two-dimensional grayscale image of the target muscle collected by the ultrasound probe during musculoskeletal ultrasound examination, scanning the grayscale distribution of image pixels, identifying the muscle boundary based on the grayscale changes at the interface between muscle tissue and fascia, marking the area enclosed by the boundary, and obtaining a binary mask of the muscle region.

[0048] The main axis direction determination module is used to execute S2: extract the corresponding boundary pixel coordinates based on the binary mask of the muscle region, analyze the spatial distribution of the boundary pixel coordinates in the ultrasound imaging plane, determine the extension direction of the muscle in the image, set the direction as a unified reference axis, and form the muscle main axis direction vector.

[0049] The segment mapping and comparison module is used to execute S3: constrain the direction of the binary mask of the muscle region according to the muscle principal axis direction vector, divide the muscle region into continuous segments along the principal axis direction, determine the position of the axis of symmetry in the same musculoskeletal ultrasound image, mirror map one side of the segment, and determine the spatial correspondence with the corresponding segment on the other side to form a spatially overlapping distribution of muscle segments.

[0050] The segment consistency discrimination module is used to execute S4: based on the spatial overlap distribution of muscle segments, it judges the spatial consistency of corresponding muscle regions on the left and right or up and down in the segment, integrates the segment-level judgment results in the order of the main axis direction, and generates muscle segment symmetry judgment results.

[0051] The overall morphology summarization module is used to execute S5: call the muscle segment symmetry judgment results, summarize the judgment status corresponding to the segments, summarize the overall muscle segment distribution in the main axis direction, and form muscle morphology symmetry judgment results.

[0052] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0053] In this invention, the interface between muscle and fascia is identified by grayscale changes and a stable region is formed, reducing boundary uncertainty. A unified extension direction is determined based on the boundary distribution as a reference axis to ensure comparability under different imaging postures. Continuous segments are divided along the reference direction and mirror correspondence analysis is performed, enabling symmetry judgment to have segment-level positioning capability. Segment results are integrated to form distributed conclusions, supporting local anomaly identification and follow-up comparison. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is a schematic diagram of the steps of the present invention;

[0056] Figure 2 This is a detailed schematic diagram of S1 of the present invention;

[0057] Figure 3 This is a detailed schematic diagram of S2 of the present invention;

[0058] Figure 4 This is a detailed schematic diagram of S3 of the present invention;

[0059] Figure 5 This is a detailed schematic diagram of S4 of the present invention;

[0060] Figure 6This is a detailed schematic diagram of S5 of the present invention. Detailed Implementation

[0061] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0062] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0063] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0064] Please see Figure 1 This invention provides a method for extracting muscle morphological features and performing symmetry analysis using musculoskeletal ultrasound, comprising the following steps:

[0065] S1: Acquire a two-dimensional grayscale image of the target muscle captured by the ultrasound probe during musculoskeletal ultrasound examination, scan the grayscale distribution of the image pixels, identify the muscle boundary based on the grayscale changes at the interface between muscle tissue and fascia, mark the area enclosed by the boundary, and obtain a binary mask of the muscle region.

[0066] The target muscle refers to a single muscle tissue object that is selected by the operator or automatically located by a preset muscle anatomy model before musculoskeletal ultrasound examination and subjected to morphological symmetry analysis.

[0067] The muscle tissue-fascia interface refers to the image transition region formed between the muscle tissue region and the adjacent fascial structure in a two-dimensional ultrasound grayscale image, which has obvious grayscale abrupt changes or grayscale gradient changes.

[0068] Gray-level variation refers to the gray-level difference, gray-level gradient, or abrupt change in gray-level distribution between adjacent pixels or regions in an ultrasound image.

[0069] Muscle boundaries refer to the closed contours formed by multiple continuously distributed boundary pixels in a two-dimensional ultrasound image.

[0070] The muscle region binary mask refers to a binary image with the same size as the original two-dimensional ultrasound grayscale image. The pixels corresponding to the muscle region are assigned a first preset value, and the pixels corresponding to the non-muscle region are assigned a second preset value.

[0071] S2: Extract the corresponding boundary pixel coordinates based on the binary mask of the muscle region, analyze the spatial distribution of the boundary pixel coordinates in the ultrasound imaging plane, determine the extension direction of the muscle in the image, set the direction as a unified reference axis, and form the muscle principal axis direction vector.

[0072] Boundary pixel coordinates refer to the coordinate data extracted from the binary mask of the muscle region, used to represent the position of the muscle boundary pixels in the two-dimensional pixel coordinate system of the ultrasound image;

[0073] Spatial distribution refers to the overall orientation, arrangement trend, and main directional characteristics of the boundary pixel coordinates within the ultrasound imaging plane;

[0074] The extension direction refers to the direction in which the muscle extends in the image, determined by the principal direction distribution or major axis characteristics of the boundary pixel coordinates in the ultrasound imaging plane.

[0075] A unified reference axis refers to a reference coordinate axis set according to the direction of muscle extension or the direction of the muscle principal axis in the same musculoskeletal ultrasound image.

[0076] The muscle principal axis direction vector is a direction vector calculated based on the boundary pixel coordinate space distribution and used to represent the muscle extension direction.

[0077] S3: Constrain the direction of the binary mask of the muscle region according to the direction vector of the muscle principal axis, divide the muscle region into continuous segments along the principal axis, determine the position of the axis of symmetry in the same musculoskeletal ultrasound image, mirror the segment on one side, perform spatial registration with the corresponding segment on the other side, and determine the spatial correspondence to form a spatially overlapping distribution of muscle segments.

[0078] A segment refers to a local muscle region unit formed by continuously dividing the binary mask of the muscle region along the main axis of the muscle region according to a preset length, number of pixels or proportional relationship.

[0079] The position of the axis of symmetry refers to the position of the symmetrical reference axis determined in the same musculoskeletal ultrasound image based on the geometric center, principal axis direction, or overall morphological characteristics of the muscle region, and used for mirror mapping.

[0080] Spatial overlap distribution refers to the spatial overlap or correspondence between a segment on one side of a muscle region and its corresponding segment on the other side in the ultrasound imaging plane after mirroring the segment along the axis of symmetry.

[0081] S4: Based on the spatial overlap distribution of muscle segments, calculate the consistency index of the corresponding muscle regions on the left and right or upper and lower sides of each segment, and make a judgment based on the preset threshold used to distinguish between symmetrical and asymmetrical segments. Integrate and record the segment-level judgment results in the order of the main axis direction, and output the muscle segment symmetry judgment result.

[0082] Spatial consistency refers to the state in which corresponding muscle segments on the left and right or up and down meet the preset similarity judgment conditions in terms of area size, shape outline, position distribution or degree of overlap;

[0083] S5: Call the muscle segment symmetry determination results, summarize the determination status corresponding to the segments, summarize the segment distribution of the whole muscle in the main axis direction, and form the muscle morphology symmetry determination results.

[0084] The determination state refers to the segment symmetry judgment result obtained based on the spatial consistency analysis of muscle segments, including at least one of the following state indicators: symmetrical, asymmetrical, or partially symmetrical.

[0085] The result of muscle morphological symmetry determination refers to the comprehensive determination result formed after integrating the determination states corresponding to each muscle segment.

[0086] Please see Figure 2 The specific steps of S1 are as follows:

[0087] S101: Acquire a two-dimensional grayscale image of the target muscle captured by the ultrasound probe during musculoskeletal ultrasound examination. Read the grayscale value pixel by pixel for the two-dimensional grayscale image, record the grayscale intensity according to the pixel coordinate order, index and arrange the pixels, call the image width and height parameters to complete the index mapping, form the correspondence between grayscale value and spatial position, count the frequency of grayscale level occurrence within the grayscale value set and calculate the pixel proportion, and generate the pixel grayscale distribution ratio value.

[0088] Based on the two-dimensional grayscale imaging data of the target muscle acquired by the probe in the musculoskeletal ultrasound examination scenario, a single frame image is regarded as a regular pixel array with a width of W and a height of H, where W and H are output in real time by the imaging device. For example, W=512, H=512, then the total number of pixels N=W×H=262144. During the execution, each pixel is accessed point by point in a fixed order of row coordinates from top to bottom and column coordinates from left to right, and its grayscale intensity value g(i,j) is read one by one, where i represents the row index and j represents the column index. The grayscale value comes from the value of the ultrasound echo signal amplitude after quantization, and the quantization range is set to 0 to 255. During the reading process, the mapping relationship between the pixel number k=(i−1)×W+j and the pixel coordinates (i,j) and grayscale value g(i,j) is established simultaneously. After traversing all pixels, a step-by-step statistical operation is performed on the grayscale value set. Specifically, for each grayscale level L∈[0,255], the number of pixels n that satisfy g(i,j)=L is counted. _ L, and calculate the pixel percentage p using the total number of pixels N as the unified denominator. _ L=n _ L / N, in practical examples, for instance, yields the number of pixels corresponding to grayscale level L=80 as n. _ 80 = 10432, then its pixel ratio is p _80 = 10432 / 262144 ≈ 0.0398. All gray levels undergo the same counting and conversion process in sequence. The statistical results are recorded in a structured form during the paragraph execution process, forming the data content shown in Table 1.

[0089] Table 1. Statistical table of pixel grayscale distribution in two-dimensional grayscale images

[0090] 0 512 262144 0.00195 20 3840 262144 0.01465 40 9280 262144 0.03542 60 16736 262144 0.06383 80 10432 262144 0.03980 100 18944 262144 0.07226 120 22144 262144 0.08448 140 17312 262144 0.06604 160 9360 262144 0.03571 180 5120 262144 0.01953 200 2048 262144 0.00781 220 768 262144 0.00293 240 368 262144 0.00140

[0091] In this table, the number of pixels is obtained directly by counting each pixel, and the pixel percentage is calculated by dividing by the total number of pixels. All percentage values ​​satisfy the check relationship that the cumulative result is close to 1, thus forming a complete set of pixel grayscale distribution percentage values.

[0092] S102: Based on the pixel grayscale distribution ratio, detect the grayscale difference between adjacent pixels in the row and column directions, compare the grayscale difference with the set grayscale change threshold point by point in the muscle tissue and fascia interface area, filter the pixel positions that continuously exceed the threshold and record their coordinates, form a set of closed contour lines in the image based on the coordinates, and generate the muscle boundary coordinate set value.

[0093] After obtaining the pixel grayscale distribution ratio and the mapping relationship between pixel grayscale and spatial coordinates, for any non-boundary pixel (i, j) in the two-dimensional pixel array, the grayscale values ​​g(i, j+1) of its adjacent pixels in the row direction and g(i+1, j) in the column direction are read respectively. During the process, the difference operation is performed on the grayscale values ​​of adjacent pixels to calculate the grayscale difference Δ in the row direction. _ row(i,j) = |g(i,j+1)−g(i,j)| and the gray level difference Δ in the column direction _ col(i,j) = |g(i+1,j)−g(i,j)|, the absolute value operation is implemented by judging the sign of the difference and taking its magnitude. Then, the gray level change threshold T is calculated based on the pixel gray level distribution ratio. In the threshold calculation process, the overall gray level mean μ = Σ is calculated first. _ L(L×p) _ L), then calculate the grayscale standard deviation σ=[Σ _ L(p) _ L×(L−μ)^2)]^0.5, in the example data μ is approximately 92 and σ is approximately 18, so the threshold is set to T=μ+0.8σ≈106. During the point-by-point comparison process, when Δ _ row(i,j) or Δ _When col(i,j) is greater than the threshold T, the corresponding pixel coordinates (i,j) are recorded in the candidate set. During continuous scanning, the spatial continuity of the pixel is determined based on the eight-neighbor relationship in two-dimensional space. When multiple pixels that meet the conditions are connected end-to-end in space, and the Euclidean distance between the first and last pixels is less than or equal to the threshold T, the candidate pixel is selected. When the pixel sequence is determined to form a closed structure, the coordinates of all pixels in the closed structure are recorded in sequence to form a complete set of boundary coordinate values.

[0094] S103: Based on the set of muscle boundary coordinates, determine whether each pixel coordinate of the two-dimensional image is inside the closed contour line. Pixels inside the closed contour line are assigned an internal label value, and the remaining pixels are assigned an external label value. Reconstruct the pixel matrix according to the original image size, verify the integrity of the matrix, and obtain the binary mask of the muscle region.

[0095] After obtaining the set of coordinates of the closed boundary, this set of coordinates is regarded as a polygonal contour in a two-dimensional plane. For each pixel coordinate (i, j) in the original image, spatial position judgment is performed point by point. Specifically, a ray is emitted from the pixel (i, j) along the horizontal direction. The number of intersections between this ray and each line segment of the boundary polygon is counted. The intersection judgment is completed by comparing the relative relationship between the y coordinate of the ray and the y coordinate of the line segment endpoint and calculating whether the x coordinate of the intersection point is located to the right of the pixel. When the number of intersections is odd, the pixel is determined to be located inside the closed contour. When the number of intersections is even, it is determined to be located outside the closed contour. During the execution, a corresponding numerical label is generated for each pixel. The internal pixels are assigned a value of 1, and the external pixels are assigned a value of 0. All label results are written into a two-dimensional matrix with the same size as the original image according to the row and column index order of the original image. After the matrix is ​​constructed, the integrity is checked by counting whether the number of matrix elements is equal to W×H and checking whether there are any unassigned positions. After the verification is passed, a complete pixel matrix composed of 0 and 1 is obtained, which is used as a binary mask output covering the spatial range of the muscle region of the original image.

[0096] Please see Figure 3 The specific steps of S2 are as follows:

[0097] S201: Obtain the binary mask of the muscle region, select the pixel position marked as the foreground in the mask, perform the detection of the pixel values ​​in the upper, lower, left and right neighborhoods, call the relationship of pixel value changes in the upper, lower, left and right, judge the boundary conditions and filter the boundary pixel points, record the corresponding row and column index of the boundary pixel in the ultrasound imaging plane, and obtain the boundary pixel coordinate set.

[0098] Using the binary labeling results of the muscle region as input, the labeling results are treated as a two-dimensional matrix M with the same size as the original ultrasound image. Each element in the matrix takes only two values: 0 or 1. During execution, the image is scanned point by point in ascending order of row index from 1 to image height H and column index from 1 to image width W. When a pixel position (r, c) is scanned and its label value is 1, the neighboring pixel values ​​in the orthogonal directions are retrieved. Specifically, the label values ​​of the pixel above (r−1, c), the pixel below (r+1, c), the pixel to the left (r, c−1), and the pixel to the right (r, c+1) are read. Before performing the neighbor reading, the row and column indices are checked for validity. If r equals 1, the upper reading is skipped; if r equals H, the lower reading is skipped; if c equals 1, the left reading is skipped; and if c equals W, the right reading is skipped. After the valid neighbor pixel values ​​are read, the current pixel label value and the neighboring pixel values ​​in the four directions are respectively... The numerical comparison operation is performed by calculating the differences M(r,c)−M(r−1,c), M(r,c)−M(r+1,c), M(r,c)−M(r,c−1), and M(r,c)−M(r,c+1). When any difference result is equal to 1, it is determined that the current pixel is directly adjacent to the background pixel. In the actual example, a pixel is located at (r=240, c=180), its own label value is 1, the label value of the pixel below it is 0, and the label value of the other directions is 1. Then M(240, 180)−M(241, 180)=1, and the pixel meets the judgment condition. After confirming the condition, the row and column index value (240, 180) of the pixel is recorded in the boundary pixel coordinate set in an ordered pair form. The set is continuously expanded by sequential appending during the execution process. After completing the point-by-point scanning of the entire matrix, the boundary pixel coordinate set consisting of the coordinates of all pixels that satisfy the above neighborhood difference condition is obtained.

[0099] S202: Based on the boundary pixel coordinate set, calculate the projection span of the coordinates in the horizontal and vertical directions according to the numerical distribution of the coordinate points in the imaging plane, compare the magnitude of the span values ​​in the two directions, determine the axis corresponding to the extension direction, record the angle value range corresponding to the direction, and generate the angle range of the extension direction.

[0100] After obtaining the set of boundary pixel coordinates as the basic data, each boundary pixel in the set is represented as (x... _ i, y _ i), where x _ i corresponds to the column index value in the ultrasound imaging plane, y _ The value 'i' corresponds to the row index. During execution, numerical statistics are performed on the horizontal and vertical coordinate components. In the horizontal direction, all x values ​​are obtained through a series of comparisons. _ The minimum value x in i _ min and maximum value x _max, obtain all y values ​​in the vertical direction using the same comparison method. _ The minimum value y in i _ min and maximum value y _ In practical examples, x can be obtained statistically. _ min=110, x _ max=420, y _ min=140, y _ Given a maximum value of 360, after obtaining the extreme value, calculate the lateral projection span Δx = x. _ max−x _ min=310 and longitudinal projection span Δy=y _ max−y _ min=220. Then, Δx and Δy are compared. When Δx is greater than Δy, the horizontal axis direction corresponding to the main extension direction is recorded. When Δy is greater than Δx, the vertical axis direction corresponding to the main extension direction is recorded. In this example, 310 is greater than 220, so the horizontal axis direction is recorded as the main extension direction. The above extreme values, spans and comparison relationships are organized in the form of structured data during the execution process and directly integrated into the following statistical table to carry the source of each value and its comparison results in this paragraph.

[0101] Table 2. Statistics on the Determination of Boundary Pixel Coordinate Projection Span and Direction

[0102] Horizontal x 110 420 310 Larger than vertical span Vertical y 140 360 220 Smaller than horizontal span

[0103] After completing the span comparison, the directional offset ratio k = Δy / Δx ≈ 220 / 310 ≈ 0.71 is further calculated based on the span ratio relationship. The ratio is then converted into an angle offset θ through arctangent operation. The numerical calculation yields θ ≈ 35°. The angle interval corresponding to the main extension direction is recorded as [−35°, 35°] and stored as the input condition for subsequent direction vector calculation.

[0104] S203: Based on the angle range of the extension direction, the unit vector generation rule is called for the center angle value of the range to convert the angle value into a planar direction component, calculate the proportion of the direction vector component in the corresponding orthogonal coordinate system, and uniformly map it to the reference axis coordinate representation to establish the muscle principal axis direction vector.

[0105] After extending the directional angle range, the process first calculates the center angle of that range. Specifically, the starting and ending angles of the range are added together and then divided by 2 to obtain the center angle φ. In the example range [−35°, 35°], the center angle φ = (−35 + 35) / 2 = 0°. If the angle range spans 360°, the angle is first expanded and then the same calculation is performed. After obtaining the center angle φ, this angle value is used as input to perform directional component conversion. Specifically, the component ratio in the orthogonal coordinate system is calculated using trigonometric function numerical relationships. The lateral component is calculated using u... _ x is calculated using cos(φ), and the longitudinal component is obtained through u. _ y = sin(φ) is used to calculate u, and in the example where φ = 0°, u is obtained. _ x=1, u _ When y=0, u can be calculated in another example when φ=30°. _ x≈0.866、u _ After y≈0.5, the calculated values ​​are uniformly mapped to a reference coordinate system with the column direction of the image as the x-axis and the row direction as the y-axis, and u is adjusted accordingly. _ x²+u _ To check if y² equals 1, perform a sum of squares check. If the check passes, then (u _ x, u _ y) is recorded as ordered numerical pairs, and finally forms the principal axis direction vector used to characterize the overall extension direction of the muscle in the ultrasound imaging plane.

[0106] Please see Figure 4 The specific steps of S3 are as follows:

[0107] S301: Based on the muscle principal axis direction vector, constrain the direction of the binary mask of the muscle region, obtain the set of binary mask pixels of the muscle region in the same musculoskeletal ultrasound image, call the principal axis direction vector component, determine the consistency of the pixel coordinates with the principal axis direction vector, filter the pixels that meet the consistency of direction conditions, reconstruct the mask region based on the filtering results, and generate the direction constraint mask angle distribution value.

[0108] Based on the muscle principal axis direction vector and the corresponding binary mask of the muscle region as the starting conditions, the binary mask is represented as a two-dimensional pixel set R with the same size as the original musculoskeletal ultrasound image, where each foreground pixel is represented in coordinate form as (p _ i, q _ i), and represent the muscle principal axis direction vector as v = (v _ x, v _ y), whose components are derived from the numerical conversion results of the principal axis angle center value in the previous stage. During execution, the coordinates of all foreground pixels are first summed and divided by the total number of foreground pixels N to obtain the mask centroid coordinates (p_ c, q _ c), for example, calculating p when N=15000. _ c≈260, q _ c≈245, then construct the direction vector u relative to the centroid for any foreground pixel. _ i = (p _ i−p _ c, q _ i−q _ c), and calculate the magnitude |u| of the direction vector. _ i|, and simultaneously calculate u _ The dot product of i and the principal axis direction vector v is u _ i·v, then calculate the cosine of the included angle using the ratio of the dot product to the modulus and convert it to the included angle θ. _ i, in the example, for instance, when the pixel coordinates are (300, 260), can be used to obtain θ. _ When i is close to 0°, after calculating the included angle, θ _ i and direction threshold θ _ T performs point-by-point comparisons, with a direction threshold θ. _ T is determined based on the width of the directional angle interval obtained in the previous stage, and θ is taken when the angle interval is [−35°, 35°]. _ When T=35°, when θ _ When i is greater than 35°, the pixel is removed from set R; when θ is greater than 35°, the pixel is removed from set R. _ When i is less than or equal to 35°, the pixel is retained. During the execution process, the above calculation and comparison operations are repeated for all foreground pixels, and the retained pixels are rewritten into a new two-dimensional matrix. At the same time, the θ corresponding to all retained pixels is calculated. _ i performs statistical analysis to form an angle distribution record after direction constraint, and finally obtains the angle distribution value of the direction-constrained mask.

[0109] S302: Based on the orientation constraint mask angle distribution value, the mask area is projected along the main axis direction to obtain the pixel density sequence corresponding to the projection position. It is determined whether the pixel density difference between adjacent projection positions meets the continuity threshold. Projection positions that meet the continuity judgment condition are merged into the same segment to form a set of segments arranged along the main axis direction, and the position interval value of the continuous segment along the main axis is obtained.

[0110] After obtaining the directional constraint mask angle distribution values ​​and their corresponding pixel sets, all pixels satisfying the directional constraints are represented in coordinate form (p _ j, q _ j), and with the muscle principal axis direction vector v = (v _ x, v _ Using y as the projection reference direction, position projection calculation is performed for each pixel, and the projected position is calculated using scalars._ j=p _ j·v _ x+q _ j·v _ y is obtained, where the scalar represents the relative position of the pixel along the principal axis. In the example, if the pixel coordinates are (300, 260) and the principal axis component is (0.866, 0.5), its projected position is approximately 519.8. After completing the projection calculation for all pixels, all projected position values ​​are sorted, and the projection step size Δs=1 is set according to the pixel spatial resolution. The projection axis is discretized, and the number of pixels falling into each discrete projection interval is counted to obtain the pixel density sequence D={d} arranged along the principal axis. _ 1,d _ 2, ..., d _ During execution, the statistical results of some continuous projection positions are directly incorporated into the following table for recording, which is used to carry the correspondence between projection position, pixel density and adjacent difference.

[0111] Table 3. Statistics on Projection Position and Pixel Density Distribution along the Main Axis Direction

[0112] 1 [510,511) 5 2 2 [511,512) 7 1 3 [512,513) 8 1 4 [513,514) 9 1 5 [514,515) 10 0 6 [515,516) 10 1 7 [516,517) 9 1 8 [517,518) 8 5 9 [518,519) 3 2 10 [519,520) 1 —

[0113] After obtaining the pixel density sequence, the difference Δd is calculated for the pixel density at adjacent projection positions. _ k=|d _ k−d _ (k+1)|, and calculate the mean μ of all differences. _ d and standard deviation σ _ d, for example, calculate μ _ d≈2.1、σ _ Since d≈1.3, the continuous judgment threshold is set to d. _ T=μ _ d+σ _ d and rounded down to 3, when Δd _ When k is less than or equal to 3, adjacent projected positions are determined to belong to the same segment, when Δd _ When k is greater than 3, the continuity is determined to be interrupted. In the example, the difference between indices 1 to 7 all meet the condition, while the difference between indices 7 and 8 is 5, which does not meet the condition. Thus, the segment division is completed, and the starting and ending projection positions of each segment are used as the interval boundary records to obtain the interval values ​​of the continuous segment positions of the main axis.

[0114] S303: For the position interval values ​​of the main axis continuous segment, detect the left and right spatial symmetry of the pixel distribution in the same musculoskeletal ultrasound image, obtain the position coordinates of the symmetry axis, map the coordinates of one side segment to the mirror according to the symmetry axis, call the coordinate set of the mapped segment and the other side segment, calculate the pixel spatial overlap ratio between the corresponding segments, and determine the correspondence based on the overlap ratio threshold to generate the spatial overlap distribution of muscle segments.

[0115] After obtaining the position interval values ​​of the continuous segments of the principal axis, left-right spatial symmetry detection is performed on the distribution of the orientation-constrained mask pixels in the same musculoskeletal ultrasound image. Specifically, the orthogonal direction n = (−v) of the principal axis direction vector v is used. _ y, v _ x) is used as the reference direction for each reserved pixel coordinate (p) _ k, q _ k) Calculate its projection value t in the orthogonal direction. _ k=p _ k·(−v _ y)+q _ k·v _ x, after completing the calculation of all projection values, for all t _ k performs summation and divides by the total number of pixels M to obtain the mean t. _ c, as the numerical representation of the location of the axis of symmetry, in the example, is calculated to obtain t. _ c≈180, then using this axis of symmetry as a reference, perform mirror mapping on the pixel coordinates within any segment, and calculate δ. _ k=t _ k−t _ c and construct the mapping position t′ _ k=t _ c−δ _ k obtains the symmetrical position, and then the mapped projection result is back-calculated back to the original image coordinate system to form the coordinate set of the mapped segment. During the execution process, the actual pixel coordinate set of the mapped segment is compared point by point with the actual pixel coordinate set of the other segment, and the number of pixels that completely overlap is counted C. _ Overlap, and record the total number of pixels C in the original segment. _ Total, calculated by the overlap ratio ρ=C _ overlap / C _The total value is used to obtain the spatial overlap between segments. In the example, if a segment contains 200 pixels and the number of overlapping pixels is 148, then ρ≈0.74. This ratio is then compared with a preset overlap ratio threshold, which is obtained by averaging the overlap ratios of all segments. For example, if the average value is 0.62, then segments with ρ greater than or equal to 0.62 are recorded as segments with corresponding relationships. Finally, the spatial overlap distribution of muscle segments is formed by the overlap ratios of each segment and their spatial correspondences.

[0116] Please see Figure 5 The specific steps of S4 are as follows:

[0117] S401: Based on the spatial overlap distribution of muscle segments, obtain the overlap area value and overlap ratio value of the corresponding muscle regions on the left and right sides. Extract the spatial proportion of the left and right regions in the same segment and perform numerical pairing. Extract the spatial proportion value of the left and right regions in the same segment. Perform numerical pairing on the spatial proportion values ​​of the left and right regions. Call the paired overlap ratio value to perform difference calculation and generate segment spatial overlap difference value.

[0118] Based on the spatial overlap distribution of muscle segments as a starting point, the distribution result is considered as a data set consisting of multiple segments arranged along the main axis of the muscle. Each segment corresponds to the pixel distribution of the left and right muscle regions at the same main axis position. During the execution process, the number of pixels in the left and right muscle regions is first counted for a single segment, and the number of pixels on the left is denoted as A. _ L, the number of pixels on the right is denoted as A. _ R is calculated by cumulatively adding up all foreground pixels within a segment that satisfy the directional and spatial constraints. For example, in a segment, the number of pixels on the left is 820 and the number of pixels on the right is 790. After counting the left and right pixels, the number of pixels on the left and right sides that completely overlap in spatial coordinates within the segment is further counted, denoted as A. _ O, this value comes from the coordinate comparison results after the left and right segments were mirrored in the previous stage, for example, statistically obtaining A _ O=610, after obtaining A _ L, A _ R and A _ After O, calculate the space proportions of the left and right sides within this section, and the space proportion P of the left side. _ L through A _ O and A _ The right-side space occupancy P is obtained by dividing L by the other phase. _ R through A _ O and A _ By dividing R, P can be calculated in the above example. _ L≈610 / 820≈0.744, P _R≈610 / 790≈0.772, then the left and right spatial proportions within the same segment are numerically paired to form (P _ L, P _ R) Paired data structures, during execution, a difference operation is performed on the pairing results, the difference is defined as ΔP=|P _ L−P _ R|, the absolute value operation is performed by directly comparing P. _ L and P _ After taking the positive difference from the value of R, in the example, we get ΔP≈|0.744−0.772|≈0.028. The above pixel count statistics, spatial proportion calculation and difference operation results are directly integrated into the following table in a structured form during the execution process to record the intermediate calculation quantities and difference results of each segment.

[0119] Table 4. Statistical Table of Spatial Overlap and Differences of Muscle Regions on the Left and Right Sides of the Section

[0120] 1 820 790 610 0.744 0.772 0.028 2 765 780 602 0.787 0.772 0.015 3 710 695 498 0.701 0.717 0.016 4 680 640 430 0.632 0.672 0.040

[0121] After completing the table records, repeat the above steps of pixel statistics, ratio calculation, numerical pairing and difference operation for all segments, and finally form a set of segment spatial overlap difference values ​​with segment index as the corresponding relationship and spatial overlap difference value as the core data content.

[0122] S402: Based on the difference value of spatial overlap of the segments, call the consistency threshold and compare them one by one to determine the size of the difference value and the consistency threshold. Output the corresponding consistency or inconsistency judgment mark for the muscle segment, and summarize the judgment mark set of the segment to obtain the segment consistency judgment state set.

[0123] After obtaining the set of spatial overlap difference values ​​for the segment, this set is represented as a combination of multiple difference values ​​ΔP. _ The sequence consisting of k, where k represents the sequence number of the segment along the main muscle axis, is first statistically analyzed during execution. This is done by analyzing all ΔP values. _ The summation of k and divided by the total number of segments K yields the mean difference value μ. _ P, simultaneously for each ΔP _ The standard deviation σ is obtained by summing the squared deviations between k and the mean, taking the average, and then taking the square root. _ For example, in the case where K=4, μ can be calculated based on the data in Table 6. _ P≈(0.028+0.015+0.016+0.040) / 4≈0.02475, further calculate σ _ P≈0.010, after obtaining the mean and standard deviation, the consistency threshold is set to T. _ C=μ _ P+σ _P≈0.035, and this threshold is used as the benchmark for subsequent item-by-item comparisons. During the execution process, the difference value ΔP for each segment is calculated. _ k and threshold T _ C performs a numerical comparison when ΔP _ k is less than or equal to T _ When C, this segment is marked as a consistent state and assigned a value of 1. When ΔP _ k is greater than T _ When C, the segment is marked as inconsistent and assigned a value of 0. In the example, the difference value of segment 1 is 0.028, which is less than 0.035, and is marked as 1. The difference value of segment 4 is 0.040, which is greater than 0.035, and is marked as 0. After completing the comparison and marking operations of all segments in sequence, the segment number and the corresponding judgment mark are associated and stored one by one, and finally a complete set of segment consistency judgment states is formed.

[0124] S403: The segment consistency determination state set is arranged according to the muscle principal axis order, the determination states are continuously recorded and segment sequence identifiers are formed, and muscle segment symmetry determination results are generated.

[0125] After obtaining the segment consistency determination state set, the state set is arranged according to the spatial order of the segments along the muscle principal axis. The arrangement is based on the numerical value of the starting position of each segment on the principal axis projection coordinate axis, with segments with smaller starting positions arranged first and segments with larger starting positions arranged last. After sorting, an ordered determination label sequence {C} is obtained. _ 1, C _ 2, ..., C _ K}, where each C _ k is either 0 or 1. During execution, the sequence is read sequentially and recorded continuously. The judgment marks of adjacent segments are directly concatenated to form the segment sequence identifier. For example, in the example with K=4, if the sorted judgment marks are {1, 1, 1, 0}, the recorded segment sequence identifier is "1110". This sequence identifier is entirely derived from the arrangement result of the segment consistency judgment state set, without introducing new calculation steps. After completing the sequential recording of all segment marks, the generated segment sequence identifier is saved as the final output content to obtain the muscle segment symmetry judgment result.

[0126] Please see Figure 6 The specific steps of S5 are as follows:

[0127] S501: Call the muscle segment symmetry determination result, obtain the segment left and right side symmetry determination mark value, read the symmetry determination mark value for the segment and map the value, complete the segment state determination according to the symmetry consistency threshold and record the corresponding state code, and generate the segment symmetry state value.

[0128] Based on the muscle segment symmetry determination result as the starting point, this result is considered as a set of multiple segments divided along the muscle's main axis. Each segment corresponds to a symmetry determination mark for the left and right muscle regions. During execution, the corresponding left and right side determination mark values ​​are read one by one for the segment index k from 1 to the total number of segments K. This mark comes from the segment consistency determination state set of the previous stage and is represented in numerical form, where a consistent state is mapped to 1 and an inconsistent state is mapped to 0. After reading, the left and right side mark values ​​S are obtained for the k-th segment. _ L(k) and S _ R(k), and then the above marker values ​​are uniformly mapped to the segment-comparable state code E. _ L(k) and E _ R(k) is mapped according to the rule that a consistent state corresponds to code 1, and an inconsistent state corresponds to code 0. After mapping is completed, the difference operation is performed on the left and right state codes within the same segment to calculate the difference ΔE(k) = |E _ L(k)−E _ R(k)|, the absolute value is obtained by taking the positive difference after numerical comparison. In the example, if the left and right codes of a certain segment are both 1, then ΔE=0; if the left and right codes are 1 and 0 respectively, then ΔE=1. A symmetric consistency threshold T is introduced during the execution process. _ S is used to constrain the segment state judgment. This threshold is obtained by statistically analyzing the differences ΔE(k) of all segments. For example, when K=8, the mean value μ of the ΔE sequence is obtained. _ E=0.25, standard deviation σ _ If E≈0.43, then T _ S is set to μ _ E+σ _ When E≈0.68 and rounded to 1, during segment-by-segment judgment, if ΔE(k) is less than or equal to T... _ When S, the segment is marked as symmetrical and assigned the segment state code C(k) = 1. When ΔE(k) is greater than T, _ When S, the segment is marked as asymmetric and assigned the value C(k) = 0. During the execution process, the mark reading, numerical mapping, difference calculation and threshold comparison operations are repeated for all segments. The state code of each segment is recorded in correspondence with its segment index, and finally a complete set of segment symmetric state values ​​is formed.

[0129] S502: Based on the symmetrical state value of the segment, obtain the corresponding position index of the segment in the main axis direction, perform sequential arrangement on the state code and position index, summarize the segment state according to the main axis direction order and count the number of continuous distributions, and generate the main axis segment distribution coefficient.

[0130] After obtaining the set of symmetric state values ​​of the segments, the set is jointly processed with the spatial position index of the segments in the muscle principal axis direction. During the execution process, the position index P(k) of each segment in the principal axis direction is read first. This index comes from the previous principal axis projection and segment division results and is used to characterize the relative arrangement order of the segments in the principal axis direction. In the example, the segment position indices are {12, 24, 37, 49, 62, 75, 88, 101}. Then, the state code C(k) of each segment is combined with its position index P(k) to form an ordered pair (P(k), C(k)). After the combination is completed, all segments are ordered according to the size of the position index. The sorting is completed by comparing the position index item by item during the sorting process. No additional calculation steps are introduced. The sorted segment state and position information are directly organized into the following table during the execution process to carry the relationship between the segment order and state distribution.

[0131] Table 5. Statistical Table of Segment Location and Status in the Main Axis Direction

[0132] 1 1 12 1 A 2 2 24 1 A 3 3 37 1 A 4 4 49 0 B 5 5 62 0 B 6 6 75 1 C 7 7 88 1 C 8 8 101 0 D

[0133] After completing the sequential arrangement, continuous distribution statistics are performed on the segment status codes arranged along the main axis in the table. Specifically, the status code column is scanned from top to bottom. When adjacent segments have the same status code, they are grouped into the same continuous segment. When the status code changes, a new continuous segment is created. In the example, continuous segment A has a length of 3, continuous segment B has a length of 2, continuous segment C has a length of 2, and continuous segment D has a length of 1. After the statistics are completed, the lengths of all continuous segments are extracted, and the maximum continuous length L is determined. _ max=3, then calculate the main axis segment distribution coefficient D based on the total number of segments K=8. _ S=L _ max / K=3 / 8≈0.375, which finally yields the main axis segment distribution coefficient used to describe the degree of continuous distribution of segment states along the main axis direction.

[0134] S503: Based on the distribution coefficient of the main axis segment, call the segment status code and the main axis position order, determine the consistency of segment distribution and calculate the overall deviation ratio value, complete the overall induction based on the corresponding judgment interval of the ratio value, and generate the muscle morphology symmetry judgment result.

[0135] After obtaining the distribution coefficient of the main axis segment, this coefficient, together with the segment state coding sequence and its main axis position order, is used as input conditions to perform overall distribution consistency judgment and deviation ratio calculation. During the execution process, the number N of segments with state 1 in the segment state coding sequence is first counted. _ 1 and the number of segments with a state of 0, N _ 0, where N _ 1+N _0 equals the total number of segments K, in the example K=8, N _ 1=5, N _ 0=3, then based on the main axis segment distribution coefficient D _ S categorizes the degree of concentration of state distribution into intervals, with interval division rules set as D. _ S≤0.3 corresponds to the dispersion interval, 0.3 <D _ S≤0.6 corresponds to a moderately concentrated interval, D _ S>0.6 corresponds to a highly concentrated interval, in the example D _ S≈0.375 falls within the moderate concentration interval; subsequently, the overall deviation ratio R is calculated. _ D, this ratio is determined by the number of asymmetric state segments N. _ 0 is obtained by dividing the total number of segments K, i.e., R _ D=N _ 0 / K = 3 / 8 ≈ 0.375. After completing the calculation, R... _ D is compared with the preset judgment interval, and the judgment interval is divided into R. _ D≤0.25, 0.25 <R _ D≤0.5、R _ In the example, R is in the three-level range where D>0.5. _ When D≈0.375 falls into the middle interval, only numerical calculations and interval assignment judgments are performed during the execution process, and the segment distribution coefficient D is set. _ S, Overall Deviation R _ D and its corresponding interval are recorded as the same judgment result entry, and finally the muscle morphology symmetry judgment result corresponding to the muscle in the current musculoskeletal ultrasound image is generated.

[0136] A musculoskeletal ultrasound system for extracting muscle morphological features and analyzing symmetry includes:

[0137] The image grayscale localization module is used to perform S1: acquire a two-dimensional grayscale image of the target muscle collected by the ultrasound probe during musculoskeletal ultrasound examination, scan the grayscale distribution of the image pixels, identify the muscle boundary based on the grayscale changes at the interface between muscle tissue and fascia, mark the area enclosed by the boundary, and obtain a binary mask of the muscle region.

[0138] The main axis direction determination module is used to execute S2: extract the corresponding boundary pixel coordinates based on the binary mask of the muscle region, analyze the spatial distribution of the boundary pixel coordinates in the ultrasound imaging plane, determine the extension direction of the muscle in the image, set the direction as a unified reference axis, and form the muscle main axis direction vector.

[0139] The segment mapping and comparison module is used to execute S3: constrain the direction of the binary mask of the muscle region according to the muscle principal axis direction vector, divide the muscle region into continuous segments along the principal axis direction, determine the position of the axis of symmetry in the same musculoskeletal ultrasound image, mirror map one side of the segment, and determine the spatial correspondence with the corresponding segment on the other side to form a spatially overlapping distribution of muscle segments.

[0140] The segment consistency discrimination module is used to execute S4: based on the spatial overlap distribution of muscle segments, it judges the spatial consistency of corresponding muscle regions on the left and right or up and down in the segment, integrates the segment-level judgment results in the order of the main axis direction, and generates muscle segment symmetry judgment results.

[0141] The overall morphology summarization module is used to execute S5: call the muscle segment symmetry judgment results, summarize the judgment status corresponding to the segments, summarize the overall muscle segment distribution in the main axis direction, and form muscle morphology symmetry judgment results.

[0142] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for extracting and analyzing the morphological features of musculoskeletal ultrasound muscles, characterized in that, Includes the following steps: S1: Acquire two-dimensional grayscale ultrasound images of the target muscle, statistically analyze pixel grayscale distribution and perform noise reduction and enhancement, extract muscle boundaries based on grayscale gradient abrupt changes at the interface between muscle tissue and fascia, mark the enclosed area after connectivity and closure processing, and generate a binary mask of the muscle region. S2: Extract the boundary pixel coordinates from the binary mask of the muscle region, calculate the main distribution trend of the boundary pixel coordinates in the imaging plane, determine the muscle extension direction and set it as a unified reference axis, and construct the muscle principal axis direction vector. S3: Constrain the direction of the binary mask of the muscle region according to the muscle principal axis direction vector and perform rotation correction. Divide the muscle region into continuous segments along the principal axis, locate the image symmetry axis, mirror map one side segment, and determine the spatial correspondence with the corresponding segment on the other side to form a spatially overlapping distribution of muscle segments. S4: Calculate the consistency index of the corresponding muscle regions on both sides of the segment based on the spatial overlap distribution of the muscle segments, determine the symmetry status of the segment by combining the threshold, integrate the segment results in the order of the main axis and record them, and output the muscle segment symmetry determination result. S5: Call the muscle segment symmetry determination results, summarize the segment determination status, summarize the segment distribution and abnormal concentration positions and proportions in the main axis direction, and generate muscle morphology symmetry determination results.

2. The method for extracting and analyzing the morphological features of musculoskeletal ultrasound muscles according to claim 1, characterized in that, The muscle region binary mask includes a foreground mask matrix, a background mask matrix, and a mask effective range identifier; the muscle principal axis direction vector includes a reference axis definition, direction angle parameters, and unit vector components; the muscle segment spatial overlap distribution includes an overlap region set, a spatial correspondence mapping table, and an overlap degree distribution matrix; the muscle segment symmetry determination result includes a segment symmetry status label, a segment determination score, and a segment integration sequence identifier; the muscle morphology symmetry determination result includes an overall symmetry level, a principal axis segment distribution overview, and an overall morphological difference indicator.

3. The method for extracting and analyzing the morphological features of musculoskeletal ultrasound muscles according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Acquire a two-dimensional grayscale image of the target muscle captured by the ultrasound probe during musculoskeletal ultrasound examination. Read the grayscale value pixel by pixel in the two-dimensional grayscale image, record the grayscale intensity according to the pixel coordinate order, index and arrange the pixels, call the image width and height parameters to complete the index mapping, form the correspondence between grayscale value and spatial position, count the frequency of grayscale level occurrence within the grayscale value set and calculate the pixel proportion, and generate the pixel grayscale distribution ratio value. S102: Based on the pixel grayscale distribution ratio, detect the grayscale difference between adjacent pixels in the row and column directions, compare the grayscale difference with the set grayscale change threshold point by point in the muscle tissue and fascia junction area, filter the pixel positions that continuously exceed the threshold and record their coordinates, form a set of closed contour lines in the image based on the coordinates, and generate a set of muscle boundary coordinate values. S103: Based on the set of muscle boundary coordinates, determine whether each pixel coordinate of the two-dimensional image is located inside the closed contour line. Pixels located inside the closed contour line are assigned an internal marker value, and the remaining pixels are assigned an external marker value. Reconstruct the pixel matrix according to the original image size, verify the integrity of the matrix, and obtain a binary mask of the muscle region.

4. The method for extracting and analyzing the morphological features of musculoskeletal ultrasound muscles according to claim 3, characterized in that, The specific steps of S2 are as follows: S201: Obtain the binary mask of the muscle region, select the pixel position marked as the foreground in the mask, perform the detection of the value of the neighboring pixels in the upper, lower, left and right, call the value change relationship of the upper, lower, left and right pixels, judge the boundary conditions and filter the boundary pixel points, record the corresponding row and column index of the boundary pixels in the ultrasound imaging plane, and obtain the boundary pixel coordinate set. S202: Based on the boundary pixel coordinate set, according to the numerical distribution of coordinate points in the horizontal and vertical directions in the imaging plane, calculate the projection span of the coordinates in the horizontal and vertical directions, compare the magnitude of the span values ​​in the two directions, determine the axis corresponding to the extension direction, record the angle value range corresponding to the direction, and generate the angle range of the extension direction. S203: Based on the extended direction angle range, the unit vector generation rule is called for the center angle value of the range to convert the angle value into a planar direction component, calculate the proportion of the direction vector component in the corresponding orthogonal coordinate system, and uniformly map it to the reference axis coordinate representation to establish the muscle principal axis direction vector.

5. The method for extracting and analyzing the morphological features of musculoskeletal ultrasound muscles according to claim 4, characterized in that, The specific steps for S3 are as follows: S301: Based on the muscle principal axis direction vector constraining the direction of the binary mask of the muscle region, obtain the set of binary mask pixels of the muscle region in the same musculoskeletal ultrasound image, call the principal axis direction vector component, determine the consistency of the pixel coordinates with the principal axis direction vector, filter pixels that meet the consistency of direction conditions, reconstruct the mask region based on the filtering results, and generate the direction constraint mask angle distribution value. S302: Based on the directional constraint mask angle distribution value, project the mask area along the main axis direction to obtain the pixel density sequence corresponding to the projection position, determine whether the pixel density difference between adjacent projection positions meets the continuity threshold, merge the projection positions that meet the continuity determination condition into the same segment, form a set of segments arranged along the main axis direction, and obtain the position interval value of the main axis continuous segment. S303: For the position interval values ​​of the continuous segment of the main axis, detect the left and right spatial symmetry of the pixel distribution in the same musculoskeletal ultrasound image, obtain the position coordinates of the axis of symmetry, map the coordinates of one side segment to the mirror image according to the axis of symmetry, call the coordinate set of the mapped segment and the other side segment, calculate the pixel spatial overlap ratio between the corresponding segments, and determine the correspondence based on the overlap ratio threshold to generate the spatial overlap distribution of muscle segments.

6. The method for extracting and analyzing the morphological features of musculoskeletal ultrasound muscles according to claim 5, characterized in that, The specific steps of S4 are as follows: S401: Based on the spatial overlap distribution of the muscle segments, obtain the overlap area value and overlap ratio value of the corresponding muscle regions on the left and right sides, extract the spatial proportion of the left and right regions in the same segment and perform numerical pairing, extract the spatial proportion value of the left and right regions in the same segment, complete the numerical pairing of the spatial proportion values ​​of the left and right regions, call the paired overlap ratio value to perform difference calculation, and generate the segment spatial overlap difference value. S402: Based on the spatial overlap difference value of the segment, call the consistency threshold and compare it item by item to determine the size of the difference value and the consistency threshold. Output the corresponding consistency or inconsistency judgment mark for the muscle segment, and summarize the judgment mark set of the segment to obtain the segment consistency judgment state set. S403: The segment consistency determination state set is arranged according to the muscle principal axis order, the determined states are continuously recorded and segment sequence identifiers are formed, and muscle segment symmetry determination results are generated.

7. The method for extracting and analyzing the morphological features of musculoskeletal ultrasound muscles according to claim 6, characterized in that, The specific steps of S5 are as follows: S501: Call the symmetry determination result of the muscle segment, obtain the symmetry determination mark value of the left and right sides of the segment, read the symmetry determination mark value of the segment and map the value, complete the segment state judgment according to the symmetry consistency threshold and record the corresponding state code, and generate the segment symmetry state value. S502: Based on the symmetrical state value of the segment, obtain the corresponding position index of the segment in the main axis direction, perform sequential arrangement on the state code and position index, summarize the segment state according to the main axis direction order and count the number of continuous distributions, and generate the main axis segment distribution coefficient. S503: Based on the main axis segment distribution coefficient, call the segment status code and main axis position order, determine the consistency of segment distribution and calculate the overall deviation ratio value, complete the overall induction based on the ratio value corresponding to the judgment interval, and generate the muscle morphology symmetry judgment result.

8. The method for extracting muscle morphological features and analyzing symmetry using ultrasound as described in claim 7, characterized in that, The target muscle refers to a single muscle tissue object that is selected by the operator or automatically located by a preset muscle anatomy model before musculoskeletal ultrasound examination and subjected to morphological symmetry analysis. The muscle tissue-fascia interface refers to the image transition region with obvious gray-level abrupt changes or gray-level gradient changes formed between the muscle tissue region and the adjacent fascial structure in a two-dimensional ultrasound grayscale image. The grayscale variation refers to the grayscale difference, grayscale gradient, or abrupt change in grayscale distribution between adjacent pixels or regions in an ultrasound image. The muscle boundary refers to the closed contour formed by multiple continuously distributed boundary pixels in a two-dimensional ultrasound image. The muscle region binary mask refers to a binary image with the same size as the original two-dimensional ultrasound grayscale image. The pixels corresponding to the muscle region are assigned a first preset value, and the pixels corresponding to the non-muscle region are assigned a second preset value. The boundary pixel coordinates refer to the coordinate data extracted from the binary mask of the muscle region, which represents the position of the muscle boundary pixels in the two-dimensional pixel coordinate system of the ultrasound image. The spatial distribution refers to the overall orientation, arrangement trend, and main directional characteristics of the boundary pixel coordinates within the ultrasonic imaging plane. The extension direction refers to the direction in which the muscle extends in the image, determined by the principal direction distribution or long axis features of the boundary pixel coordinates in the ultrasound imaging plane. The unified reference axis refers to the reference coordinate axis set according to the muscle extension direction or the muscle principal axis direction in the same musculoskeletal ultrasound image; The muscle principal axis direction vector refers to the direction vector used to represent the muscle extension direction, which is calculated based on the boundary pixel coordinate space distribution.

9. The method for extracting and analyzing the morphological features of musculoskeletal ultrasound muscles according to claim 8, characterized in that, The segment refers to a local muscle region unit formed by continuously dividing the binary mask of the muscle region along the main axis of the muscle region according to a preset length, number of pixels or proportional relationship. The symmetry axis position refers to the symmetry reference axis position in the same musculoskeletal ultrasound image, determined based on the geometric center, principal axis direction, or overall morphological characteristics of the muscle region, and used for mirror mapping. The spatial overlap distribution refers to the spatial overlap or correspondence between a segment on one side of the muscle region and the corresponding segment on the other side in the ultrasound imaging plane after mirroring the segment along the axis of symmetry. Spatial consistency refers to the state in which corresponding muscle segments on the left and right or up and down meet preset similarity criteria in terms of area size, shape, location distribution, or degree of overlap. The determination state refers to the segment symmetry determination result obtained based on the spatial consistency analysis of muscle segments, including at least one of the state identifiers of symmetry, asymmetry, or partial symmetry. The muscle morphology symmetry determination result refers to the comprehensive determination result formed after integrating the determination states corresponding to each muscle segment.

10. A musculoskeletal ultrasound system for extracting muscle morphological features and analyzing symmetry, characterized in that... The system is used to implement the musculoskeletal ultrasound muscle morphology feature extraction and symmetry analysis method according to any one of claims 1-9, and the system includes: The image grayscale localization module is used to perform S1: acquire a two-dimensional grayscale image of the target muscle collected by the ultrasound probe during musculoskeletal ultrasound examination, scan the grayscale distribution of the image pixels, identify the muscle boundary based on the grayscale changes at the interface between muscle tissue and fascia, mark the area enclosed by the boundary, and obtain a binary mask of the muscle region. The main axis direction determination module is used to execute S2: extract the corresponding boundary pixel coordinates based on the binary mask of the muscle region, analyze the spatial distribution of the boundary pixel coordinates in the ultrasound imaging plane, determine the extension direction of the muscle in the image, set the direction as a unified reference axis, and form the muscle main axis direction vector. The segment mapping and comparison module is used to perform S3: constrain the direction of the binary mask of the muscle region according to the muscle principal axis direction vector, divide the muscle region into continuous segments along the principal axis direction, determine the position of the axis of symmetry in the same musculoskeletal ultrasound image, mirror map one side segment, and determine the spatial correspondence with the corresponding segment on the other side to form a spatially overlapping distribution of muscle segments. The segment consistency discrimination module is used to execute S4: based on the spatial overlapping distribution of the muscle segments, determine the spatial consistency of the corresponding muscle regions on the left and right or up and down in the segment, integrate the segment-level judgment results in the order of the main axis direction, and generate the muscle segment symmetry judgment result. The overall morphology summarization module is used to execute S5: call the muscle segment symmetry determination results, summarize the determination states corresponding to the segments, summarize the overall muscle segment distribution in the main axis direction, and form muscle morphology symmetry determination results.