Histogram analysis for smartphone-based rapid hematocrit determination

: A novel and rapid analysis technique using histogram has been proposed for the colorimetric quantification of blood hematocrits. A smartphone-based “Histogram” app for the detection of hematocrits has been developed integrating the smartphone embedded camera with a microfluidic chip via a custom-made optical platform. The developed histogram analysis shows its effectiveness in the automatic detection of sample channel including auto-calibration and can analyze the single-channel as well as multi-channel images. Furthermore, the analyzing method is advantageous to the quantification of blood-hematocrit both in the equal and varying optical conditions. The rapid determination of blood hematocrits carries enormous information regarding physiological disorders, and the use of such reproducible, cost-effective, and standard techniques may effectively help with the diagnosis and prevention of a number of human diseases.


Introduction
The interference of a blood hematocrit is usually considered as a potentially important issue by many health-care professionals [1,2]. The normal hematocrit-level is considered as rather constant, and it is in the range of 40% to 54% for adult males and 37% to 47% for adult women [3][4][5]. The inconsistency of a hematocrit from its reference levels is generally regarded as the sign of a critical disease such as anemia, leukemia, a kidney infection, or a diet deficiency; or, it could be the indication of an unambiguous condition, such as pregnancy, or even extensive exercise [2,6,7]. A blood hematocrit in the range of 10% to 45% favors the screening of or the extension of a person's anemia; that is, a low hematocrit less than the normal range indicates an anemia or a diseased body. A critically low hematocrit level (<21%) may present a bias for an immediate blood-transfusion decision [8,9] to survive. Thus the rapid determination of a hematocrit is significantly important for the automatic detection of anemia, or sometimes for the making of a clinical decision that decides the extent to which a transfusion is needed for a diseased patient.
In microfluidic platforms for various point-of-care testings (POCTs), a number of opticaldetection techniques have already been demonstrated including absorbance [10,11], surfaceplasmon resonance [12,13], high-resolution near-field and far-field fluorescence, and chemiluminescence methods [14][15][16]. While these methods include the advantage of a minimal sample preparation for the provision of a real-time detection, they are excessively expensive and highly trained technical personnel with the necessary laboratory setup are required [17,18].
The development of smartphone-based colorimetric detection and analysis has potentially addressed these limitations, as the smartphone-based method provides an ease of operation, portability, and an excellent processing capability [19][20][21], and it is suitable for integrating with a microfluidic chip [22][23][24][25]. Additionally, the inherent optics of a smartphone that are due to its high-resolution camera have made the device a reliable platform for different POCTs, since the smartphone camera can be interfaced with colorimetric assays for the detection of color changes at very small scales. But the limitations of the smartphone camera mean that it requires recalibration if the imaging environment is disturbed, whereby similar and even imaging conditions [25,26] are required. For a colorimetric analysis of smartphone camera-captured images, usually the in-house MATLAB, ImageJ (NIH) are very often reported [27-30], which is an obstacle for the lab-on-a-chip (LOC)-based POCT in resourcelimited and remote environments. Because these computer-based applications require postcalculations for the determination of colorimetric outcomes, and difficulties sometimes arise with respect to emergency issues.
Histograms have been extensively used for the statistical analysis, and in the recognition and characterization of images, videos [31,32]. In this study, the application of histograms to quantify the concentration of the liquid biomarkers such as blood hematocrits and thus, an Android "Histogram" app for a colorimetric analysis of blood hematocrits for which a developed microfluidic LOC has been used are presented. The LOC platform includes a disposable microfluidic device, and a smartphone for real-time imaging and hematocrit analyzing "Histogram" app. In our previous work [33], we demonstrated a 'hardware' platform including optical diffuser and reflector inside a white acrylic imaging box to overcome the external light interruption by the smart-phone camera flash. On the other hand, to advance the smartphone-based colorimetric analysis of hematocrit, we have reported a 'software'-based histogram algorithm along with multi-channel and control channel analysis of blood hematocrit in this manuscript. Based on the algorithm, the developed app provides the gray intensity histogram counting the pixels of the camera-captured image of blood hematocrit that is contained in the microfluidic channel. In analysis, the app shows two prominent advantages including the automatic detection of microfluidic sample channel and the colorimetric quantification of blood hematocrits both in the equal and varying optical conditions with auto-calibration. Thus the demonstration of novel histogram analysis using the inexpensive and compact smartphone-based LOC platform can be an ideal colorimetric detection technique for cost-effective, rapid POC diagnostics and applications.

Lab-on-a-chip (LOC) device
For this study, a disposable microfluidic LOC device was fabricated for the analysis of hematocrit of the human blood. The developed LOC platform can be utilized for the analysis of an equal and even minute volume of a hematocrit sample. Figure 1 shows a conceptual view of the microfluidic LOC device with a smartphone on the top for the imaging. As outlined in the figure, the microchannel of the LOC device consists of an opening at both sides. When blood hematocrit is pipetted into an opening of the LOC device, microfluidic pressure of the blood itself loads the blood solution into the channel. Since the image processing of a sample is largely affected by an inconsistent imaging environment, the provision of a uniform light is necessary; therefore, the LOC platform is equipped with a PDMS light diffuser that is fixed inside a white acrylic imaging box, as previously described [33]. The fixation of the light diffuser inside the white box can provide a unified imaging condition that eliminates ambient lighting effect. When the image of the hematocrit-contained microchannel is captured inside the white box under the smartphone flashlight, the light transmitted through the diffuser is evenly distributed onto the hematocrit sample, providing similarly intense imaging environments for the attainment of accurate onsite measurements.

Color image to gray intensity histogram conversion
A color image consisting of red, green and blue (RGB) channels contains both the color and intensity information. If the color information is eliminated, the color image turns into grayscale as the composition of black and white shades without apparent color. The value of each pixel in grayscale carries only intensity information, representing black at the weakest gray intensity and white at the strongest gray intensity. The gray intensity increases and decreases with the brightness and darkness of a gray image respectively.
A histogram graphically represents the distribution of numerical data. In the context of image processing, these data correspond to the number of pixels in terms of the various intensities found in an image. Plotting of the number of pixels of a gray image with respect to their intensity gives a gray image histogram. The histogram plot is executed by a number of processes, including (i) the conversion of color image into grayscale, (ii) counting the number of pixels with same gray intensity, in which each gray intensity level may have different number of pixels, and then (iii) plotting the number of pixels according to the gray intensities that results in a gray intensity histogram of the image. The concept of gray intensity histogram can be applied to the analysis of blood hematocrit, since each hematocrit has its own gray intensity that varies with the concentration of RBC in blood. The higher is hematocrit level due to higher concentration of RBC; the darker is the hematocrit image resulting in lower gray intensity. Thus, the concentration of the blood hematocrit can effectively be quantified by gray intensity value of hematocrit image using histogram.

Image processing of smartphone app for histogram analysis
In terms of the use of the Android-smartphone Histogram app, the gray intensity of the blood hematocrit was the preeminent issue. The app has been developed for a colorimetric analysis of blood-hematocrit to provide gray intensity histogram. For the proper guidance of the users, the successive working steps of the app for the image analysis are demonstrated in Fig. 2.

Fabrication of LOC
The developed LOC platform as outlined in Fig. 1 includes a smartphone installed with an image-processing Histogram app, a PDMS light diffuser, a hematocrit-containing microfluidic chip, and a white acrylic-imaging box. The microfluidic chip with the dimensions of 24 mm x 20 mm x 100 µm was fabricated on double-sided polymeric tape purchased from TMS Co., Ltd, Korea and the chip contains four microchannels of a 1 mm width and a 10 mm length. The microchannels of the chip were patterned on the double-sided tape with a thickness of 100 µm using a laser-cutter (C30, Coryart Inc., Kr), and they are bonded onto a plain PMMA acrylic substrate of a 1 mm thickness for the preparation of the microfluidic chip.

Sample preparation
The sample-preparation method is largely influential regarding the success of a hematological experiment. To perform the present work, blood samples were collected according to the local ethical and legal regulations. Venous whole blood (5 ml) was collected from a healthy adult donor on the day of the experiment, and it was immediately procured in a K3-EDTA (ethylenediaminetetraacetic acid) tube to prevent red-blood-cell (RBC) clogging. Afterward, the procured blood was centrifuged at 1500 rpm for 10 min, and the serum was pipetted into a polypropylene tube. The 10% to 60% hematocrit samples with a 5% incrimination interval were subsequently prepared by mixing the required volume of separated blood cells with the serum. Then, 10 μl of each of the hematocrit samples were pipetted and loaded into the microchannels of the LOC chip.

Image acquisition for histogram analysis
For the imaging, the hematocrit-contained LOC chip was inserted into the rectangular white acrylic imaging box and the images of the microchannels of the different hematocrit levels in the chip were captured by a smartphone (Galaxy S II, Samsung, Kr) camera through the opening on the top of the imaging box, as already reported [33]. The captured images were analyzed using the developed "Histogram" app according to the working steps as outlined in Fig. 2.

Pixel count for same gray intensity of blood hematocrit image
In the analysis of hematocrit image, the app converts the color image into grayscale. The conversion procedures of a number of pixels for various levels of hematocrit image into the corresponding gray intensity have been visualized in Fig. 3. In the figure, x-axis represents the pixel intensity of the converted gray image including a 5 intensity incrimination interval for the corresponding hematocrit levels in the y-axis. For a 45% of hematocrit, the blackest pixels for 45% of hematocrit was found at pixel intensity of 110, which means that the maximum number of pixels correspond to the same gray intensity of 110 for 45% of hematocrit. Consequently, there are a few numbers of pixels for 45% hematocrit, which exist in the range of the remaining pixel intensities. Thus, the converted pixels for 45% hematocrit result in the gray intensity of 110. Similarly, the highest number of pixels for 30%, 20% and 10% hematocrit levels were resultant at the 120, 135, and 150 pixel intensity, respectively that correspond to the respective gray intensity of the 30%, 20% and 10% of blood hematocrit. In this way, the lower is the hematocrit level; the higher is the gray intensity of pixels. In order to measure the hematocrit level from the image of the blood-containing microchannel, the gray picture is thus constructed with the pixels, which have various values of the gray intensity and the maximum number of pixels with the same gray intensity can be calculated to represent as the histogram peak. Fig. 3. Visualization of the pixels in gray images, which have the same gray intensity. The gray image inside the red rectangular box corresponds to the highest pixel numbers, i.e. histogram peak for the different hematocrit levels.

Single-channel image analysis under similar optical condition
In colorimetric image processing, a histogram basically represents the distribution of colors with respect to the number of pixels at each of the intensities of an image. Since, a gray image, which only contains scalar values as its intensity, is constructed with pixels, and the number of pixels with the same gray intensity is represented as a histogram. In the resultant histogram, the highest peak corresponds to maximum intensity of the image as described in Fig. 3. To measure the hematocrit levels from the camera-captured image of the microchannels, the developed app analyzes the maximum number of pixels with same intensity of the image following the working steps explained in Fig. 2 based on the conversion mechanism as described in Fig. 3, and the corresponding gray intensity of the image is provided as a histogram, as shown in Fig. 4(a). Figure 4(a) shows the Android-app-generated histogram screenshots for the bloodhematocrit levels of 10%, 20%, 30%, 45%, where a decreasing gray intensity histogram is found for the increasing hematocrit concentration in accordance with the histogram-analysis principle that is demonstrated in Fig. 3. And Fig. 4(b) represents the corresponding gray intensity profile with respect to the various hematocrit concentrations. The corresponding gray intensities that were extracted from the histogram-peak intensity show that the gray intensity is higher for the lower hematocrit levels, which decrease as the hematocrit level increases with corresponding repeatability of 0.17 and coefficient of variation (CV) of 0.36% for the developed LOC platform.

Multi-channel image analysis under similar optical condition
The blood-hematocrit gray intensities that are presented in Fig. 4(a) are based on the singlechannel image that is selectively cropped from the multi-channels according to the developedapp analysis. Simultaneously, an algorithm of the app for the analysis of multi-channel images, as shown in Fig. 5(a), was developed. Since the gray intensity from the multi-channel image is obtained for the blood hematocrits, including the white background that exists between the channels of the chip, this algorithm is helpful for the successful determination of only the respective gray intensities of the different blood-hematocrit concentrations that are contained in the multi-channel, thereby eliminating the background. The algorithm differentiates the number of the pixels of the gray intensity for camera-captured images. In this case, the developed-app-generated histogram image that is shown for four different hematocrit concentrations in Fig. 5(a) has been considered. The calculation of the change of the number of pixels with respect to the change of the corresponding gray intensity has been executed following the equation- where y i represents the pixel number for the corresponding gray intensity value of x i . The plotting of y xi with xi provides the respective gray intensity of the blood hematocrit shown in Fig. 5(a) at the coordinates on the x-axis that are notated by 45%, 30%, 20%, and 10%, as shown in Fig. 5(b), and this is because 0 = dy dx at the peak of each histogram, which corresponds to the 0-point on the x-axis for the differentiated pixels of the hematocrits of various levels.  5. (a). Screenshots of the app-generated histograms for the multi-channel image of the 10%, 20%, 30%, and 45% hematocrits (intra-microchannel hematocrit levels are on the left side) and, (b~c). algorithm-derived gray intensities of corresponding hematocrits. Figure 5(c) shows the gray intensities of 45%, 30%, 20%, and 10% blood-hematocrit levels, where the gray intensity decreases with the increasing of the hematocrit concentration; therefore, the decreasing gray intensity with the increasing hematocrit level is well agreed with the previous gray intensity for various hematocrit levels that is shown in the singlechannel-based histogram analysis of Fig. 4(b). The gray intensity analysis with multi-channel approach shows the device repeatability of 0.34 and CV of 0.48%. Even though the multichannel analysis provides worse repeatability and CV than the single-channel technique, the histogram peaks are well-separated and sufficiently linear for different concentrations of blood hematocrit. Since the differential pixel count provides a continuous wave with respect to gray intensity, the gray intensities for various hematocrit levels shown in Fig. 5(c) were approximated from the coordinating points of the continuous wave on x-axis that is shown in Fig. 5(b).

Control-channel based image analysis under differing optical conditions
The overcoming of the optical-condition discrepancy that provides a uniform photographing environment is always a major user concern for any colorimetric analysis [34]. Although a unique optical platform that is made of PMMA based white-acrylic photographic box has been used to fix the camera position as described [33], and a focal length with the LOC has been adopted for the imaging process, in real-time imaging a number of variations of photographic-situation will exist, and these may fluctuate the brightness of the captured images of the sample channel. A further measurement approach for differing optical conditions has therefore been carried out using the control channels of an equal hematocrit concentration, along with an under investigation hematocrit level. The object of this experiment was to observe the success of the histogram app to analyze the blood hematocrit in more versatile conditions. Finally, a detailed gray intensity measurement for the 10% to 60% hematocrits range was performed under an optimized optical condition using the smartphone-based histogram app.
In the experiment of differing optical conditions during the imaging process, a threechannel LOC device, as outlined in the top view of Fig. 6 with a sample-loading channel between the two control channels, was used. Using this approach, the images of the threechannel LOC device with the 10% hematocrit in the sample channel and the 30% hematocrit in the control channel were captured under three different optical illuminations (luminance of 200, 215 and 220 cd/m 2 ); consequently, the histogram-based gray intensities of the sample channel and the control channel have been measured using the developed app. The summarized data for the gray intensity variations with three different optical conditions is presented in Table 1 and the corresponding app-generated screenshots are beneath the corresponding channel images in Fig. 6. Fig. 6. Screenshots of the app-generated histograms for each of the three-channel LOC devices (on top) containing 10% and 30% hematocrits in the sample and control channels, respectively. The histogram beneath corresponds to the above channel image, and the channel images above in Fig. 6(a), (b), and (c) were captured with an increasing optical luminance of 200, 215 and 220 cd/m 2 respectively.
In principle, the histogram-peak intensity should be the same for specific hematocrit levels. Since the shifting of both the control-and sample-signal peaks is closely related to the fluctuation of the image intensity, it is expected that the difference of the peak intensity for the control and sample channels will be the same for the images for which the image intensity is equally shifted. Using the control channel of the 30% hematocrit, the developed app gives two histogram peaks for each of the measurements. Table 1 shows the peak-intensity values for the control channel of 30% hematocrit and, the sample channel of the 10% hematocrit, and the difference of the peak-intensity that is due to the shifting of their peaks under differing optical conditions. The reproducibility of the developed histogram app for the grayintensity measurement was evidenced by the same peak-intensity difference that is shown in Table 1 for the captured images under different optical illuminations. Thus the same peak intensity difference using control channel shows the necessary robustness of the developed technique to be applied for hematocrit analysis even under differing optical conditions.

Detailed analysis of blood hematocrit
Further, the gray intensities for the hematocrit levels of 10% to 60% with 5% incrimination interval have been determined under the optimized optical condition, and the summarized data is presented in Fig. 7(a). In Fig. 7(a), the gray intensities that correspond to the histogram peak-intensity with respect to various hematocrit levels that range from 10% to 60% decreased with the increasing of the hematocrit levels, which successfully agrees with the previously described single-channel and multi-channel approaches shown in Fig. 4(b) and Fig. 5(c), respectively. In order to validate the reliability of the proposed analysis technique, same images for hematocrits ranging from 10% to 60% were also analyzed with ImageJ, one of the popular and widely used computer-based open-source image-processing programs. Gray intensities from the ImageJ program similarly decrease with the increasing hematocrit levels as shown in Fig. 7(b), nevertheless, the linear-correlation coefficient of Histogram method is worse than that of the Image-J. Thus, the use of histogram analysis can be applied for the detection of blood hematocrit levels in POC diagnosis.
Microhematocrit and macrohematocrit are the standard methods for blood-hematocrit determination [35,36]. These manual hematocrit determinations for which the packed cell volume (PCV) of RBC are used requires uniform cell packing, for which centrifuges, the standard capillary or wintrobe tubes and selective reading devices [37] are also used. A colorimetric analysis for an on-site hematocrit determination for which a smartphone is used has several advantages over the standard methods including cost-effective disposable LOC devices, data archiving, and a transfer capability during the imaging. But in the stand-alone smartphone-based platform for the colorimetric analysis, the optical arrangement is a critical issue to ensure the accuracy, repeatability, and reliability of measurements overwhelming the ambient lighting conditions [38]. By utilizing a whole measurement setup that costs approximately US$300, whereby the smartphone is the most expensive constituent, this work conveniently meets the necessary criteria. The developed app includes built-in database functions for the recording of the processed histogram image along with the corresponding histogram value and the execution period of the experiment. To improve the accuracy of the smartphone based analysis, the machine learning technique could be included as a future work. Because the reported machine learning algorithm can process the analysis with different color spaces intelligently calibrating the disturbance of external light noise and imaging conditions [39]. In addition, machine learning algorithm enables the rapid analysis of smartphone based colorimetric data without human intervention.

Conclusion
In this work, a smartphone-based app for the rapid colorimetric quantification of blood hematocrits is proposed. The app successfully detects and analyzes blood hematocrits in the range of 10% to 60%. For the detection mechanism, single-channel and, multi-channel images of hematocrits that were captured under an equal optical illumination, and also multichannel images of hematocrits that were captured under varying optical environments, were used. The lowest detection range of the hematocrits for the analysis is 10%, which is the critical range for the diagnosis of hematological diseases such as severe anemia and for the finalization of blood transfusion decisions. The app shows impressive features including compactness, portability, and an ease of operation. Since the platform presents a rapid analysis of hematocrit levels, whereby a disposable microfluidic chip and a smartphone app with a minimal user error are used, the entire platform could be widely extended to other biomarkers for POC applications.