{'fraction_non_alphanumeric': 0.022775423728813558, 'fraction_numerical': 0.0413135593220339, 'mean_word_length': 4.805021778119396, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Validated method for automated glioma diagnosis from GFAP immunohistological images: a complete pipeline

Background and objective Glial fibrillar acid protein is a common marker for brain tumor because of its particular rearrangement during tumor development. It is commonly used in manually histological glioma detection and grading. An automatic pipeline for tumor diagnosis based on GFAP is proposed in the present manuscript for detecting and grading canine brain glioma in stages III and IV. Methods The study was performed on canine brain tumor stages III and IV as well as healthy tissue immunohistochemically stained for gliofibrillar astroglial protein. Four stereological indexes were developed using the area of the image as reference unit: density of glioma protein, density of neuropil, density of astrocytes and the glioma nuclei number density. Images of the slides were subset for image analysis (n=1415) and indexed. The stereological indexes of each subset constituted an array of data describing the tumor phase of the subset. A 5% of these arrays were used as training set for decision tree classification with PCA. The other arrays were further classified in a supervised approach. ANOVA and PCA analysis were applied to the indexes. Results The final pipeline is able to detect brain tumor and to grade it automatically. Added to it, the role the neuropil during tumor development has been quantified for the first time. While astroglial cells tend to disappear, glioma cells invade all the tumor area almost to a saturation in stage III before reducing the density in stage IV. The density of the neuropil is reduced during the tumour growth. Conclusions The method validated ere allows the automated diagnosis and grading of glioma in dogs. This method opens the research of the role of the neuropil in tumor development. Graphical abstract

Image segmentation algorithms such as thresholding, edge detection and region growing 56 [3], are able to distinguish tumor features from classically stained histological sections 57 and to classify them depending on the tumor malignancy grade [2-4,6,19-21]. 58 However, the quantification from two dimensional slice of tissue produces indexes 59 that do not take into account the volumetric size, shape, or orientation of particles, and 60 therefore these indexes are biased [22]. In order to proceed with an unbiased estimation 61 of the features of interest, stereological algorithms correct the error thus providing with 62 quantification indexes related to the volumetric distribution of the indicators. These 63 algorithms allow the three-dimensional interpretation of two-dimensional cross sections 64 of materials or tissues [23]. Added to this, the quantification by stereological unbiased 65 indexes can increase the accuracy of the diagnosis and with it the possibilities of success 66 in treatment selection [24][25][26][27][28][29][30]. 67 In the present article we propose a diagnosis of glioma, brain tumor, based on 68 segmentation of the extracellular matrix (ECM) which in turn is composed by glial 69

Image intake 117
Images were taken with a Leica DM6000 camera attached to a Leica DM4 118 microscope. The output image resulted in a complete section of tissue and it is referred 119 here as original image. Four to five images per individual were taken from different areas 120 of the tumor, by which at least 95% of the image was covered. 121

Analysis pipeline 122
For analysing the images, a software was developed using MATLAB 2016a following 123 the standard pipeline: pre-processing, processing and post-processing (  Three methods of image sampling were compared by studying the reduction of the 133 standard error [30]. These methods are complete, random and periodic sampling. In the 134 complete method, the original image was analysed and here we will refer it as complete 135 sampling method or CS ( Figure 1A). The same analysis was repeated sub-setting the 136 complete image. The image is sub-sampled in smaller rectangles or subsets that allow an 137 array of sub-images per individual. The informative indexes were analysed within those 138 images to perform the statistical analysis with higher accuracy and reduction of the 139 standard error. Image sampling produced subsets of 250x200 pixels. The size of the 140 subsets was chosen to include representative cell features of interest with grading 141 purposes. Each subset has a start point or origin (x,y) placed in the top left corner. Those 142 starting points were declared following two different methods: random and periodic. 143 The first method consisted in selecting random starting points in the full image and it 144 is called here random sampling method or RS ( Figure 1B). There were starting points 145 overlapping already taken areas and were avoided by the program. 146 The last method for analysing the image is the periodic sampling. In this method there 147 is a unique starting point as origin selected from the first 250x200 pixels in the top left 148 side of the image. Two periods, one for each axis, x and y, are established from this point 149 thus creating an imaginary grid with squares never smaller than 250x200 pixels. The 150 crossing points of this grid will become the origin of the subsets ( Figure 1C). The subsets 151 were selected in a periodic manner and no overlapping occurred. This method is therefore 152 named periodic sampling or PS and achieves the instruction in Weibel The origin (x0,y0) for sampling is defined by 170 where α is a random number taking values between 0 and 1. 172 More than 40 subsets per image were obtained with both systems, random (total 173 subsets = 658) and periodic (total subsets = 1415). The features quantified from CS 174 analysis of the image have provided four values per individual. In contrast, the features 175 indexed for each of the subsets provided more than 40 values per individual. Therefore, 176 each ID could have average and standard deviation for each index. This standard 177 deviation will be taken into account for a multilevel statistical analysis. 178

Processing: Segmentation 179
Our team has segmented 4 basic structures for glioma grading: astrocyte GFAP (AG), 180 neuropil GFAP (NG), glioma GFAP (GP) and glioma nuclei (GN). 181 The protein synthesized by the glial cells (GFAP) was immuno-stained with the 182 previously described antibody. Three different stain intensities were detected according 183 to the proteomic structure of GFAP: synthesized as cytoskeleton of the body of the 184 astrocytes (used in the AG index), stored in the neuropil (astrocytic elongations) or 185 secreted to the ECM GFAP (used in the NG index) and produced in an uncontrolled 186 manner by the glioma cells (glioma protein, used in the GP index) (Figure 2, B, C and D). 187 GFAP pixels were manually sampled from ICH stained images and collected in a library 188 of pixels. The values of each color channels, red, green and blue, were analysed for further 189

Stereological indexes 247
The major features identified when tumors were graded by the pathologist were: The area of reference for density is the size of the image (μm 2 ) and it varies depending 264 on the analysis performed, being 86900μm 2 for the complete image and 884μm 2 for the 265 subsets in the periodic and random sampling of the image. 266 Each image or subset that wasanalysed produced an array with GP, NG, AP and GN 267 indexes to describe the presence of tumor features if any and its grade. 268

Precision of the image segmentation and processing 269
The precision of the segmentation by thresholding as proposed before was evaluated 270 according to its sensitivity and specificity. To do so, an image of the segmented feature 271 was overlapped with the original image to identify manually the segmentation ( Astrocyte GFAP and glioma nuclei quantification were evaluated by overlaying the 284 masked nuclei with the original image. Astrocyte GFAP true positives were those 285 astrocytes with cytoskeletal GFAP providing star shape, typical from these cellules. True 286 negatives were those cells with stained nuclei but corresponding to different cellular types 287 that did not have any GFAP masked. False positives were GFAP proteins segmented that 288 do not correspond with astrocytes and false negatives were astrocytes that have not been 289 detected. In the case of the glioma nuclei, the true positives were the coincident nuclei. 290 The true negatives were the healthy nuclei that were not masked as glioma. The false 291 negatives were those glioma nuclei that were not detected. The false positives were those 292 healthy nuclei or blood cells that were masked. 293

Multilevel statistics and characterization of the tumor 294
Tissue differences were characterized by a one-way ANOVA and multivariate 295 analysis using R v. 3.1.0 GUI 1.64. The variables tested were the 4 variables defined 296 previously, namely: GN, GP, NG and AG. The images used were the subsets created on 297 the periodic image sampling (n=1415). As established by Weibel (1979), the variability 298 between subsets has been taken into account as inter-individual variability random effect, 299 and therefore, as source of error in the ANOVA model under an F-test. Further Pairwise 300 T-test has been used to compare between tissues. 301

Classification for diagnosis: detection and grading 302
The two-step hierarchical classification was divided in detection (presence or absence 303 of tumor) and further grading (grade III and grade IV) and the final classification was 304 achieved by prediction after training. 305 Two training sets were constructed, one for tumor detection and another for tumor 306 grading, including pathological cases in early or late stages and also inter- The analysis pipeline started with the detection function followed by the grading 326 function. The subsets were classified by the grading and each subset was then grouped 327 according to the individual or patient ( According to their malignancy grade, glioblastomas showed a stage IV of cytonuclear 344 atypia and an increased frequency of necrosis and glomeruloid vascular proliferation. 345 Pseudo-palisading of neoplastic cells around necrotic foci was a pathognomic feature of 346 Glioblastoma. Additional features observed were and infiltrative growth pattern, 347 muccinous secretion, and some areas of inflammation. 348

Color differences between features from healthy tissue and glioma 349
One-way ANOVA applied to the pixel library has shown high significant differences 350 for each of the three color channels RGB for all the tested structures, namely astrocyte, 351 nucleus-high, GFAP control, GFAP-high (Supplemental 1, 2, 3 and 4, p value = 0, F-test). 352 The intensity of the color is higher for the glioma nuclei while it is lighter for the healthy 353 nuclei. Similarly, GFAP synthesized by the healthy astrocytes is significantly darker than 354 the one synthesized by the mutated glial cells, which in turn are darker than the GFAP 355 protein found in the neuropil (p value = 0, F-test and Tukey multi-comparison test). 356

Precision of GFAP image segmentation 357
The precision of the segmentation is described in Table 3. There was a notable 358 decrease in the specificity of the glioma nuclei down to the 61% for tumors of stage IV. 359 This decrease is due to a high number of false positive (46 false positive compared to 72 360 true negative) corresponding to artefacts and blood cells that were stained as nuclei but 361 were not. However, no healthy nuclei were masked as glioma nuclei. Moreover, the 362 segmentation did not detect any nuclei of the glioma in the normal tissue images. 363  The false negatives in the segmentation for protein secreted for neuropil (neuropil 370 GFAP) correspond to very lax protein that was not masked in the healthy and stage IV 371 tumor tissue. 372

Reduction of the standard error by sampling histological images 373
The use of subsets from complete histological images was applied here for reduction 374 of standard error as suggested by Weibel (1979). The standard error was reduced for all 375 the features below 5%, except for the astrocyte GFAP protein, which remains around 10% 376 The indexes are astrocyte GFAP density (AG), glioma nuclei number-density (GN), 382 glioma GFAP density (GP) and neuropil GFAP density (NG). 383

Tissue differences detected by multilevel statistics 384
The presence of the tumor was easy detectable by the presence of glioma nuclei (GN), 385 that did not exist in the normal tissue ( Figure 5A, p-value = 0, F-test and T-test). Similarly, 386 the glioma GFAP (GP) was significantly higher in the glioma tissue ( Figure 5B, p-value 387 = 0, F-test and T-test). Both GP and GN were significantly higher in tissues with stage III 388 tumor grade when compared to stage IV ( Figure 5B, p-value = 0, T-test). 389 NG was significantly higher in normal tissue than in the tumor samples. It was also 390 higher in stage IV tumor when compared with the one in stage III ( Figure 5C, F-test, p-391 value = 0). 392 AG was significantly higher in the healthy brain tissue and in the stage III tumor when 393 compared to the stage IV tumor ( Figure 5D, F-test, p-value =0). However, the difference 394 between stage III tumor and normal brain tissue was not significant due to the low density 395 of astrocytes in both tissues and the high dispersion of this index. 396

Classification and tumor diagnosis 402
The best algorithm for classification is the SDT for tumor detection and MDT is the 403 best for tumor grading according to their accuracy (Table 4). 404   18.52% and the fourth is 11.9%. 419

PCA 420
The PCA shows a strong correlation between NG, GN   However, the procedure can be improved to detect palisades or pseudopalisades by 472 differential stain of the cancer nuclei using proliferation markers such as Ki-67 or cyclin 473 A. 474

Identification of key structures for grading 475
A board of pathologists assessed the histological evaluation of the tumors with IHC 476 specific for GFAP, following the WHO directives [38]. The features used during this 477 analysis have been successfully segmented with high levels of precision ( Figure 5 is affected in a manner that cannot process the GFAP thus losing the shape and as 495 proposed by Chen and co-workers [52], also changing the function. 496 The same principle applies to the differential staining of the cancer cell nuclei when 497 compared to the health cell nuclei. Again, because of the high mitotic activity described 498 by Gichet [31], the staining of the cancer nuclei has higher accumulation of colorant, and 499 consequently, a darker color. Therefore, the differential segmentation is possible because 500 of the differential pattern of the chromatin structure. 501

Segmentation 502
The sensitivity and specificity of the GFAP structures is maintained over 84%, with 503 an exception of the sensitivity of neuropil GFAP that decrease to 75% in healthy tissue 504 and 79.1% in stage IV tumor. The library of pixels for segmenting the neuropil was 505 created from the more identifiable color in the neuropil of the healthy tissue, which is also 506 the densest neuropil GFAP. This GFAP density is also similar to the one found in the 507 neuropil of a tumor. However, the very lax GFAP in the neuropil of healthy tissue is not 508 segmented since it has very similar coloration than the background. Those different 509 densities of the protein associated to neuropil can be influenced by the ECM, which can 510 also contain almost degraded GFAP from cellular processes. That can be explained by 511 the heterogeneity of the ECM in the normal brain tissue and also during tumor 512 development [53]. Nevertheless, the area of the ECM in brain tissue is considered almost 513 non-existing and the specificity was 100%. Therefore, the reduction in the sensitivity for 514 the neuropil did not reduce the accuracy of the segmentation. That is also consistent with 515 the high accuracy of the further tumor classification. This method opens here for the first 516 time the possibility to quantify and to study the heterogeneity of the brain neuropil with 517 unbiased quantitative tools. 518 The accuracy values are all above 88% for nuclei segmentation with the exception of 519 the nuclei in the stage IV glioma (IV), showing 61% of specificity. This can be explained 520 by the increase of the necrosis areas and capillaries in the advanced stages of the tumor 521 [38]. The dead cells and the blood cells in the tissue are also colored as nuclei and 522 therefore the segmentation process has false positives. This problem could be possibly 523 solved with differential stain for proliferation such as Ki-67 or cyclin A [4]. However, the 524 sensitivity of the segmentation here was enough to compensate the low specificity for the 525 tumor in grade IV (91.7%) and the accuracy was not reduced by the presence of false 526 positives. Even though this reduction in accuracy did not affect the final diagnosis of the 527 tumor, a complementary evaluation of the vascular components, such as capillary 528 glomeruloid, can be recommended. 529 The identification of the nuclei by its color and its separation with watershed 530 techniques has been also applied before by Mouelhi [6]. However, these studies focused 531 only on the density of nuclei as markers and are not strong enough to develop a proper 532 diagnosis. In our study, the watershed segmentation applied to the tumor nuclei is a 533 complement to the GFAP indexes thus creating a complete array of cancer indexes. 534

Stereological indexes 535
Subsetting the image by either periodic or random sampling reduced the standard 536 error of the indexes when compared to the analysis of the entire image. Furthermore, the 537 periodic sampling is proved to be more accurate because it has a higher number of subsets, 538 and therefore, the indexation is more robust. The standard error of the indexes is reduced 539 below 5% in all the cases except in the astrocyte-GFAP density that remained in the 540 10.33%. This exception occurs because the distribution pattern of the astrocytes has a 541 frequency of appearance that is bigger than the period of the sampling. It means that only 542 few subsets have astrocyte-GFAP. The most subsets in all the sampled tissues have no 543 presence of astrocyte-GFAP and it produces a binomial distribution of the frequency: or 544 no astrocyte (majority of subsets) or certain density, depending on the subset (minority). 545 However, the astrocyte GFAP has been proved to be a determinant factor for grading of 546 tumour [38]. Therefore, this index has been also included in the classification-learning 547 algorithm with a particular success in grading. 548

Classification learner 610
The machine-learning process for classification of tumor is proved more efficient for 611 tumor detection than for grading (Table 4) nuclei when compared with a theoretical model of stage IV glioma as for example 634 individual 2. Individual 7 was considered healthy or grade III patient indistinctly when 635 the system was trained without representing the early stage IV. Only after training the 636 system with a more heterogeneous set, the diagnosis can be corrected for all patients. This 637 is also an indication that a training set collecting only the patterns for each tumor grade 638 as established in the WHO classification cannot always detect the inter-grade tumors. 639 The most critical medical decision making for treatment selection corresponds to 640 grades III and IV, the ones successfully classified here. However, a medical research 641 approach should include also grades I and II in order to achieve a full perspective of the 642 tumor development. 643 644 The role of the neuropil in the development of gliomas is quantified here and 645 compared to those of the tumor cell proliferation and growth. The density of neuropil 646 GFAP protein is the most important index for brain tumor diagnosis according to the 647 PCA. This is a new approach for brain histological evaluations. Unbiased quantification 648 of the neuropil can be included in order to approach cell communication in the physiology 649 of the whole tissue, thus opening new research horizons within the neuropil field. 650 This is the first time that a whole pipeline of accurate segmentation integrates a 651 successful machine learning approach for brain tumor diagnosis. When compared with 652 other stereology software, the application developed here successfully automates the 653 quantification and classification of both tumor and healthy brain tissue, thus avoiding 654 time for manual counting. The four indexes developed here constitute an array able to 655 determine the presence of tumor and also the possibility to grade its malignancy in a 656 successful diagnosis process. 657

Conclusions and recommendations
As a novel approach, we discovered here that the IHC stained protein can have many 658 different proteomic states depending on the tissue structure and developmental stage 659 which in turn increases the efficiency in automated medical diagnosis. A suggestion for 660 further histological quantifications is to develop IHC and create a library of pixels in 661 accordance to automate the diagnosis processes. 662 This IHC technique has also proved to be necessary for the classification under a 663 machine learning approach. This is the first time proved that inter-individual variability 664 for the tumor development must be classified with a less accurate training set. This 665 variability should be taken into account henceforth when developing classification and 666 grading of highly "transformable" tissues, such as tumors. This is a basic approach for 667 achieving a correct diagnosis and prognosis, as well as for treatment selection with 668 automatic semi-supervised machine-learning tools. 669 Finally, after increasing the efficiency in the indexation with stereology, the realistic 670 inter-individual variability included in the training set allowed a successful detection and 671 grading of the tumor for all the pathological cases exposed here. 672 Acknowledgements 673 We gratefully acknowledge professor Antonella Zanna from the University of Bergen 674 and MOLIMAGLIO (SAF2014-52332-R) for supporting this study. This research did not 675 receive any specific grant from funding agencies in the public, commercial, or not-for-676 profit sectors. Author AC held a EU-ITN grant from the European Commission within 677 Horizon2020. 678 Disclosure 679