A method and system for automatically correcting head data angle in medical images
By automatically correcting the head data angle through image registration, the problem of image discrepancies caused by head tilt during scanning is solved, achieving fast and accurate head correction, reducing the need for computing resources and manual intervention, and adapting to changes in patient posture.
Patent Information
- Application Number
- CN202211645740.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-20
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-12-20
AI Technical Summary
In existing technologies, when a patient's head is tilted or cannot be parallel to the bed during a head CT or MRI scan, the image will be significantly different from the doctor's usual orientation, affecting diagnostic capabilities. Furthermore, existing methods require manual intervention, have high computational resource requirements, poor robustness, and cannot adapt to patient movement or physical limitations.
The head data angle is automatically corrected by image registration method. Two-dimensional registration is used instead of three-dimensional registration. Histogram matching and deep neural network algorithms are used to find similar slices. The rotation angle and offset are calculated by combining RegNet network to achieve head correction.
It reduces computational workload, improves accuracy and speed, reduces manual intervention, adapts to patient movement, and improves the precision and comfort of correction results.
Smart Images

Figure CN116128817B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical imaging technology, and in particular to a method and system for automatically correcting the angle of head data in medical images. Background Technology
[0002] During head CT (Computed Tomography) or MRI scans, patient conditions such as stroke or cervical spine injury may cause the head to tilt to the left or right, or the head to be out of parallel with the bed. These situations result in significant discrepancies between the reconstructed head image and the doctor's preferred orientation, severely impacting diagnostic accuracy. Therefore, we propose a rapid and effective automatic head correction method that automatically adjusts the angle based on the patient's current head position to achieve a standard alignment.
[0003] The main solution is usually done manually, for example: 1. Before scanning, the doctor or nurse fixes the patient's head position with a headrest. During the scanning process, the patient needs to keep his head still. This method is limited for patients with limited cooperation ability. 2. After image reconstruction, the doctor uses image post-processing tools to manually rotate and adjust the direction of the image. Frequent interaction affects the doctor's diagnostic efficiency, especially for tertiary hospitals with a large number of outpatients. 3. Zeng et al. [1] proposed that after image reconstruction, key points of the head such as the left ear, right ear, left eye and right eye should be detected, the correction angle should be calculated based on the detected key points, and finally the head data should be corrected and output based on the angle.
[0004] Disadvantages of existing technology:
[0005] 1. Doctors or nurses need to guide the patient's positioning, which will consume a lot of manpower and time;
[0006] 2. During the scan, the patient's head position may shift due to movement;
[0007] 3. Some patients may be unable to position their head in the optimal position due to their physical condition;
[0008] 4. Key point detection methods have high requirements for the integrity of scan data and lack strong robustness;
[0009] 5. Existing 3D registration methods involve huge computational loads, require AI recognition, and have stringent requirements for computing resources; Summary of the Invention
[0010] Technical Objective: To address the deficiencies in existing technologies, this invention discloses a method and system for automatically correcting the head angle in medical images. This invention automatically corrects the patient's head position in the input data using image registration, and replaces direct three-dimensional registration with two-dimensional registration, greatly reducing computation and increasing accuracy.
[0011] Technical solution: To achieve the above technical objectives, the present invention adopts the following technical solution.
[0012] A method for automatically correcting head angle data in medical images includes the following steps:
[0013] S1: Set the reference image: The reference image is a standard, untilted, and centered head slice image obtained when the patient's head is in a standard posture. It is required to be free of artifacts and have an intact head without defects.
[0014] S2: Input image sequence to be corrected: The image sequence to be corrected is 3D image data, which is a medical image sequence obtained after the patient is reconstructed by CT or MRI scan. Several slices with the same orientation as the reference image are generated based on the 3D image data as the input sequence.
[0015] S3. Finding similar slices: Use histogram matching or deep neural network algorithms to find the slices in the input sequence that are most similar to the reference image; where the reference image is also the target corrected image of the input sequence.
[0016] S4. Head Correction: Register the similar slice image found in S3 with the reference image to obtain correction parameters, including the rotation angle and the horizontal offset in the x and y directions. Process the image sequence to be corrected according to the rotation angle and the horizontal offset in the x and y directions to achieve head correction on the 3D image data.
[0017] Preferably, the reference image is a preset image or image library. The direction of the reference image includes the transverse section, the coronal plane and the sagittal plane. The preset image or image library is a single image in one direction or an image library in several directions. When it is an image library in several directions, steps S2-S4 are executed for each reference image in each direction to realize head correction of 3D image data.
[0018] Preferably, when using histogram matching to find the slice image in the input sequence that is most similar to the reference image, the process of measuring the similarity between each slice image in the input sequence and the reference image includes:
[0019] For each slice in the input sequence, calculate the histogram similarity and area similarity with the reference image. Select the slice with the highest similarity value as the slice in the sequence to be corrected that is most similar to the reference image, i.e., the similarity slice map.
[0020] Preferably, the formula for calculating the area similarity is:
[0021]
[0022] Where S1 represents the area occupied by the head in the reference image, and S2 represents the area occupied by the head in the slice of the sequence to be corrected.
[0023] Preferably, the formula for calculating the similarity measure is:
[0024] Similarity measure = a * histogram similarity + β * area similarity
[0025] Here, α and β are two hyperparameters.
[0026] Preferably, the registration method in step S3 includes: feature image registration, grayscale image registration, transform image registration, or neural network registration.
[0027] Preferably, the neural network-based registration uses RegNet, where I F Indicates a fixed image, i.e., a reference image, I M The floating image is represented by the similar slices found in S3. In the RegNet network, network downsampling is performed at downsampling rates of 4 and 2 respectively. The output of the entire network is a displacement vector field (DVF). The angle and offset are obtained from the displacement vector field (DVF) using the least squares method or singular value decomposition method. The loss function during training includes two parts: one is the Huber loss, which is used to minimize the distance between the ground truth T and the predicted DVF T′, and the other is the bending energy (BE) regularization term, which is used to ensure the smoothness of the displacement field.
[0028] Preferably, the loss function during training is:
[0029] C=Huber(T(x),T′(x))+γ·BE(T′(x))
[0030] Huber's loss is:
[0031]
[0032] Where C is the loss function of RegNet, T(x) is the ideal deformation field, T′(x) is the actual deformation field output by the network, γ is the hyperparameter, and x is the image to be corrected.
[0033] A system for automatically correcting head angle data in medical images includes a processor, a memory, and a computer program stored in the memory and executable on the processor. The system is characterized in that, when the processor executes the program, it implements any of the methods described above for automatically correcting head angle data in medical images.
[0034] Beneficial effects: This invention automatically corrects images by using image registration to automatically correct the patient's head position in the input data. It also uses a two-dimensional registration method to replace direct three-dimensional registration, which greatly reduces the amount of computation and increases accuracy. Attached Figure Description
[0035] Figure 1 This is a flowchart of the method of the present invention;
[0036] Figure 2 This is a schematic diagram of the reference image and similar slices of the present invention;
[0037] Figure 3 This is a schematic diagram of the pre-correction and post-correction sections of the present invention;
[0038] Figure 4 This is a schematic diagram of the cross-section, coronal plane, and sagittal plane before correction according to the present invention;
[0039] Figure 5 for Figure 4 Schematic diagrams of the corrected transverse, coronal, and sagittal sections;
[0040] Figure 6 This is a schematic diagram of a twin network structure;
[0041] Figure 7 This is a schematic diagram of the RegNet network structure;
[0042] Figure 8 This is a flowchart of a registration method based on neural networks. Detailed Implementation
[0043] The following description, in conjunction with the accompanying drawings, further illustrates and explains a method and system for automatically correcting head data angles in medical images according to the present invention.
[0044] As attached Figure 1 As shown, a method for automatically correcting the angle of head data in medical images includes the following steps:
[0045] S1: Setting the reference image: The reference image is a standard, untilted, and centered slice of the patient's head, obtained when the patient's head is in a standard posture. It must be free of artifacts and show a complete, undamaged skull. The reference image is a preset image or image library. The reference image's orientation includes transverse, coronal, and sagittal planes. The preset image or image library can be a single image in one direction or an image library with images in several directions. When it is an image library with images in several directions, steps S2-S4 are executed for each reference image in each direction to achieve head correction based on the 3D image data. Maintaining a standard head posture means that the patient's head remains centered and parallel to the bed during a CT scan or MRI scan. The reference image is obtained from the patient's standard three-dimensional volume data, i.e., a DICOM image.
[0046] S2: Input image sequence to be corrected: The image sequence to be corrected is 3D image data, which is a medical image sequence obtained after the patient is reconstructed by CT or MRI scan. Several slices in the same direction as the reference image are generated based on the 3D image data as the input sequence; that is, the number of images in the image sequence to be corrected can be one or more slice images.
[0047] S3: Finding similar slices: When the input image sequence to be corrected is a single image, the single image is used as a similar slice. When the input image sequence to be corrected consists of multiple images, the slice in the image sequence to be corrected that is most similar to the reference image library is found. In this invention, the reference image library can be cross-sectional, coronal, or sagittal slices, or a combination of any two planes, or all three planes. The slices in the input sequence are slices of the planes corresponding to the reference images generated from 3D image data. The reference images are used as the target correction images. For example, in 2D head correction targeting cross-sections, the reference image library contains standard, untilted, and centered cross-sectional slices of the patient's head taken when the patient's head is in a standard posture. The standard posture refers to the patient's head being centered and parallel to the bed during a CT scan or MRI scan. When searching for similar slices, only one reference image is needed, as shown in S1, i.e., any slice of the patient's three-dimensional volume data under the standard posture. Furthermore, when performing cross-sectional correction, the reference image is the corresponding cross-sectional slice. This step uses histogram matching or a deep neural network-based algorithm to find the slice image in the sequence to be corrected that is most similar to the reference image.
[0048] The deep neural network-based algorithm in this invention takes the image matching algorithm based on Siamese networks as an example, and its network structure is shown in the attached figure. Figure 6 As shown:
[0049] Input 1 represents the input baseline image, and input 2 represents the slice images in the sequence to be corrected. The shared weight feature extraction network maps the input of the two channels to a new feature space to obtain a new dimensionality-reduced feature vector. Finally, the loss function uses Euclidean distance to measure the similarity between the two, and the smaller the distance, the higher the similarity. The slice image with the smallest distance is selected as the most similar slice.
[0050] The loss function during training is set as follows:
[0051]
[0052] Where L is the loss function of the Siamese network, D is the Euclidean distance between the reduced-dimensional vectors after mapping the inputs of the two channels, l is the label (set to 1 when the inputs of the two channels are similar images, otherwise 0), and m is the distance that a set of dissimilar images should be spaced apart in ideal space. Since D is the Euclidean distance between the two reduced-dimensional vectors, the overall effect of the loss function is to encourage similar images to move closer to each other in the feature space, while forcing dissimilar images to be spaced at least m apart.
[0053] In this invention, when using histogram matching to find the slice image in the image sequence to be corrected that is most similar to the reference image, the process of measuring the similarity between each slice image in the image sequence to be corrected and the reference image includes:
[0054] For each slice in the input sequence, histogram similarity and area similarity are calculated with the reference image. The slice with the highest similarity score is selected as the slice in the sequence to be corrected that is most similar to the reference image, i.e., the similarity slice image. Histogram similarity is obtained using a histogram matching method; the formula for calculating area similarity is:
[0055]
[0056] Where S1 represents the area occupied by the head in the reference image, and S2 represents the area occupied by the head in the slice of the image sequence to be corrected. (Appendix) Figure 2 This is a schematic diagram of the reference image and similar slices of the present invention; the left is the reference image and the right is the similar slice; the formula for calculating the area similarity in the present invention uses the two values of the area occupied by the skull in the reference image and the similar image. This ensures that the internal structure of the skull is similar to the reference image, and also requires that the area occupied by the skull to be corrected is as similar as possible to the reference image, thereby reducing the amount of calculation required for subsequent head correction.
[0057] The formula for calculating the similarity score is shown below:
[0058] Similarity measure = α * histogram similarity + β * area similarity;
[0059] Here, α and β are two hyperparameters, and their specific values are subject to actual conditions. In some embodiments of the present invention, α = 0.75 and β = 0.25.
[0060] S4: Head Correction: The similar slice images found in S3 are registered with the reference image to obtain correction parameters, such as the rotation angle and the horizontal offset in the x and y directions. The image sequence to be corrected is processed according to the rotation angle and the horizontal offset in the x and y directions to achieve head correction on the 3D image data. Registration methods include feature image registration, grayscale image registration, transform image registration, or neural network registration. (Appendix) Figure 3 These are schematic diagrams of the pre-correction and post-correction sections of the present invention; wherein, the left is a schematic diagram of the pre-correction section and the right is a schematic diagram of the post-correction section.
[0061] In this invention, the registration method based on neural networks is exemplified by RegNet, and the training flowchart is attached. Figure 8 As shown, its overall network structure is as follows: Figure 7 As shown: where I F Indicates a fixed image, i.e., a reference image, I M The floating image represents the similar slices found in S3. In the RegNet network, the superscripts 4 and 2 indicate downsampling rates of 4 and 2, respectively. The output of the entire network is a displacement vector field (DVF). Angles and offsets are obtained from the DVF using least squares or singular value decomposition. The loss function during training consists of two parts: Huber loss, which minimizes the distance between the ground truth T (where the ground truth is the desired deformation field) and the predicted DVF T′; and bending energy (BE) regularization, which ensures the smoothness of the displacement field. The formula is expressed as:
[0062] C=Huber(T(x),T′(x))+γ·BE(T′(x))
[0063] Where C is the loss function of RegNet, T(x) is the ideal deformation field, T′(x) is the actual deformation field output by the network, γ is a hyperparameter, x is the image to be corrected, and the Huber loss is:
[0064]
[0065] This invention can automatically correct images without manual intervention, saving manpower. It uses image registration to automatically correct the patient's head position in the input data, and replaces three-dimensional direct registration with two-dimensional registration, which greatly reduces the amount of calculation, is fast, can be calculated in real time, saves time, increases accuracy, and makes the correction results precise.
[0066] Furthermore, this invention can perform two-dimensional registration using at least two reference images with different cross-sections. In each of the at least two two-dimensional registrations, the similar slices are found in step S2 for registration, and the rotation angle and offset are calculated in step S3. This allows for cross-sectional correction followed by coronal plane correction, further improving the accuracy of the invention. Using the correction method of this invention, the patient can move before scanning, maintaining a more comfortable posture, making it more humane.
[0067] This invention is applicable to transverse, coronal, and sagittal plane correction, thereby achieving a 3D craniotomy effect. Comparisons of the results of 3D craniotomy are attached. Figure 4 and attached Figure 5 As shown, attached Figure 4 and attached Figure 5 The diagrams, from left to right, show the transverse, coronal, and sagittal sections, with appendices. Figure 4 The image before correction is attached. Figure 5 The image is corrected using the method of this invention.
[0068] A system for automatically correcting head angle data in medical images includes a processor, a memory, and a computer program stored in the memory and executable on the processor. The system is characterized in that, when the processor executes the program, it implements any of the methods described above for automatically correcting head angle data in medical images. The memory can be of various types, such as random access memory, read-only memory, flash memory, etc. The processor can be of various types, such as a central processing unit, microprocessor, digital signal processor, or image processor.
[0069] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for automatically correcting head angle data in medical images, characterized in that: Includes the following steps: S1: Set the reference image: The reference image is a standard, untilted, and centered head slice image obtained when the patient's head is in a standard posture. It is required to be free of artifacts and have an intact head without defects. S2: Input image sequence to be corrected: The image sequence to be corrected is 3D image data, which is a medical image sequence obtained after the patient is reconstructed by CT or MRI scan. Several slices with the same orientation as the reference image are generated based on the 3D image data as the input sequence. S3. Finding similar slices: Use histogram matching or deep neural network algorithms to find the slices in the input sequence that are most similar to the reference image; The reference image also refers to the target corrected image of the input sequence; S4: Head correction: Register the similar slice image found in S3 with the reference image to obtain correction parameters, including rotation angle and horizontal offset in the x and y directions. Process the image sequence to be corrected according to the rotation angle and horizontal offset in the x and y directions to achieve head correction on the 3D image data.
2. The method for automatically correcting head angle data in medical images according to claim 1, characterized in that: The reference image is a preset image or image library. The orientation of the reference image includes the transverse, coronal and sagittal planes. The preset image or image library is a single image in one orientation or an image library in several orientations. When it is an image library in several orientations, steps S2-S4 are executed for each reference image in each orientation to achieve head correction of the 3D image data.
3. The method for automatically correcting head angle data in medical images according to claim 1, characterized in that: When using histogram matching to find the most similar slice image to the reference image in the sequence to be corrected, the process of measuring the similarity between the most similar slice in the input sequence and the reference image includes: Histogram similarity and area similarity are calculated for each slice in the input sequence, and then the similarity measure between each slice in the sequence to be corrected and the reference image is calculated. The slice with the largest similarity measure is selected as the slice in the sequence to be corrected that is most similar to the reference image, i.e., the similar slice map.
4. The method for automatically correcting head angle data in medical images according to claim 3, characterized in that: The formula for calculating the similarity measure is as follows: Similarity measurement = α *Histogram similarity+ β *Area similarity, in, α and β These are two hyperparameters.
5. The method for automatically correcting head angle data in medical images according to claim 1, characterized in that: The registration methods in step S4 include: registration based on feature images, registration based on grayscale images, registration based on transformed images, or registration based on neural networks.
6. A method for automatically correcting head angle data in medical images according to claim 5, characterized in that: The neural network-based registration uses RegNet, where I F Indicates a fixed image, i.e., a reference image, I M The floating image, i.e., the similar slices found in S3, is represented by the RegNet network, which performs network downsampling at rates of 4 and 2 respectively. The output of the entire network is a displacement vector field. The angle and offset are obtained from the displacement vector field using the least squares method or singular value decomposition. The loss function during training consists of two parts: one is the Huber loss, which is used to minimize the ground truth. T and predicted DVF T The distance between ′ is one part, and the other part is the bending energy canonical term, which is used to ensure the smoothness of the displacement field.
7. The method for automatically correcting head data angles in medical images according to claim 6, characterized in that: The loss function during training is: , Huber's loss is: , Where C is the loss function of RegNet. T ( x ( ) is an ideal deformation field, The actual deformation field output by the network is γ, which is a hyperparameter. x The image to be corrected.
8. A system for automatically correcting head angle data in medical images, characterized in that: The invention includes a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the program, it implements a method for automatically correcting head data angles in medical images as described in any one of claims 1-7.
Citation Information
Patent Citations
Cone beam CT and CT image registration method based on ICP algorithm and B spline
CN106934821A
Strain measurement system and method based on image in-situ processing
CN115112037A