Brain midline determination method and device and medium
By combining a dual-path fusion method and a machine learning model with analytical geometry to determine the brain midline, the problem of low accuracy and poor robustness in brain midline identification in existing technologies is solved. This achieves high-precision and high-reliability brain midline determination in complex cases, and is applicable to scenarios such as emergency and intensive care.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies for identifying the brain midline suffer from low accuracy, poor robustness, and susceptibility to noise, especially in complex cases where the error is large, affecting the efficiency and accuracy of clinical diagnosis.
A dual-path fusion method is adopted, which obtains candidate brain midlines through linear fitting and geometric methods, and uses a machine learning model to fuse weights. The final brain midline is calculated by combining analytical geometric methods, and the first and second candidate brain midlines are fused to improve accuracy and robustness.
It can still output accurate brain midlines in complex cases, improving the accuracy and robustness of brain midline determination. It is suitable for emergency and intensive care scenarios, enhancing the reliability of clinical diagnosis.
Smart Images

Figure CN121861104A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of brain midline recognition, and more specifically, to a method, apparatus, and medium for determining the brain midline. Background Technology
[0002] The midline of the brain is an important marker for assessing the symmetry of brain structure and functional lateralization. The left hemisphere is more dominant in language, while the right hemisphere is more focused on spatial and facial recognition.
[0003] In neuroimaging (such as CT and MRI), accurate identification of the midline is crucial for diagnosing "midline shift," a sign that often indicates increased intracranial pressure caused by tumors, hemorrhage, or cerebral edema, requiring urgent intervention.
[0004] Currently, commonly used clinical methods include visual localization by doctors based on anatomical landmarks such as the third ventricle and corpus callosum, or automated methods such as image symmetry analysis and Hough transform to detect edge lines.
[0005] However, visual methods rely on experience, are time-consuming, and highly subjective; symmetry methods fail when pathological asymmetry occurs; and Hough transforms are susceptible to image noise and edge discontinuities, leading to inaccurate detection.
[0006] These limitations restrict the accuracy and automation of midline localization, and are prone to errors, especially in complex cases, affecting the efficiency and accuracy of clinical diagnosis. Summary of the Invention
[0007] One of the purposes of this disclosure is to provide a method for accurately determining the midline of the brain.
[0008] One of the purposes of this disclosure is to provide a method for determining the brain midline that is highly accurate, robust, and interpretable.
[0009] One of the purposes of this disclosure is to provide a method for determining the brain midline that is highly fault-tolerant and noise-resistant.
[0010] According to a first aspect of this disclosure, a method for determining the brain midline is provided. The method includes: acquiring a standardized image of the brain, wherein the anterior commissure and posterior commissure in the standardized image are aligned with each other; acquiring the edge contour of the brain parenchyma based on the standardized image; performing linear fitting on the edge contour of the brain parenchyma to obtain a first candidate brain midline; obtaining a second candidate brain midline based on the edge contour of the brain parenchyma using a geometric method; and fusing the first candidate brain midline and the second candidate brain midline to obtain the final brain midline.
[0011] Preferably, the step of fusing the first candidate midline and the second candidate midline to obtain the final midline may include: determining the fitting quality features and anatomical rationality features of the brain parenchyma edge contour of the first candidate midline and the second candidate midline, respectively; standardizing and splicing the fitting quality features and anatomical rationality features to obtain a multidimensional reliability feature vector; inputting the multidimensional reliability feature vector into a pre-trained machine learning model to obtain the first weight of the first candidate midline and the second weight of the second midline; and obtaining the final midline based on the first weight, the second weight, the first linear equation of the first candidate midline, and the second linear equation of the second candidate midline.
[0012] Preferably, the step of obtaining the final brain midline based on the first weight and the second weight, the first linear equation of the first candidate brain midline, and the second linear equation of the second candidate brain midline may include: expressing the first linear equation and the second linear equation with the ordinate as the independent variable; taking values within the ordinate range of the brain parenchyma edge contour and calculating the corresponding abscissas on the first candidate brain midline and the second candidate brain midline; using the first weight and the second weight to weight the corresponding abscissas under the same ordinate value to obtain a new set of points; and performing linear fitting on the new set of points to obtain the final brain midline.
[0013] Preferably, the step of fusing the first candidate brain midline and the second candidate brain midline to obtain the final brain midline may include: calculating the midline between the first candidate brain midline and the second candidate brain midline based on analytical geometry methods as the final brain midline.
[0014] Preferably, the step of calculating the midline between the first candidate brain midline and the second candidate brain midline as the final brain midline based on analytical geometry may include: determining the first straight line equation of the first candidate brain midline and the second straight line equation of the second candidate brain midline; using the coordinates of the first and second straight line equations as a reference, obtaining multiple pairs of points with the same ordinate on the first candidate brain midline and the second brain midline; determining the midpoint of each pair of points to obtain a new set of points; performing straight line fitting on the new set of points, and using the fitting result as the final brain midline.
[0015] Preferably, the step of obtaining the second candidate brain midline based on the brain parenchyma edge contour using geometric methods may include: obtaining the leftmost point with the smallest abscissa and the rightmost point with the largest abscissa in the brain parenchyma edge contour; determining the midpoint between the leftmost and rightmost points; determining the centroid of the brain parenchyma edge contour; and determining the second candidate brain midline based on the midpoint and centroid.
[0016] Preferably, the determination method may further include: performing convex hull processing and symmetry repair on the brain parenchyma edge contour sequentially before obtaining the leftmost point with the smallest abscissa and the rightmost point with the largest abscissa in the brain parenchyma edge contour.
[0017] Preferably, the steps of convex hull processing and symmetry repair may include: performing a convex hull transformation on the brain parenchyma edge contour to generate a closed convex polygon contour; calculating the minimum area circumscribed rectangle of the convex polygon contour; using the perpendicular bisector of the minor axis of the minimum area circumscribed rectangle as a temporary midline; dividing the convex polygon contour into a left half and a right half based on the temporary midline; calculating the geometric features of the left half and the right half respectively, and comparing the differences between them; identifying the relatively complete one of the left half and the right half based on the differences between them; performing a geometric mirror transformation relative to the temporary midline based on the one of them to obtain a mirrored convex hull contour; and obtaining the preprocessed brain parenchyma edge contour based on the one of them and the mirrored convex hull contour.
[0018] According to a second aspect of this disclosure, a device for determining the midline of the brain is provided. The device includes a non-transitory computer-readable storage medium and a processor. The non-transitory computer-readable storage medium stores a program or instructions that, when executed by the processor, cause the processor to perform the determination method described above.
[0019] According to a third aspect of this disclosure, a non-transitory computer-readable storage medium is provided, which stores a program or instructions that, when executed by a processor, cause the processor to perform the aforementioned determination method. Attached Figure Description
[0020] The above and other aspects, features, and advantages of specific embodiments of the present disclosure will become more apparent from the following description taken in conjunction with the accompanying drawings, in which: Figure 1 A flowchart is shown for a method of determining the midline of the brain according to an exemplary embodiment of the present disclosure; Figure 2 A standardized image of the brain according to an example embodiment of the present disclosure is shown; Figure 3 A binarized image of brain parenchyma according to an example embodiment of the present disclosure is shown; Figure 4 An inflated image is shown according to an example embodiment of this disclosure; Figure 5 An edge detection result image of the Canny operator according to an example embodiment of the present disclosure is shown; Figure 6 A schematic diagram of a first candidate midline of the brain according to an exemplary embodiment of the present disclosure is shown; Figure 7 A schematic diagram of a second candidate midline of the brain according to an exemplary embodiment of the present disclosure is shown; Figure 8 A flowchart is shown for a weighted midline determination method according to an exemplary embodiment of the present disclosure; Figure 9A detailed flowchart of a weighted midline determination method according to an exemplary embodiment of the present disclosure is shown; Figure 10 A flowchart illustrating the calculation of the final brain midline using an analytical geometry-based method according to an example embodiment of this disclosure is shown; Figure 11 A flowchart illustrating convex hull processing and symmetry repair according to an example embodiment of this disclosure is shown; Figure 12 A block diagram of a device for determining the midline of the brain according to an exemplary embodiment of the present disclosure is shown. Detailed Implementation
[0021] The following detailed description is provided to aid in obtaining a full understanding of the methods, apparatus, and / or systems described herein. However, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein; equivalent substitutions or changes may be made, except for operations that must occur or be performed in a specific order. Furthermore, for clarity and conciseness, descriptions of content well-known in the art will be omitted or simplified.
[0022] Unless otherwise specified, the same reference numerals generally refer to the same elements (e.g., components, steps, and methods). Reference numerals described in previous embodiments that reappear in later embodiments may be omitted. Furthermore, technical features described in different or the same embodiments can be combined in any way, as long as the combined embodiment or technical solution is complete and can solve the technical problems of this application or achieve the technical effects described or not described in this disclosure but which can be determined based on the complete technical solution described above.
[0023] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains upon understanding this disclosure. Unless expressly defined herein, terms (such as those defined in a general dictionary) shall be interpreted as having a meaning consistent with their meaning in the context of the relevant field and in this disclosure, and shall not be interpreted in an idealized or overly formalistic manner. The terminology in this disclosure is described below.
[0024] Anterior commissure (AC): Located at the base of the brain, it is a small bundle of nerve fibers that crosses the fissure of the cerebral hemisphere.
[0025] Posterior commissure (PC): Similar to the anterior commissure (AC), the PC is also a group of nerve fibers connecting the left and right hemispheres of the brain, but it is located closer to the back of the brain. The anterior commissure (AC) and posterior commissure (PC) together define a line, the AC-PC line, which is used as a standardized reference plane to ensure that data from different scans or different patients can be compared with each other.
[0026] This disclosure utilizes the fusion of independent dual-path midlines to obtain the final brain midline, thereby improving the accuracy of brain midline determination. The dual-path midlines are a linearly fitted midline (e.g., the Hough midline) and a geometric midline, and the fusion method includes analytical geometric fusion and machine learning fusion.
[0027] In cases with severe asymmetry, such as unilateral cerebral hemorrhage, large-area cerebral infarction, or brain tumors, traditional single-path methods often fail or exhibit significant bias. However, the dual-path design disclosed in this paper can make reasonable inferences based on the "residual information" of the other path even when the information from one path is distorted. By fusing and smoothing errors, it can still output a relatively reasonable and bias-controlled brain midline. This stability under extreme pathological conditions is unexpected. Furthermore, in normal or mildly diseased images, the results from the two paths are already close; fusion can further eliminate their respective minor errors, resulting in a more accurate brain midline.
[0028] The following is a detailed description of the embodiments of this disclosure.
[0029] Figure 1 A flowchart is shown for a method of determining the midline of the brain according to an exemplary embodiment of the present disclosure; Figure 2 A standardized image of the brain according to an example embodiment of the present disclosure is shown; Figure 3 A binarized image of brain parenchyma according to an example embodiment of the present disclosure is shown; Figure 4 An inflated image is shown according to an example embodiment of this disclosure; Figure 5 An edge detection result image of the Canny operator according to an example embodiment of the present disclosure is shown; Figure 6 A schematic diagram of a first candidate midline of the brain is shown according to an exemplary embodiment of the present disclosure.
[0030] Reference Figure 1 The method for determining the midline of the brain according to an example embodiment of the present disclosure may include steps S110, S120, S130, S140 and S150.
[0031] In step S110, a standardized image of the brain is acquired. In the standardized image of the brain, the anterior commissure and posterior commissure are aligned with each other, i.e., AC-PC aligned. This allows for the reduction of anatomical positional variations due to individual differences by using the AC-PC line as a reference, enabling data from different individuals to be compared within the same framework.
[0032] The steps for obtaining standardized images of the brain may include: performing skin and bone removal operations on raw brain CT scan images to obtain images showing only brain tissue, and then performing ACPC alignment to obtain standardized images of the brain (see details). Figure 2Adjusting the window width and level of an image in this way optimizes the contrast and visibility of brain tissue, making it easier for doctors to observe details within the brain, such as gray matter, white matter, the ventricular system, and any potential lesions. Specifically, the "window width" controls the density range displayed on the image, while the "window level" is the center value of this range. For brain windows, commonly used window width and level settings may vary depending on specific clinical needs, but generally, the window width is set at 80-100 HU, and the window level at around 35-40 HU. These values can be fine-tuned as needed to adapt to different observation targets. It is important to note that removing the scalp and skull does not actually delete this information from the original data; rather, it is done by adjusting the image display parameters to highlight or display only the areas of interest. This is usually performed by radiologists or specialized technicians to ensure optimal diagnostic results.
[0033] The above-described method of obtaining standardized images is merely an example. This disclosure is not limited to this. Alternatively, the brain tissue region can be directly segmented by setting a threshold using the CT value range (brain tissue is typically in the range of 20-80 HU).
[0034] During AC-PC alignment, the anterior commissure (AC) and posterior commissure (PC) anatomical landmarks are first precisely located on MRI or CT images. Then, using the AC-PC line as a reference, the spatial orientation of the image is adjusted so that the AC-PC line is horizontal and perpendicular to the anterior-posterior direction of the brain. A standard coordinate system is typically established with the AC point as the origin. This eliminates differences in head tilt and ensures that brain structures from different individuals are aligned in the same anatomical space, providing a consistent space for subsequent midline extraction, brain region segmentation, and functional analysis.
[0035] In step S120, the edge contour of the brain parenchyma is obtained based on the standardized image. There are many ways to obtain the edge contour of the brain parenchyma based on the standardized image. For example, binarization is performed first, followed by morphological operations, then maximum connected component calculation, then edge detection, and finally breakpoint connection and merging to obtain the final edge contour of the brain parenchyma.
[0036] For example, the standardized image can first be segmented using the Otsu threshold to obtain a binarized image of the brain parenchyma (see details). Figure 3 Otsu thresholding assumes that an image can be naturally divided into two classes based on gray levels: foreground (target) and background. The algorithm aims to find a threshold that makes the separation between these two classes as clear as possible. Specifically, it calculates the inter-class variance for each possible threshold and selects the threshold that maximizes the inter-class variance as the optimal threshold. The Otsu method iterates through all possible thresholds, calculates the inter-class variance for each threshold, and selects the threshold that maximizes the inter-class variance as the final segmentation threshold.
[0037] However, the above-described method for obtaining binarized images of brain parenchyma is merely an example, and this disclosure is not limited thereto. For example, a global threshold that maximizes the inter-class variance can be automatically found.
[0038] Then, dilation morphological operations can be performed on the binarized brain parenchyma image to obtain the dilated image (see details for reference). Figure 4 This can fill in small holes or tiny breaks inside the brain parenchyma in binary images of the brain parenchyma, and connect adjacent but unconnected brain tissue regions. In addition to performing a dilation operation using structuring elements (such as circles), morphological images can also be obtained through a closing operation (dilation followed by erosion) for subsequent processing.
[0039] Next, the maximum connected component is calculated on the dilated image to obtain the processed brain parenchyma image. This removes small noise regions or non-brain tissue fragments generated after segmentation, while retaining the largest, connected brain parenchyma.
[0040] The process of calculating the maximum connected component is as follows: First, all connected components in the dilated image need to be labeled. For example, this can be done using a two-pass scanning algorithm. Specifically, in the first pass, a temporary label is assigned to each encountered foreground pixel, and equivalence pairs are recorded; in the second pass, equivalence classes are merged. Then, connectivity rules are determined, commonly 4-connectivity and 8-connectivity. The size of each connected component is calculated. Specifically, after labeling all connected components, the number of pixels contained in each connected component is calculated. Finally, the maximum connected component is found. Specifically, the sizes of all connected components are compared, and the connected component with the most pixels is the maximum connected component.
[0041] In addition to calculating the maximum connected component, brain parenchyma images can also be obtained through morphological operations (e.g., opening operations).
[0042] Next, the Canny operator is used to detect the edges of the processed brain parenchyma to obtain the brain parenchyma edge contours (see details in [reference]). Figure 5 This allows for the detection of boundaries in brain parenchyma regions, generating a clear and continuous set of edge points. However, this disclosure is not limited to this; brain parenchyma edge contours can also be obtained through extraction based on segmented boundaries.
[0043] Finally, the discontinuous points of the brain parenchyma edge contour are connected and merged to obtain the final brain parenchyma edge contour. This can repair minor discontinuities caused by noise or imperfect segmentation, forming a more complete and smooth closed contour. As an example, the final brain parenchyma edge contour can also be obtained through contour smoothing and other methods.
[0044] In step S130, Hough line fitting is performed on the contour of the brain parenchyma edge to obtain the first candidate brain midline. Hough line fitting first performs edge detection (e.g., Canny) on the image to extract the edge point set. For each edge point, voting is performed in the parameter space (ρ-θ): all possible lines passing through the point are traversed and accumulated to the corresponding (ρ, θ) cell. After traversing all points, the (ρ, θ) corresponding to the peak value in the accumulator is the most likely line parameter. Multiple candidate lines are extracted by setting a threshold or selecting the top K peak values. Finally, (ρ, θ) is converted into a line equation in the image space to complete the fitting.
[0045] Specifically, the steps of fitting Hough lines to the brain parenchyma edge contour to obtain the first candidate brain midline may include: mapping each point of the brain parenchyma edge contour to a sine curve in the Hough parameter space; counting and accumulating the discrete accumulator grid cells passed through by each sine curve; determining the global highest peak value based on the accumulation result; and performing an inverse transformation on the global highest peak value to obtain the first candidate brain midline.
[0046] Specifically, firstly, each point (x) on the contour can be... i , y i Mapped to the Hough parameter space (ρ-θ plane), its trajectory is a sine curve ρ = x i cos θ + y i sin θ. The parameter space is discretized into a two-dimensional accumulator grid, where θ typically ranges from [0° to 180°), and ρ corresponds to the maximum diagonal distance of the image. A vote count is performed on the discrete grid cells traversed by each sine curve to achieve accumulation. After traversing all contour points, the cell with the highest value in the accumulator corresponds to the global highest peak value, representing the line parameter (ρ) that supports the most points in the image. max , θ max Finally, through inverse transformation, this parameter is restored to the linear equation x cos θ in image space. max + y sin θ max = ρ max This will yield the first candidate midline of the brain. See details in [link to relevant documentation]. Figure 6 Multiple candidate brain midlines can be obtained by setting a voting threshold and selecting multiple significant peaks in the accumulator; alternatively, a single primary candidate brain midline can be determined solely based on the highest global peak (e.g., Figure 6 The middle line of the brain (as shown).
[0047] Besides the Hough transform, the first candidate brain midline can also be obtained through linear fitting, such as least squares fitting. The line obtained by linear fitting can capture the overall trend of the brain contour and is insensitive to minor local deformations, but it is easily affected by large-scale contour loss or severe asymmetry. As mentioned above, this disclosure does not use a single method to determine the brain midline, but further integrates information representing "symmetry and centroid dominance." This method is sensitive to asymmetry but insensitive to local details of the contour, and can reflect the overall mass distribution. Thus, the advantages and disadvantages of these two methods are complementary. When pathology leads to severe loss of brain tissue on one side, path one (fitted straight line) may fail, but path two (geometric center) can still provide a reference based on the centroid of the remaining tissue; conversely, when the contour has local interference but is overall symmetrical, path one is more reliable.
[0048] Therefore, the method for determining the brain midline using a fusion approach disclosed in this invention no longer strictly relies on the ideal assumptions of "intact brain tissue" or "strict symmetry," enabling it to be applied to a wider range of clinical scenarios, including emergency rooms and intensive care units where rapid and automated assessment of midline shift is urgently needed. The geometric method for determining candidate brain midlines disclosed in this invention is described in detail below.
[0049] Figure 7 A schematic diagram of a second candidate midline of the brain according to an exemplary embodiment of the present disclosure is shown; Figure 8 A flowchart is shown for a weighted midline determination method according to an exemplary embodiment of the present disclosure; Figure 9 A detailed flowchart of a weighted midline determination method according to an exemplary embodiment of the present disclosure is shown; Figure 10 A flowchart illustrating the calculation of the final brain midline using an analytical geometry-based method according to an example embodiment of this disclosure is shown; Figure 11 A flowchart illustrating convex hull processing and symmetry repair according to an example embodiment of this disclosure is shown.
[0050] In step S140, a second candidate brain midline is obtained based on the edge contour of the brain parenchyma using geometric methods.
[0051] Step S140, which obtains the second candidate brain midline based on the brain parenchyma edge contour using geometric methods, may include: obtaining the leftmost point with the smallest abscissa and the rightmost point with the largest abscissa in the brain parenchyma edge contour; determining the midpoint of the leftmost point and the rightmost point; determining the centroid of the brain parenchyma edge contour; and determining the second candidate brain midline based on the midpoint and the centroid.
[0052] For details, please refer to Figure 7The process of obtaining the second candidate brain midline based on the brain parenchyma edge contour is as follows: First, the leftmost point A (smallest x-coordinate) and the rightmost point B (largest x-coordinate) of the brain parenchyma edge contour are identified in the standardized image. These two points are located at the left and right lateral boundaries of the brain, respectively. Connecting A and B forms a horizontal diameter AB, with its geometric midpoint C representing the lateral center position. Then, the centroid D of the entire brain parenchyma edge contour is calculated, which is the weighted average of the coordinates of all contour points, reflecting the overall structural center of gravity. Since the ideal brain midline should pass through the center of the brain and be parallel to the left and right axes of symmetry, points C and D are used as two key reference points to determine a straight line—the second candidate brain midline. This method utilizes geometric features, requires no complex calculations, is intuitive and robust, and can serve as an effective supplement to linear fitting methods such as the Hough transform.
[0053] In step S150, the first candidate brain midline and the second candidate brain midline are fused to obtain the final brain midline. Specific fusion methods may include machine learning fusion and analytical geometry fusion; however, this disclosure is not limited thereto. The machine learning fusion method is described below.
[0054] Step S150, which involves fusing the first candidate brain midline and the second candidate brain midline to obtain the final brain midline, may include steps S1501, S1502, S1503, and S1504.
[0055] Reference Figure 8 In step S1501, the fitting quality characteristics of the first candidate brain midline and the anatomical rationality characteristics of the brain parenchyma edge contour are determined respectively.
[0056] For example, fitting quality features (e.g., Hough accumulator peak value of the first candidate brain midline, symmetry repair residual of the second candidate brain midline) and anatomical plausibility features (e.g., distances from these two lines to the geometric center of the brain, difference in area between the left and right hemispheres after segmentation, and overlap with the third ventricle) can be calculated separately. In addition, image quality features (such as image signal-to-noise ratio and mean edge gradient) can also be determined.
[0057] Specifically, the peak value of the Hough accumulator can be determined by the maximum value in the statistical parameter space accumulator after the Hough transform; the symmetry repair residual can be calculated by mirroring the brain parenchyma using the second candidate brain midline as the axis of symmetry, and calculating the mean square error of the pixel difference between the two sides, the smaller the error, the better the symmetry; the distance from these two lines to the geometric center of the brain can be calculated as follows: first, calculate the centroid coordinates of the brain parenchyma point set (the average of the x and y coordinates of each point), and then calculate the shortest distance from these two lines to the centroid (the formula for the distance from a point to a line); the difference in area between the left and right hemispheres after segmentation can be calculated as follows: using the candidate lines... To segment the boundary, count the number of brain parenchyma pixels on both sides of the line and calculate their absolute difference or ratio; the overlap with the third ventricle can be calculated as follows: locate the third ventricle region in the standard template and determine whether the two lines pass through the region, or calculate the overlap length and distance between the line segment and the center line of the third ventricle; the image signal-to-noise ratio can be calculated by selecting a uniform region inside the brain parenchyma and calculating the ratio of its gray-scale mean to the standard deviation of the background noise; the mean edge gradient can be calculated as follows: apply the Sobel or Canny operator to the brain parenchyma edge neighborhood, extract the gradient magnitude, and take the average of the gradients of all edge points.
[0058] Reference Figure 8 In step S1502, the fitted quality features and anatomical rationality features are standardized and concatenated to obtain a multidimensional reliability feature vector. However, this disclosure is not limited to this; the influence quality features and other features described above can also be concatenated to obtain a higher-dimensional reliability feature vector.
[0059] Specifically, the fitting quality features (such as Hough peaks and symmetry residuals) and anatomical rationality features (such as area differences and distance to the third ventricle) can first be standardized. For example, the Z-score method can be used, subtracting the training set mean and dividing by the standard deviation to make each feature follow a distribution with a mean of 0 and a variance of 1. Then, the standardized features are concatenated in a predefined order to form a unified multidimensional vector. This multidimensional vector comprehensively reflects the candidate midline's performance in both geometric fit and anatomical rationality, and serves as input to the machine learning model, which can be used to evaluate its reliability and guide the allocation of fusion weights.
[0060] Reference Figure 8 In step S1503, the multidimensional reliability feature vector is input into the pre-trained machine learning model to obtain the first weight of the first candidate brain midline and the second weight of the second brain midline.
[0061] The machine learning model here can be a regression model such as XGBoost, random forest, or shallow neural network.
[0062] The training process of the above machine learning model can be described as follows: First, brain image samples that have been aligned by AC-PC can be collected, and a first candidate brain midline (such as obtained by Hough transform) and a second candidate brain midline (such as obtained by geometric symmetry method) can be generated for each image. At the same time, the real brain midline is manually labeled by experts as the standard.
[0063] However, for each candidate line, its fitting quality features (such as Hough accumulator peak value and symmetry repair residual) and anatomical rationality features (such as the distance from the candidate line to the brain centroid, the difference in area between the left and right hemispheres after segmentation, the spatial overlap with the third ventricle, and the mean edge gradient) are extracted, standardized by Z-score, and concatenated into a multidimensional reliability feature vector. Then, using the true midline as a reference, the average distance error between the weighted fusion line and the true line is calculated by enumerating different weight combinations (e.g., w1 from 0 to 1 with a step size of 0.01). The weight that minimizes the error is selected as the ideal value for that sample. The feature vectors of all samples are used as input, and the optimal weight is used as output to construct the training dataset.
[0064] During model training, mean squared error (MSE) can be used as the loss function, and cross-validation can be employed for parameter tuning to learn the nonlinear mapping relationship from multidimensional features to weight allocation. After training, the model can automatically evaluate the reliability of two candidate lines in new samples and output weights, thereby achieving a fusion of anatomical rationality and image quality-driven approaches, improving the accuracy and robustness of the final brain midline localization.
[0065] However, the above model training method is merely an example, and this disclosure is not limited thereto. The machine learning model of this disclosure outputs fused weights rather than directly predicting the final brain midline. This method has strong interpretability, and the weights clearly reflect the relative reliability of each candidate line (such as the Hough midline and the geometric midline), allowing doctors to understand "why it leans towards a certain line," thus enhancing clinical trust. Secondly, it has high robustness; the model only needs to learn the weight mapping, without directly fitting complex spatial locations, avoiding overall midline shift due to individual errors, and can flexibly cope with different pathological morphologies. Furthermore, separating "feature evaluation" from "midline generation" allows for changing the candidate line generation method on different data without retraining the model, and also allows for the introduction of prior constraints (such as limiting the weight range) to ensure the rationality of fusion, improving the system's flexibility and security. In contrast, while end-to-end midline prediction is simple, it is prone to becoming a "black box," has poor fault tolerance, and is difficult to incorporate anatomical priors. The brain midline determination scheme of this disclosure is more suitable for high-reliability medical scenarios. It should be noted that a person's health status cannot be directly determined based on the brain midline. It is necessary to use the professional knowledge of a doctor to make a judgment on a person's health status. Therefore, the brain midline obtained according to the brain midline determination method disclosed herein is only an intermediate result used to assist in the judgment of health status.
[0066] Reference Figure 8In step S1504, the final brain midline is obtained based on the first weight and the second weight, the first straight line equation of the first candidate brain midline, and the second straight line equation of the second candidate brain midline.
[0067] Reference Figure 9 The step S1504, which obtains the final brain midline based on the first weight and the second weight, the first straight line equation of the first candidate brain midline, and the second straight line equation of the second candidate brain midline, includes: step S15041, step S15042, step S15043, and step S15044.
[0068] Reference Figure 9 In step S15041, the equations of the first and second straight lines are expressed using the ordinate as the independent variable. Specifically, the equations of the first and second candidate brain midlines can be uniformly converted into the form x = my + c. That is, the ordinate y is used as the independent variable, and the abscissa x is used as the dependent variable.
[0069] Reference Figure 9 In step S15042, values are taken within the vertical coordinate range of the brain parenchyma edge contour, and the corresponding horizontal coordinates on the first candidate brain midline and the second candidate brain midline are calculated.
[0070] Specifically, the effective range [y_min, y_max] of the brain parenchyma edge contour in the vertical direction can be determined, which is the minimum and maximum y-values among the contour points. Within this interval, N discrete y_i values are uniformly sampled. For each y_i, its corresponding horizontal coordinate is calculated by substituting it into the equations of the two candidate lines: x1_i = m1y_i + c1, x2_i = m2y_i + c2, thus obtaining the corresponding point set.
[0071] Reference Figure 9 In step S15043, the corresponding x-coordinates under the same y-coordinate value are weighted using the first weight and the second weight to obtain a new point set. Using the first weight w1 and the second weight w2 (satisfying w1+w2=1) output by the machine learning model, the two x values under the same y_i are weighted and fused: x_final_i= w1x1_i + w2x2_i, generating a new fused point set {(x_final_i, y_i)}.
[0072] Reference Figure 9 In step S15044, a straight line is fitted to the new set of points to obtain the final midline of the brain. The straight line fitting here can be the least squares straight line fitting, but is not limited to this.
[0073] Specifically, a least-squares linear fit can be performed on the fusion point set, with the goal of minimizing the sum of squared horizontal distances from all points to the fitted line x = m_final y + c_final. The resulting line is the final brain midline.
[0074] The linear weighting using the first and second weights described above is merely an example, and this disclosure is not limited thereto. For instance, nonlinear weighting can also be used. The following is a detailed description of the fusion method based on analytic geometry disclosed in this disclosure.
[0075] The step of fusing the first candidate brain midline and the second candidate brain midline to obtain the final brain midline may also include: calculating the midline between the first candidate brain midline and the second candidate brain midline as the final brain midline based on analytical geometry methods.
[0076] Reference Figure 10 The steps for calculating the midline between the first candidate brain midline and the second candidate brain midline as the final brain midline based on analytical geometry include steps S1511, S1512, S1513 and S1514.
[0077] Reference Figure 10 In step S1511, the first straight line equation of the first candidate brain midline and the second straight line equation of the second candidate brain midline are determined. Specifically, the equations of the first candidate brain midline (obtained through Hough transform fitting) and the second candidate brain midline (obtained through geometric symmetry) are first obtained. To accommodate the approximately perpendicular nature of the brain midline, both lines are represented in the form x = my + c, i.e., with the ordinate y as the independent variable and the abscissa x as the dependent variable. This avoids the slope singularity in the vertical direction of the traditional y = kx + b form and ensures numerical stability.
[0078] Reference Figure 10 In step S1512, based on the coordinates used to depict the equations of the first and second straight lines, multiple pairs of points with the same ordinate on the first candidate brain midline and the second brain midline are obtained.
[0079] Specifically, using the image coordinate system as a reference, N discrete y_i values can be uniformly selected within the effective y-range covered by the two candidate lines (e.g., from the front to the back of the brain). For each y_i, substitute it into the equations of the two lines to calculate its corresponding x-coordinate: x1_i = m1 y_i + c1 and x2_i = m2 y_i + c2, thus obtaining N pairs of points with the same y-coordinate: (x1_i, y_i) and (x2_i, y_i), ensuring that the point pairs are aligned in the horizontal direction.
[0080] Reference Figure 10 In step S1513, the midpoint of each pair of points is determined to obtain a new set of points.
[0081] Specifically, for each pair of points, calculate the midpoint: x_mid_i = (x1_i + x2_i) / 2, y_mid_i = y_i, and generate a new point set {(x_mid_i, y_i)}.
[0082] Reference Figure 10 In step S1514, a straight line is fitted to the new set of points, and the fitting result is used as the final brain midline.
[0083] Specifically, a least-squares line fitting can be performed on the midpoint set to find the optimal line x = m_final y + c_final, which minimizes the sum of the squared horizontal distances from all midpoints to this line. This least-squares line fitting is merely an example, and this disclosure is not limited thereto.
[0084] Before obtaining the leftmost point with the smallest x-coordinate and the rightmost point with the largest x-coordinate in the brain parenchyma edge contour, the brain parenchyma edge contour is sequentially processed by convex hull processing and symmetry restoration. Convex hull processing removes concave portions in the brain parenchyma edge contour, simplifying the contour shape and facilitating subsequent analysis. Symmetry restoration corrects asymmetry caused by image noise, lesions, and other factors, restoring the proper left-right symmetry structure of the brain parenchyma. The leftmost and rightmost points obtained in this way more accurately reflect the true boundaries of the brain, thereby improving the accuracy and reliability of locating the second candidate brain midline. This enhances robustness to contour outliers and optimizes the final accuracy of brain midline extraction.
[0085] Reference Figure 11 The steps for convex hull processing and symmetry repair according to the example embodiments of this disclosure may include: steps S1411, S1412, S1413 and S1414.
[0086] In step S1411, a convex hull transformation is performed on the brain parenchyma edge contour to generate a closed convex polygon contour. First, the coordinate point set of the brain parenchyma edge contour is input. A computational geometry algorithm (such as Graham scan or Jarvis step algorithm) is used to construct a closed convex polygon, which is the shape containing all the original point set and having the smallest area. This step determines which points constitute the outermost boundary by traversing all points, thus forming a closed region without depressions. This eliminates depressions, gaps, or local collapses caused by lesions (such as brain atrophy or space-occupying lesions) in the contour, simplifying complex boundaries into the most compact convex shape, ensuring that subsequent analysis is based on a complete and unbroken outer contour.
[0087] In step S1412, the minimum area circumscribed rectangle of the convex polygon contour is calculated.
[0088] As an example, algorithms such as the rotating caliper method can be applied to find the rectangle with the smallest area that completely encloses the convex polygon. Specifically, a series of possible borders can be rotated and their areas calculated until the rectangle with the smallest area is found. Its geometric properties reflect the extension direction of the brain's main body, thereby allowing the extraction of the brain's overall spatial orientation.
[0089] In step S1413, the perpendicular bisector of the minor axis of the circumscribed rectangle with the smallest area is used as a temporary median. Based on the circumscribed rectangle with the smallest area obtained in step S1412, its minor axis is found, and the perpendicular bisector of this minor axis is calculated. This line is the temporary median; it passes through the center of the rectangle and is perpendicular to the minor axis. Mathematically, the equation of this line can be directly obtained using analytic geometry.
[0090] In step S1414, the convex polygon contour is divided into a left half and a right half based on a temporary centerline.
[0091] As an example, the convex polygon in step S1411 can be divided into left and right sections based on the temporary midline determined in step S1413. For instance, the position of each point relative to the midline can be examined, dividing them into two sets of points located to the left and right of the midline. Specifically, the x-coordinate values of each point can be compared with the positional relationship of the midline. This allows for the quantification of the degree of symmetry on both sides, determining which side is closer to the ideal brain contour shape.
[0092] In step S1415, the geometric features of the left and right halves are calculated separately, and the differences between them are compared. For example, for the left and right halves divided in step S1414, their respective geometric features are calculated. These geometric features may include, but are not limited to, area, perimeter, and centroid position. Then, the differences between these feature values are compared to assess the symmetry of the two sides.
[0093] In step S1416, the relatively complete half of the left and right halves is identified based on the difference between them. For example, if a side has a larger area and a perimeter closer to the theoretical value, then that side is considered relatively complete.
[0094] In step S1417, a geometric mirror transformation is performed relative to the temporary centerline using one side as a reference to obtain the mirrored convex hull profile. As an example, the side identified as more complete in step S1416 can be selected, and the geometric mirror operation can be performed around the temporary centerline. That is, for all points on the selected side, their symmetrical points about the centerline are calculated. This can be achieved using analytical geometry, i.e., moving each point to its corresponding position on the other side along a direction perpendicular to the centerline.
[0095] In step S1418, the preprocessed brain parenchyma edge contour is obtained based on the above-mentioned feature and the mirror convex hull contour. As an example, the original intact side can be combined with the mirror side obtained in step S1417 to form a new contour; that is, the two point sets can be merged, and the new contour can be ensured to be smooth and continuous to obtain an optimized brain parenchyma edge contour. This improves the accuracy and reliability of subsequent brain midline extraction.
[0096] In the presence of noise, lesions, or structural defects, restoring the ideal bilateral symmetry of the brain parenchyma's edge contours can improve the accuracy and robustness of subsequent midline extraction.
[0097] Figure 12 A block diagram of a device for determining the midline of the brain according to an exemplary embodiment of the present disclosure is shown.
[0098] The brain midline determination apparatus 1300 according to an exemplary embodiment of the present disclosure may include a non-transitory computer-readable storage medium 1310 and a processor 1320.
[0099] The non-transitory computer-readable storage medium 1310 may store a program or instructions that, when executed by a processor, cause the processor 1320 to perform at least one step of the determined method described above.
[0100] This disclosure also provides a non-transitory computer-readable storage medium storing a program or instructions that, when executed by a processor, cause the processor to perform the determined method described above.
[0101] The determination method according to exemplary embodiments of this disclosure may be written as a computer program, code segment, instruction, or any combination thereof, and recorded, stored, or fixed on or in one or more non-transitory computer-readable storage media. The computer-readable storage medium is any data storage device capable of storing data read by a computer system.
[0102] Examples of computer-readable storage media include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray and / or optical disc storage, hard disk drive (HDD), solid-state drive (SSD), card storage (such as multimedia cards, secure digital (SD) cards, or ultra-fast digital (XD) cards), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state drive, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and to provide the computer program and any associated data, data files, and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the aforementioned computer-readable storage medium can run in an environment deployed in computer devices such as client, host, agent, or server. Furthermore, in one example, the computer program and any associated data, data files, and data structures are distributed across a networked computer system, such that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner by one or more processors or computers. The above has been referred to Figures 1 to 12 Methods, apparatus, etc., for determining the midline of the brain according to exemplary embodiments of the present disclosure are described. However, it should be understood that the units, modules, and systems shown in the figures can be configured as software, hardware, firmware, or any combination thereof to perform specific functions. For example, these systems and apparatuses may correspond to dedicated integrated circuits, pure software code, or modules combining software and hardware. Furthermore, one or more functions implemented by these systems or apparatuses may also be uniformly executed by components in a physical entity device (e.g., a processor, client, or server).
[0103] When a system, unit, or module is implemented as software, firmware, middleware, or microcode, the program code or code segment used to perform the corresponding operation can be stored in a computer-readable medium such as a storage medium, so that at least one processor or at least one computing device can perform the corresponding operation by reading and running the corresponding program code or code segment. In addition, the computer-readable medium or storage medium can cause the processor to perform the above-described determination method when the computer program is executed by the processor.
[0104] According to embodiments of this disclosure, a first candidate brain midline and a second candidate brain midline are extracted based on linear fitting and analytical geometry methods, respectively, and the accuracy of brain midline determination is improved by utilizing the complementarity of multi-source information.
[0105] The method for determining the brain midline according to embodiments of this disclosure can accurately determine the brain midline.
[0106] The method for determining the brain midline according to embodiments of this disclosure is highly accurate, robust, and interpretable.
[0107] The method for determining the brain midline according to embodiments of this disclosure is highly fault-tolerant and has good noise resistance.
[0108] According to embodiments of this disclosure, a standardized anatomical space is established through AC-PC alignment to eliminate individual pose differences and ensure cross-sample anatomical consistency in midline positioning.
[0109] According to embodiments of this disclosure, convex hull processing and symmetry repair are performed on the edge contour of brain parenchyma to suppress noise and pathological interference, restore ideal symmetrical structure, and improve contour integrity and geometric reliability.
[0110] According to embodiments of this disclosure, a fusion strategy is used to generate a midpoint set by weighting the x-coordinates of two candidate lines with y as the independent variable, thereby avoiding the singularity of vertical line fitting and achieving numerically stable fusion.
[0111] While exemplary embodiments have been shown and described above, it will be readily understood by those skilled in the art that modifications and variations may be made without departing from the scope of this disclosure as defined by the appended claims.
Claims
1. A method for determining the brain midline, characterized in that, The determination method includes: Obtain standardized images of the brain, wherein the anterior commissure and posterior commissure in the standardized images are aligned with each other; Based on the standardized image, the edge contour of the brain parenchyma is obtained; The edge contour of the brain parenchyma is fitted with a straight line to obtain the first candidate brain midline; Based on the outline of the brain parenchyma, a second candidate brain midline is obtained through geometric methods; The first candidate brain midline and the second candidate brain midline are merged to obtain the final brain midline.
2. The method for determining the midline of the brain according to claim 1, characterized in that, The steps of fusing the first candidate brain midline and the second candidate brain midline to obtain the final brain midline include: The fitting quality characteristics of the first candidate brain midline and the second candidate brain midline and the anatomical rationality characteristics of the brain parenchyma edge contour were determined respectively. The fitting quality features and the anatomical rationality features are standardized and concatenated to obtain a multidimensional reliability feature vector. The multidimensional reliability feature vector is input into a pre-trained machine learning model to obtain the first weight of the first candidate brain midline and the second weight of the second brain midline. The final brain midline is obtained based on the first weight and the second weight, the first straight line equation of the first candidate brain midline, and the second straight line equation of the second candidate brain midline.
3. The method for determining the midline of the brain according to claim 2, characterized in that, The steps for obtaining the final brain midline based on the first weight, the second weight, the first linear equation of the first candidate brain midline, and the second linear equation of the second candidate brain midline include: The equations of the first and second lines are expressed with the ordinate as the independent variable. Values are taken within the vertical coordinate range of the brain parenchyma edge contour, and the corresponding horizontal coordinates on the first candidate brain midline and the second candidate brain midline are calculated; By using the first weight and the second weight, the corresponding x-coordinates under the same y-coordinate value are weighted to obtain a new set of points; The new set of points is fitted with a straight line to obtain the final brain midline.
4. The method for determining the midline of the brain according to claim 1, characterized in that, The step of fusing the first candidate brain midline and the second candidate brain midline to obtain the final brain midline includes: calculating the midline between the first candidate brain midline and the second candidate brain midline based on analytical geometry methods as the final brain midline.
5. The method for determining the midline of the brain according to claim 4, characterized in that, The steps for calculating the midline between the first candidate brain midline and the second candidate brain midline as the final brain midline based on analytical geometry methods include: Determine the first linear equation of the first candidate brain midline and the second linear equation of the second candidate brain midline; Based on the coordinates used to depict the equations of the first and second straight lines, multiple pairs of points with the same ordinate on the first candidate brain midline and the second brain midline are obtained. Determine the midpoint of each pair of points to obtain a new set of points; A straight line is fitted to the new set of points, and the fitting result is used as the final brain midline.
6. The method for determining the midline of the brain according to any one of claims 1 to 5, characterized in that, The steps for obtaining a second candidate brain midline using geometric methods based on the aforementioned brain parenchyma boundary contour include: Obtain the leftmost point with the smallest x-coordinate and the rightmost point with the largest x-coordinate in the edge contour of brain parenchyma; Determine the midpoint between the leftmost point and the rightmost point; Determine the centroid of the edge contour of the brain parenchyma; The second candidate brain midline is determined based on the midpoint and the centroid.
7. The method for determining the midline of the brain according to claim 6, characterized in that, The determination method further includes performing convex hull processing and symmetry repair on the brain parenchyma edge contour sequentially before obtaining the leftmost point with the smallest abscissa and the rightmost point with the largest abscissa in the brain parenchyma edge contour.
8. The method for determining the midline of the brain according to claim 7, characterized in that, The steps of convex hull processing and symmetry repair include: A convex hull transformation is performed on the edge contour of the brain parenchyma to generate a closed convex polygon contour. Calculate the minimum area circumscribed rectangle of the convex polygonal profile; Use the perpendicular bisector of the minor axis of the circumscribed rectangle with the smallest area as a temporary median. The convex polygon contour is divided into a left half and a right half based on the temporary centerline. Calculate the geometric features of the left half and the right half respectively, and compare the differences between them; Identify the relatively complete one of the left and right halves based on the differences between them; Using one of the aforementioned components as a reference, a geometric mirror transformation is performed relative to the temporary midline to obtain the mirrored convex hull profile. The preprocessed brain parenchyma edge contour is obtained based on the aforementioned one and the mirrored convex hull contour.
9. A device for determining the brain midline, characterized in that, The determining apparatus includes a non-transitory computer-readable storage medium and a processor, the non-transitory computer-readable storage medium storing a program or instructions that, when executed by the processor, cause the processor to perform the determining method according to any one of claims 1-8.
10. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores a program or instructions that, when executed by a processor, cause the processor to perform the determination method according to any one of claims 1-8.