Abstract
Based on video data acquired with low-cost, portable microscopy equipment, we introduce a semi-automatic method to count visual gaps in the blood flow as a proxy for white blood cells (WBC) passing through nailfold capillaries. Following minimal user interaction and a pre-processing stage, our method consists in the spatio-temporal segmentation and analysis of capillary profiles. Besides the mere count information, it also estimates the speed associated with every WBC event. The accuracy of our algorithm is validated through the analysis of two capillaries acquired from one healthy subject. Results are compared with manual counts from four human raters and confronted with related physiological data reported in literature.
I. Introduction
White blood cells (WBCs) are one of our main defensive mechanisms against external threats. Thus, WBC counts are a relevant physiological parameter for the diagnosis, monitoring, and treatment of several conditions, including bacterial and viral infections (e.g., pneumonia or meningitis), bone marrow functionality associated with chemotherapy toxicity, and haematologic proliferative processes such as leukaemia. In current clinical practice, WBC counts imply visits to healthcare centers, blood draws, and lab work involving specialized devices, technicians, and reagents. In this context, the development of a non-invasive technique to achieve WBC counts would allow more frequent monitoring, reduced visits to clinics, and access to areas lacking proper lab facilities or reagent supplies.
Recent works have exploited the optical properties of WBCs [1] to observe them as gaps in retinal capillaries [2] or moving particles in oral mucosa capillaries [3]. However, these works did not develop methods to extract particle counts from such images, which were acquired with specialized, non-portable equipment (i.e., adaptive optics and confocal microscopy). On the other hand, portable and low-cost optical devices called capillaroscopes have been employed to observe the morphology of nailfold capillaries and diagnose reumathological diseases [4] but no detection of WBC events from such images was performed.
In this paper, we present an image-processing pipeline that aims at counting visual blood flow gaps as a proxy for WBCs in capillary images. The data are acquired with an unexpensive, portable, commercially available capillaroscope. Unlike previous methods [2], [3], [4], we are able to detect these events based on such low-quality images. The flowing speed of these particles was also deduced to estimate the total sampled blood volume. The resulting particle counts extracted from two capillaries in one subject fell within the expected range for leukocytes in healthy individuals.
II. Proposed Method
The aim of our algorithm is detecting the number of WBCs passing through a given capillary, their speed, and the total counts—number of WBC events per μL—based on video images acquired from a given subject. Our method consists in four main steps, i.e., (1) normalization and registration of the video image stack, (2) capillary segmentation and profile extraction, (3) spatio-temporal analysis of the extracted profiles, and (4) detection and characterization of the associated WBC events. The contribution of our approach is the ability to identify WBC events from relatively low-resolution, low-frame-rate, and noisy video nailfold-capillary data.
A. Input Data
The data that we consider consist in a 24-bit-RGB nailfold capillaroscopy video (VGaps) acquired from a healthy subject; approval to carry out experiments involving human subjects was obtained from the MIT Committee on the Use of Humans as Experimental Subjects (Protocol #1501006860). In full generality, an input video is associated with a frame rate of r frames per second and a camera pixel size of Sp μm. It corresponds to an image stack I of size Nh × Nv × Nf, where Nh and Nv are the horizontal and vertical frame sizes, and where Nf is the number of frames. Each value I[k, l] is an RGB vector (R[k, l], G[k, l], B[k, l]). The indices k = (k1, k2) ∈ ℤ2 and l ∈ ℕ* refer to the discrete 2D location inside the field of view and to the frame index, respectively. The first frame of VGaps is shown in Fig. 1 for illustration. In this image, the darker U-shaped capillary profiles are readily identifiable despite the presence of white saturated areas associated with non-ideal acquisition conditions.
Fig. 1.
First frame of the VGaps sequence used in our experiments. Left: Raw version. Right: Pre-processed version. The capillaries #1 (top) and #2 (bottom) are shown in a magnified region of interest. The user-defined and interpolated points are highlighted as red crosses and blue dots, respectively.
B. Preprocessing
The stack I is first converted into a single-channel version In that can be suitably exploited for further profile segmentation and analysis. Specifically, the scalar-valued stack In[k, l] is obtained by first averaging the RGB channels of I pointwise and then normalizing the resulting intensities. The normalization is performed such that the mean and standard deviation of the intensity values of In over every given frame l correspond to 0 and 1, respectively. The frames constituting In must subsequently be registered to compensate for camera movements. Frame registration corresponds to distinct corrective shifts applied to every frame l > 1 of In. First, a pointwise operation is performed to obtain a temporary stack I′[k, l] = R[k, l] − G[k, l], ∀k, l that emphasizes capillary-like structures while discarding surrounding artefacts. Then, a binary-thresholded version of I′, , is obtained using a threshold value τc that is specified for every separate frame of the sequence. Finally, our algorithm computes a 2D registered stack, Ir, such that the applied corrective shifts maximize the correlation between and , l > 1.
C. Capillary Profile Segmentation
The segmentation and profile extraction of each capillary is semi-automatic and involves minimal user-defined 2D coordinates, Pint[k], Pext[k], with k = 1 … Np, that follow the internal and external capillary boundaries as defined on the first frame of the stack I. Our experiments below use curves that follow capillary loops, such loops being particularly easy to identify by the user.
First of all, a denser set of points is generated using cubic-spline interpolation [5] of the original points with a resampling factor α. The point-resampling operation involves separate 1D resampling of the corresponding horizontal and vertical coordinate sequences [6], the total amount of resampled points being α(Np − 1) + 1 in each case. Given these two resampled curves, a series of Nc intermediate curves , with m = 1 … Nc, are generated by linear combinations of the form with t = (m − 1)/(Nc − 1). In addition, the middle curve is defined as .
The curvilinear distance is then defined as the Euclidian norm between each point in with respect to the starting point . For simplicity, all same samples k for all curves are assigned the same curvilinear distance as . As an illustration, the first frame of the stack Ir of VGaps is displayed in Fig. 1. Both capillaries #1 and #2 are also highlighted in the processed image along with the corresponding user-defined and interpolated points that follow the internal and external curves of each profile. The middle curve from which the curvilinear distances are computed is also shown.
Then, the intensities of the capillary profiles as a function of the curvilinear distance are extracted. Specifically, each on Ir is associated with an intensity value. We use bilinear interpolation to compute the resulting intensities f[k, m, l] with subpixel precision at given curvilinear index k, curve m, and frame l. Given f[k, m, l], we compute the average of the capillary intensities of all curves f′[k, l] for every frame and curvilinear distance. The profile f′[k, l] is finally resampled, using linear interpolation, to a profile g[k, l] containing the same number of samples as f′[k, l] but with equidistant curvilinear spacings, a condition not fulfilled by f′[k, l] in general.
D. Spatio-Temporal Profile Analysis
The profile g[k, l] consists in an intensity profile evolving as a function of time for each point k along the curvilinear distance of each capillary. This profile exhibits correlations in space and time, which we can leverage in our method to compensate for the fact that image intensities are noisy and acquired from relatively low-frame-rate, low-resolution data. In order to emphasize intensity variations created by WBC events, a median-normalized version of g is computed. Specifically, the medians of the time-varying intensity lines of g[k, l] are first set to zero at every curvilinear coordinate k, the same operation being then repeated columnwise at every frame l. Finally, to reduce noise, the contrast-normalized profile g′ is filtered along the time axis with a symmetric and unit-sum rectangle function of size σ, which yields g″.
The profile g″ that is estimated from the capillary #1 of VGaps is displayed in Fig. 2. One can identify the spatio-temporal trajectories corresponding to the WBC events as lines spanning the 2D intensity plot. The slope of each line is associated with the average speed of the corresponding WBC event inside the capillary.
Fig. 2.
Time-varying profile corresponding to the capillary #1. The displayed values depend on the frame 1 … Nf of the VGaps video (x-axis) and on the curvilinear distance inside the capillary (y-axis).
E. Event Detection and Characterization
Based on the estimated spatio-temporal intensity profile (Fig. 2), our method identifies the number of WBC events and their parameters using the Radon transform (Fig. 3), which is known to map 2D lines to peaks located at particular positions [7]. This makes event detection and analysis convenient and robust to noise, the latter being observed as cloudy artefacts in the original spatio-temporal domain. The reconstructed trajectories associated with the peak positions in the Radon domain are shown as dotted lines in Fig. 2.
Fig. 3.
Radon-transformed values corresponding to the capillary #1. The horizontal and vertical axes correspond to the projection angle and to the associated normalized radial coordinate, respectively.
Given a continuous 2D image f(x)—with x ∈ ℝ2 the Cartesian coordinate defined with respect to the center of f—its Radon transform [7] called f̂ = ℛf is defined as
| (1) |
where the radial coordinate x′ is defined as x′ = [x1 cos θ + x2 sin θ, − x1 sin θ + x2 cos θ]. Since our setting involves discrete images, our method uses a discrete-domain Radon transform ℛ0 involving a finite amount of radial-coordinate values and of angles in [0, π]. The largest radial-coordinate value corresponds to half of the image-diagonal length. Our Radon-domain sequence ĝ is thus written as ĝ[kθ, kr] = ℛ0g″. The number of angles is denoted by Nθ, the number of radial coordinates Nr being proportional to , where Np,i = α(Np − 1) + 1 is the number of interpolated curvilinear points. Fig. 3 shows the Radon transform ĝ of the map represented in Fig. 2. In this new representation, one can easily identify several peaks, each of which correspond to the linear trajectories observed in the spatial domain. These peaks are then identified and located based on local-maxima detection within a window of odd pixel size Sw × Sw. These values must be not only maximal within this window but also greater than a threshold τm. Furthermore, the maxima locations must correspond to angular values within the range [0, π/2], thereby imposing one single flow direction inside the capillary.
These maxima are highlighted in Fig. 3 by the surrounding circles. The original physical time and speed parameters can then be analytically deduced from the maxima locations based on the known frame rate and pixel size through elementary trigonometric relations. In the framework of our algorithm, the time of each event corresponds to the first frame in which a visual gap appears in the capillary.
III. Results
In this section, we apply our method to the video VGaps. Our goal is to identify all WBC events occuring in capillaries #1 and #2 and estimate their speed. To validate our results, we compare our algorithm implemented in MATLAB to manual counts performed by 4 experts. The acquisition parameters that we use are Nh = 1280, Nv = 960, Nf = 450, r = 15, and Sp = 0.65 μm, the duration of VGaps being 30s. The threshold τc is heuristically set to 3/4 of the maximum intensity value for each frame l in I′. The amount of user-specified curve points is set to Np = 6, which yields accurate segmentations. The number of interpolated curves is set to Nc = 10, using α = 100 for resampling. The size of the filter used for noise reduction is set to σ = 3. Finally, the window size and threshold value used for Radon-domain maxima detection are chosen as Sw = 11 and τm = 7, the number of Radon angles being set to Nθ = 400.
Blood Flow Gaps Detection
Experiments on gap counts are performed using two individual capillaries, #1 and #2, selected manually in VGaps. Results obtained from our algorithm and from Expert 1—one of the four blinded human experts—are shown in Fig. 4. We observe that more than 80% of the WBC events detected by our algorithm are consistent with those of Expert 1. Missed events correspond to temporally adjacent visual gaps that could not be automatically resolved due to the poor frame rate. In Fig. 5, the total event counts obtained from our algorithm are further compared with those obtained from all 4 human experts. The results obtained from our method are shown in these box plots to fall within the human inter-rater variability.
Fig. 4.
Detection and analysis of the WBC events occurring inside the capillaries #1 (top) and #2 (bottom). Every event detected by our algorithm is marked by a cross. The event times estimated by Expert 1 are denoted by the dashed vertical lines. The horizontal lines represent the maximum and minimum blood-flow-related limits described in the literature [8].
Fig. 5.
Inter-observer variability of manual counts. Each capillary is associated with a box where the central mark is the median, the edges the 25th and 75th percentiles, and the whiskers extend to the extreme data points. The blue crosses and the red circles denote the counts completed by each of the 4 experts and by our algorithm, respectively.
Speed Estimation
The slope of the visual gap trajectories in Fig. 2 was employed to compute the speed associated with WBC events for both capillaries #1 and #2. The results, represented in Fig. 4, fall within the range for nailfold capillaries blood-flow values, [450, 1200] μm/s, previously reported in literature [8].
WBC Counts
We employed our interpolated inner and outer capillary curves, Pint[k], Pext[k], to extract the vessel radius, r, which corresponded to approximately 7.5 μm for both capillaries #1 and #2, a value consistent with previous published data [9]. Assuming circular cross sections, and given that our estimated average speed, v, was approximately 600 μm/s, the total sampled blood volume per second V can be determined as
| (2) |
Given that the healthy WBC range is [3500, 9000] per μL [10], and given our video duration of 30 seconds, one should observe on it a number c of WBC counts determined as
| (3) |
which is consistent with the median counts of 10 and 11 events obtained for capillaries #1 and #2, respectively.
IV. Discussion
We presented a semi-automatic method to count visual gaps in the blood flow and determine their speed based on optical capillary images through the nailfold. Results were comparable to manual counts in terms of accuracy and consistent with physiological data. Besides yielding reliable counts, our algorithm provided flow-speed parameters which can be relevant to assess certain conditions such as systemic sclerosis. In further work, full automatisation based on more advanced segmentation techniques would constitute an essential improvement towards parallelizability and potential diagnostic applicability. Additionally, the estimation of features such as gap size, density, morphology, and dynamics from similarly acquired data could be envisioned. Such features could help characterizing blood-flow gaps to differentiate leukocytes and their subpopulations. Furthermore, the set of input parameters currently used in our algorithm could be either simplified or optimized numerically to improve the robustness and user-friendliness of the method. A clinical study will be conducted to correlate the algorithmic output with gold-standard clinical data.
Acknowledgments
This work was supported by the Consejería de Educación, Juventud y Deporte de la Comunidad de Madrid (Spain) through the Madrid-MIT M+Visión Consortium
We wish to thank Prof. Arrate Muñoz Barrutia who provided excellent comments and suggestions for improvement.
References
- 1.Riva CE, Petrig B. Blue field entoptic phenomenon and blood velocity in the retinal capillaries. J Opt Soc Am A. 1980;70(10):1234–1238. doi: 10.1364/josa.70.001234. [DOI] [PubMed] [Google Scholar]
- 2.Uji A, Hangai M, Ooto S, Takayama K, Arakawa N, Imamura H, Nozato K, Yoshimura N. The source of moving particles in parafoveal capillaries detected by adaptive optics scanning laser ophthalmoscopy. Invest Ophthalmol Visual Sci. 2012;53(1):171–178. doi: 10.1167/iovs.11-8192. [DOI] [PubMed] [Google Scholar]
- 3.Golan L, Yeheskely-Hayon D, Minai L, Dann EJ, Yelin D. Noninvasive imaging of flowing blood cells using label-free spectrally encoded flow cytometry. Biomed Opt Express. 2012 Jun;3:1455–1464. doi: 10.1364/BOE.3.001455. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Anderson ME, Allen PD, Moore T, Hillier V, Taylor CJ, Herrick AL. Computerized nailfold video capillaroscopy–a new tool for assessment of raynaud’s phenomenon. J Rheumatol. 2005;32(5):841–848. [PubMed] [Google Scholar]
- 5.De Boor C. A practical guide to splines, vol. 27 of Applied Mathematical Sciences. Springer-Verlag; New York: [Google Scholar]
- 6.Delgado-Gonzalo R, Unser M. Spline-based framework for interactive segmentation in biomedical imaging. IRBM. 2013;34(3):235–243. [Google Scholar]
- 7.Ye Q, Huang R, He X, Zhang C. A SR-based radon transform to extract weak lines from noise images. Proc. Int. Conf. Image Proc; Barcelona, Spain. 2003; pp. 849–852. [Google Scholar]
- 8.Mugii N, Hasegawa M, Hamaguchi Y, Tanaka C, Kaji K, Komura K, Ueda-Hayakawa I, Horie S, Ikuta M, Tachino K, Ogawa F, Sato S, Fujimoto M, Takehara K. Reduced red blood cell velocity in nail-fold capillaries as a sensitive and specific indicator of microcirculation injury in systemic sclerosis. Brit J Rheumatol. 2009;48(6):696–703. doi: 10.1093/rheumatology/kep066. [DOI] [PubMed] [Google Scholar]
- 9.Hofstee HMA, Serné EH, Roberts C, Hesselstrand R, Scheja A, Moore TL, Wildt M, Manning JB, Noordegraaf AV, Voskuyl AE, Herrick AL. A multicentre study on the reliability of qualitative and quantitative nail-fold videocapillaroscopy assessment. Brit J Rheumatol. 2011:ker403. doi: 10.1093/rheumatology/ker403. [DOI] [PubMed] [Google Scholar]
- 10.Hollis VS, Holloway JA, Harris S, Spencer D, van Berkel C, Morgan H. Comparison of venous and capillary differential leukocyte counts using a standard hematology analyzer and a novel microfluidic impedance cytometer. PloS One. 2012;7(9):e43702. doi: 10.1371/journal.pone.0043702. [DOI] [PMC free article] [PubMed] [Google Scholar]





