Detailed Description
The technical solution of the present invention will be described in detail with reference to the accompanying drawings and preferred embodiments.
The invention aims to provide a fluorescence image signal data storage and color classification method, which can quickly extract fluorescence signals in a fluorescence image and can realize a data classification method in various forms.
In one embodiment, as shown in fig. 1, the present invention provides a fluorescence image signal data storage and color classification method, which specifically includes the following steps:
step one (S100): and acquiring a fluorescence image, extracting a fluorescence signal in the fluorescence image, and saving the extracted fluorescence signal data in a data _ table file. In this step, the AVT of the biochip reader optical system can be utilized: the MG-1236B camera and the biochip reader optical system software extract the fluorescence signals in the fluorescence image, and then the extracted fluorescence signal data is stored in a data _ table file, so that the fluorescence signal data can be rapidly stored and classified.
Step two (S200): the data _ table file stores the fluorescent signal data by adopting a user-defined NodePoint type unidirectional linked list, and completes data color classification by utilizing a data marking bit in the unidirectional linked list.
The Data _ table is a basic storage container for all Data, the Data in the container is respectively read and then stored into two single-direction chain tables of a Data _ list A and a Data _ list B of a Point type, the single-direction chain table of the Data _ list A comprises X Data members, the single-direction chain table of the Data _ list B comprises Y Data members, the single-direction chain table of the NodePoint type comprises X, Y, Temp three Data members, Temp is a Data marking bit, the Data marking bit in the shape is changed by selecting the functions of a rectangle, a polygon and the like, the Data color classification can be realized, and the Data _ table represents a required file. In the computer implementation process, an object-oriented C # programming language derived from C and C + + published by microsoft corporation is used, and named widgets used in the following are all from the.net framework4.7.2 development kit.
Further, the second step comprises the following steps:
step 1: data namespace defining an object of DataRow class, represented by SData; define List class object of Point type in System, Collection, general namespace, represented by Data _ listA and Data _ listB; defining a List class object of NodePoint type in a System, Collection, general name space, and expressing the List class object by data _ point; defining a DataTable class object in a System.Data namespace, and expressing the DataTable object by using data _ table;
step 2: the SData object calls a NewRow function, a new data row object is created, dr is used for representing, a Substring function is called circularly, a return value of the called Substring function is assigned to dr, whether an expression value in the circulating process is True or not is judged, if yes, step 3 is executed, and otherwise, step 2 is executed continuously;
and step 3: the data _ table object calls a Rows.Add function, data in the SData object are circularly assigned to the data _ table object, whether an expression value in a circulating process is True or not is judged, if yes, the step 4 is executed, and if not, the step 3 is continuously executed;
and 4, step 4: the Data _ table object calls a Foreach function to retrieve Data in the Data container, assigns a return value of the Foreach function to Data _ listA and Data _ listB respectively, judges whether an expression value in the circulation process is False, if so, executes step 5, otherwise, continues to execute step 4;
and 5: the Data _ point object circularly calls an AddRange function, Data in Data _ listA and Data _ listB are respectively assigned to an X Data member and a Y Data member in Data _ point, a Temp Data member in Data _ point is assigned to be 1, whether an expression value in the circulating process is False is judged, if yes, step 6 is executed, and if not, step 5 is continuously executed;
step 6: defining an object of a node point class, representing by a node, wherein data members included in the node object comprise a node.X, a node.Y and a node.Temp, circularly reading data in the data _ point object, assigning an X data type in the data _ point object to the node.X, assigning a Y data type in the data _ point object to the node.Y, assigning a Temp data type in the data _ point object to the node.Temp, judging whether an expression value in a circulating process is False or not, if so, executing a step 7, otherwise, continuously executing a step 6;
and 7: defining an object of a Chart control class, expressing the object by Chart _ XY, calling an AddXY function by a Points member under the Chart _ XY, circularly reading node.X, node.Y and node.Temp in the node object, displaying data, judging whether an expression value in a circulating process is False, if so, executing a step 8, otherwise, continuing to execute a step 7;
and 8: creating a mouse click trigger event under chat _ XY, expressing by start.X and start.Y, calling an Axisx method in a ChartAreas drawing area in the chat _ XY control, calling a PixelPositionToValue function, assigning a return value for calling the PixelPositionToValue function to the start.X and the start.Y, judging whether expression values of the start.X and the start.Y exist or not, if so, executing the step 9, otherwise, continuing to execute the step 8;
and step 9: defining four objects of the var class in a System namespace, respectively representing the four objects by n1, n2, n3 and n4, calling a Where function under the node object to judge the data positions of coordinate points of start.X and start.Y in the node object, and at the moment, only judging the current coordinate position and not judging the node.Temp identification position. Assigning the Where function return value to n1 when node.X in the node is greater than start.X and node.Y is greater than start.Y; assigning the Where function return value to n2 when node.X in the node is greater than start.X and node.Y is less than start.Y; assigning the Where function return value to n3 when node.X in the node is less than start.X and node.Y is greater than start.Y; when the node.X in the node is smaller than the start.X and the node.Y is smaller than the start.Y, assigning the Where function return value to n4 to complete the division of four quadrants;
step 10: defining an object of a var class in a System namespace, representing the object by n _ listA, defining a List class object of a Point type in the System namespace, representing the object by listA, calling a Foreach function by the n _ listA object to retrieve data in n1, and assigning a return value of the calling Foreach function to the listA; defining an Int class object in a System namespace, expressing the Int class object by using index, wherein the index is a loop initial value, calling a loop statement for function, retrieving data in listA, assigning the retrieved value to node.X, node.Y and node.Temp in the node object, classifying the node.Temp data meeting the condition in the step 9 into 1, judging whether the expression value in the loop process is False or not if the expression value is red, executing the step 11 if the expression value is False, otherwise, continuing to execute the step 10;
step 11: defining an object of a var class in a System namespace, representing the object by n _ listB, defining a List class object of a Point type in the System namespace, representing the object by listB, calling a Foreach function by the n _ listB object to retrieve data in n2, and assigning a return value of the calling Foreach function to the listB; defining an Int class object in a System namespace, expressing the Int class object by using index, wherein the index is a loop initial value, calling a loop statement for function, retrieving data in listB, assigning the retrieved value to node.X, node.Y and node.Temp in a node object, and judging whether an expression value in a loop process is False or not if the expression value is False if the node.Temp data in the node object is 2 in the conditions of step 9 and step 10, and judging whether the expression value in the loop process is False or not if the expression value is green, executing step 12, otherwise, continuing to execute step 11;
step 12: defining an object of a var class in a System namespace, representing the object by n _ listC, defining a List class object of a Point type in the System namespace, representing the object by listC, calling a Foreach function by the n _ listC object to retrieve data in n3, and assigning a return value of the calling Foreach function to the listC; defining an Int class object in a System namespace, expressing the Int class object by using index, wherein the index is a loop initial value, calling a loop statement for function, retrieving data in listC, assigning the retrieved value to node.X, node.Y and node.Temp in the node object, classifying the node.Temp data into 3 when the conditions of step 9 and step 10 are met, judging whether the expression value in the loop process is False or not if the expression value is black, executing step 13 if the expression value is False, otherwise, continuing to execute step 12;
step 13: defining an object of a var class in a System namespace, representing the object by n _ List D, defining a List class object of a Point type in the System namespace, representing the object by List D, calling a Foreach function by the n _ List D object to retrieve data in n4, and assigning a return value of the calling Foreach function to List D; defining an Int class object in a System namespace, expressing the Int class object by using index, wherein the index is a loop initial value, calling a loop statement for function, retrieving data in listD, assigning the retrieved value to node.X, node.Y and node.Temp in the node object, classifying the node.Temp data into 4 when the conditions of step 9 and step 10 are met, judging whether the expression value in the loop process is False or not if the expression value is blue, executing step 14 if the expression value is False, otherwise, continuing to execute step 13;
step 14: defining a Globaldata class object, defining four objects of ColorA, ColorB, ColorC and ColorD in a System.drawing namespace, defining four objects of NameA, Name B, Name C and Name D in a string namespace, and respectively distinguishing colors and selecting classification modes;
step 15: defining a Point class object in a System.Drawing namespace, representing the Point class object by tempEndPoint, defining two temporary objects of var class in the System namespace, representing a rectangular starting Point, and representing the two temporary objects by a and b respectively; calling an AxisX object in a ChartAreas drawing area under chart _ XY to call a PixelPositionToValue function, and assigning return values of the called PixelPositionToValue function to a and b; defining two temporary objects of var class in a System namespace, which are used for representing rectangular termination points and are respectively represented by c and d, calling an Axisx object in a ChartAreas drawing area under chart _ XY to call a PixelPositionToValue function, and assigning return values for calling the PixelPositionToValue function to c and d; defining a var class object in a System namespace, expressing the var class object by using the ntepa, calling a Where function under the node object to judge the data positions of coordinate points a, b, c and d in the node object, when the data in the node object simultaneously meet the conditions that a is more than or equal to a, less than or equal to b, less than or equal to c and more than or equal to d, assigning the return value of the Where function to the ntepa, circularly calling a Foreach function, resetting the node.temp value in the data in the rectangular area, judging whether the expression value in the resetting process is false, if so, executing a step 16, otherwise, continuing to execute a step 15;
step 16: respectively recording 4 areas divided by the controls in the steps 8 and 9 as nA, nB, nC and nD, when the target area is nC, the selected color is red and the selected graph is rectangular, the color of Colora is red, the name of NameA is rectangular, then assigning node.Temp to be 1, calling a Remove function in nC to Remove data with node.Temp being 1, calling an AddRange function to load the node data again, finishing the classification of rectangular red colors, judging whether the expression value in the classification process is true, if so, executing the step 17, otherwise, continuing to execute the step 16;
and step 17: when the target area is nC, the selected color is green, and the selected graph is rectangular, the color of Colora is red, the name of NameA is rectangular, at the moment, node.Temp is assigned to be 1, a Remove function is called in the node to Remove data with node.Temp being 1, an AddRange function is called to load the node data again, the classification of the green color of the rectangle is completed, whether the expression value in the classification process is true is judged, if yes, step 18 is executed, otherwise, step 17 is continuously executed;
step 18: defining a List class object of a double type in a System, Collection, general namespace, expressed by xs and ys, and defining a List class object of a Point type in the System, Collection, general namespace, expressed by points, and used for storing the position of a polygon coordinate Point; circularly calling a Foreach function, traversing a coordinate point points value of a polygon, calling an AxisX object in a ChartAreas drawing area under chart _ XY to call a PixelPositionToValue function, assigning a return value of the called PixelPositionToValue function to xs and ys, judging whether an expression value in a circulating process is false, if so, executing a step 19, otherwise, continuing to execute a step 18;
step 19: defining a PositionPnPpoly class, wherein 5 groups of parameters exist in the class, and the parameters are respectively 1: fixed point number of irregular shape, parameter 2: current x-coordinate, parameter 3: current y-coordinate, parameter 4: irregular shape x-coordinate set, parameter 5: an irregular-shaped set of y-coordinates. Dividing the polygon into an inner area and an outer area, assuming that a certain data point to be measured is in the polygon, based on a ray method, leading out a ray from the point, wherein the direction is horizontal to the right, if the intersection point of the ray and the polygon is an odd number, judging that the data point to be measured is in the polygon, and if the intersection point of the ray and the polygon is an even number, judging that the data point to be measured is outside the polygon. Defining an Int class object in a System namespace, representing by i, calling a loop statement for function, retrieving data in a parameter 1, sequentially checking each side of a polygon, calling an if function to judge a parameter 2 and a parameter 4 and a parameter 3 and a parameter 5, judging that two vertexes on one side are respectively above and below a data point to be detected, detecting the number of rays led out rightward from the data point to be detected and possibly intersecting the side, calculating parity, obtaining a result of whether the data point to be detected is in the polygon, judging whether an expression value in a loop process is true, executing a step 20, otherwise, continuing to execute a step 19;
step 20: defining a List class object of a NodePoint type in a System, Collection, general name space, expressing by result, calling an if function to judge whether a data point to be detected is in a polygon, calling an Add function, assigning a node data set of the data point to be detected in the polygon to the result, circularly calling a Foreach function, resetting a node Temp value in data in the polygon area, judging whether an expression value in the resetting process is false, if so, executing a step 21, otherwise, continuing to execute the step 20;
step 21: when the target area is nC, the color is red, and the selected graph is a polygon, the color of Colora is red, the name of NameA is a polygon, at the moment, node.Temp is assigned to be 1, a Remove function is called in the node to Remove data with node.Temp being 1, an AddRange function is called to load the node data again, the classification of the red color of the polygon is completed, whether the expression value in the classification process is true is judged, if yes, step 22 is executed, otherwise, step 21 is continuously executed;
step 22: when the target area is nC, the selected color is green, and the selected graph is a polygon, the color of Colora is red, the name of NameA is a polygon, the node.Temp is assigned to be 1, a Remove function is called in the node to Remove data with the node.Temp being 1, an AddRange function is called to reload the node data, and classification of the green color of the polygon is completed.
The steps are sequentially completed to store the fluorescence image signal data and classify the colors.
The invention has the positive effects that: the method adopts a user-defined NodePoint type single-direction linked list which comprises X, Y, Temp data members, Temp is a data structure of an identification bit, data is stored by a method of the user-defined data structure, color classification is completed by a data identification bit mode, and flexibility of data storage and color classification is improved.
The technical scheme and the technical effect of the invention are further explained below by combining specific experimental data. Fig. 2 shows a two-dimensional diagram of the droplet-fluorescent scattering points obtained by the experiment, fig. 3 and 4 show a classification diagram of rectangles and polygons of the droplet-fluorescent scattering points, in fig. 2-4, the horizontal axis shows the fluorescent intensity under HEX light, the vertical axis shows the fluorescent intensity under FAM light, the 4 divided regions respectively show blue, red, green and black regions in order from top left clockwise to bottom left, the fluorescent numbers in the blue, red, green and black regions are respectively represented by CH1+ CH2-, CH1+ CH2+, CH1-CH2+ CH1-CH2-, and the fluorescent numbers in the blue, red, green and black regions are respectively 507, 11, 63 and 4090.
As shown in fig. 3, when the selected color is red in the black region and the selected pattern is a rectangle, the number of data points in the rectangle is 3, and when the selected color is red in the green region and the selected pattern is a rectangle, the number of data points in the rectangle is 11. Wherein the fluorescence data in the green region is reduced from 63 to 52 in fig. 1, the data in the black region is reduced from 4090 to 4087 in fig. 1, and the fluorescence data in the red region is increased from 11 to 25 in fig. 1.
As shown in fig. 4, when the selected color is red in the black region and the selected pattern is a polygon, the number of data points in the polygon is 6, and when the selected color is red in the green region and the selected pattern is a polygon, the number of data points in the polygon is 7. The data in the green area is reduced from 63 to 56 in fig. 1, the data in the black area is reduced from 4090 to 4084 in fig. 1, and the data in the red area is increased from 11 to 24 in fig. 1.
Therefore, the invention can flexibly change the storage of fluorescence data and the color classification by selecting the functions of rectangle, polygon and the like and changing the data mark bit in the shape.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.