A method for calculating parameters of hip replacement surgery
Through deep learning and image processing technology, automatically identify and calculate the key parameters in hip replacement surgery, solve the problem of inaccurate parameters in existing technologies, and improve the accuracy and efficiency of surgery.
Patent Information
- Application Number
- CN202411524013.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-30
AI Technical Summary
In existing hip replacement surgery, the determination of surgical parameters depends on the doctor's clinical experience, which can easily lead to inaccurate parameter settings and high error rate, which affects the treatment effect and patient's postoperative recovery.
Using deep learning and image processing technology, a rough segmentation model, vertebral segmentation model, and pelvic point recognition model are used through UNET network training to automatically identify the vertebral area, pelvic area and physiological key points in the hip image of patients, and calculate related surgery parameter.
The automation calculation of surgical parameters has been achieved, the accuracy and efficiency of surgery are improved, the dependence of doctors' manual measurement is reduced, and the error rate is reduced.
Smart Images

Figure CN119067995B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method for calculating parameters of hip replacement surgery. Background Art
[0002] Hip replacement surgery is a mature and reliable treatment method that uses bone cement and screws to fix an artificial prosthesis, including the femoral part and the acetabulum, to normal bones to replace the diseased joint and reconstruct the normal function of the patient's hip joint. How to accurately determine the various parameters during the operation so that the replaced hip joint can maintain a good linkage relationship with the patient's spine and pelvis is one of the keys to the success of the operation.
[0003] The determination of various existing parameters is mostly done by manual measurement by doctors, which relies heavily on the doctors' clinical experience. This method can easily lead to inaccurate surgical parameter settings and a high error rate, thus affecting the treatment effect and being detrimental to the patient's postoperative recovery. Summary of the invention
[0004] Purpose of the invention: In view of the above-mentioned deficiencies, the present invention proposes a method for calculating hip replacement surgery parameters, which can realize the automatic calculation of surgical parameters, provide guidance for hip replacement surgery, and improve surgical accuracy and efficiency.
[0005] Technical solution: The present invention provides a method for calculating hip replacement surgery parameters, comprising:
[0006] S1. Obtain hip joint images of several patients, extract grayscale distribution features thereof, input the images into a UNet network for training to obtain a rough segmentation model, and segment the vertebral region and pelvic region of the hip joint images of the patients through the rough segmentation model;
[0007] The pelvic region of the vertebral body region is clipped respectively, and the vertebral segment part in the vertebral body region is clipped using the bounding box, which is input into the UNet network training to obtain the vertebral segmentation model;
[0008] Mark the key points in the pelvic area and map the marked key points to the Gaussian sphere to obtain a marked image, which is then input into a random configuration network for training to obtain a pelvic point recognition model;
[0009] S2, obtaining the patient's hip joint image and correcting it, inputting it into the rough segmentation model trained by S1, segmenting the vertebral body region and pelvic region, cropping the vertebral body region and pelvic region respectively, and inputting the vertebral segmentation model and pelvic point recognition model trained by S1 respectively, thereby obtaining the vertebral segmentation image and the physiological key points of the pelvic region respectively;
[0010] S3. Calculate relevant surgical parameters based on the vertebral segmentation image and physiological key points of the pelvic region obtained in S2.
[0011] Specifically, the vertebral segmentation images obtained by S2 are lumbar vertebra L1 images and sacrum S1 images, and the physiological key points of the pelvic region are the feature points A of the bilateral anterior superior iliac spines P1, P2 and pubic symphysis and the midpoint B of the center lines of the femoral heads on both sides;
[0012] The related surgical parameters include pelvic tilt angle PT, sacral tilt angle SS, pelvic index PI and lumbar lordosis LL, which are calculated by obtaining the physiological key points.
[0013] More specifically, the pelvic tilt angle is the angle between the line between the midpoint P′ of the line connecting points P1 and P2 and point A and the head-foot direction of the human body, or the angle between the line between point B and the midpoint of the upper end plate of the sacrum S1 and the head-foot direction of the human body; wherein the position of the upper end plate of the sacrum S1 is automatically detected by a deep learning method;
[0014] The sacral inclination angle is the angle between the tangent line of the upper end plate of the sacrum S1 and the horizontal line;
[0015] The pelvic index is the angle between the line between point B and the midpoint of the upper endplate of the sacrum S1 and the straight line perpendicular to the upper endplate of the sacrum S1 and passing through the midpoint;
[0016] The lumbar lordosis is the angle between the tangent line of the upper end plate of the lumbar vertebra L1 and the tangent line of the upper end plate of the sacrum S1; wherein the position of the upper end plate of the lumbar vertebra L1 is automatically detected by a deep learning method.
[0017] Furthermore, the positions of the upper endplate of the lumbar vertebra L1 and the upper endplate of the sacrum S1 are automatically detected by the deep learning method, as follows:
[0018] (1) Use a one-dimensional Sobel filter to detect the boundaries of lumbar vertebrae L1, L5, and sacrum S1 in the segmented lumbar vertebrae L1 image and sacrum S1 image respectively;
[0019] (2) Perform Hough straight line transform on the boundaries detected in step (1), extract the straight lines, and associate each straight line with the corresponding vertebral segment based on the segmentation result of the vertebral segmentation model to obtain the upper and lower edges of each vertebral segment;
[0020] (3) Based on the positions of the upper edges of the lumbar vertebra L1 and the sacrum S1 obtained in step (2), the positions of the upper end plates of the lumbar vertebra L1 and the sacrum S1 are obtained.
[0021] Furthermore, the step (3) is specifically as follows:
[0022] (31) In combination with the positions of the upper edges of the lumbar vertebra L1 and the sacrum S1 obtained in step (2), pixels and their pixel values within the upper set range of the lumbar vertebra L1 and the sacrum S1 are extracted from the lumbar vertebra L1 image and the sacrum S1 image obtained by the vertebral segmentation model, and these pixels are divided into a foreground pixel set Fg and a background pixel set Bg;
[0023] (32) Count the histograms of the pixel values in the foreground pixel set Fg and the background pixel set Bg respectively, and calculate the pixel value I with the largest distribution in the foreground pixel set Fg and the background pixel set Bg. fg and I bg , calculate I fg and I bg The median value I th as a demarcation threshold;
[0024] (33) In the lumbar vertebra L1 image and sacral S1 image obtained by the vertebral segmentation model, the pixels within the upper set range of the lumbar vertebra L1 and the sacral S1 are respectively extracted to form corresponding images, and the demarcation threshold I th Create a contour line;
[0025] (34) Use the least squares method to fit the points on the contour line created in step (33) to obtain the corresponding straight line, that is, the upper edge of the lumbar vertebra L1 and the sacrum S1;
[0026] (35) Substitute the positions of the two end points of the upper edge of the lumbar vertebra L1 and the sacrum S1 obtained in step (2) into the straight line equation obtained in step (34), and the edge positions of the lumbar vertebra L1 and the sacrum S1 are obtained, and then the midpoints of the lumbar vertebra L1 and the sacrum S1, as well as the direction of the upper end plate, are obtained.
[0027] Furthermore, the pixels within the set range are specifically pixels within a 3×3 range around the upper edges of the lumbar vertebra L1 and the sacrum S1 as the center.
[0028] Furthermore, in step (2), for the lumbar vertebra L1, only the straight lines that are distributed on the lumbar vertebra L1, are horizontal in direction and are located in the upper part of the image are retained, that is, the upper and lower edges of the lumbar vertebra L1 are obtained;
[0029] For lumbar vertebra L5, only the straight lines that are distributed on lumbar vertebra L5, horizontal in direction and located in the lower part of the image are retained, that is, the upper and lower edges of lumbar vertebra L5 are obtained;
[0030] For the sacrum S1, only the straight line located on the sacrum S1 and parallel to the lower edge of the lumbar vertebra L5 and closest to the lower edge of the lumbar vertebra L5 is retained, that is, the upper edge of the sacrum S1 is obtained.
[0031] Furthermore, the method for determining whether a straight line is horizontal is as follows: select any two points {p0, p1} on the straight line, form a vector, and calculate the angle between the vector and the horizontal direction. When the angle is less than 30°, the straight line is considered to be horizontal.
[0032] Specifically, in S1, after acquiring hip joint images of several patients, the hip joint images of the patients are corrected according to the anatomical coordinate system, the corrected hip joint images of the patients are resampled according to the scanning resolution and image thickness of the hip joint images of the patients, the grayscale distribution characteristics of the resampled images are extracted, the images are standardized, the images are size-adapted after data enhancement, and the images are input into the UNet network for training to obtain a coarse segmentation model.
[0033] More specifically, in the resampling, the voxel size in the image is reset so that the size in a certain direction of the resolution of the resampled image is expressed as an exponent closest to 2, and the size in the other direction is adjusted accordingly, and corresponding cropping and padding are performed when it exceeds the set size.
[0034] Furthermore, after the resampling, if the size of the obtained image exceeds the set size, the image needs to be cropped, wherein the set size is determined according to actual needs and expressed as an exponent closest to 2;
[0035] The trimming is as follows: retaining an area starting from the center of the image and extending horizontally to both sides to a set length in the direction, and retaining an area starting from the bottom edge of the image and extending vertically to a set length in the direction;
[0036] If the size of the obtained image does not exceed the set size, the missing part in the corresponding direction is filled with pixels with a gray value of 0.
[0037] Beneficial effects: The present invention analyzes the imaging data of the patient's vertebrae, pelvis and hip joints through deep learning and image processing technology, automatically identifies important anatomical structures, realizes automatic calculation of surgical parameters, provides guidance for hip replacement surgery, and improves surgical accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are merely embodiments of the present invention, and ordinary technicians in this field can obtain other drawings based on these drawings without creative work.
[0039] Figure 1 is a flow chart of a method for calculating parameters of hip replacement surgery of the present invention;
[0040] Figure 2 Schematic diagram of the training rough segmentation model, vertebra segmentation model and pelvic point recognition model of the present invention;
[0041] Figure 3 This is an example diagram of resampling;
[0042] Figure 4 This is a sample image cropped after resampling;
[0043] Figure 5 This is an example image of clipping the vertebral area;
[0044] Figure 6 An example diagram for clipping the vertebral segment portion in the vertebral body region;
[0045] Figure 7 An example diagram for mapping labeled key points to a Gaussian sphere;
[0046] Figure 8 Examples of lumbar vertebra L1 image and sacrum S1 image obtained by vertebra segmentation model;
[0047] Fig. 9 Flowchart for detecting the upper endplate of the lumbar vertebra L1 and the upper endplate of the sacrum S1 using a deep learning method. DETAILED DESCRIPTION
[0048] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present application is described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0049] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present invention should have the usual meanings understood by people with ordinary skills in the field to which the present invention belongs. "Include" or "comprising" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0050] In the present invention, the doctor plans the scanned patient's hip joint image. In view of the large size of the image and the presence of multiple tasks of image segmentation and key point detection, a single neural network cannot complete the task. Therefore, the present invention can first perform a rough segmentation on the image to identify the vertebral area and pelvic area, then perform vertebral segmentation on the vertebral area, and perform key point detection on the pelvic area to identify feature points, and then calculate the corresponding parameters based on this.
[0051] The hip replacement surgery parameter calculation method of the present invention is as follows Figure 1 As shown, the steps include:
[0052] S1, respectively train to obtain a rough segmentation model, a vertebral segmentation model and a pelvic point recognition model;
[0053] 1) The training of the coarse segmentation model is as follows Figure 2 As shown, the details are as follows:
[0054] Hip joint images of several patients are obtained, and the patients' hip joint images are corrected according to the anatomical coordinate system, and the grayscale distribution characteristics of the corrected images are extracted. The corrected hip joint images of the patients are resampled according to the scanning resolution and image thickness of the patients' hip joint images, and the resampled images are subjected to data normalization processing, and the images are size-adapted after data enhancement, and then input into the UNet network for training to obtain a coarse segmentation model. The coarse segmentation model can be used to segment the vertebral area and pelvic area in the patients' hip joint images.
[0055] In the present invention, the loss function of the UNet network adopts the BCE function and the Dice coefficient.
[0056] Specifically, the hip joint image of the patient may be corrected according to the LPS coordinate system by correcting the hip joint image of the patient according to the anatomical coordinate system;
[0057] In an embodiment of the present invention, the patient's direction information is obtained from the patient's hip joint image, and the patient's hip joint image is corrected according to the acquisition device and the patient's body position during acquisition to ensure the consistency of the patient's body position.
[0058] like Figure 3 As shown, in the embodiment of the present invention, the voxel size in the image is reset according to the scanning resolution of the patient's hip joint image, and resampling is performed so that the resolution of the resampled image is expressed according to the exponent closest to 2, that is, the resolution of the resampled image can be expressed as 2 m ×2 n ,in, m , n All are natural numbers.
[0059] In the present invention, during resampling, the voxel size in the image can be reset so that the size in a certain direction of the resolution of the resampled image is expressed as an exponent closest to 2, and the size in the other direction is adjusted accordingly, and corresponding cropping and padding are performed when it exceeds the set size.
[0060] In a specific embodiment of the present invention, Figure 3As shown, the size of the slice image of the patient's hip joint image collected is 1542×2801, and the physical size of the flat panel detector is 220mm×400mm, so the pixel size of the slice image is 0.143×0.143. In the present invention, the pixel size of the slice image is modified to 1.5625×1.5625 for resampling. Of course, the patient's hip joint images come from various sources, and the sizes of the resampled images are different, so a size adaptation operation is required.
[0061] In the present invention, Figure 4 As shown in the figure, after resampling, if the size of the obtained image exceeds the set size, the image needs to be cropped. The set size is determined according to actual needs and is generally expressed as the exponent closest to 2, that is, 2 m ×2 n ; The specific trimming is as follows: keep the image from the center and move horizontally to both sides to the set length in that direction, i.e. 2 m The area is retained from the bottom edge of the image along the vertical direction to the set length in that direction, that is, 2 n area; if the size of the obtained image does not exceed the set size, the missing part in the corresponding direction can be filled with pixels with a gray value of 0.
[0062] In the present invention, the standardization process is specifically as follows:
[0063] ;
[0064] ;
[0065] in, x Represents the gray value of a pixel in the slice image of the standardized patient's hip joint image, μ , σ Represents the mean and variance of the grayscale distribution characteristics in the slice image of the patient's hip joint image, x u and x l They represent the 0.95 quantile and the 0.05 quantile respectively. max ( σ ,1 e -8) indicates the maximum value between two numbers; 1 e -8 indicates the minimum value set to prevent max ( σ ,1 e -8) takes the value of zero.
[0066] In the present invention, data enhancement can adopt conventional means, such as image transformation, grayscale change, random cropping or random noise.
[0067] In the present invention, data adaptation is specifically as follows:
[0068] ( x msz , y msz )=max([ X sz , Y sz ]);
[0069] ( x sz , y sz )=nearest(( x msz , y msz ),[ X val , Y val ]);
[0070] in,[ X sz , Y sz ] represents the array corresponding to the size of each image data currently being processed, where: X sz , Y sz Respectively represent the length of a certain image data size in the corresponding direction; ( x msz , y msz ) represents the maximum length in the direction selected from the array corresponding to the size of each image data currently being processed; [ X val , Y val ] indicates the candidate length value set in the corresponding direction, which is generally set to 2 k , in a specific embodiment of the present invention, k The value of is 48, 64, 128 or 256; ( x sz , y sz )=nearest(( x msz , y msz ),[ X val , Y val ])express( x msz , y msz ) in the set length candidate value [X val , Y val ] selects the value closest to it, such as the set length candidate value is 96, 128, 256, 512, the maximum length in the direction selected from the array corresponding to the size of each image data currently being processed x msz , y msz are 140 and 256 respectively, then we get x sz , y sz They are 128 and 256 respectively.
[0071] 2) Training of vertebral segmentation model Figure 2 As shown, the details are as follows:
[0072] The rough segmentation model obtained through the above training segmented the vertebral area and pelvic area of the patient's hip joint image, and the vertebral area was obtained by cropping, such as Figure 5 As shown in , the grayscale distribution features are extracted and resampled. The resampled image is cropped using the bounding box (bbox) according to the pre-annotated labeled data set to obtain the vertebral segment part in the vertebral area, as shown in Figure 6 As shown, it is used as a training sample for the vertebral segmentation model, wherein the labeled data set is obtained by labeling the vertebral regions in the hip joint images of several patients; the training samples are input into the UNet network for training after data enhancement and size adaptation, and the vertebral segmentation model is obtained;
[0073] In the present invention, the image resampling of the vertebral region is different from the above, and the voxel size in this process is 0.143x0.143.
[0074] In the present invention, data enhancement and size adaptation may be consistent with the above.
[0075] In the present invention, the UNet network selected for training the vertebral segmentation model is different from that of the coarse segmentation model, and its loss function adopts the CE function and DICE.
[0076] 3) Training of pelvic point recognition model Figure 2 As shown, the details are as follows:
[0077] The rough segmentation model obtained through the above training segmented the vertebral area and pelvic area of the patient's hip joint image, cropped the pelvic area, extracted its grayscale distribution characteristics, and resampled it. At the same time, the key points were marked and mapped to the Gaussian sphere to obtain the marked image, such as Figure 7As shown in the figure, after data enhancement, a heat map is generated, which is input into the random (SCN) configuration network for training to obtain the pelvic point recognition model.
[0078] Among them, the global and local feature recognition of the randomly configured network adopts the first step of UNet network pruning, SCN-Local adopts a 4-layer UNet network, SCN-Spatial adopts a 4-layer UNet network, the encoding unit and the decoding unit both use one convolution unit, and the depth monitoring operation is cancelled. The loss function uses MSE, and the optimizer selects Adam.
[0079] S2, obtaining the patient's hip joint image, and correcting the patient's hip joint image according to the anatomical coordinate system, such as S1 resampling the patient's hip joint image, inputting the resampled image into the coarse segmentation model trained by S1, segmenting the vertebral body region and the pelvic region, respectively cropping the vertebral body region and the pelvic region, and respectively inputting the vertebral segmentation model and the pelvic point recognition model trained by S1, thereby obtaining the vertebral segmentation image and the physiological key points of the pelvic region;
[0080] In this embodiment, the vertebral segmentation images obtained by segmentation of the vertebral segmentation model are lumbar vertebra L1 image and sacrum S1 image. Figure 8 As shown, the physiological key points of the pelvic area identified by the pelvic point recognition model are the feature points A of the bilateral anterior superior iliac spines P1, P2 and pubic symphysis and the midpoint B of the center lines of the femoral heads on both sides.
[0081] S3, calculating relevant surgical parameters according to the vertebral segmentation image and physiological key points of the pelvic region obtained in S2;
[0082] In the present invention, the relevant surgical parameters include pelvic tilt angle PT, sacral tilt angle SS, pelvic index PI and lumbar lordosis LL.
[0083] Specifically:
[0084] The pelvic tilt angle PT is used to evaluate pelvic rotation activity. It is the angle between the line between the midpoint P′ of the line connecting the bilateral anterior superior iliac spines P1 and P2 and the characteristic point A of the pubic symphysis and the head-foot direction of the human body, or the angle between the line between the midpoint B of the center line of the femoral head on both sides and the midpoint of the upper end plate of the sacrum S1 and the head-foot direction of the human body.
[0085] Among them, the position of the upper endplate of the sacrum S1 can be automatically detected by deep learning methods, and then its accurate spatial coordinates can be obtained;
[0086] The sacral tilt angle SS is used to assess pelvic rotation and is the angle between the tangent line of the upper endplate of the sacrum S1 and the horizontal line. The sacral tilt angle SS and the pelvic tilt angle PT are inversely proportional in spinal-pelvic kinematics, that is, for every 1° increase in PT, SS decreases by 1°.
[0087] The pelvic index PI is the angle between the line between the midpoint B of the centerline of the femoral head on both sides and the midpoint of the upper endplate of the sacrum S1 and the straight line perpendicular to the upper endplate of the sacrum S1 and passing through the midpoint. This angle remains constant in the human body after adulthood and does not change with spinal-pelvic movement or spinal degeneration. The calculation formula is PI = PT + SS.
[0088] Lumbar lordosis LL is used to assess whether the spine has deformity, and is the angle between the tangent of the upper endplate of the lumbar vertebra L1 and the tangent of the upper endplate of the sacrum S1. The position of the upper endplate of the lumbar vertebra L1 can also be automatically detected through deep learning methods, and its accurate spatial coordinates can be obtained.
[0089] In a specific embodiment of the present invention, the lumbar vertebra L1 image and the sacrum S1 image obtained by segmentation of the vertebral segmentation model are automatically detected by a deep learning method, and then the upper end plate of the lumbar vertebra L1 and the upper end plate of the sacrum S1 are obtained, such as Fig. 9 As shown, including:
[0090] (1) Use a one-dimensional Sobel filter to detect the boundaries of lumbar vertebrae L1, L5, and sacrum S1 in the segmented lumbar vertebrae L1 image and sacrum S1 image respectively;
[0091] When the one-dimensional Sobel filter acts on the background and foreground, the output of the one-dimensional Sobel filter is 0. When the one-dimensional Sobel filter acts on the edge, the one-dimensional Sobel filter outputs +1 or -1. Therefore, a boundary map of the same size as the segmented lumbar vertebra L1 image and sacrum S1 image is created. When the one-dimensional Sobel filter outputs 0, the corresponding pixel of the boundary map is 0. When the one-dimensional Sobel filter outputs +1 or -1, the corresponding pixel of the boundary map is 255. In this way, the boundaries of lumbar vertebrae L1, L5 and sacrum S1 in the lumbar vertebra L1 image and sacrum S1 image can be detected.
[0092] (2) Perform Hough straight line transform on the boundaries detected in step (1), extract the straight lines, and associate each straight line with the corresponding vertebral segment based on the segmentation result of the vertebral segmentation model to obtain the upper and lower edges of each vertebral segment. The lower edge of lumbar vertebra L5 is extracted to facilitate the extraction of the upper edge of sacrum S1.
[0093] Due to the prior knowledge of the lumbar vertebra L1, for the lumbar vertebra L1, in this embodiment, based on the human body signs and the correction of S1, only the extracted straight lines that are distributed on the lumbar vertebra L1, horizontal in direction and located in the upper part of the image are retained, that is, the upper and lower edges of the lumbar vertebra L1 are obtained.
[0094] Among them, the method of judging whether the straight line is horizontal is to select any two points {p0, p1} on the straight line, form a vector, and calculate the angle between it and the horizontal direction. When the angle is less than 30°, the straight line can be considered horizontal.
[0095] For lumbar vertebra L5, the method of extracting lumbar vertebra L5 is similar to that of lumbar vertebra L1, that is, only the straight lines distributed on lumbar vertebra L5, horizontal in direction and located in the lower part of the image are retained, that is, the upper and lower edges of lumbar vertebra L5 are obtained.
[0096] For the sacrum S1, in this embodiment, only the straight line located on the sacrum S1 and parallel to the lower edge of the lumbar vertebra L5 and closest to the lower edge of the lumbar vertebra L5 is retained, that is, the upper edge of the sacrum S1 is obtained.
[0097] (3) Based on the positions of the upper edges of the lumbar vertebra L1 and the sacrum S1 obtained in step (2), accurate positioning is performed, that is, the positions of the upper endplate of the lumbar vertebra L1 and the upper endplate of the sacrum S1 are obtained;
[0098] The rough positions of the upper edges of the lumbar vertebra L1 and sacrum S1 extracted in step (2) need to be precisely located as follows:
[0099] (31) In combination with the positions of the upper edges of the lumbar vertebra L1 and the sacrum S1 obtained in step (2), pixels and their pixel values within the upper set range of the lumbar vertebra L1 and the sacrum S1 are extracted from the lumbar vertebra L1 image and the sacrum S1 image obtained by the vertebral segmentation model, and these pixels are divided into a foreground pixel set Fg and a background pixel set Bg;
[0100] Specifically, pixels within a set range above the lumbar vertebra L1 and the sacrum S1 are extracted, specifically, pixels within a 3×3 range around the upper edges of the lumbar vertebra L1 and the sacrum S1 as the center.
[0101] (32) Count the histograms of the pixel values in the foreground pixel set Fg and the background pixel set Bg respectively, and calculate the pixel value I with the largest distribution in the foreground pixel set Fg and the background pixel set Bg. fg and I bg , calculate I fg and I bg The median value I th as a demarcation threshold;
[0102] (33) In the lumbar vertebra L1 image and sacral S1 image obtained by the vertebral segmentation model, the pixels within the upper set range of the lumbar vertebra L1 and the sacral S1 are respectively extracted to form corresponding images, and the demarcation threshold I th Create a contour line;
[0103] (34) Use the least squares method to fit the points on the contour line created in step (33) to obtain the corresponding straight line, and then you can get a more accurate upper edge of the lumbar vertebra L1 and sacrum S1;
[0104] The details are as follows:
[0105] Define the equation of the line as y i = θ 0+ θ 1 x i , the points on the contour line created in step (33) ( x 0, y 0)、( x 1, y 1),…,( x w , y w ) into the equation of the line, we get:
[0106] ;
[0107] ;
[0108] ;
[0109] ;
[0110] ;
[0111] in, w Indicates the number of points on the contour line;
[0112] Convert it into a matrix as follows:
[0113] ;
[0114] ;
[0115] The least squares loss function is defined as:
[0116] ;
[0117] Deriving it:
[0118] ;
[0119] When the derivative is zero, the loss function takes the minimum value and is solved as follows: θ =(X T X) -1 X TY, and thus the corresponding straight line can be obtained;
[0120] (35) By substituting the positions of the two end points of the upper edge of the lumbar vertebra L1 and the sacrum S1 obtained in step (2) into the straight line equation obtained in step (34), a more accurate edge position of the lumbar vertebra L1 and the sacrum S1 can be obtained, and then a more accurate midpoint of the lumbar vertebra L1 and the sacrum S1, as well as the direction of the upper end plate, can be obtained.
[0121] The present invention analyzes the imaging data of the patient's spine, pelvis and hip joint through deep learning and image processing technology, and separates the vertebral area and pelvic area in the overall image by preliminary segmentation of the vertebral area and the pelvic area. The segmented vertebral area and the pelvic area are then processed separately. For the vertebral area, the shape and position of each vertebral segment are accurately segmented by the vertebral segment segmentation model. For the pelvic area, the physiological key points of the pelvic area are identified by the pelvic point recognition model, so that important anatomical structures can be automatically identified, and the morphology and structure of the pelvis can be further analyzed, providing a basis for subsequent medical analysis and diagnosis, realizing the automatic calculation of surgical parameters, providing guidance for hip replacement surgery, and improving surgical accuracy and efficiency.
[0122] The embodiments of the present invention are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for calculating hip replacement surgery parameters, characterized in that: include: S1. Obtain hip joint images of several patients, extract grayscale distribution features thereof, input the images into a UNet network for training to obtain a rough segmentation model, and segment the vertebral region and pelvic region of the hip joint images of the patients through the rough segmentation model; The vertebral body region and pelvic region are respectively cut out, and the vertebral segment part in the vertebral body region is cut out using the bounding box, which is then input into the UNet network for training to obtain a vertebral segmentation model; Mark the key points in the pelvic area and map the marked key points to the Gaussian sphere to obtain a marked image, which is then input into a random configuration network for training to obtain a pelvic point recognition model; S2, obtaining the patient's hip joint image and correcting it, inputting it into the rough segmentation model trained by S1, segmenting the vertebral body region and pelvic region, cropping the vertebral body region and pelvic region respectively, and inputting the vertebral segmentation model and pelvic point recognition model trained by S1 respectively, thereby obtaining the vertebral segmentation image and the physiological key points of the pelvic region respectively; The vertebral segmentation images are lumbar vertebrae L1 images and sacrum S1 images, and the physiological key points of the pelvic region are the feature points A of the bilateral anterior superior iliac spines P1, P2 and pubic symphysis and the midpoint B of the center lines of the femoral heads on both sides; S3, calculating relevant surgical parameters according to the vertebral segmentation image and physiological key points of the pelvic region obtained in S2; The relevant surgical parameters include pelvic tilt angle PT, sacral tilt angle SS, pelvic index PI and lumbar lordosis LL; The pelvic tilt angle is the angle between the line between the midpoint P′ of the line connecting points P1 and P2 and point A and the head-foot direction of the human body, or the angle between the line between point B and the midpoint of the upper end plate of the sacrum S1 and the head-foot direction of the human body; wherein the position of the upper end plate of the sacrum S1 is automatically detected by a deep learning method; The sacral inclination angle is the angle between the tangent line of the upper end plate of the sacrum S1 and the horizontal line; The pelvic index is the angle between the line between point B and the midpoint of the upper endplate of the sacrum S1 and the straight line perpendicular to the upper endplate of the sacrum S1 and passing through the midpoint; The lumbar lordosis is the angle between the tangent line of the upper end plate of the lumbar vertebra L1 and the tangent line of the upper end plate of the sacrum S1; wherein the position of the upper end plate of the lumbar vertebra L1 is automatically detected by a deep learning method.
2. The hip replacement surgery parameter calculation method according to claim 1, characterized in that: The positions of the upper endplate of the lumbar vertebra L1 and the upper endplate of the sacrum S1 are automatically detected by the deep learning method, as follows: (1) Use a one-dimensional Sobel filter to detect the boundaries of lumbar vertebrae L1, L5, and sacrum S1 in the segmented lumbar vertebrae L1 image and sacrum S1 image respectively; (2) Perform Hough straight line transform on the boundaries detected in step (1), extract the straight lines, and associate each straight line with the corresponding vertebral segment based on the segmentation result of the vertebral segmentation model to obtain the upper and lower edges of each vertebral segment; (3) Based on the positions of the upper edges of the lumbar vertebra L1 and the sacrum S1 obtained in step (2), the positions of the upper end plates of the lumbar vertebra L1 and the sacrum S1 are obtained.
3. The hip replacement surgery parameter calculation method according to claim 2, characterized in that: The step (3) is specifically as follows: (31) In combination with the positions of the upper edges of the lumbar vertebra L1 and the sacrum S1 obtained in step (2), pixels and their pixel values within the upper set range of the lumbar vertebra L1 and the sacrum S1 are extracted from the lumbar vertebra L1 image and the sacrum S1 image obtained by the vertebral segmentation model, and these pixels are divided into a foreground pixel set Fg and a background pixel set Bg; (32) Count the histograms of the pixel values in the foreground pixel set Fg and the background pixel set Bg respectively, and calculate the pixel value I with the largest distribution in the foreground pixel set Fg and the background pixel set Bg. fg and I bg , calculate I fg and I bg The median value I th as a demarcation threshold; (33) In the lumbar vertebra L1 image and sacral S1 image obtained by the vertebral segmentation model, the pixels within the upper set range of the lumbar vertebra L1 and the sacral S1 are respectively extracted to form corresponding images, and the demarcation threshold I th Create a contour line; (34) Use the least squares method to fit the points on the contour line created in step (33) to obtain the corresponding straight line, that is, the upper edge of the lumbar vertebra L1 and the sacrum S1; (35) Substitute the positions of the two end points of the upper edge of the lumbar vertebra L1 and the sacrum S1 obtained in step (2) into the straight line equation obtained in step (34), and the edge positions of the lumbar vertebra L1 and the sacrum S1 are obtained, and then the midpoints of the lumbar vertebra L1 and the sacrum S1, as well as the direction of the upper end plate, are obtained.
4. The method for calculating hip replacement surgery parameters according to claim 3, characterized in that: The pixels within the set range are specifically pixels within a 3×3 range around the upper edges of the lumbar vertebra L1 and the sacrum S1 as the center.
5. The method for calculating hip replacement surgery parameters according to claim 3, characterized in that: In step (2), for the lumbar vertebra L1, only the straight lines that are distributed on the lumbar vertebra L1, are horizontal in direction and are located in the upper part of the image are retained, that is, the upper and lower edges of the lumbar vertebra L1 are obtained; For lumbar vertebra L5, only the straight lines that are distributed on lumbar vertebra L5, horizontal in direction and located in the lower part of the image are retained, that is, the upper and lower edges of lumbar vertebra L5 are obtained; For the sacrum S1, only the straight line located on the sacrum S1 and parallel to the lower edge of the lumbar vertebra L5 and closest to the lower edge of the lumbar vertebra L5 is retained, that is, the upper edge of the sacrum S1 is obtained.
6. The hip replacement surgery parameter calculation method according to claim 5, characterized in that: The way to determine whether a line is horizontal is to select any two points {p0, p1} on the line, form a vector, and calculate the angle between it and the horizontal direction. When the angle is less than 30°, the line is considered to be horizontal.
7. The hip replacement surgery parameter calculation method according to claim 1, characterized in that: In S1, after acquiring hip joint images of several patients, the hip joint images of the patients are corrected according to the anatomical coordinate system, the corrected hip joint images of the patients are resampled according to the scanning resolution and image thickness of the hip joint images of the patients, the grayscale distribution characteristics of the resampled images are extracted, the images are standardized, the images are size-adapted after data enhancement, and the images are input into the UNet network for training to obtain a coarse segmentation model.
8. The method for calculating hip replacement surgery parameters according to claim 7, characterized in that: In the resampling, the voxel size in the image is reset so that the size in a certain direction of the resolution of the resampled image is expressed as an exponent closest to 2, and the size in the other direction is adjusted accordingly, and corresponding cropping and padding are performed when it exceeds the set size.
9. The method for calculating hip replacement surgery parameters according to claim 8, characterized in that: After the resampling, if the size of the obtained image exceeds the set size, the image needs to be cropped, wherein the set size is determined according to actual needs and expressed as an exponent closest to 2; The trimming is as follows: retaining an area starting from the center of the image and extending horizontally to both sides to a set length in the direction, and retaining an area starting from the bottom edge of the image and extending vertically to a set length in the direction; If the size of the obtained image does not exceed the set size, the missing part in the corresponding direction is filled with pixels with a gray value of 0.
Citation Information
Patent Citations
Total hip replacement preoperative planning system based on deep learning
CN114419618A
Hip joint medical image processing method and device based on deep learning
CN114663363A