Image-based stroke rat brain atrophy volume and infarct volume computation

Stroke is one of the leading causes of death as well as results in a massive economic burden for society. Stroke is a cerebrovascular disease mainly divided into two types: ischemic stroke and hemorrhagic stroke, which, respectively, refer to the partial blockage and bleeding inside brain blood vessels. Both stroke types lead to nutrient and oxygen deprivation in the brain, which ultimately cause brain damage or death. This study focuses on ischemic stroke in rats with middle cerebral artery occlusion (MCAO) as experimental subjects, and the volumes of infarct and atrophy are calculated based on the brain slice images of rat brains stained with 2,3,5-triphenyl tetrazolium chloride. In this study, a stroke rat brain infarct and atrophy volumes computation system (SRBIAVC system) is developed to segment the infarcts and atrophies from the rat brain slice images. Based on the segmentation results, the infarct and atrophy volumes of a rat brain can be computed. In this study, 168 images of brain slices cut from 28 rat brains with MCAO are used as the test samples. The experimental results show that the segmentation results obtained by the SRBIAVC system are close to those obtained by experts.


Introduction
Stroke is now the leading cause of acquired adult disability worldwide [29]. Stroke is caused mainly by the internal cerebrovascular obstruction or hemorrhagic that causes the brain lack of nutrient and oxygen, leading to brain injury or Chun-Fu Hong and Meng-Hsiun Tsai have equal contribution to this article. The two authors are listed based on their surname. death eventually. Stroke is classified majorly into two types: ischemic stroke and hemorrhagic stroke, in which ischemic stroke accounts for 70-80% of all stroke incidences. According to the statistics of World Health Organization (WHO), there were about 15.2 million people died of stroke and ischemic heart disease in 2016 and these diseases are still the leading causes of death over the last decade [42]. In 2013, global prevalence of stroke was 25.7 million, in which 10.3 million people suffered first attack [10]. In the USA, stroke ranked as No. 5 among all causes of death in 2014 and is also a leading cause of long-term disability and cognitive impairment; according to the estimates in 1999, there were about 795,000 American experienced a new or recurrent stroke, in which 610,000 people were first attacks and others were recurrent incidences [4]; according to the data during 2011-2014, the overall stroke prevalence was estimated 7.2 million American over 20 years of age, accounting for 2.7% of the population [4]; from 2012 to 2013, the estimated overall cost of stroke was US$33.9 billion [4,26]; it is projected that, by 2030, 3.88% of the US population over 18 years of age will have had a stroke, and the real total direct annual stroke-related medical costs, in 2010, are estimated to increase from $71.55 billion to $184.13 billion between 2012 and 2030 [31]. Age is one of the essential risk factors for stroke. The probability of suffering a stroke attack is nearly doubled every 10 years over age 55 [41]. Due to the increasing growth of aging population worldwide, it has been a critical challenge to reduce the cost of stroke diagnosis and treatment. Therefore, many investigators are highly interested in the research of stroke fields.
In general, the brain has a high demand for oxygen and glucose, i.e., even though the brain tissue represents only about 2% of the whole body weight, it requires 20% of the body's total oxygen consumption, and adult cerebral blood flow takes up 15% of the cardiac output [6,27]. The delivery of oxygen and glucose to the brain via cerebral blood flow is essential for normal brain functions. Clinically, the most common type of stroke belongs to ischemic infarcts. Among the several major vessels in the brain, infarction frequently occurs in the greatest branch of internal carotid artery called middle cerebral artery. The sudden loss of cerebral blood supply, even a few minutes, initiates a series of cellular and molecular cascades that lead to irreversible ischemic brain damage, eventually leading to stroke [39].
Although some therapies and drugs have been developed to inhibit or treat ischemic stroke [7,32], there is no effective strategy or medication treatment yet to completely prevent or cure the disease. Intravenous thrombolysis using recombinant tissue plasminogen activator (rtPA), for example, is now the only approved medical treatment for acute ischemic stroke. However, the administration of rtPA is limited up to 4.5 h after stroke and its applicable rate is only up to 5% of all patients [11]. Even though for stroke patients, the sooner tPA is given to, the greater the benefit they have, and only approximately one quarter of patients receive timely door-to-needle time ≤ 60 min [12]. Therefore, there is an urgent need for developing new medical treatments for acute ischemic stroke. However, successful translation of preclinical stroke research is rare, which may be attributed partially to the complexity of stroke pathobiology or to the inadequate choice of animal model. Even though the limited application of animal experiments in stroke study, several animal models have been applied in stroke research, providing a better understanding of stroke pathophysiologic mechanisms.
Rodent models have long been employed as one of the important methods for understanding ischemic stroke mechanism [3,18,25]. For example, middle cerebral artery occlusion (MCAO), one of the animal models that can closely simulate human ischemic stroke and account for > 40% ischemic stroke animal experiments, is applied in this study to compensate for the flaw of animal model determination. Staining ischemic brain slice with 2,3,5-triphenyl tetrazolium chloride (TTC) has been considered as a common and reliable method for visualizing the infarct region of an animal brain to reveal the severity of stroke level [3,18]. Commonly, images of TTC-staining brain slice of MCAO-treated ischemic rats are examined by well-trained experts who are familiar with discriminating TTC-staining images, and the infarcted regions are then determined and analyzed. These rodent stroke animal models can not only provide valuable information of pathophysiology of ischemic brain injury, but also aid in the development of novel neuroprotectvie or antioxidant agent against stroke. For example, Xu et al. [43] used MCAO mice model to examine the therapeutic potential of Humanin (HNG) in stroke mice. Brain slices of HNG pretreated and posttreated stroke mice were stained with TTC, and the infarct region of these images were then determined. Their results showed that HNG protects against cerebral ischemia/reperfusion injury in mice. Thus, these animal models can help develop stroke translational research from bench to bedside.
The examination of images of TTC-stain rat brain slice is time-consuming and labor intensive, and sometimes subjective bias may exist due to manual investigation. Therefore, in this study a stroke rat brain infarct and atrophy volumes computation (SRBI-AVC) system is provided to segment the infarcts and atrophies in rat brain slice images. Then, the brain infarct and atrophy volumes of the rat can be computed via the segmentation results. Methods including background removal, gamma correction, brain cerebral central line detection, and genetic algorithm will be applied to segment the brain infarct and atrophy regions in the rat brain slice images and to precisely estimate the infarct and atrophy volumes. In segmenting rat brain infarction, not only gamma correction but also local gamma correction are proposed to stretch the contrast of an image. This system can provide a potential tool for the development of stroke medication.
The remainder of this paper is organized as follows. The next section will introduce related works for literature reviews and the ischemic rat stroke images which will be used as the testing data in this paper. Section 3 describes the SRBIAVC System in details. In Sect. 4, two machine learning methods are provided to decide the fittest values for the parameters used in the SRBIAVC System. The experimental results are illustrated in Sect. 5. The conclusions are given in the last section.

Literature reviews
In addition to the selection of animal model, how to appropriately interpret the animal experimental results is another important issue. Some studies, for example, employed well-trained animal physiologist to determine the area of rat ischemic stroke, and some employed public image procession program such as ImageJ to determine its severity [5,13,14,34]. In the preclinical animal studies of stroke drug development, there are massive demands for stroke image analysis. However, few attempts have been made to develop automatic calculation algorithms to deal with this problem [13,23,24]. Therefore, it is critical to develop methods that can assess the effects of drugs or treatments on stroke animal models.
In general, the size of infarct region is often examined to determine the severity of brain damage after stroke. Hence, it is reasonable to assess the effects of a regimen by comparing differences in brain infarct regions between stroke patients with or without the treatment. Furthermore, the estimation of differences in the daily progression of infarct regions can aid doctors to diagnose patients' stroke conditions. Therefore, the correct estimation of infarct volume is a very important issue on stroke therapy. Traditionally, infarct volume is estimated manually by conducting calculations on images of brain slices. However, these time-consuming tasks do not yield precise approximations of infarct volume as the estimation of infarct area is often hindered by factors such as background, lighting, and corpus callosum. Currently, many methods have been applied to detect the infarct region and various studies have constructed many algorithms aiming to correctly compute the infarct volume [22-24, 28, 35]. This study is to develop an automatic identification system to distinguish infarcts and calculate their volume by utilizing experimental stroke rat brain images.
Recently, there are many researches focused on medical image segmentation and recognition, in which artificial intelligence has the potential to help civilization flourish-as long as we manage to keep the technology beneficial to image analysis [15,16]. Peng et al. [33] proposed an ELBP (extend local binary pattern), a rotation invariant texture; however, ELBP cannot describe the local structural information but gradient orientation difference can. ELBP was hence combined with the feature of gradient orientation difference to describe the local brightness and structure of a chest CT image. Then, SVM was used to recognize lung disease. In 2011, Somasundaram and Kalaiselvi [38] used an adaptive intensity thresholding method to convert a magnetic resonance image of head and brain scan into a binary image, and the mathematical morphology and a 3D approach were applied to eliminate noise. After that, the binary images were processed into mask images, and fine brain slices were then obtained. Lee et al. [24] developed a program called InfarctSizer that can automatically detect the infarct region and compute the infarct volume of TTC-stained brain slice images from mice treated with MCAO. In their study, the infarct region was determined by collecting the pixels with values greater than the average RGB value of the total brain image, and the infarct volume proportional to the pixel intensity was calculated. Vanderbeck et al. [40] applied liver biopsy images to identify the non-alcoholic fatty liver disease. Each liver biopsy sample was stained with an H&E stain. An image was obtained by scanning the sample. Then, a gray-level image was created from the green channel of the image. The gray-level image was smoothed by the average filter, and the gamma correction method was employed to increase the contrast of the gray-level image. After that Otsu's method was used to convert the gray-level image into a binary image. K-means clustering algorithm and 4-neighborhood connectivity were employed to remove the background of the image. A supervised machine learning classifier was applied to categorize the white regions in liver biopsies.
From the literature mentioned above, obviously one can find that most of the medial image processing follows the steps to pre-select the masks in segmentation stage such as using gamma correction to heighten the contrast, and using Otsu's thresholding method and mathematical morphology or LBP (local binary pattern) to extract the ROI (region of interest) in the image.

Materials
Ischemic rat stroke images were obtained from Taichung Veteran General Hospital. In this study, rats with ischemic stroke were introduced by performing MCAO and were used as experimental subjects [2]. All animal experimental procedures were approved by the Institutional Animal Care and Use Committee of Taichung Veteran General Hospital. For MCAO procedures, anesthesia was induced with 4% isoflurane (Baxter, U.S.A.) and maintained with 2% isoflurane. A midline cervical incision was made to isolate the right bilateral common carotid artery. A small incision was subsequently made in the proximal portion of the external carotid artery, and a 25-mm-long 3-0 nylon monofilament suture was gently inserted (approximately 18 mm) into the internal right carotid bifurcation. After 60 min MCAO, the nylon surgical thread was removed to allow complete reperfusion of the ischemic area. The infarction size would be determined by the severity of ischemic brain injury. In worst case, the infarct zone may cover half of the whole brain [37]. Twenty-eight adult male Wistar rats were used in this study. All of the rats were subjected to the MCAO procedure. On the day of operation, ten of the 28 rats were sacrificed for brain removal. Coronal sections of each brain were obtained by cutting them into six 2 mm-thick slices, which were labeled as "day-1." Following the same procedures, six rats were randomly selected for brain removal and sectioned on day-7, day-14, and day-28, and the obtained brain slices were labeled accordingly. In order to distinguish the infarct regions from normal regions in the rat brain, the slices were stained with 2% TTC (Sigma, Germany) for 30 min at 37 °C in the dark. After the stain developed, tissue blocks were placed into 10% phosphate-buffered formalin for 45 min. TTC does not stain brain regions with neuronal loss, and therefore, infarcted tissues remain white in these areas [37]. The six slices obtained from each brain were vertically arranged and recorded in Fig. 1, in which each column of brain images represents one rat. Figure 2 portrays the framework of the SRBIAVC System. Each rat brain is cut into six slices. A slice image is taken from one brain slice. RBS segmentation step is to extract the rat brain slice (RBS) from a slice image. Drawing cerebral central line step is to draw the cerebral central line to cut the RBS into cerebral hemisphere and ipsilateral hemisphere. Extracting corpus callosum step is to segment the corpus callosum from the cerebral hemisphere. Extracting infarct step is to segment the infarct from the ipsilateral hemisphere. The step of removing corpus callosum from infarct is to eliminate the corpus callosum from the segmented infarct. The step of computing infarct and atrophy volumes is to compute the volumes of the infarct and the atrophy based on the segmented infarct, cerebral hemisphere, and ipsilateral hemisphere.

RBS segmentation
An RGB image is composed of red, green, and blue independent color channels; an HSV image consists of hue, saturation, and bright color channels. In this study, an RGB (resp. HSV) color image is first separated into red, green, and blue (reps. hue, saturation, and bright) color components. The intensities of color channel C of all the pixels in the color image can compose a gray-level image I C for C = R, G, B, H, S, and V. Figure 3 reveals that I H is less affected by the texture of image background; thus in this study, I H is applied to remove image background. In order to more effectively distinguish the brain from the background, the gray levels of I H is stretched via the following formula: where I H (i, j) denotes the gray level of the pixel located at coordinates (i, j) in I H ; min H and max H are, respectively, the minimal and maximal gray levels of the pixels in I H . After stretching the contrast, I H in Fig. 3e is converted into the image in Fig. 4a.
In Fig. 4a, the gray levels of some pixels in brain slices are greater than and others are less than the gray levels of the pixels in background. The SRBIAVC system hence changes I In Fig. 4b, the gray level of the pixel in background region is mostly lower than that in slice region. Otsu thresholding operation [30] is a commonly used image binarization operation. In this study, Otsu thresholding operation is applied to . The pixels with gray levels larger then T H are regarded as white pixels (their gray levels are set to "1"); otherwise, they are considered to black pixels (their gray level are set to "0"). Otsu thresholding operation can convert I ′′ H into a binary image I b . Since there may be some minor white or black spots in I b , erosion operation [17,36] and then dilation operation [17,36] with a 5 × 5 structure element shown in Fig. 4c are used to eliminate the noise (minor white and black spots) and smooth the contour of RBS. Figure 4d is the I b obtained by running Otsu thresholding operation and noise removing on the image in Fig. 4b. Each white region in Fig. 4d describes a rat brain slice (RBS). We call the smallest rectangle containing the whole RBS the RBS rectangle of the brain slice. Figure 5 depicts the RBS rectangles obtained from some rat brain slice images.

Drawing cerebral central line
The aim of the SRBIAVC system is to segment the infarct from each RBS. The corpus callosum, such as the regions indicated by the blue outlines in Fig. 6, resembles the infarct in color and is often misidentified as the infarct during image segmentation. Since the corpus callosum is bilaterally symmetrical in a normal rat brain, the SRBIAVC system solves the problem by dividing the brain into two hemispheres based on its cerebral central line. The cerebral hemisphere with infarct is called the ipsilateral hemisphere, whereas the hemisphere with normal function is called the contralateral hemisphere. The SRBIAVC system will segment the brain infarct and corpus callosum from the ipsilateral hemisphere, and extracts the corpus callosum from the contralateral hemisphere. Then, the area of the infarct obtained in the ipsilateral hemisphere subtracting the area of the corpus callosum in the contralateral hemisphere is considered as the actual area of infarct. Let us call the RBS in the top half of the RBS rectangle the upper half RBS, and that in the lower half of the RBS rectangle the lower half RBS. As indicated by the blue arrows in Fig. 7, there is a groove at the center of the upper half RBS, and normally, drawing a vertical line from this point would align with the cerebral central line (see the yellow lines in Fig. 7a). Since the image may be taken with different shooting angles, the RBS in the brain slice image may be slanted so it may cause the shift and rotation variations of the cerebral central line (see the RBSs in Fig. 7b, c). To deal with this problem, the SRBIAVC system looks for the concave point in the upper half RBS and the convex point in the lower half RBS. The cerebral central

Convex point detecting
The SRBIAVC system cuts the RBS rectangle into upper-left (UL), lower-left (LL), upper-right (UR), and bottom-right (BR) four equal-sized regions (such as the yellow dotted lines in Fig. 8a). It finds the highest points ULTP and URTP (such as the blue points in Fig. 8a) of the RBSs in UL and UR regions, and then considers the lowest point on the RBS contour between ULTP and URTP to be the top central groove T g (such as the red points in Fig. 8a).

Concave point detecting
Next, the SRBIAVC system draws a vertical line L g which passes through T g and at D g crosses the RBS contour in the lower half RBS (see Fig. 8b). Let D l be the lowest point on the RBS contour at the left side of D g , and D r the lowest point on the RBS contour at the right side of D g in the lower half RBS. Also let D lh (x lh , y lh ) be the highest point along the RBS contour from D l to D g , and D rh (x rh , y rh ) be the highest point along the RBS contour from D r to D g . D c (x c , y c ) is considered to the concave point where D c (x c , y c ) is on the RBS contour in the lower half RBS and x c = x rh + x lh ∕2 . The SRBIAVC system draws a line L gc to connect T g and D c . L gc hence separates the RBS into the left half region and the right half region (see Fig. 8b). We call L gc the cerebral central line of the RBS. The green line in Fig. 8c is the cerebral central line of the RBS.
The obtained cerebral central line divides the RBS into two halves. The corpus callosum and the infarct are generally brighter than others in the RBS. Let D ag be the difference of the average gray levels in two halves of the RBS, and S rg be the average gray level in the RBS. If |D ag /D rg | is greater than a given threshold T as = 0.2, the SRBIAVC system considers that the rat brain is stocked. After that, the half of the RBS with a greater average gray level is regarded as the ipsilateral hemisphere, and the other is considered to the contralateral hemisphere.

Extracting infarct
The SRBIAVC system then intends to extract the infarct from each the ipsilateral hemisphere. In Fig. 9, a color ipsilateral hemisphere RB IH is converted into three gray-level ipsilateral hemispheres R IH , G IH , B IH , which, respectively, consist of the R, G, and B color components of all the pixels in RB IH . From Fig. 9, one can obviously observe that G IH provides a higher contrast between infarct and non-infarct in ipsilateral hemisphere. Hence, the SRBIAVC system will extract the infarct from G IH .
The SRBIAVC system employs gamma correction operation [1,44] to stretch the contrast of G IH , and generates a gray-level image G G : where Min IH and Max IH are the minimal and maximal gray levels in G IH , and γ IH is a given constant. Figure 10a shows the results obtained by running the gamma correction operation on G IH in Fig. 9c.
Next, Otsu thresholding operation [30] is applied to provide a threshold T O for G G to create a binary image G O . If G G [x, y] is greater than T O , then G O [x, y] = 1 (respecting a white pixel), which indicates that G G [x, y] is an infarct pixel; otherwise, G O [x, y] = 0 (respecting a black pixel), which indicates that G G [x, y] is a noninfarct pixel. Taking the images in Fig. 11a as examples, the pink areas should be the less severe infarct. Since the mild infarction may lead to brain necrosis in the future, the SRBIAVC system also considers the regions outlined by the green closed curves in Fig. 11b is the infarct regions. Therefore, in this study, is a given constant, and σ O is the standard deviation of the gray levels of all the pixels in G O . Figure 10b shows the result obtained by running the binarization operation on G G in Fig. 10a.  Figure 10c demonstrates the result obtained by running the mode filter on the image in Fig. 10b. The contour obtained from Fig. 10c is then applied in Fig. 9a and the result is shown in Fig. 10d.

Extracting corpus callosum
This subsection is to segment the corpus callosum from the contralateral hemisphere RB CH . Each pixel in a color image RB CH can be separated into red, green, and blue color components. The values of color component c of all the pixels in the RGB color contralateral hemisphere compose a gray-level image c CH for c = R, G, and B. Figure 12b-d show the R CH , G CH , and B CH of the contralateral hemisphere in Fig. 12a. As shown in Fig. 12, G CH has a better contrast. Therefore, the SRBIAVC system will extract the corpus callosum from G CH . Similarly, gamma correction is applied to enhance the contrast of G CH , and then, Otsu thresholding operation is employed to transform G CH into a binary image. Global gamma correction works well on the images containing objects with a uniform intensity on a contrasting background. However, it cannot give a good result for the image with a low contrast between the object and the background for a noisy image or for the image across which the background intensity varies significantly. Figure 13a illustrates the results provided by the global gamma correction operation. There is a low contrast for part of the corpus callosum in Fig. 13a. In this study, a local gamma correction is hence provided to highlight the contrast of the corpus callosum.
For each pixel G CH (x, y), the local gamma correction operation is given a m CH × m CH window W CH in G CH , where G CH (x, y) is the central pixel of W CH . Let Min CH , Max CH and Mean CH be the minimal gray level, the maximal gray level, and the mean of gray levels in G CH . Then, the local gamma correction operation converts G CH into G lG by the following formula: where γ CH is a given constant. Figure 11b shows the result obtained by the local gamma correction operation on G CH to create a gray-level image G lG .
There are some small bright regions which are not the corpus callosum in Fig. 11b. The SRBIAVC system hence uses gray-level opening operation [17,36] to remove the small bright spots where the structure element is a 5 × 5 small window in which all the gray levels are zero. Figure 13c displays the result obtained by running the gray-level opening operation on the image in Fig. 13b. After that, Otsu thresholding operation is used to compute the fittest threshold from the gray levels of all the pixels in the image and then to change the image into a binary image G b based on the threshold. Figure 13d is the binary image G b obtained by executing Otsu thresholding operation on the image in Fig. 13c. In addition, the small regions  Figure 13e is the G b after getting rid of the small regions from Fig. 13d.
There may be the arachnoid mater, long white strips near the boundary of the brain (see Fig. 13e). If the average minimal distance of each pixel in one region in G b to the contour of the brain is less than a threshold T d , then the region is eliminated. Figure 13f is the result after removing the long white strips closed to the contour of the brain in Fig. 13e. Figure 13g displays the result obtained by applying the contour in Fig. 13f to the image in Fig. 12a.

Removing corpus callosum from infarct
Since the color of corpus callosum is very close to the color of the infarct in a rat brain, the SRBIAVC system cannot effectively separate the corpus callosum from the infarct in the ipsilateral hemisphere; while the color of corpus callosum is quite different from others in the contralateral hemisphere, extracting the corpus callosum in contralateral hemisphere is much easier. Moreover, the corpus callosum is bilaterally symmetrical in the normal brain. The SRBIAVC system hence replaces the corpus callosum in ipsilateral hemisphere with the corpus callosum in contralateral hemisphere. Assume that the ipsilateral hemisphere is the right hemisphere of an RBS R B . If R B (x, y) is in the contralateral hemisphere and a corpus callosum pixel R B (x + d, y) is in the cerebral central line, the SRBIAVC system sets R B (x + 2d, y) to a corpus callosum pixel, too. Assume that the ipsilateral hemisphere is the left hemisphere of an RBS R B . If R B (x, y) is in the contralateral hemisphere and a corpus callosum pixel R B (x + d, y) is in the cerebral central line, the SRBIAVC system also sets R B (x-d, y) to a corpus callosum pixel. Figure 14a is the segmented infarcts (in the right half side) combined with the segmented corpus callosum (in the left half side). Figure 14b is the segmented infarct after removing the corpus callosum. Figure 14c is the segmentation result.

Computing infarct and atrophy volumes
The SRBIAVC system calculates the volumes of the stroke and atrophy of a rat brain based on the segmented RBS and infarcts on the six slices of a rat brain. Let A i1 , A i2 ,…, A i6 , respectively, be the areas of the segmented infarcts in the six slices. The infarct volume V i of the rat brain is defined as: where TH is the thickness of each slice, and in this study TH = 2 mm.
The left half and the right half of a normal rat brain are bilaterally symmetrical. It means that the volumes of the left half and the right half of a normal rat brain are very close. Since the volume of ipsilateral hemisphere may shrink, the proportion of the infarct volume to the volume of contralateral hemisphere is more helpful for a doctor. The proportion of the infarct volume to the volume of contralateral hemisphere can be defined as: Fig. 14 The steps of removing corpus callosum from infarct: a the segmented infarct (on the right half) combined with the segmented corpus callosum (on the left half), b the infarct after removing corpus callosum, c the segmented infarct where A p1 , A p2 , …, A p6 , respectively, are the areas of the segmented contralateral hemisphere in the six slices of the bat brain. Since the volume of ipsilateral hemisphere may shrink, it is very difficult to measure the original volume of the ipsilateral hemisphere. The SRBIAVC system hence determines the percentage P a of the atrophy volume in ipsilateral hemisphere by

Time complexity
Assume that S I is the size of the input image. The time complexity of each step in the SRBIAVC system is described as follows: Therefore, the SRBIAVC system spends time about 6 × S I to extract the brain infarct and atrophy and compute their areas.

Fittest parameters determining
In this study, two algorithms are provided to decide the fittest parameters used in the SRBIAVC system. In this section, we will describe them in details.

Genetic algorithm-based parameters determining
In this study, a genetic algorithm [19]-based parameters detector (GABPD) is provided to determine the fittest values of the parameters used in the SRBIAVC system; we call it the SRBIAVC system with GABPD. If there are n p parameters in a system, the GABPD gives each chromosome n p substrings s 1 , s 2 ,…, s n p which, respectively, consist of n 1 , n 2 , …, n n p binary bits and their corresponding decimal values are v 1 , v 2 , …, v n p . Each chromosome composes of n 1 + n 2 +··· + n n p binary bits and v i is employed to describe the value of the i-th parameter in the system. Hence, each chromosome will give n p values mapping to all the parameters in the system, and then, the system can provide a performance based on the test data collected in advance. The performance is considered to the fitness of the chromosome.
In the initial step, GABPD randomly generates N i chromosomes. We call the N i chromosomes the reserved chromosomes. To evolve the best solution, GABPD repeatedly and alternately executes three operations mutation, crossover, and selection, until the fitness of all the reserved chromosomes is similar or the number of iterations is equal to a given constant MAX_NO_RUN.
For the crossover operation, GABPD randomly assigns N c chromosome pairs from the reserved chromosomes. For each chromosome pair (Ch 1 , Ch 2 ), a binary string S M , consisting of n 1 + n 2 + ···,+ n n p binary bits, is offered. GABPD then randomly selects (n 1 + n 2 + ···,+ n n p )/2 binary bits in S M and sets all the selected bits to 1bits, and sets others in S M to 0-bits. After that, GABPD runs the following formula to create a new chromosome Ch: where ˄ is the logical AND operator, ˅ is the logical OR operator, and S M is the logical NOT operator.
For the mutation operation, for each of the N i reserved chromosomes, GABPD uses a random number generator to specify one bit b for each of its substrings, and replaces b with ¬b to generate a new chromosome, where ¬ signifies the logical NOT operator. Therefore, in this operation, N i new chromosomes are created.
For the selection operation, 0.9 × N i chromosomes with the best fitness are selected from the reserved chromosomes and the chromosomes generated by the crossover and mutation operations. The selection operation also randomly creates 0.1 × N i chromosomes. Moreover, the 0.9 × N i selected chromosomes and 0.1 × N i created chromosomes are used as the reserved chromosomes in next iteration. The GABPD repeatedly and alternately executes the operations crossover, mutation, and selection, until the fitness of all reserved chromosomes is very simliar, or the number of iterations is equal to a given constant MAX_NO_RUN.
GABPD trains the fittest parameters used in a system based on the accumulated historical data. When given a chromosome, the values of the parameters used in the system can be determined. The system then extracts the ROI (region of interest) via the values of the parameters. Let X be the segmentation result and Y the ground truth (the result drawn by the experts). Jaccard coefficient (JC) [20] can be used to measure the segmentation result: The average Jaccard coefficients obtained by the systems based on the parameters decided by the chromosome are considered to the fitness of the chromosome.
GABPD is helpful for a system with multiple parameters. In the SRBIAVC system, the parameters γ I , k O , m O are used in the extracting infarct step, and the parameters γ CH , T a , T d are employed in the extracting corpus callosum step. In this study, GABPD is hence applied to determine the fittest parameters used in the extracting infarct step and in the extracting corpus callosum step:

The fittest values of γ I , k O , m O
To determine the fittest the parameters used in the extracting infarct step, γ I , k O , and m O is mapped to s 1 , s 2 , s 3 , where n 1 = n 2 = 6, n 3 = 3, γ I = v 1 × 0.05, k O =v 2 × 0.05, and m O = 3+v 3 .

The fittest values of γ CH , T a , T d
To determine the fittest parameters used in the corpus callosum step, γ CH , T a , T d is related to s 1 , s 2 , s 3 , and n 1 = n 2 = 6, and n 3 = 3. γ CH = v 1 × 0.05, T a = v 2 × 0.05, and T d = 3+v 3 .

PSO-based parameters determining
In this study, a particle swarm optimization (PSO) algorithm [9]-based parameters detector (PSOBPD) is also provided to determine the fittest values of the parameters used in the SRBIAVC system; we call it the SRBIAVC system with PSO. Particle swarm optimization (PSO) searches the optimal solution by iteratively improving a set of candidate solutions with regard to a given quality measure. Each particle has its own position, and the i-th particle position in t-th iteration can be expressed as is the velocity of the i-th particle in the t-th iteration, where v id (t) is the velocity of the d-th dimension of the i-th particle in the t-th iteration; Pbest i is the obtained local best solution of the i-th particle obtained thus far, and Gbest is the global best solution obtained until now from all the particles in the population.
The new velocities and positions of the i-th particle in the t-th generation are evolved by the following equations: where c 0 is an inertial parameter affecting the movement propagation given by last velocity value, and two acceleration coefficients c 1 and c 2 , respectively, are the importance of personal best value and the importance of social best value; rand 1 and rand 2 are two random numbers between [0, 1]. Shi and Eberhart [21] indicated that choosing c 0 ϵ [0.8, 1.2] results in faster convergence, hence, in this study, we set c 0 = 1. Generally, c 1 and c 2 are set to 2. The PSOBPD can be implemented by the following Algorithm PSO(): In this study, each particle X i (t) is a candidate solution, and x id (t) describes the value of the i-th parameter in the SRBIAVC system. Hence, each particle X i (t) will give n p values representively mapping to all the parameters in the system, and then the system can provide a performance based on the test data collected in advance. The performance is considered to the fitness of the particle. In addition, Num p is set to 10.

Experiments and discussions
In this study, 168 ischemic stroke rat brain images with sizes between 185 × 134 and 360 × 261 pixels provided by Taichung Veteran General Hospital are used as the test images. Twenty-eight rats were subjected to the MCAO procedure approved by the Institutional Animal Care and Use Committee of Taichung Veteran General Hospital. On the day of operation, ten of the 28 rats were sacrificed for brain removal. Each brain was cut into six coronal sections, each of which was a 2 mm-thick slices and was labeled as "day-1." Following the same procedures, six rats were randomly selected for brain removal and sectioned on day 7 and the obtained brain slices were labeled as "day-7." Similarly, other six rats were randomly selected for brain removal and sectioned on day 14 and the obtained brain slices were labeled as "day-14." The brains of the remaining six rats were also removed and sectioned on day 28 and the obtained brain slices were labeled as "day-28." The first experiment intends to investigate the performance of removing the image backgrounds of the 168 ischemic stroke rat brain images. The experimental results show that the average dice similarity (DS) provided by the SRBIAVC system in removing the image background of the 168 ischemic stroke rat brain images is 98% which is much higher than the DS = 85.95% obtained by J. Lee's method [23]. Figure 15 displays the results obtained by J. Lee's method and the SRBIAVC system in removing the image background of some ischemic stroke rat brain images.
The SRBIAVC system automatically draws the cerebral central line but J. Lee's method requires the user to draw the cerebral central line by himself. Let line L gc be the cerebral central line drawn by the SRBIAVC system and line L ′ gc be the ground truth drawn by the expert. Assume that T g and D c are the convex point and the concave point on L gc and T ′ g , and D ′ c are the convex point and the concave point on L ′ gc . In this study, MAX(|T g −T ′ g |, |D c −D ′ c |) is defined as the difference between L gc and L ′ gc . The average of the difference between L gc and L ′ gc is only 5.48 pixels. Figure 16 illustrates some cerebral central lines drawn by the SRBI-AVC system and the expert.
However, the brain slices in Fig. 17 do not contain a recognizable groove. Figure 17a depicts the cerebral central lines drawn by the SRBIAVC system and Fig. 17b illustrates the cerebral central lines drawn by the expert. The SRBIAVC system cannot give good cerebral central lines for both brain slices.
In next experiment, GABPD is employed to train the fittest parameters γ I , k O , and m O used in the extracting infarct step based on the brain slice images of two rats which were randomly selected from the 28 adult male Wistar rats. Moreover, the brain slice images of other 26 adult male Wistar rats were used as the testing images. In this experiment, GABPD gives the fittest parameters γ I = 0.95, k O = 0.65, m O = 5.  Figure 18 demonstrates the segmented infarct regions in the ipsilateral hemisphere of the brain slice images of some day-1 and day-14 rats. However, the SRBIAVC system is sensitive to the mild infarct (pink area) in the extracting infarct, so that it cannot give a good result for extracting the infarcts in Fig. 19.
In experiment 4, similarly GABPD is employed to train the fittest parameters γ CH , T a , and T d used in the extracting corpus callosum step based on the same training data and testing data adopted in experiment 3. In this experiment, GABPD gives the fittest parameters γ CH = 1.95, T a = 0.05, T d = 21. Based on the fittest parameters γ CH = 1.95, T a = 0.05, T d = 21, and the testing images, the experimental result shows that the SRBIAVC system can obtain the average JC = 71.08% and the average DS = 77.48%. Figure 20 displays the segmented corpus callosums in the contralateral hemispheres of the brain slice images of some rats. However, the accuracy of this method is compromised when the color of the corpus callosum resembled that of its surroundings, as shown in Fig. 21. As demonstrated in the middle panel of Fig. 21, the white areas pointed by the yellow arrow are misidentified to be the corpus callosum.
Experiment 5 is to explore the performances of infarct segmentation after removing corpus callosum. The experimental result shows that the SRBIAVC system obtaining the average JC = 75.54% and the average DS = 82.22% is much better than J. Lee's method providing the average JC = 51.43% and the average DS = 64.14% in (1) ( 2) (a) (1) ( 2) (b) Fig. 17 The brain slices containing the difficult recognizable groove: a the cerebral central lines drawn by the SRBIAVC system, b the cerebral central lines drawn by the expert infarct segmentation after removing corpus callosum. Figure 22 depicts some infarct segmentation results after removing corpus callosum from the rat brain slice images. Experiment 6 is to compute the infarct volumes and the atrophy volumes. Wistar rats by the SRBIAVC system with PSO, the SRBIAVC system with GABPD, J. Lee's method, and the expert. Figure 23b demonstrates the results computing the infarct volumes of the rat brains according to their labels. The experimental results shows that the proportions of the infarct volumes to the contralateral hemisphere volumes computed by the SRBIAVC system with GABPD are quite closed to those computed by the expert. J. Lee's method does not describe how to compute the atrophy volume. Therefore, in this experiment, only the atrophy volumes computed by the SRBIAVC system and the expert are displayed. Figure 24a shows the results computing the atrophy volumes of 28 adult male Wistar rats by the SRBIAVC system and the expert. Figure 24b displays the results computing the atrophy volumes of the rat brains according to their labels.

Conclusions
To assess the effectiveness of stroke treatment and diagnosis, the SRBIAVC system is proposed to take the place of the manual method in computing the infarct volumes and the atrophy volumes of rat brains. First, the SRBIAVC system uses H color layer of an HSV color rat brain slice image, in which there is the most significant difference of the contrast between the RBS and image background, to extract the RBS in the image.
To eliminate the influence of the corpus callosum on infarct volume estimation, in this paper, a cerebral central line detection method is provided to automatically divide the brain into ipsilateral and contralateral hemispheres. Then, the corpus callosum volume in the contralateral hemisphere is subtracted from the infarct volume in the ipsilateral hemisphere. Since the contrast between the infarct region and the background is more apparent in the G color layer, this layer is used in infarct region segmentation. To make the infarct region segmentation easier, a local gamma correction method is proposed to enhance the contrast of an image. In image background removal, the SRBIAVC system obtaining the experimental result DS = 98% is much better than J. Lee's method obtaining the experimental result DS = 85.95%. In cerebral central line detection, J. Lee's method requires the user manually to draw the cerebral central line, while the SRBIAVC system draws the cerebral central line automatically. The experimental results showed that the average distance between the cerebral central lines drawn by the SRBIAVC system and by the experts is 4.479 pixels.
As mentioned previously, examining TTC-staining images of ischemic rat brain slice is time-consuming and labor intensive, and some subjective bias may appear. Even though some automated methods were invented to overcome the possible bias produced by manual examination, several flaws remain to be taken into account. For example, determining the cerebral central line or outlining the infarct region in ischemic brain images usually achieves manually. Comparing with J. Lee's study, our SRBIAVC system can determine the central line and outline the infarct region automatically. The SRBIAVC system also removes corpus callosum area when calculating ischemic infarct region to avoid interferencing the accuracy. The SRBIAVC system further employs two algorithms to determine the fittest parameter values in the extracting infarct step. Therefore, the proportion of infarct volume obtained by the SRBIAVC system is much closer to the results calculated by experts comparing with J. Lee's method. In addition, the atrophy volumes computed by the SRBI-AVC system are in close proximity to that calculated by the experts, while J. Lee's method does not offer atrophy volume calculations. In summary, the SRBIAVC system is recommended for assessing the effectiveness of stroke therapy, development of stroke medications, and diagnosis of stroke conditions. Even though our results show that all of these measures can improve the accuracy of infarct region detection effectively, there are still some limitations as well. First, although the SRBIAVC system can automatically draw the cerebral central line of the brain slice images, some images are not regularly shaped and the center groove cannot be easily recognized (Fig. 17). Second, such as in Fig. 19, the SRBIAVC system is sensitive to the mild infarct area in the extracting step, so if the brain slice images are not well-stained or not easily distinguished, it cannot give a good result for extracting the infarcts. Therefore, future studies can dedicate to develop new algorithms to overcome these shortcomings and provide more precisely evaluating programs for stroke animal models analysis.

Conflict of interest None.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/.