Pathological image swept-focus classification method based on k-means cluster
Technical field
The present invention relates to technical field of microscopy more particularly to a kind of pathological image swept-focus based on k-means cluster
Classification method.
Background technique
Digital slices scanner is the Medical Devices quickly grown in recent years, and digital slices scanning system can be complete by glass slide
Information, comprehensive quick scanning make the glass slide of conventional matter become new-generation digital pathological section, digital slices scanning
Instrument is to realize epoch-making change to pathological diagnosis technology.A digital slices scanner essential ring during the scanning process
Section is exactly to focus, i.e., is cooperated by moving up and down for Z axis with camera grabgraf, finds the slice a certain number of focuses of different location
Afterwards, the focal plane for calculating slice, for preparing for slice scanning.There are mainly two types of existing focusing methods, and one is one
Secondary property is to complete all focuses, but the error focused in this way is big, and scan image is fuzzy;Another method is to complete one
Part focus scanning a part, i.e. dynamic focusing, this method there occur a problem that when being sliced larger or tissue be island
When, the focal plane calculated for the first time may be not suitable for farther away focus, cause farther away focus focusing difficult.
Summary of the invention
The above problem existing for focusing method for existing digital slices scanner, now providing that one kind aims at can
It calculates the first time focal plane of dynamic focusing and is suitable for all focuses to be calculated, accelerate focusing speed, improve focusing precision
Pathological image swept-focus classification method based on k-means cluster.
Specific technical solution is as follows:
Based on the pathological image swept-focus classification method of k-means cluster, a pathological section, including following steps are provided
It is rapid:
S1. K focus is obtained from the pathological section;
S2. the K focuses are obtained into N number of center of mass point using iteration self-organizing data analysis method one by one;
S3. classified according to N number of center of mass point of acquisition to the K focuses, to divide each focus institute
The class of category, each center of mass point are corresponding a kind of;
S4. the position of the center of mass point of every class is adjusted according to the corresponding focus of every class after division, is terminated.
Preferably, the detailed process of the step S2 are as follows:
S21. choose a focus as the i-th=1 center of mass point, obtain respectively the K-1 focuses with it is described
The distance D of i-th of center of mass pointi(j), and by K-1 distance Di(j) it adds up to obtain total distance sum (Di),
Wherein, i, j are positive integer, Di(j) the distance between j-th of focus and i-th of center of mass point are indicated,
1≤i≤K,1≤j≤K,i≠j;
S22. i+1 center of mass point is obtained according to formula (1):
Random-Di(j) < 0 (1),
Wherein, Random is less than or equal to sum (Di) integer, when Random meets formula (1), the distance Di
(j) corresponding j-th focus is i-th=i+1 center of mass point;
S23. judge whether i is equal to N, if so, executing step S24;If it is not, executing step S3;
S24. the distance D of K-1 the focuses and described i-th center of mass point is obtained respectivelyi(j), and by K-1
A distance Di(j) it adds up to obtain the total distance sum (Di), it returns, executes step S22.
Preferably, the distance that each focus arrives each center of mass point respectively is obtained one by one in the step S3,
The focus is classified as shortest apart from the corresponding class of the corresponding center of mass point in corresponding distance.
Preferably, each focus is obtained according to formula (2) in the step S3 arrive each center of mass point respectively
Distance:
Cj=argmin ‖ Xj-Yi‖2(2),
Wherein, XjIndicate the position coordinates of j-th of focus, YiIndicate the position coordinates of i-th of center of mass point, Cj
Indicate described j-th focus to i-th of center of mass point distance.
Preferably, being averaged for the position coordinates for all focuses for belonging to every class is obtained one by one in the step S4
Coordinate, using the average coordinates as the position coordinates of the center of mass point corresponding with the class.
Preferably, it is sat in the step S4 according to the position that formula (3) obtain all focuses for belonging to every class
Target average coordinates:
Wherein, M indicates all focuses belonged in the corresponding class of i-th of center of mass point, QiIndicate i-th of institute
State the average coordinates of the center of mass point of the corresponding class of center of mass point.
Above-mentioned technical proposal the utility model has the advantages that
In the technical scheme, it is sorted using iteration self-organizing data analysis method to classification of focal spot to be calculated, it is effective to add
Fast focusing speed, improves focusing precision, improves the applicability of focal plane.
Detailed description of the invention
Fig. 1 is a kind of implementation of the pathological image swept-focus classification method of the present invention based on k-means cluster
The flow chart of example.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art without creative labor it is obtained it is all its
His embodiment, shall fall within the protection scope of the present invention.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the present invention can phase
Mutually combination.
The present invention will be further explained below with reference to the attached drawings and specific examples, but not as the limitation of the invention.
As shown in Figure 1, the pathological image swept-focus classification method based on k-means cluster, provides a pathological section, wrap
Include following step:
S1. K focus is obtained from pathological section;
S2. K focus is obtained into N number of center of mass point using iteration self-organizing data analysis method one by one;
S3. classified according to N number of center of mass point of acquisition to K focus, to divide class belonging to each focus, Mei Gezhi
Heart point is corresponding a kind of;
S4. the position of the center of mass point of every class is adjusted according to the corresponding focus of every class after division, is terminated.
In the present embodiment, it is sorted using iteration self-organizing data analysis method to classification of focal spot to be calculated, it is effective to accelerate
Focusing speed improves focusing precision, improves the applicability of focal plane.
In a preferred embodiment, the detailed process of step S2 are as follows:
S21. a focus is chosen as the i-th=1 center of mass point, obtains K-1 focus respectively at a distance from i-th of center of mass point
Di(j), and by K-1 distance Di(j) it adds up to obtain total distance sum (Di),
Wherein, i, j are positive integer, Di(j) expression the distance between j-th of focus and i-th of center of mass point, 1≤i≤K,
1≤j≤K,i≠j;
S22. i+1 center of mass point is obtained according to formula (1):
Random-Di(j) < 0 (1),
Wherein, Random is less than or equal to sum (Di) integer, when Random meets formula (1), distance Di(j) right
J-th of the focus answered is i-th=i+1 center of mass point;
S23. judge whether i is equal to N, if so, executing step S24;If it is not, executing step S3;
S24. K-1 focus and i-th of center of mass point distance D are obtained respectivelyi(j), and by K-1 distance Di(j) add up with
Obtain total distance sum (Di), it returns, executes step S22.
In the present embodiment, the selection number of center of mass point and position will have a direct impact on the quality of cluster result, therefore use
Iteration self-organizing data analysis method algorithm calculates center of mass point number, and focusing precision can be improved.
In a preferred embodiment, the distance that each focus arrives each center of mass point respectively is obtained one by one in step s3, it will
Focus is classified as shortest apart from the corresponding class of corresponding center of mass point in corresponding distance.
Further, the distance that each focus arrives each center of mass point respectively is obtained according to formula (2) in step s3:
Cj=argmin ‖ Xj-Yi‖2(2),
Wherein, XjIndicate the position coordinates of j-th of focus, YiIndicate the position coordinates of i-th of center of mass point, CjIt indicates j-th
Distance of the focus to i-th of center of mass point.
In a preferred embodiment, in step s 4 one by one obtain belong to every class institute focal position coordinates put down
Equal coordinate, using average coordinates as the position coordinates of center of mass point corresponding with class.
Further, in step s 4 according to formula (3) obtain belong to every class institute focal position coordinates put down
Equal coordinate:
Wherein, M indicates all focuses belonged in the corresponding class of i-th of center of mass point, QiIndicate that i-th of center of mass point is corresponding
Class center of mass point average coordinates.
In the present embodiment, using average coordinates as the position coordinates of center of mass point corresponding with class, after completing focus cluster,
By the sequence to inhomogeneity focus, efficient focus identification can be realized.
The foregoing is merely preferred embodiments of the present invention, are not intended to limit embodiments of the present invention and protection model
It encloses, to those skilled in the art, should can appreciate that all with made by description of the invention and diagramatic content
Equivalent replacement and obviously change obtained scheme, should all be included within the scope of the present invention.