A brain image reference point automatic labeling method based on magnetic resonance imaging

The automated annotation method for brain images obtained through magnetic resonance imaging has solved the problems of time consumption and error in manual annotation during preoperative assessment for epilepsy treatment. It has achieved high-precision automatic positioning of the nasal root, left auricular point, and right auricular point, thus improving diagnostic efficiency and accuracy.

CN115797293BActive Publication Date: 2026-06-12BEIJING HUINAO CLOUD COMPUTING CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING HUINAO CLOUD COMPUTING CO LTD
Filing Date
2022-12-02
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

In the preoperative evaluation for epilepsy treatment, current technology relies on manual marking of magnetic resonance imaging brain reference points, which leads to repetitive work, long time consumption, large errors, and inconsistent standards, affecting the accuracy of localization.

Method used

An automated brain image annotation method based on magnetic resonance imaging was adopted. By preprocessing MRI images, template matching, and global-local search, the reference points of the nasal root, left auricular point, and right auricular point were automatically located. The accuracy was improved by combining the curve extremum method and the area change method.

🎯Benefits of technology

It achieves automated, accurate, and efficient benchmark positioning with an error of less than 5mm, reducing human error, adapting to most human brain images, and improving diagnostic efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115797293B_ABST
    Figure CN115797293B_ABST
Patent Text Reader

Abstract

The application discloses a kind of brain image reference point automatic labeling methods based on magnetic resonance imaging, including the pre-processing of patient brain MRI image and conversion, obtain the space transformation matrix of MRI image and MNI template matching;The coordinates of standard reference point on MNI template are mapped to MRI image coordinate system, obtain the low-precision positioning coordinates of corresponding target reference point, output NAS positioning coordinates;LPA point or RPA point horizontal coordinate corresponding sagittal plane image is traversed, the features of each connected domain in sagittal plane image are determined, and the sagittal plane image of external auditory meatus is determined according to the relative position of connected domain features and NAS point;The intersection point of tragus and vortex is found on the sagittal plane image of external auditory meatus using curve extremum method and area change method, respectively obtain the high-precision positioning coordinates of LPA and RPA, with the characteristics of automation, high precision and strong adaptability, effectively avoid the error caused by human subjective factors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of brain magnetic resonance imaging technology, specifically to an automated annotation method for brain image reference points based on magnetic resonance imaging. Background Technology

[0002] Magnetic resonance imaging (MRI) is an advanced medical imaging technique. Utilizing the principle of nuclear magnetic resonance (NMR), it determines the location and type of atomic nuclei that make up an object by detecting the emitted electromagnetic waves through an applied gradient magnetic field, based on the varying attenuation of released energy in different structural environments within a substance. This allows for the creation of an image of the object's internal structure.

[0003] Currently, preoperative evaluation for epilepsy treatment requires lesion localization, which necessitates the use of 3D brain imaging data generated by magnetic resonance imaging (MRI). To meet this localization requirement, existing methods typically involve manually marking three reference points on the brain's MRI images: the nasal root (NAS), the left pre-auricular point (LPA), and the right pre-auricular point (RPA). When processing a large volume of patient MRI data, this repetitive manual work consumes a significant amount of physician time, leading to fatigue and increasing the likelihood of annotation errors. Furthermore, if the quality of the MRI structural image data is poor, the subjective error of manual marking is substantial. In addition, manual annotation prolongs the diagnostic process. Inconsistent annotation standards among different physicians can also negatively impact subsequent lesion localization.

[0004] In the existing technical solution, "A Method and Device for Facial Acupoint Location Based on Feature Point Localization Algorithm," application publication number CN105930810A, a method for locating facial acupoints is mentioned. This method extracts the left eyebrow, right eyebrow, and the highest point of the midline of the hairline from facial feature reference points. However, this method is primarily designed for visual facial images, rather than three-dimensional medical images generated by magnetic resonance imaging (MRI). The extracted reference points have different locations and uses. In the current field of MRI medical imaging, the mainstream approach remains manual annotation. Summary of the Invention

[0005] To address this issue, this invention provides an automated annotation method for brain image reference points based on magnetic resonance imaging (MRI) to solve the problem of intelligent localization of human brain images in preoperative assessment for epilepsy treatment.

[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0007] An automated annotation method for brain imaging reference points based on magnetic resonance imaging includes:

[0008] Step S01: Preprocess the MRI images of the patient's brain and convert them into brain tissue images in MNI space to maximize the similarity measurement between the MRI images and the MNI template, thereby obtaining the spatial transformation matrix that matches the MRI images and the MNI template.

[0009] Step S02: Map the coordinates of the three standard reference points on the MNI template to the coordinate system of the MRI image. The coordinate values ​​of the standard reference points are transformed by a spatial transformation matrix to obtain the low-precision coordinate values ​​of the target reference points in the MRI image. The three target reference points are the NAS point, LPA point and RPA point, respectively, to obtain the final positioning coordinates of the NAS.

[0010] Step S03: Traverse the sagittal images corresponding to all possible values ​​of the abscissa of the LPA or RPA points. The traversal process includes binarizing the sagittal images, determining the connectivity features of each connected component in the sagittal images, and determining the sagittal image of the external auditory canal opening based on the connectivity features and the relative position with the NAS points.

[0011] Step S04: Use the curve extremum method and area change method on the sagittal image of the external auditory canal opening to find the intersection point of the tragus and the vortex, and obtain the high-precision positioning coordinates of LPA and RPA respectively.

[0012] Furthermore, the MRI image preprocessing in step S01 includes coordinate system unification, grayscale normalization, image smoothing, and data type conversion. The coordinate system unification includes rotating and mirroring the MRI image to align its coordinates to the RAS direction of the world coordinate system.

[0013] The grayscale normalization is a normalization process applied to the maximum and minimum grayscale values, and the calculation formula is as follows:

[0014]

[0015] In the formula, inputPixel is the grayscale value of a pixel in the original input MRI image;

[0016] outputPixel represents the grayscale value of the pixel in the normalized MRI image output.

[0017] inputMin is the minimum gray value of the original input MRI image;

[0018] inputMax is the maximum grayscale value of the original input MRI image;

[0019] outputMin is the minimum gray value of the normalized MRI image output, which is set to 0;

[0020] `outputMax` is the maximum grayscale value of the normalized MRI image output, set to 511.

[0021] The image smoothing method uses the neighborhood averaging method.

[0022] Furthermore, the spatial transformation function for matching the MRI image with the MNI template in step S01 is:

[0023]

[0024] In the formula, T represents the spatial transformation;

[0025] R is the reference image;

[0026] F represents a floating image;

[0027] S is a similarity measure.

[0028] Furthermore, before step S03, the local search interval is determined based on the low-precision coordinates of the LPA and RPA points obtained in step S02, and the local search range of the LPA and RPA points is determined based on empirical data of the general size of a human face.

[0029] Furthermore, in step S03, the binarization processing of the sagittal image corresponding to the horizontal coordinate x includes, if x = i, i.e.:

[0030]

[0031] In the formula, inputGray for Gray values ​​of pixels in a time-sagittal image;

[0032] outputBinary for The pixel values ​​of the image after time binarization;

[0033] This is the grayscale threshold.

[0034] Furthermore, in step S03, the flood fill algorithm is used to determine the connected components.

[0035] Furthermore, in step S04, the curve extremum method specifically includes: traversing all possible values ​​of the vertical coordinate z corresponding to the horizontal coordinate x in the sagittal image where the external auditory canal opening is located; during the traversal, obtaining one-dimensional discrete continuous data points along the vertical coordinate z direction; and using the first derivative... The method of changing the sign of the positive and negative signs to determine the extreme points is as follows:

[0036] In the formula, This represents the grayscale value at coordinate z.

[0037] The subscripts i-1, i, and i+1 are the indexes of discrete continuous data points;

[0038] The subscripts peak and peak-1 represent the indexes of the extreme points in the discrete continuous data points.

[0039] Obtain the gray values ​​at the corresponding extreme points on at least 3 adjacent sagittal images. If the gray values ​​show a non-decreasing distribution along the direction of increasing x-axis, then the coordinates of the extreme point meet the requirements.

[0040] Furthermore, in step S04, if the curve extremum method fails to find a suitable intersection point between the tragus and the vortex, the area change method is used to locate the tragus. The area change method includes: when x=i, comparing the grayscale value changes of the two sagittal images at x=i-1 and x=i, generating a binarized image of the grayscale value change, i.e.:

[0041]

[0042] In the formula, The value of the corresponding pixel in the time-binarized image;

[0043] For x= The grayscale value of the pixel in the corresponding sagittal image;

[0044] .

[0045] In the binarized image, connective regions with pixel values ​​of 1 are found to obtain connective region information, which includes the shape and area of ​​the connective regions. Then, the coordinates of the tragus region are determined based on the connective region information and factors such as the position relative to the external auditory canal opening. Based on the coordinates of the tragus region, the LPA coordinates or RPA coordinates are found.

[0046] The embodiments of the present invention have the following advantages:

[0047] This invention presents an automated reference point annotation method for brain images based on magnetic resonance imaging (MRI), primarily addressing the intelligent localization problem in preoperative assessment of human brain images for epilepsy treatment. The method offers more accurate reference point localization, featuring automation, high precision, and strong adaptability. It improves the efficiency of existing manual annotation methods, effectively avoids errors caused by subjective human factors, and assists in the diagnosis of brain diseases. Using a medical image template matching method for global search, the approximate location of the reference point can be quickly determined, with a probability of completely incorrect reference point location being less than 2%, making it applicable to the vast majority of human brain MRI images. Furthermore, considering the characteristics of brain medical images, a scheme combining global and local search is proposed to find reference points, significantly reducing data processing volume and effectively avoiding large-scale search errors. Using the structural features of medical images for local search effectively improves the accuracy of global search localization. Compared with the annotation results of several experienced physicians, the average error in locating NAS, LPA, and RPA is approximately 5 mm. Attached Figure Description

[0048] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.

[0049] The structures, proportions, sizes, etc. illustrated in this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed herein, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.

[0050] Figure 1 This is a flowchart of an automated annotation method for brain image reference points based on magnetic resonance imaging, provided in Embodiment 1 of the present invention.

[0051] Figure 2 This is a schematic diagram illustrating the mapping of reference points from an MNI template to an MRI image in an automated annotation method for brain images based on magnetic resonance imaging provided in Embodiment 1 of the present invention.

[0052] Figure 3 A schematic diagram showing the location of the NAS point in an MRI image;

[0053] Figure 4This is a flowchart of a method for determining the sagittal plane image of the external auditory canal opening in an automated annotation method for brain imaging reference points based on magnetic resonance imaging, as provided in Embodiment 1 of the present invention.

[0054] Figure 5 A schematic diagram showing the locations of the LPA and RPA points in an MRI image;

[0055] Figure 6 This is a flowchart of the curve extremum method in an automated annotation method for brain image reference points based on magnetic resonance imaging provided in Embodiment 1 of the present invention;

[0056] Figure 7 The flowchart of the area change method in the automated annotation method of brain image reference points based on magnetic resonance imaging provided in Embodiment 1 of the present invention is shown. Detailed Implementation

[0057] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0058] like Figure 1 As shown, an automated annotation method for brain image reference points based on magnetic resonance imaging includes the following steps:

[0059] Step S01: Preprocess the MRI images of the patient's brain and convert them into brain tissue images in MNI space to maximize the similarity measurement between the MRI images and the MNI template, thereby obtaining the spatial transformation matrix that matches the MRI images and the MNI template.

[0060] The MRI images of the patient's brain include three-dimensional medical images of the patient's brain, such as sagittal and coronal images. The gray values ​​in the images represent the relative density of voxels. In addition, they include transformation matrices between the anatomical coordinate system and the image coordinate system, as well as between the anatomical coordinate system and the world coordinate system. These transformation matrices are usually 4x4 linear transformation matrices. For example, the coordinates of a point a(x, y, z) on an MNI template are transformed into the corresponding coordinates of a point b(x', y', z') in the MRI image, as shown in the following formula:

[0061]

[0062] In this embodiment of the invention, the MRI images of the patient's brain use NIFTI format files. In the NIFTI file header information, qform / sform stores the linear transformation matrix. Theoretically, qform is used for the mutual conversion between world coordinates in the MRI scanner space and image coordinates, while sform is used for the mutual conversion between world coordinates in standard space and image coordinates. In practice, there is no limitation. Alternatively, this matrix can be stored in the vox2ras file within the FreeSurfer mgh file.

[0063] MRI image preprocessing includes coordinate system unification, grayscale normalization, and image smoothing. The coordinate system unification involves rotating and mirroring the MRI image to align its coordinates to the RAS direction of the world coordinate system. Here, R represents the positive x-axis (left to right), A represents the positive y-axis (posterior to anterior), and S represents the positive z-axis (inferior to superior).

[0064] The grayscale normalization uses maximum and minimum value normalization, and the calculation formula is as follows:

[0065]

[0066] In the formula, inputPixel is the grayscale value of a pixel in the original input MRI image;

[0067] outputPixel is the grayscale value of a pixel in the normalized MRI image output;

[0068] inputMin is the minimum gray value of the original input MRI image;

[0069] inputMax is the maximum grayscale value of the original input MRI image;

[0070] `outputMin` is the minimum gray value of the normalized MRI image output. This value is manually set and is generally set to 0 for a normalization of 512 points.

[0071] `outputMax` is the maximum grayscale value of the normalized MRI image output. This value is manually set and is generally a normalization of 512 points, i.e., set to 511.

[0072] The image smoothing method uses a neighborhood averaging approach, which adds the gray value of a pixel in the original image to the gray values ​​of its multiple neighboring pixels, and then uses the average of the sums as the gray value of that pixel in the new image. This method is used to remove pixels with abrupt changes in color. Its advantages include simple algorithm, fast computation speed, and the ability to suppress high-frequency components, especially at edges and details. In this embodiment, the neighborhood averaging method uses a 5x5x5 convolution kernel with a kernel weight of 0.008.

[0073] Preprocessing of MRI images also includes data type conversion, which converts the normalized and smoothed gray values ​​into uint8 type. The conversion process generally involves data truncation, which can save computer memory during the calculation process.

[0074] Currently, the commonly used standard coordinate spaces and templates are the MNI space and MNI templates. The MNI space only defines the coordinate system, and there are different MNI templates within the MNI space. Commonly used MNI templates include MNI305, Colin27, and MNI152. MNI152 is further divided into linear and non-linear versions. Although these templates are all located in the MNI space, they differ significantly in their anatomical positions. The MNI template used in this embodiment of the invention is MNI152.

[0075] The MRI images are transformed into brain tissue images in MNI space through rigid body transformation. The rigid body transformation involves rotation, translation, scaling, and oblique cutting of the MRI images to maximize the similarity between the transformed MRI images and the MNI template. Then, the spatial transformation function T for matching the MRI images and the MNI template is calculated using the following formula:

[0076]

[0077] In the formula: The spatial transformation function is obtained from the spatial transformation matrix M: ;

[0078] R is the grayscale feature value of point F in the MNI template;

[0079] F is the grayscale feature value of the point corresponding to point F in the MRI image;

[0080] S is a similarity measure.

[0081] Determining the alignment degree between two images is crucial in template matching. The similarity metric S is a function constructed based on the structural or grayscale features of the two images, representing their alignment degree. Common similarity measurement methods can be categorized as follows: feature distance-based, grayscale-based, and information content-based. The optimal similarity measurement method is selected based on the specific application scenario, and corresponding features are extracted from the reference image R and the floating image F for calculation. This algorithm uses the mean-squared difference (MSQ) based on grayscale as the similarity metric S, which can be expressed as:

[0082]

[0083] In the formula: S is the similarity measure;

[0084] g is the gradient vector. or ,in It is a differential operator;

[0085] D is the difference. I and J are a pair of images, corresponding to the MNI template and the MRI image in this embodiment, and x is the index, i.e. point F in the spatial transformation function T.

[0086] To maximize image alignment and similarity, a suitable search algorithm is needed to explore all possible spatial transformations. Optimization methods based on this search begin with one or more guesses and, guided by the optimal match, aim to maximize the similarity of two images under a given spatial transformation. Commonly used search algorithms include: Powell's multidimensional direction set algorithm, steepest gradient descent, Newton's method, conjugate gradient method, simplex search, and genetic algorithms.

[0087] Step S02: Obtain the coordinates of the reference point using a global search method, specifically as follows: Figure 2 As shown, the coordinates of three standard reference points on the MNI template are mapped to the coordinate system of the MRI image. These three standard reference points are the NAS reference point, LPA reference point, and RPA reference point. The mapped coordinates of these three standard reference points are transformed using a spatial transformation matrix to obtain three global search target reference points in the MRI image. These three global search target reference points are the NAS point, LPA point, and RPA point, respectively. The accuracy of the NAS point meets the requirements. The NAS positioning coordinates are output, as shown below. Figure 3 As shown, the NAS positioning coordinates are located at the junction of the frontal bone and the nasal bone, but the accuracy of the LPA and RPA points is too low to meet the requirements. Further precision is needed in the vicinity of the LPA and RPA points to improve the positioning accuracy.

[0088] The LPA and RPA points obtained from the global search in this step are not very accurate, but they can pinpoint their approximate locations. Using the LPA and RPA coordinates located in this step, the local search intervals are determined. Based on empirical data on the general size of a face, the local search intervals for the LPA and RPA points are determined separately. This effectively avoids large-scale search errors, reduces a large amount of invalid processing, and improves processing efficiency. If the LPA coordinates of the template matching in step S02 are (100, 200, 300), then according to the face size, the x-direction needs to be precisely searched within 10 units before and after, that is, the x-search interval is [100-10, 100+10]; according to the face size, the y-direction needs to be precisely searched within 15 units before and after, that is, the y-search interval is [200-15, 200+15]; according to the face size, the z-direction needs to be precisely searched within 20 units before and after, that is, the y-search interval is [300-20, 300+20]; the next step of local search is to search within a cube in space, and the local search space of the LPA point is x[90, 110], y[185, 215], z[280, 320].

[0089] Step S03: Traverse all possible values ​​of the horizontal coordinate x in the local search space of the LPA or RPA points respectively. During the traversal, the sagittal images corresponding to the horizontal coordinate x are binarized to determine the information of each connected component in the sagittal images. Based on the connected component feature information and their relative positions with the NAS points, the sagittal images of the external auditory canal openings are determined, resulting in the sagittal images of the left and right external auditory canal openings. Since the processing methods for LPA and RPA points are the same, the following only describes the implementation method for determining the appropriate external auditory canal opening for LPA points:

[0090] 1) such as Figure 4 As shown, the sagittal images corresponding to all possible horizontal coordinates x in the local search space of the LPA point are binarized. Traversing all pixels in the sagittal image from the outside in, when x=i, the binarization formula is as follows:

[0091]

[0092] In the formula: inputGray The grayscale value of a pixel in the time-sagittal image, i.e., the input image is the sagittal image corresponding to the x-axis.

[0093] outputBinary for Pixel values ​​after time-binarization;

[0094] This is the grayscale threshold.

[0095] 2) Find connected components with a value of 0 in the binarized image and determine the information of each connected component, including its area and shape. The method for finding connected components is a flood-fill algorithm. This algorithm, like a flood, fills a connected region. For water to flow, certain conditions must be met; these conditions can be understood as low-lying areas where water can flow. In image processing, this involves starting from a seed point and expanding outwards to nearby pixels, finding all points with the same or similar colors and filling them with a new color. These points form a connected region.

[0096] 3) Using constraints: the area of ​​the connected component is greater than an empirical threshold, the shape of the connected component meets empirical requirements, and the vertical relative distance between the upper boundary of the connected component and the NAS point is within an empirical range, connected components that meet the conditions are selected as the sagittal plane image of the external auditory canal opening. The boundary coordinates of the external auditory canal opening are recorded, the traversal loop is exited, and the subsequent steps are entered. If the external auditory canal opening that meets the conditions is still not found after traversing all possible values ​​of the x-coordinate in the sagittal plane image, the low-precision LPA point coordinates located in step S02 are output.

[0097] Step S04: Using the curve extremum method on the sagittal image of the external auditory canal opening obtained in step S03, find the intersection point of the tragus and the vortex, such as... Figure 5 The image shows the LPA and RPA positioning coordinates on an MRI image. Figure 6 As shown, the curve extremum method specifically includes traversing all possible x-coordinates within the local search space of the LPA point or RPA point, respectively. x, x The value range is from the x-axis boundary within the local search space to the x-coordinate of the adjacent external auditory canal opening. x=j At that time, an empirical density threshold was used to binarize the external auditory canal opening. y, z To increase the success rate of the search, the sagittal plane image of the coordinate range region can be used in the current... y, z Extending outwards from the coordinate range, find the sagittal image where the total area of ​​regions with a value of 1 in the binarized image is greater than the empirical density threshold.

[0098] Traversing the sagittal image of the external auditory canal opening obtained in step S03, the horizontal coordinates x corresponding ordinate z All possible values, during the traversal, along the y-axis z The direction yields one-dimensional discrete continuous pixel grayscale values, using the first derivative. The method of changing the sign of the positive and negative signs to determine the extreme points is as follows:

[0099]

[0100] In the formula: coordinates z The corresponding grayscale value;

[0101] Subscript i- 1 、i、i+ 1 represents the sequence number of a discrete continuous data point;

[0102] Subscript peak, peak- 1 represents the index of the extreme point in the discrete continuous data points.

[0103] Obtain the gray values ​​of the corresponding extreme point locations on at least three adjacent sagittal images. If the gray values ​​show a non-decreasing distribution along the direction of increasing x-axis, then the coordinates of the extreme point meet the requirements and are used as high-precision positioning coordinates for LPA or RPA, and output.

[0104] If the above curve extremum method fails to find a suitable point of intersection between the tragus and the vortex, then the area change method is used to find the tragus. Figure 7 As shown, the area change method specifically includes iterating through all possible values ​​of x from the outside in, where the range of x extends from the x-axis boundary within the local search space to the x-coordinate of the adjacent external auditory canal opening. When x = When comparing x= -1 and x= The changes in grayscale values ​​in the two sagittal planes generate a binarized image of the grayscale value changes. That is:

[0105]

[0106] In the formula, The value of the corresponding pixel in the time-binarized image;

[0107] for The grayscale value of the pixel in the corresponding sagittal image;

[0108] This is an empirical threshold.

[0109] In the binarized image, within the region anterior to the external auditory canal opening, connected components with pixel values ​​of 1 are identified to obtain connected component information. This information includes the shape and area of ​​the connected components. Then, based on the following constraints: the area of ​​the connected component is greater than an empirical threshold, the shape of the connected component meets empirical requirements, the vertical distance between the upper boundary of the connected component and the upper and lower boundaries of the external auditory canal opening is within an empirical range, and the y-direction distance between the right boundary of the connected component and the left boundary of the external auditory canal opening is within an empirical range, all connected components are filtered. The reasonable connected components are designated as the tragus region. Based on the tragus region, the coordinates of the highest point in the z-direction are obtained. These coordinates represent the intersection of the tragus and the vortex, i.e., the LPA positioning coordinates or RPA positioning coordinates, and are then output.

[0110] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.

Claims

1. An automated annotation method for brain image reference points based on magnetic resonance imaging, characterized in that, Includes the following steps: Step S01: Preprocess the MRI images of the patient's brain and convert them into brain tissue images in MNI space to maximize the similarity measurement between the MRI images and the MNI template, and obtain the spatial transformation matrix matching the MRI images and the MNI template. Step S02: Map the coordinates of the three standard reference points on the MNI template to the coordinate system of the MRI image. The coordinate values ​​of the standard reference points are transformed by a spatial transformation matrix to obtain the low-precision coordinate values ​​of the target reference points in the MRI image. The three target reference points are the NAS point, LPA point and RPA point, respectively, to obtain the final positioning coordinates of the NAS. Step S03: Traverse the sagittal images corresponding to all possible values ​​of the abscissa of the LPA or RPA points. The traversal process includes binarizing the sagittal images, determining the connectivity features of each connected component in the sagittal images, and determining the sagittal image of the external auditory canal opening based on the connectivity features and the relative position with the NAS points. Step S04: Use the curve extremum method and area change method on the sagittal image of the external auditory canal opening to find the intersection point of the tragus and the vortex, and obtain the high-precision positioning coordinates of LPA and RPA respectively.

2. The automated annotation method for brain image reference points based on magnetic resonance imaging according to claim 1, characterized in that, The preprocessing of the MRI image in step S01 includes unifying the coordinate system, grayscale normalization, and image smoothing. The unified coordinate system includes operations such as rotating and mirroring MRI images to unify their coordinate system to the RAS direction of the world coordinate system; The grayscale normalization is a normalization process applied to the maximum and minimum grayscale values, and the calculation formula is as follows: In the formula, inputPixel is the grayscale value of a pixel in the original input MRI image; outputPixel represents the grayscale value of the pixel in the normalized MRI image output. inputMin is the minimum gray value of the original input MRI image; inputMax is the maximum grayscale value of the original input MRI image; outputMin is the minimum gray value of the normalized MRI image output, which is set to 0; outputMax is the maximum gray value of the normalized MRI image output, which is set to 511. The image smoothing method uses the neighborhood averaging method.

3. The automated annotation method for brain image reference points based on magnetic resonance imaging according to claim 1, characterized in that, The spatial transformation function for matching the MRI image with the MNI template in step S01 is: In the formula, T is the spatial transformation function; R is the reference image; F represents a floating image; S is a similarity measure.

4. The automated annotation method for brain image reference points based on magnetic resonance imaging according to claim 1, characterized in that, Before step S03, the local search interval is determined based on the low-precision coordinates of LPA and RPA points obtained in step S02, and the local search interval range of LPA and RPA points is determined based on empirical data of the general size of a human face.

5. The automated annotation method for brain image reference points based on magnetic resonance imaging according to claim 1, characterized in that, In step S03, the sagittal image corresponding to the horizontal coordinate x is binarized. For the sagittal image where x=i, the binarization process is as follows: In the formula, inputGray for Gray values ​​of pixels in a time-sagittal image; outputBinary for The pixel values ​​of the image after time binarization; This is the grayscale threshold.

6. The automated annotation method for brain image reference points based on magnetic resonance imaging according to claim 1, characterized in that, In step S03, the flood fill algorithm is used to determine the connected components.

7. The automated annotation method for brain image reference points based on magnetic resonance imaging according to claim 1, characterized in that, In step S04, the curve extremum method specifically includes: traversing the horizontal coordinates of the sagittal image where the external auditory canal opening is located. x corresponding ordinate z All possible values, during the traversal, along the y-axis z The direction yields one-dimensional discrete continuous data points, using the first derivative. The method of changing the sign of the positive and negative signs to determine the extreme points is as follows: In the formula, This represents the grayscale value at coordinate z. Subscript i- 1. i、i+ 1 represents the sequence number of a discrete continuous data point; Subscript peak -1 represents the index of the extreme point in the discrete continuous data points; Obtain the gray values ​​at the corresponding extreme points on at least 3 adjacent sagittal images. If the gray values ​​show a non-decreasing distribution along the direction of increasing x-axis, then the coordinates of the extreme point meet the requirements.

8. The automated annotation method for brain image reference points based on magnetic resonance imaging according to claim 1, characterized in that, In step S04, if the curve extremum method fails to find a suitable intersection point between the tragus and the vortex, the area change method is used to locate the tragus. The area change method includes: when x=i, comparing the grayscale value changes of the two sagittal images of x=i-1 and x=i, generating a binarized image of the grayscale value change, i.e.: In the formula, for The value of the corresponding pixel in the time-binarized image; for The grayscale value of the pixel in the corresponding sagittal image; This is an empirical threshold; In the binarized image, connective regions with pixel values ​​of 1 are found to obtain connective region information, which includes the shape and area of ​​the connective regions. Then, the coordinates of the tragus region are determined based on the connective region information and the positional factors relative to the external auditory canal opening. Based on the coordinates of the tragus region, the LPA coordinates or RPA coordinates are found.