A convex hull fitting-based light field reconstruction brain image brain region boundary extraction method
By using a convex hull fitting method, the problems of noise and boundary breaks in light field reconstructed brain images are solved, generating a highly robust brain region boundary mask suitable for neural activity analysis, reducing computational costs and improving the accuracy of results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG HEHU TECH CO LTD
- Filing Date
- 2026-01-08
- Publication Date
- 2026-05-12
AI Technical Summary
Existing light field reconstruction methods for brain images struggle to achieve fully automated and robust brain region boundary extraction when dealing with issues such as noise, low contrast, and boundary breaks. This results in inaccurate masking, affecting the accuracy and reliability of subsequent neural signal analysis.
A convex hull fitting-based method is adopted to generate a continuous and complete mask image by performing steps such as p-percentile cropping, contrast stretching and Gaussian filtering for smoothing and denoising, Canny edge detection, dilation and closing operations, and convex hull fitting on the brain image after light field reconstruction.
It achieves highly robust boundary extraction of light field reconstructed images. The generated mask has high consistency and strong continuity with the target region, which is suitable for subsequent neural cell recognition and signal extraction. It reduces the computational cost and is suitable for resource-constrained scenarios.
Smart Images

Figure CN121482294B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of light field microscopy imaging technology, and more specifically to a method for extracting brain region boundaries in light field reconstructed brain images based on convex hull fitting. Background Technology
[0002] Light field microscopy acquires information about the space and angles of a three-dimensional scene in a single shot and then reconstructs the angles of various locations in the three-dimensional scene through post-construction. It is very suitable for rapid and high-resolution imaging of dynamic neural activity in the living brain. By reconstructing the light field image, three-dimensional data at different depths in the brain can be obtained.
[0003] However, the reconstruction process is subject to interference from sensor noise, background fluorescence, and motion artifacts introduced by tissues such as muscle activity or blood vessels, which in turn cause reconstruction errors in the reconstructed images and obscure the true signals of the brain images. Due to the optical properties of the brain tissue itself and the limitations of imaging depth, the edges of brain tissue are often low in contrast and discontinuous. In large-scale brain science research, it is necessary to automate the processing of massive amounts of light field imaging data to extract neuronal activity signals in specific brain regions. Manually delineating the boundaries of brain regions is both time-consuming and prone to introducing subjective errors.
[0004] Inaccurate brain region masking can lead to contamination of downstream neural signal extraction and analysis, specifically:
[0005] False positives: Noise or non-neuronal structures outside the mask are incorrectly included and misidentified as active neurons by the neuron recognition algorithm, introducing incorrect signals; False negatives: Incomplete masks may clip out real neurons located at the edge of brain regions, resulting in signal loss; Signal contamination: When calculating overall background noise or fluorescence changes of neurons, if the mask contains high-intensity noise regions, it will severely distort the calculation results and reduce the signal-to-noise ratio.
[0006] Segmentation and boundary extraction of brain images are important prerequisites for brain structure analysis, functional research, and lesion detection. Currently, common brain boundary extraction methods mainly suffer from the following problems:
[0007] Global thresholding methods are simple to implement, but they are sensitive to noise and brightness changes, and the boundaries are prone to breakage or displacement. Region growing methods rely on seed point selection and have a low degree of automation. Deep learning-based methods have high segmentation accuracy, but require a large amount of labeled data, have high computational costs, and are difficult to promote in resource-constrained scenarios.
[0008] Therefore, the urgent problem to be solved by those skilled in the art is: how to overcome the challenges of reconstruction errors, abnormal noise, low contrast and boundary breaks in light field reconstructed brain images, and realize a fully automatic and robust brain region boundary extraction method, so as to generate continuous, complete and accurate binary masks, provide a high-quality region of interest basis for subsequent automated neural cell identification and fluorescence signal extraction, and ultimately improve the accuracy and reliability of neural activity analysis results. Summary of the Invention
[0009] In view of the above problems, the present invention is proposed to provide a method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting that overcomes or at least partially solves the above problems.
[0010] To achieve the above objectives, the present invention adopts the following technical solution:
[0011] A method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting includes:
[0012] S1. Calculate the p percentile of the brain image after light field reconstruction and crop the image grayscale values;
[0013] S2. Perform contrast stretching on the cropped image and smooth it with Gaussian filtering to remove noise;
[0014] S3. Perform Canny edge detection on the filtered image to obtain a binary edge map;
[0015] S4. Enhance the boundary and improve connectivity of a binary edge graph through dilation and closing operations;
[0016] S5. Extract all connected regions from the binary edge map and select the contour with the largest area as the contour representing the boundary of the brain region.
[0017] S6. Determine the reference point based on the contour of the brain region boundary, calculate the polar angle and distance of each point except the reference point and sort them, and perform convex hull fitting based on the reference point and the sorted point set by Graham Scan.
[0018] S7. Convert the convex hull into a closed boundary region, and obtain the mask image of the brain image after light field reconstruction through the mask function.
[0019] Preferably, step S1 includes the following:
[0020] S11. Calculate the brain image after light field reconstruction. The p percentile is:
[0021]
[0022] in, Representing brain images A two-dimensional grayscale matrix, , This is a set of image pixels, where x and y are pixel coordinates, and the image pixel values represent grayscale values.
[0023] S12. Crops the image grayscale values to the specified range. :
[0024]
[0025] in, The cropped image. The function is defined as:
[0026]
[0027] in, The minimum cutoff value, This is the maximum truncation value.
[0028] Preferably, in step S2, the specific content of contrast stretching is as follows:
[0029] For the cropped image Linear normalization is performed to map the dynamic range to the standard 8-bit grayscale range [0, 255] to maximize image contrast;
[0030]
[0031] in, and Images The minimum and maximum gray values in the range;
[0032] The Gaussian filtering method is as follows:
[0033]
[0034] in, The image after contrast stretching. The image after filtering. For a two-dimensional Gaussian kernel, Represents the Gaussian distribution function. and These are the Gaussian kernel coordinates in the x and y directions, respectively.
[0035] Preferably, step S3 includes the following:
[0036] S31. On the image after Gaussian filtering, use the Sobel operator to calculate the first-order gradient components of the image in the x and y directions respectively;
[0037] S32. Calculate the gradient magnitude and gradient direction of each pixel based on the gradient components;
[0038] S33. Based on the gradient magnitude of each pixel and its two neighboring pixels along its gradient direction, non-maximum suppression is performed on the gradient magnitude image to obtain candidate edge points;
[0039] S34. Apply double thresholding to the gradient magnitude map after non-maximum suppression, and mark strong edge points and weak edge points for candidate edge points;
[0040] S35. Connect the strong edge points and the weak edge points that are connected to any strong edge point in the 8-neighborhood to obtain a binary edge map.
[0041] Preferably, step S4 involves performing boundary enhancement and connectivity improvements on the binary edge map using dilation and closing operations as follows:
[0042]
[0043]
[0044] in, This is a binary edge map. Indicates expansion. Indicates corrosion. It is a 5×5 structure element matrix.
[0045] Preferably, in step S5, the extracted brain region boundary contours are as follows:
[0046]
[0047] in, This refers to all connected regions extracted from the binary edge map after boundary enhancement and connectivity. For each region, the largest area is selected as the outline of the brain region.
[0048] Preferably, in step S6, the method for determining the reference point based on the contour of the brain region boundary is as follows:
[0049] Select the contour point set of brain region boundaries The point with the smallest ordinate in the middle is used as the reference point. If there are multiple points with the same vertical coordinate, the point with the smallest horizontal coordinate is selected as the reference point.
[0050] Preferably, in step S6, the specific content of calculating and sorting the polar angle and distance of each point other than the reference point is as follows:
[0051] For the contour point set of brain region boundaries Except for the reference point every point Calculate its relative to the reference point polar angle Square distance from Euclidean distance :
[0052]
[0053]
[0054] in, This is the arctangent function in the four quadrants, and its return value range is... ;
[0055] Sort all points in ascending order of polar angle; when polar angles are the same, sort them according to their relative position to the reference point. Sort the points in ascending order by distance to obtain the sorted set of points.
[0056] The preferred method for convex hull fitting based on the reference point and the sorted point set using Graham Scan is as follows:
[0057] Initialize a stack Then, push the pivot point and the first two points of the sorted point set onto the stack in sequence:
[0058]
[0059] Starting from the third point in the sorted point set, traverse each point sequentially, calculating the two-dimensional cross product at each step. The check includes the top of the stack (top), the next top of the stack (next), and the current point. The turning relationship between the three points;
[0060] when When, it indicates that three points form a left turn, and the current point... Push onto stack ;when When the three points are collinear or turn right, pop the top element of the stack `top`, and recheck the new top three points of the stack until the left turn condition is met or the stack contains fewer than two elements. After traversing all points, the stack is... The sequence of points stored in the convex hull forms the convex hull. The vertices are arranged in a counter-clockwise direction.
[0061] Preferably, in step S7, the brain image after light field reconstruction. mask image for:
[0062]
[0063]
[0064] in, For mask function, This is the closed boundary region for convex hull transformation.
[0065] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting, which has the following beneficial effects:
[0066] By sorting the edge point set by polar angle and constructing the convex hull, global fitting of the overall boundary is achieved, overcoming the defect of traditional threshold segmentation being sensitive to local gray-level fluctuations. This invention has the advantages of being insensitive to local noise, maintaining the overall geometric features of the boundary, and accurately adapting to the special boundary morphology of the light field reconstructed image.
[0067] This invention eliminates the need for resource-intensive network training processes and can run in real time on a CPU, making it suitable for rapid batch image processing.
[0068] The mask generated by this invention has high consistency with the boundary of the target region, strong continuity, and no obvious edge jitter. It can be directly used for subsequent processing steps, including but not limited to brain region structure segmentation, multimodal registration, quantitative signal analysis, and three-dimensional reconstruction and visualization. In particular, in light field reconstruction images, the gray-scale change between tissue boundaries and background is often slow. This invention can provide more stable boundary localization than the simple thresholding method, ensuring the integrity of the brain region ROI. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of the present invention or 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 only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0070] Figure 1 This is a flowchart of a method for extracting brain region boundaries in a light field reconstruction brain image based on convex hull fitting, provided in an embodiment of the present invention.
[0071] Figure 2 This is a schematic diagram of the non-maximum suppression neighborhood partitioning provided in an embodiment of the present invention;
[0072] Figure 3 This is an intermediate experimental result diagram provided in an embodiment of the present invention. Detailed Implementation
[0073] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. 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.
[0074] Example 1
[0075] This invention discloses a method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting, such as... Figure 1 As shown, it includes:
[0076] S1. Calculate the p percentile of the brain image after light field reconstruction and crop the image grayscale values;
[0077] S2. Perform contrast stretching on the cropped image and smooth it with Gaussian filtering to remove noise;
[0078] S3. Perform Canny edge detection on the filtered image to obtain a binary edge map;
[0079] S4. Enhance the boundary and improve connectivity of a binary edge graph through dilation and closing operations;
[0080] S5. Extract all connected regions from the binary edge map and select the contour with the largest area as the contour representing the boundary of the brain region.
[0081] S6. Determine the reference point based on the contour of the brain region boundary, calculate the polar angle and distance of each point except the reference point and sort them, and perform convex hull fitting based on the reference point and the sorted point set using the Graham Scan method.
[0082] S7. Convert the convex hull into a closed boundary region, and obtain the mask image of the brain image after light field reconstruction through the mask function.
[0083] To further implement the above technical solution, the specific content of step S1 includes:
[0084] S11. Calculate the brain image after light field reconstruction. The p-percentile is designed to suppress outlier values caused by potential saturation pixels, fluorescent markers, or reconstruction artifacts. Specifically:
[0085]
[0086] in, Representing brain images The input in this embodiment is the intermediate clear layer of a three-dimensional brain image, which is a two-dimensional grayscale matrix. , This is a set of image pixels, where x and y are pixel coordinates, and the image pixel values represent grayscale values. Typically, p=99 is set.
[0087] S12. Crops the image grayscale values to the specified range. :
[0088]
[0089] in, The cropped image. The function is defined as:
[0090]
[0091] in, The minimum cutoff value, In this embodiment, the maximum cutoff value is used. , .
[0092] To further implement the above technical solution, the specific content of contrast stretching in step S2 is as follows:
[0093] For the cropped image Linear normalization is performed to map the dynamic range to the standard 8-bit grayscale range [0, 255] to maximize image contrast;
[0094]
[0095] in, and Images The minimum and maximum gray values in the range;
[0096] In this embodiment, and Specifically:
[0097]
[0098] ;
[0099] To remove noise, Gaussian smoothing is applied to the image. A Gaussian filter can effectively reduce background noise while preserving edge information. The Gaussian filtering method is as follows:
[0100]
[0101] in, The image after contrast stretching. The image after filtering. For a two-dimensional Gaussian kernel, Let be a two-dimensional Gaussian kernel, representing the Gaussian distribution function. and These are the Gaussian kernel coordinates in the x and y directions, respectively;
[0102] In this embodiment, the Gaussian distribution function is specifically:
[0103]
[0104] in, This is the bandwidth of the Gaussian kernel, used to control the smoothness of the image after Gaussian filtering. The larger the value, the smoother the filtered image; conversely, the smaller the value, the sharper the image.
[0105] To further implement the above technical solution, step S3 employs the multi-stage optimal edge detection algorithm, Canny edge detection, aiming to suppress interference while accurately locating the true edges in the filtered image. Canny edge detection is performed on the data to compress it into boundary information for easier subsequent processing. The specific content of Canny edge detection includes:
[0106] S31. On the image after Gaussian filtering, use the Sobel operator to calculate the first-order gradient components of the image in the x and y directions respectively;
[0107] In this embodiment, the first-order gradient approximation and for:
[0108]
[0109]
[0110] in, This represents the convolution operation. and Sobel convolution kernels in the x and y directions, respectively:
[0111]
[0112]
[0113] S32. Based on gradient components and Calculate the gradient magnitude of each pixel. and gradient direction ;
[0114]
[0115]
[0116] S33. Based on the gradient magnitude of each pixel and its two neighboring pixels along its gradient direction, non-maximum suppression is performed on the gradient magnitude image to obtain candidate edge points;
[0117] Specifically: For each pixel, check its gradient direction. If the gradient magnitude of the current pixel is greater than or equal to that of two adjacent pixels, then... If it is not a local maximum along the gradient direction, then suppress it to zero. In actual calculations, the gradient direction is... Discretize into four main directions (0°, 45°, 90°, 135°) and compare the gradient magnitude of the current pixel with its two neighboring pixels along that direction, such as... Figure 2 As shown, if If the gradient magnitude is less than that of any neighboring pixel, then Otherwise, retain the original value. After this step, only the points with the largest local gradient are retained as candidate edge points, thus achieving the goal of selecting edge points.
[0118] S34. Apply double thresholding to the gradient magnitude map after non-maximum suppression, and mark strong edge points and weak edge points for candidate edge points;
[0119] Specifically: Set a high threshold and low threshold ,generally , Can be set to ,like Then the point is marked as a strong edge point; if Then the point is marked as a weak edge point; if If so, then that point is suppressed;
[0120] S35. Connect the strong edge points and the weak edge points that are connected to any strong edge point in the 8-neighborhood to obtain a binary edge map;
[0121] In this embodiment, all weak edge points are examined. If a weak edge point is connected to any strong edge point within its 8-neighborhood, it is promoted to a strong edge point and included in the final edge map, resulting in a binary edge map. Defined as:
[0122] .
[0123] To further implement the above technical solution, since the morphology of blood vessels in different brain regions varies greatly among different samples, in order to prevent blood vessels from affecting the detection of brain region contours, step S4 uses dilation and closing operations to process the binary edge map. Boundary enhancement and connectivity improvements are performed to eliminate vascular holes in brain regions, using the following methods:
[0124]
[0125]
[0126] in, This is a binary edge map. Indicates expansion. Indicates corrosion. It is a 5×5 structure element matrix.
[0127] To further implement the above technical solution, in step S5, the extracted brain region boundary contour is as follows:
[0128]
[0129] in, The binary edge graph after boundary enhancement and connectivity All connected components extracted from [the dataset] For each region, the largest area is selected as the outline of the brain region.
[0130] The convex hull H is the smallest convex polygon containing all points of the point set S, which in this embodiment includes... The smallest convex polygon comprising all constituent points is obtained, and the Graham Scan method is used for convex hull fitting in this invention.
[0131] To further implement the above technical solution, in step S6, the method for determining the reference point based on the contour of the brain region boundary is as follows:
[0132] Select the contour point set of brain region boundaries Middle ordinate The smallest point is used as the reference point. If multiple points have the same vertical coordinate, then the horizontal coordinate is selected. The smallest point is used as the reference point:
[0133]
[0134] in, Defined as pressing first Ascending order comparison, if If they are the same, then... Ascending order comparison.
[0135] To further implement the above technical solution, step S6, which involves calculating and sorting the polar angle and distance of each point other than the reference point, is as follows:
[0136] For the contour point set of brain region boundaries Except for the reference point every point Calculate its relative to the reference point polar angle Square distance from Euclidean distance :
[0137]
[0138]
[0139] in, This is the arctangent function in the four quadrants, and its return value range is... It can accurately reflect the location of the point;
[0140] All points according to polar angle Sort in ascending order; when polar angles are the same, sort according to the reference point. Sort the points in ascending order by distance to obtain the sorted set of points. ;
[0141] The comparison rule is as follows: If , Before; if Then compare the distances, if , First, polar angle sorting ensures that the access order of the point set conforms to the geometric loop order of the convex hull.
[0142] To further implement the above technical solution, the specific method for convex hull fitting based on the benchmark points and the sorted point set using Graham Scan is as follows:
[0143] Initialize a stack Then, push the pivot point and the first two points of the sorted point set onto the stack in sequence:
[0144]
[0145] Starting from the third point in the sorted point set, traverse each point in turn. , In each step, the two-dimensional cross product is calculated. The check includes the top of the stack (top), the next top of the stack (next), and the current point. The turning relationship between the three points;
[0146] Define vector , The two-dimensional cross product is:
[0147]
[0148] when When, it indicates that the three points form a left turn (counter-clockwise), and the current point... Push onto stack ;when When the three points are collinear or rotate to the right (clockwise), the top element of the stack is popped, and the new top three points are rechecked until the left rotation condition is met or the number of elements in the stack is less than two. This ensures that the point sequence in the stack always maintains the geometric property of a strict left rotation, thus corresponding to the convex hull boundary of the currently scanned point set. After traversing all points, the stack is... The sequence of points stored in the convex hull forms the convex hull. The vertices are arranged in a counter-clockwise direction;
[0149]
[0150] in, .
[0151] To further implement the above technical solution, in step S7, the brain image after light field reconstruction... mask image for:
[0152]
[0153]
[0154] in, For mask function, As a closed boundary region of convex hull transformation, this mask image accurately covers the brain region and can be directly used for subsequent analysis tasks such as neuronal signal extraction.
[0155] Example 2
[0156] This embodiment uses light field reconstruction images of the mouse cerebral cortex as an example. The experimental data comes from adult mouse brain images acquired by a light field microscopy system, with an image resolution of [missing information]. Pixels, after light field reconstruction, yield a depth of approximately The volumetric data is used to select mid-layer slices with clear signals as two-dimensional input images. The brain region boundary extraction method for light field reconstruction based on convex hull fitting proposed in this invention was implemented. The intermediate experimental results are shown in the figure below. Figure 3 As shown, from left to right, the original image, edge map, convex hull mask map, and mask-filtered posterior brain region image are displayed.
[0157] Example 3
[0158] A computer-readable storage medium having a computer program stored thereon, characterized in that, when executed by a processor, the computer program implements a method for extracting brain region boundaries from light field reconstructed brain images based on convex hull fitting.
[0159] Example 4
[0160] A processing terminal includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, characterized in that the processor executes the computer program to implement a method for extracting brain region boundaries from light field reconstruction brain images based on convex hull fitting.
[0161] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0162] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting, characterized in that, include: S1. Calculate the p percentile of the brain image after light field reconstruction and crop the image grayscale values; S2. Perform contrast stretching on the cropped image and smooth it with Gaussian filtering to remove noise; S3. Perform Canny edge detection on the filtered image to obtain a binary edge map; S4. Enhance the boundary and improve connectivity of a binary edge graph through dilation and closing operations; S5. Extract all connected regions from the binary edge map and select the contour with the largest area as the contour representing the boundary of the brain region. S6. Determine the reference point based on the contour of the brain region boundary, calculate the polar angle and distance of each point except the reference point and sort them, and perform convex hull fitting based on the reference point and the sorted point set by Graham Scan. S7. Convert the convex hull into a closed boundary region, and obtain the mask image of the brain image after light field reconstruction through the mask function; The specific content of step S1 includes: S11. Calculate the brain image after light field reconstruction. The p percentile is: in, Representing brain images A two-dimensional grayscale matrix, , This is a set of image pixels, where x and y are pixel coordinates, and the image pixel values represent grayscale values. S12. Crop the image grayscale values to the specified range. : in, The cropped image. The function is defined as: in, The minimum cutoff value, This is the maximum truncation value.
2. The method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting as described in claim 1, characterized in that, In step S2, the specific details of contrast stretching are as follows: For the cropped image Linear normalization is performed to map the dynamic range to the standard 8-bit grayscale range [0, 255] to maximize image contrast; in, and Images The minimum and maximum gray values in the range; The Gaussian filtering method is as follows: in, The image after contrast stretching. The image after filtering. For a two-dimensional Gaussian kernel, Represents the Gaussian distribution function. and These are the Gaussian kernel coordinates in the x and y directions, respectively.
3. The method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting as described in claim 1, characterized in that, The specific content of step S3 includes: S31. On the image after Gaussian filtering, use the Sobel operator to calculate the first-order gradient components of the image in the x and y directions respectively; S32. Calculate the gradient magnitude and gradient direction of each pixel based on the gradient components; S33. Based on the gradient magnitude of each pixel and its two neighboring pixels along its gradient direction, non-maximum suppression is performed on the gradient magnitude image to obtain candidate edge points; S34. Apply double thresholding to the gradient magnitude map after non-maximum suppression, and mark strong edge points and weak edge points for candidate edge points; S35. Connect the strong edge points and the weak edge points that are connected to any strong edge point in the 8-neighborhood to obtain a binary edge map.
4. The method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting as described in claim 1, characterized in that, Step S4 involves performing boundary enhancement and connectivity improvements on the binary edge graph using dilation and closing operations. in, This is a binary edge map. Indicates expansion. Indicates corrosion. It is a 5×5 structure element matrix.
5. The method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting as described in claim 1, characterized in that, In step S5, the extracted brain region boundary contours are as follows: in, This refers to all connected regions extracted from the binary edge map after boundary enhancement and connectivity. For each region, the largest area is selected as the outline of the brain region.
6. The method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting as described in claim 1, characterized in that, In step S6, the method for determining the reference point based on the contour of the brain region boundary is as follows: Select the contour point set of brain region boundaries The point with the smallest ordinate is used as the reference point. If there are multiple points with the same vertical coordinate, the point with the smallest horizontal coordinate is selected as the reference point.
7. The method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting as described in claim 1, characterized in that, In step S6, the specific steps for calculating and sorting the polar angle and distance of each point other than the reference point are as follows: For the contour point set of brain region boundaries Except for the reference point every point Calculate its relative to the reference point polar angle Square distance from Euclidean distance : in, This is the arctangent function in the four quadrants, and its return value range is... ; Sort all points in ascending order of polar angle; when polar angles are the same, sort them according to their relative position to the reference point. Sort the points in ascending order by distance to obtain the sorted set of points.
8. The method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting as described in claim 1, characterized in that, The specific method for convex hull fitting based on the baseline points and the sorted point set using Graham Scan is as follows: Initialize a stack Then, push the pivot point and the first two points of the sorted point set onto the stack in sequence: Starting from the third point in the sorted point set, traverse each point sequentially, calculating the two-dimensional cross product at each step. The check includes the top of the stack (top), the next top of the stack (next), and the current point. The turning relationship between the three points; when When, it indicates that three points form a left turn, and the current point... Push onto stack ;when When the three points are collinear or turn right, pop the top element of the stack `top`, and recheck the new top three points of the stack until the left turn condition is met or the stack contains fewer than two elements. After traversing all points, the stack is... The sequence of points stored in the convex hull forms the convex hull. The vertices are arranged in a counter-clockwise direction.
9. The method for extracting brain region boundaries in light field reconstruction brain images based on convex hull fitting as described in claim 1, characterized in that, Step S7, Brain image after light field reconstruction mask image for: in, For masking functions, This is the closed boundary region for convex hull transformation.