Automatic cell soma recognition and segmentation method and device based on two-photon calcium imaging data

Through image processing and multi-scale dot enhancement, the active contour model combined with elliptical shape constraints is solved, and the problem of time-consuming and inaccurate segmentation of cell recognition in two-photon calcium imaging technology is achieved, and efficient and accurate cell body segmentation is achieved.

CN116681685BActive Publication Date: 2025-07-29ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310722477.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-19
Publication Date
2025-07-29
Estimated Expiration
2043-06-19

AI Technical Summary

Technical Problem

The existing two-photon calcium imaging technology is time-consuming and difficult to accurately segment when the data volume is huge and the signal-to-noise ratio is low. The existing algorithms are prone to miss out on structures outside the cell such as axons and dendrites.

Method used

After image denoising and enhancing, local correlation summary images are calculated, seed points are identified using a multi-scale dot enhancement algorithm, and an active contour model of elliptical shape constraints is applied on block video for cell segmentation, dimensionality reduction processing and elliptical shape constraints to improve accuracy.

Benefits of technology

It realizes efficient identification and segmentation of cell bodies, reduces the amount of data storage and calculation, and ensures that the segmentation results only include cell bodies and excludes structures such as axons and dendrites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116681685B_ABST
    Figure CN116681685B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for automatically identifying and segmenting cell somas based on two-photon calcium imaging data. First, a two-photon calcium imaging video of cells is acquired, and image denoising and image enhancement are performed on each frame of the video image. Then, the two-photon calcium imaging video is reduced in dimension to a locally correlated summary image, and a cell recognition algorithm based on multi-scale dot enhancement is applied to the locally correlated summary image to calculate the central coordinates of near-circular structures of different sizes within the imaging region, i.e., the seed points of the cell somas. Finally, for each seed point, the two-photon calcium imaging video is cropped into a block video of a fixed size centered on the seed point, and a cell segmentation algorithm based on an elliptical shape-constrained active contour model is applied to the block video to obtain the contour of the cell soma. The present invention can improve the operation efficiency and reduce the data storage volume.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing / neurobiological data analysis, and particularly to a method and device for automatically identifying and segmenting cell somas based on two-photon calcium imaging data. Background Art

[0002] The brain is a very important and complex organ. Many countries have long listed brain science and brain-like research as national strategic technologies. The development of brain science is inseparable from efficient and high-resolution neural activity recording technologies. Two-photon calcium imaging technology is currently the standard tool for monitoring a large number of neurons, recording the activities of a large number of neurons in vivo at the single-cell resolution level. However, due to the huge amount of data generated by two-photon calcium imaging technology, the low signal-to-noise ratio of the data, and the characteristic of imaging hundreds of neurons simultaneously, it brings difficulties in data analysis: It is time-consuming to identify cells manually and it is difficult to unify the standards. Therefore, many algorithms have been developed to automatically, accurately and quickly identify the positions and contours of single nerve cells.

[0003] Regarding the difficulty of the extremely large amount of calcium imaging data, some cell recognition and segmentation algorithms compress the three-dimensional calcium imaging video into a two-dimensional summary image by calculating the temporal mean value, temporal maximum value or temporal correlation, so that the data volume is only related to the imaging area size and has nothing to do with the imaging time. Then, traditional pattern recognition and image segmentation algorithms are used to identify or segment cells on the summary image. However, this method has deficiencies: Since the time dimension is discarded, the neurons in the summary image will overlap, which instead increases the difficulty of cell recognition and segmentation.

[0004] Some cell recognition and segmentation algorithms are directly based on calcium imaging video data, regarding it as a spatial combination of calcium fluorescence signals of different components, clustering the signals or performing matrix decomposition on the calcium imaging video to achieve cell recognition and segmentation. However, this method has the disadvantages of large data storage and low operation efficiency, and the recognition and segmentation results do not all include the neuron somas that are more interesting in the research, and may also include structures such as axons and dendrites of neurons. Summary of the Invention

[0005] The purpose of the present invention is to propose a method for automatically identifying and segmenting cell somas based on two-photon calcium imaging data in view of the deficiencies of the prior art, which can improve the operation efficiency, reduce the data storage amount, and solve the problems that existing methods are prone to missing cells in cell recognition and the recognition and segmentation results include structures such as axons and dendrites in addition to the somas.

[0006] The purpose of the present invention is achieved through the following technical solutions: In the first aspect, the present invention provides a method for automatically identifying and segmenting cell somas based on two-photon calcium imaging data, and the method includes the following steps:

[0007] Step 1: Obtain two-photon calcium imaging video of cells and perform image denoising and image enhancement on each frame of video image;

[0008] Step 2: Calculate the temporal correlation coefficient between the fluorescent calcium signal of each pixel coordinate in the two-photon calcium imaging video and the fluorescent calcium signals of several coordinate points in its surrounding neighborhood, and calculate the average value as the grayscale value of the pixel. Reduce the dimension of the two-photon calcium imaging video into a local correlation summary image. Based on the local correlation summary image, a cell recognition algorithm based on multi-scale dot enhancement is used to enhance circular structures with a certain diameter range in the image by constructing a function related to the eigenvalues of the Hessian matrix. Calculate the center coordinates of circular structures of different sizes in the imaging area, i.e., the seed points of the cell body.

[0009] Step 3: Based on the seed points obtained in step 2, for each seed point, the two-photon calcium imaging video is cropped into a block video with a fixed size centered on the seed point. The cell segmentation algorithm based on the elliptical shape constrained active contour model is applied to the block video to obtain the outline of the cell body; specifically: construct a level set function Energy function In minimization Simultaneous evolution The function Corresponding to the outline of the cell, in order to construct the energy function First, a data-driven term is constructed based on the characteristics of two-photon calcium imaging data to measure the difference in correlation vectors inside and outside the contour. The correlation vector I(u) of each coordinate point u is obtained by calculating the correlation value of the fluorescent calcium signal at that position with the fluorescent calcium signals of all coordinate points v in the block:

[0010]

[0011] Wherein the pixel point u in the image is (x, y), I(u) is a one-dimensional correlation vector, As the new feature of the pixel, N is the total number of pixels in the block, v is the coordinates of all points in the block, Ω is defined as the image domain, image I:Ω→R N is defined in the image domain; secondly, using the prior value that the cell body is elliptical, an elliptical shape constraint term is added to the energy function, so that the final cell contour tends to be elliptical; the details are as follows:

[0012] During the level set evolution process, the contour is fitted into a parameterized ellipse, and the ellipse is used to constrain the evolution of the level set so that the contour of the final level set is also close to an ellipse. The steps of alternating evolution are as follows:

[0013] (1) Initialize the level set function With the elliptical shape φ(x, y);

[0014] (2) Given a certain situation, minimize the energy function by the gradient descent method to obtain the evolution equation of φ(x, y). Since φ(x, y) is a parameterized ellipse, it is determined by the center coordinates (x0, y0) of the ellipse, the semi-major axis a of the ellipse, the semi-minor axis b of the ellipse, and the rotation angle θ of the ellipse: Given a certain situation, minimize the energy function by the gradient descent method to obtain the evolution equation of φ(x, y). Since φ(x, y) is a parameterized ellipse, it is determined by the center coordinates (x0, y0) of the ellipse, the semi-major axis a of the ellipse, the semi-minor axis b of the ellipse, and the rotation angle θ of the ellipse:

[0015]

[0016] Therefore, evolving φ(x, y) means updating the parameters (x0, y0, a, b, θ);

[0017] (3) After determining φ(x, y), minimize the energy function by the gradient descent method again to update

[0018] (4) Repeat steps (2) and (3) until the convergence condition is reached, that is, the change in the level set function is less than the set value or the number of iterations is greater than the set value.

[0019] Furthermore, anisotropic filtering algorithm is adopted for the image denoising.

[0020] Furthermore, top-hat transform is adopted for the image enhancement to obtain the brighter regions in the original image.

[0021] Furthermore, in step 2, the specific steps of calculating the center coordinates of near-circular structures with different sizes in the imaging area based on the multi-scale dot-enhanced cell recognition algorithm are as follows:

[0022] (2.1) Set the upper limit σ min of the scale parameter according to the upper and lower limits of the cell radius in the local correlation summary image max and the lower limit σ

[0023] (2.2) For each scale parameter σ within the upper and lower limits of the scale parameter, calculate the eigenvalues λ1, λ2 of the Hessian matrix of each pixel point (x, y) in the single-scale Gaussian space;

[0024] (2.3) Introduce the eigenvalue λ3, where the eigenvalues of the Hessian matrix corresponding to spherical structures in three-dimensional space satisfy λ1≈λ2≈λ3<0, and the eigenvalues of the Hessian matrix corresponding to tubular structures satisfy |λ2|≈|λ3|≥λ1, and set the parameter τ to regularize it to λ ρ ;

[0025]

[0026] (2.4) Calculate the spherical structure similarity function

[0027] (2.5) Repeat steps (2.2) to (2.4) to calculate VR(x, y, σ) corresponding to all scale parameters σ.

[0028] (2.6) For each pixel point (x, y), take the maximum value of VR(x, y, σ) at all scale parameters to obtain the multi-scale spherical structure similarity function VR(x, y), that is, obtain the spherical structure enhanced image.

[0029] (2.7) Set the threshold TH according to the 3σ principle of the normal distribution in probability theory, and binarize the spherical structure enhanced image, where the pixel points belonging to the spherical structure have a value of 1, and the values of other pixel points are 0.

[0030] (2.8) Use the morphological filtering method to remove the structures in the figure whose areas do not meet the requirements.

[0031] (2.9) Calculate the centroid of each spherical structure in the figure to obtain the seed point coordinates.

[0032] In a second aspect, the present invention also provides a device for automatically identifying and segmenting cell somas based on two-photon calcium imaging data, including a memory and one or more processors. An executable code is stored in the memory. When the processor executes the executable code, the method for automatically identifying and segmenting cell somas based on two-photon calcium imaging data as described above is implemented.

[0033] In a third aspect, the present invention also provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, the method for automatically identifying and segmenting cell somas based on two-photon calcium imaging data as described above is implemented.

[0034] Advantages of the present invention:

[0035] 1. It realizes the automatic processing of the fluorescence activity data of visual cortex neurons collected by a two-photon fluorescence microscope, automatically identifies the positions of hundreds of neurons in the imaging area and segments the contours of the cell bodies, and then extracts the fluorescence calcium signals of the neurons for joint behavioral analysis of the neural mechanisms of cognitive functions, which has important value for promoting the development of brain science.

[0036] 2. First, compress the three-dimensional calcium imaging video into a two-dimensional summary image, and then identify the seed points of the cells on the summary image, so that the data volume of the cell recognition algorithm is only related to the size of the imaging area and has nothing to do with the imaging time. Then, crop the calcium imaging video into block videos with the seed points as the center, and then segment the contours of the cells on the block videos, which also greatly reduces the data volume and computational complexity of the cell segmentation algorithm.

[0037] 3. A cell recognition algorithm based on multi-scale dot enhancement is proposed, which can recognize nearly circular cell bodies of different sizes in the imaging area without recognizing structures such as axons and dendrites of neurons.

[0038] 4. A cell segmentation algorithm based on an elliptical constrained active contour model is proposed. The data-driven term constructed based on relevance vectors makes the segmented contour more accurate. The introduced elliptical constraint term makes the zero level set contour close to an ellipse, so that the segmented contour only contains the cell body and excludes structures such as axons and dendrites. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0040] Figure 1 It is a flowchart of an automatic cell body recognition and segmentation method based on two-photon calcium imaging data provided by the present invention;

[0041] Figure 2 It is a result diagram of cell recognition;

[0042] Figure 3 It is a result diagram of cell segmentation;

[0043] Figure 4 It is a schematic diagram of the function of the elliptical constraint term in the cell segmentation method;

[0044] Figure 5 It is a structural diagram of an automatic cell body recognition and segmentation device based on two-photon calcium imaging data provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] The following will further describe the specific embodiments of the present invention in detail with reference to the drawings.

[0046] As Figure 1 shown, an automatic cell body recognition and segmentation method based on two-photon calcium imaging data provided by the present invention includes the following specific steps:

[0047] Step 1. Obtain the two-photon calcium imaging video of the cells, and perform image denoising and image enhancement on each frame of the video image.

[0048] Step 1.1. Image denoising: Anisotropic filtering algorithm.

[0049] Step 1.2. Image enhancement: Top-hat transformation to obtain the brighter gray-scale areas in the original image.

[0050] Step 2: Calculate the temporal correlation coefficient between the fluorescence calcium signal of each pixel coordinate in the two-photon calcium imaging video and the fluorescence calcium signals of several coordinate points in its surrounding neighborhood, and take the average as the gray value of the pixel point, reducing the two-photon calcium imaging video to a local correlation summary image. Based on the multi-scale circular dot enhanced cell recognition algorithm on the local correlation summary image, construct a function related to the eigenvalues of the Hessian matrix (Frangi A F, Niessen W J, Vincken K L, et al. Multiscale vessel enhancement filtering[C]. International conference on medical image computing and computer-assisted intervention. Springer, Berlin, Heidelberg, 1998:130-137.) to enhance circular structures with diameters within a certain range in the image, and calculate the center coordinates of circular structures with different sizes in the imaging area, that is, the seed points of cell bodies; specifically as follows:

[0051] Step 2.1: Local correlation summary image: For all coordinate points in the imaging area of the two-photon calcium imaging video, calculate the temporal correlation coefficient between the fluorescence calcium signal of each coordinate point (x, y) and the fluorescence calcium signals of 8 coordinate points in its surrounding neighborhood respectively, and take the average of the 8 temporal correlation coefficients as the gray value of this pixel point. Finally, a local correlation summary image is obtained.

[0052] Step 2.2: The multi-scale circular dot enhanced cell recognition algorithm constructs a function related to the eigenvalues of the Hessian matrix to enhance circular structures with diameters within a certain range in the image, and calculates the center of the circular structure as the position coordinate of the cell body. The specific steps are as follows:

[0053] (2.1) Set the upper limit σ of the scale parameter according to the upper and lower limits of the cell radius in the local correlation summary image min and the lower limit σ max ;

[0054] (2.2) For each scale parameter σ within the upper and lower limits of the scale parameter, calculate the eigenvalues λ1, λ2 of the Hessian matrix of each pixel point (x, y) in the single-scale Gaussian space;

[0055] (2.3) Introduce the eigenvalue λ3. Among them, the eigenvalues of the Hessian matrix corresponding to spherical structures in three-dimensional space satisfy λ1≈λ2≈λ3<0, and the eigenvalues of the Hessian matrix corresponding to tubular structures satisfy |λ2|≈|λ3|≥λ1, and set the parameter τ to regularize it to λ ρ;

[0056]

[0057] (2.4) Calculate the spherical structure similarity function

[0058] (2.5) Repeat steps (2) to (4) to calculate VR(x, y, σ) corresponding to all scale parameters σ;

[0059] (2.6) For each pixel point (x, y), take the maximum value of VR(x, y, σ) at all scale parameters to obtain the multi-scale spherical structure similarity function VR(x, y), that is, obtain the spherical structure enhanced image;

[0060] (2.7) Set an appropriate threshold TH according to the 3σ principle of the normal distribution in probability theory, and binarize the spherical structure enhanced image, where the pixel point values belonging to the spherical structure are 1, and the values of other pixel points are 0;

[0061] (2.8) Use the morphological filtering method to remove the structures in the figure with an area less than 176um 2 ;

[0062] (2.9) Calculate the centroid of each spherical structure in the figure to obtain the seed point coordinates.

[0063] Step 3. According to the seed points obtained in Step 2, for each seed point, crop the two-photon calcium imaging video into a block video with a fixed size centered on the seed point, and apply the cell segmentation algorithm based on the elliptical shape constrained active contour model on the block video to obtain the contour of the cell body, as Figure 2 and Figure 3 shown.

[0064] Step 3.1. The length and width of the block video are determined by the diameter of the cell body in the imaging area of the two-photon calcium imaging video, 41×41.

[0065] Step 3.2. The cell segmentation algorithm based on the elliptical shape constrained active contour model is an improvement of the distance-regularized level set evolution model. After the level set evolution ends, the zero level set contour converges to the edge of the cell body, and this contour is the contour of the cell body. Specifically: construct the energy function about the level set function while minimizing evolve where the function corresponds to the contour of the cell. In order to construct the energy function First, construct a data-driven term according to the characteristics of two-photon calcium imaging data. Secondly, since neurons are composed of structures such as cell bodies, axons, and dendrites, and the present invention only wants to segment the contour of the cell body to calculate the fluorescence signal of the cell body in subsequent steps, the present invention uses the prior value that the cell body is elliptical in shape and adds an elliptical shape constraint term to the energy function, so that the finally obtained cell contour tends to be elliptical. The improvement of the distance-regularized level set evolution model includes the following two points:

[0066] Improvement 1: The data-driven term is no longer based on the gray value, but measures the difference between the correlation vectors inside and outside the contour. The correlation vector I(u) of each coordinate point u is obtained by calculating the correlation value between the fluorescence calcium signal at this position and the fluorescence calcium signals of all coordinate points v in the block:

[0067]

[0068] Improvement 2: An elliptical constraint term is also added to the energy function. During the level set evolution process, the contour is fitted to a parameterized ellipse, and this ellipse is used to restrict the evolution of the level set, so that the finally obtained level set contour is also close to an ellipse. The steps of alternating evolution are as follows:

[0069] (1) Initialize the level set function and the elliptical shape φ(x, y);

[0070] (2) Under the condition of being determined, minimize the energy function by the gradient descent method to obtain the evolution equation of φ(x, y). Since φ(x, y) is a parameterized ellipse, it is determined by the center coordinates (x0, y0) of the ellipse, the semi-major axis a of the ellipse, the semi-minor axis b of the ellipse, and the rotation angle θ of the ellipse:

[0071]

[0072] Therefore, evolving φ(x, y) means updating the parameters (x0, y0, a, b, θ);

[0073] (3) After determining φ(x, y), minimize the energy function by the gradient descent method again to update

[0074] (4) Repeat steps (2) and (3) until the convergence condition is reached, that is, the change of the level set function is less than the set value or the number of iterations is greater than the set value.

[0075] The role of the elliptical constraint term in the cell segmentation method, such as Figure 4 the a in Figure 4 the b in Figure 4As shown in Figure c, the three columns respectively show the results of the cell segmentation algorithm with and without the elliptical constraint term in three groups of data. The left side shows the case without using the elliptical constraint term, while the right side uses the elliptical constraint term. The results in the upper three rows indicate that introducing the elliptical constraint term can confine the segmentation result within the neuron cell body without considering the axons and dendrites of the neuron; while the results in the last row show that for overlapping neurons, introducing the elliptical constraint term can also prevent the segmentation result from overflowing the boundary of the real cell.

[0076] Corresponding to the foregoing embodiment of a method for automatic identification and segmentation of neuron cell bodies based on two-photon calcium imaging data, the present invention also provides an embodiment of an apparatus for automatic identification and segmentation of neuron cell bodies based on two-photon calcium imaging data.

[0077] See Figure 5 , an apparatus for automatic identification and segmentation of neuron cell bodies based on two-photon calcium imaging data provided by an embodiment of the present invention includes a memory and one or more processors. Executable code is stored in the memory. When the processor executes the executable code, it is used to implement the method for automatic identification and segmentation of neuron cell bodies based on two-photon calcium imaging data in the foregoing embodiment.

[0078] The embodiment of the apparatus for automatic identification and segmentation of neuron cell bodies based on two-photon calcium imaging data provided by the present invention can be applied to any device with data processing capabilities. The any device with data processing capabilities can be a device or apparatus such as a computer. The embodiment of the apparatus can be implemented by software, or by hardware, or by a combination of software and hardware. Taking software implementation as an example, as a logically meaningful apparatus, it is formed by the processor of any device with data processing capabilities reading the corresponding computer program instructions in the non-volatile memory into the memory for running. From the hardware level, as Figure 5 shown, it is a hardware structure diagram of any device with data processing capabilities where the apparatus for automatic identification and segmentation of neuron cell bodies based on two-photon calcium imaging data provided by the present invention is located. In addition to Figure 5 the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities where the apparatus in the embodiment is located usually also includes other hardware according to the actual functions of the any device with data processing capabilities, which will not be elaborated here.

[0079] The specific implementation processes of the functions and roles of each unit in the above apparatus are specifically described in the implementation processes of the corresponding steps in the above method, which will not be elaborated here.

[0080] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present invention. A person of ordinary skill in the art can understand and implement it without creative work.

[0081] An embodiment of the present invention also provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, it implements a method for automatic recognition and segmentation of cell somas based on two-photon calcium imaging data in the above embodiments.

[0082] The computer-readable storage medium may be an internal storage unit of any device with data processing capabilities described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium may also be an external storage device of any device with data processing capabilities, such as a plug-in hard disk, a Smart Media Card (SMC), an SD card, a Flash Card, etc. equipped on the device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store the data that has been output or will be output.

[0083] The above embodiments are used to explain the present invention, rather than limit the present invention. Any modification and change made to the present invention within the spirit and scope of the claims of the present invention fall within the protection scope of the present invention.

Claims

1. A method for automatic recognition and segmentation of cell somas based on two-photon calcium imaging data, characterized in that, The method includes the following steps: Step 1: Obtain the two-photon calcium imaging video of cells, and perform image denoising and image enhancement on each frame of the video image. Step 2: Calculate the temporal correlation coefficient between the fluorescence calcium signal of each pixel coordinate in the two-photon calcium imaging video and the fluorescence calcium signals of several coordinate points in its surrounding neighborhood, and take the mean as the gray value of the pixel point, reducing the two-photon calcium imaging video to a local correlation summary image. Based on the cell recognition algorithm with multi-scale dot enhancement on the local correlation summary image, by constructing a function related to the eigenvalues of the Hessian matrix, enhance the circular structures with diameters within a certain range in the image, and calculate the central coordinates of the circular structures with different sizes in the imaging area, that is, the seed points of the cell bodies. Step 3. Based on the seed points obtained in Step 2, for each seed point, crop the two-photon calcium imaging video into a block video with a fixed size centered on the seed point, and apply a cell segmentation algorithm based on an elliptical shape-constrained active contour model to the block video to obtain the contour of the cell body. Specifically: Construct an energy function for the level set function The energy function While minimizing Evolve Where the function Corresponds to the contour of the cell. To construct the energy function First, construct a data-driven term according to the characteristics of the two-photon calcium imaging data to measure the difference in the correlation vectors inside and outside the contour. The correlation vector I(u) of each coordinate point u is obtained by calculating the correlation value between the fluorescence calcium signal at this position and the fluorescence calcium signals of all coordinate points v in the block: where the pixel point \(u=(x,y)\) in the image, and \(I(u)\) is a one-dimensional correlation vector, As the new feature of this pixel, \(N\) is the total number of pixel points in the block, \(v\) is all coordinate points in the block, \(\Omega\) is defined as the image domain, and the image \(I:\Omega\rightarrow R\) N is defined on the image domain; secondly, using the prior value that the cell body is elliptical, an elliptical shape constraint term is added to the energy function so that the finally obtained cell contour tends to be elliptical; specifically as follows: During the level set evolution process, fit the contour to a parameterized ellipse, and use this ellipse to restrict the evolution of the level set, so that the contour of the final level set is also close to an ellipse. The alternating evolution steps are as follows: (1) Initialize the level set function and the elliptical shape φ(x, y); (2) When is determined, the energy function is minimized by the gradient descent method to obtain the evolution equation of φ(x, y). Since φ(x, y) is a parameterized ellipse, it is determined by the center coordinates (x0, y0) of the ellipse, the semi-major axis a of the ellipse, the semi-minor axis b of the ellipse, and the rotation angle θ of the ellipse: Therefore, evolving φ(x,y) means updating the parameters (x0,y0,a,b,θ). (3) After determining φ(x, y), minimize the energy function using the gradient descent method to update (4) Repeat steps (2) and (3) until the convergence condition is met, i.e., the change in the level set function is less than the set value or the number of iterations is greater than the set value.

2. The automatic recognition and segmentation method of cell soma based on two-photon calcium imaging data according to claim 1, characterized in that The anisotropic filtering algorithm is used for the image denoising.

3. A method for automatic identification and segmentation of cell somas based on two-photon calcium imaging data according to claim 1, characterized in that The top-hat transform is used for the image enhancement to obtain the brighter gray regions in the original image.

4. A method for automatic recognition and segmentation of cell somas based on two-photon calcium imaging data according to claim 1, characterized in that, In step 2, for the cell recognition algorithm with multi-scale dot enhancement, the specific steps for calculating the central coordinates of the nearly circular structures with different sizes in the imaging area are as follows: (2.1) Set the upper limit σ of the scale parameter according to the upper and lower limits of the cell radius in the locally relevant summary image min and the lower limit σ max ; (2.2) For each scale parameter σ within the upper and lower limits of the scale parameter, calculate the eigenvalues λ1 and λ2 of the Hessian matrix of each pixel point (x,y) in the single-scale Gaussian space. (2.3) Introduce the eigenvalue λ3, where the eigenvalue of the Hessian matrix corresponding to the spherical structure in three-dimensional space satisfies λ1≈λ2≈λ3<0, and the eigenvalue of the Hessian matrix corresponding to the tubular structure satisfies |λ2|≈|λ3|≥λ1, and set the parameter τ to regularize it to λ ρ ; (2.4) Calculate the spherical structure similarity function (2.5) Repeat steps (2.2) to (2.4) to calculate VR(x,y,σ) corresponding to all scale parameters σ. (2.6) For each pixel point (x,y), take the maximum value of its VR(x,y,σ) at all scale parameters to obtain the multi-scale spherical structure similarity function VR(x,y), that is, obtain the spherical structure enhanced image. (2.7) Set the threshold TH according to the 3σ principle of the normal distribution in probability theory, and binarize the spherical structure enhanced image, where the pixel points belonging to the spherical structure have a value of 1, and the values of other pixel points are 0. (2.8) Use the morphological filtering method to remove the structures in the figure whose areas do not meet the requirements. (2.9) Calculate the centroid of each spherical structure in the figure to obtain the seed point coordinates.

5. An automatic cell soma recognition and segmentation device based on two-photon calcium imaging data, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that, When the processor executes the executable code, it implements a method for automatic recognition and segmentation of cell bodies based on two-photon calcium imaging data as described in any one of claims 1-4.

6. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements a method for automatic recognition and segmentation of cell bodies based on two-photon calcium imaging data as described in any one of claims 1-4.