System and Method for Measuring the Percent Fill of Blood Sampling Capillary

20230200693 · 2023-06-29

Assignee

Inventors

Cpc classification

International classification

Abstract

A system and method for measuring the percent fill of a blood sampling capillary includes a chamber for receiving a sample capillary containing a blood sample, an illuminator arranged to illuminate the sample capillary, an imaging lens aligned with the chamber and the sample capillary, an image sensor aligned with the imaging lens wherein the image sensor receives an image of the blood in the sample capillary from the imaging lens and converts the image to image data, a micro-controller circuit electrically coupled to the image sensor, and at least one of a host computer or a user interface electrically coupled to the micro-controller unit where the micro-controller circuit processes the image data into a percent fill result where the percent fill result is passed to the at least one of the host computer or the user interface.

Claims

1. A system for measuring the percent fill of a blood sampling capillary, the system comprising: a chamber for receiving a sample capillary containing a blood sample; an illuminator arranged to illuminate the sample capillary; an imaging lens aligned with the chamber and the sample capillary; an image sensor aligned with the imaging lens wherein the image sensor receives an image of the blood in the sample capillary from the imaging lens and converts the image to image data; a micro-controller circuit electrically coupled to the image sensor; and at least one of a host computer or a user interface electrically coupled to the micro-controller unit, wherein the micro-controller circuit processes the image data into a percent fill result wherein the percent fill result is passed to the at least one of the host computer or the user interface.

2. The system of claim 1 wherein the illuminator is a white light LED.

3. The system of claim 1 further comprising an aperture structure aligned with the imaging lens and the imaging sensor wherein the aperture structure is disposed between the imaging lens and the image sensor, the aperture structure restricting a ray cone of the image of the blood in the sample capillary to decrease image distortion and aberrations caused by the imaging lens.

4. The system of claim 1 wherein the microcontroller circuit controls the illuminator.

5. The system of claim 1 wherein the micro-controller circuit includes software that selects out the pixels of the image of the sample capillary whose values lie in a particular range of hue.

6. The system of claim 1 wherein the software converts the image data into a first type of hue space and a second type of hue space.

7. The system of claim 6 wherein the first type of hue space is a YCbCr format color space.

8. The system of claim 6 wherein the second type of hue space is a HSV format color space.

9. The system of claim 5 wherein the software is an interpreted high-level general-purpose programming language containing a first algorithm to convert the image to a YCbCr format color space and a second algorithm to convert the image to a HSV format color space.

10. The system of claim 6 wherein the image data of the first type of hue space and the image data of the second type of hue space are run through mask-generating functions to create two masks, a mask of the YCbCr color space and a mask of the HSV color space based on a selected hue range, wherein pixels lying within the selected hue range are set to 1 in the mask and pixels outside the selected hue range are set to 0.

11. The system of claim 10 wherein a 1-dimensional array is created from the combination of the two masks.

12. The system of claim 1 further comprising a reference capillary known to be one hundred percent filled with blood or a capillary known to be one hundred percent filled with a blood substitute having a required red hue wherein image data of the reference capillary establishes a calibration value for determining the percent fill of the sample capillary.

13. A method for measuring a percent fill of a sample capillary containing a blood sample of claim 1, the method comprising: a) disposing the sample capillary into the system; b) capturing an image of the of the sample capillary and converting the image to image data; c) submitting the image data from the captured image to a micro-controller circuit containing software that processes the image data into the first type of hue space data and a second type of hue space data; d) submitting the first type of hue space data and the second type of hue space data to corresponding mask-generating functions creating two masks based on a selected hue range; e) creating a 1-dimensional array by combining the two masks; and f) determining a percent fill result of the sample capillary containing the blood sample by comparing a value generated by analysis of the 1-dimensional array to a calibration value.

14. The method of claim 13 wherein the determining step includes calculating a difference from a blood sample start location of the blood in the image of the sample capillary and an end location of the blood in the image of the sample capillary, and multiplying the difference by the calibration value.

15. The method of claim 13 further comprising: creating a calibration value using a reference capillary known to be one hundred percent (100%) filled with blood or a capillary known to be one hundred percent (100%) filled with a substitute substance having a required red hue; submitting the reference capillary known to be one hundred percent (100%) filled to steps a), b), c), d), e); and calculating the calibration value.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

[0027] FIG. 1 is a schematic view showing a diagram of the capillary imager of the present invention showing a capillary filled with blood, an illumination source, an image sensor, an imaging lens, an optional aperture structure, a micro-controller circuit, and a host computer or analyzer and/or a user interface.

[0028] FIG. 2 is a flow chart showing the general steps in the process for determining the percent fill of sample capillary containing a blood sample.

[0029] FIG. 3 is a color image of a capillary containing a blood sample showing a one hundred percent filled capillary with blood start and blood end lines.

[0030] FIG. 4 is a color image mask of a partially filled capillary separated by hue.

[0031] FIG. 5 is a graphical representation of the pixel column sum of the mask.

[0032] FIG. 6 is a calculated result of the capillary fill overlayed on the capillary image for a partially-filled capillary showing vertical lines where the algorithm determined the beginning and end of the blood in the capillary.

DETAILED DESCRIPTION OF THE INVENTION

[0033] The embodiments of the present invention are illustrated in FIGS. 1-6. FIG. 1 shows one embodiment of a diagram of the capillary imager system of the present invention. The capillary imager system 10 includes a capillary 20 containing a blood sample to be imaged and a percent fill to be determined, an illumination source 30, an image sensor 40, an imaging lens 50, an optional aperture structure 80, a micro-controller circuit 60, and a host computer or analyzer and/or a user interface 70. The illuminator is a light source such as, for example, a white LED. An image of the capillary 20 is projected onto the image sensor 40 by the imaging lens 50. The image sensor 40 communicates with the micro--controller circuit 60, where the micro-controller circuit 60 also controls the illumination source 30. image data from the image sensor 40 is processed by the micro-controller circuit, and the results are passed to the host computer or analyzer and/or the user interface 70. The percent fill results may be presented to a user of the system, or for further processing performed by the host computer or analyzer. For example, the host computer may control an entire analyzer with other subsystems, and use the percent fill results from the micro-controller circuit 60 for further calculations and/or corrections of measured analyte values.

[0034] FIG. 2 is an illustration of the process of determining the percent fill of a sample capillary containing a blood sample using the above-described system. A general description of the process is as follows. In step 1 (100), an image of a sample capillary is captured. In Step 2 (110), the captured image is converted to two types of hue space. In Step 3 (120), the images in the two new types of hue spaces are run through mask generating functions, one mask-generating function for each of the two types of hue space. Step 4 (130) then combines the results of the two masks generated into a 1-dimensional array by summing/combining the mask of the first hue space and the mask of the second hue space pixel-by-pixel. In Step 5 (140), the 1-dimensional array is optionally run through erosion and dilation operations to reduce noise. In Step 6 (150), the blood start location 80 and blood end location 82 in the image of the sample capillary 20 is determined. In Step 7 (160), the percent fill of the sample capillary 20 is determined by multiplying the difference between the blood start location 80 and the blood end location 82 by a calibration value.

Process of Calculating the Percent Fill From a Capillary Image

[0035] Turning now to FIG. 3, there is shown a typical image of a capillary containing a blood sample gathered from a system as shown in FIG. 1. For illustrative purposes only, the capillary in the image is filled completely to the one hundred percent (100%) level. The software or code used to calculate the percent fill from a capillary image is written in the Python programming language. Python is an interpreted high-level general-purpose programming language. Its design philosophy emphasizes code readability with its use of significant indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code, for small and large-scale projects.

[0036] Many of the most widely used programming languages (such as C++, Java, Python, etc.) are multi-paradigm and they support object-oriented programming to a greater or lesser degree, typically in combination with imperative, procedural programming. Significant object-oriented languages include: Java, C++, C#, Python, R, PHP, Visual Basic.NET, JavaScript, Ruby, Perl, SIMSCRIPT, Object Pascal, Objective-C, Dart, Swift, Scala, Kotlin, Common Lisp, MATLAB, and Smalltalk. Although the Python language was used, persons skilled in the art are capable of transcribing the method in Python code into any of the object-oriented languages including those listed above.

[0037] The next step in the process is to select a region of the capillary containing the blood sample. One way of doing this is to select out the pixels whose values lie in a particular range of hue. In the present invention, the image is converted to two types of hue space: YCbCr and HSV. YCbCr is typically used for digital encoding of color information suited for video, still-image compression and transmission such as MPEG and JPEG. HSV (hue, saturation, value), also known as HSB (hue, saturation, brightness), is often used by artists because it is perceived to be more natural to think about a color in terms of hue and saturation than in terms of additive or subtractive color components. HSV is a transformation of an RGB color space, and its components and colorimetry are relative to the RGB color space from which it was derived. Once converted, the images in the new color spaces are then run through mask generating functions.

[0038] The function calls to perform this are: [0039] 1) Yimg = MT9M114_rgb_to_ycbcr(img) [0040] 2) Himg = rgb_to_hsv(img) [0041] 3) BWY = createMask(Yimg, 0, 255, 0, 255, 143, 255) [0042] 4) BWH = createMaskHSV(Himg, 240, 20, 51, 255, 0, 255)

[0043] The inputs to the mask-generating calls show the hue range to be selected. Pixels that are in between those values are set to 1 in the mask, pixels outside the ranges are set to 0. The results of the two masks are combined pixel-by-pixel with the following logical AND statement: [0044] 5) import numpy as np [0045] 6) BWYH = np.logical_and(BWY,BWH)

[0046] The resulting array of 1′s and 0′s is summed column-wise into a 1-dimensional array:

[0047] 7) sBWYH = np.sum(BWYH,0)

Algorithm to Convert Image to YCbCr Format (Python Language)

[0048] The following algorithm is used to convert the captured image to YCbCr format using the Python language.

TABLE-US-00001 import numpy as np           def MT9M1 14_rgb_to_ycbcr(img):               img__ycbcr= np.zeros(img.shape)               Rp = img[..., 0]               Gp = img[..., 1]               Bp = img[..., 2]               irng_ycbcr[..., 0] = (0.2126 * Rp + 0.7152 * Gp + 0.0722 * Bp) * (219/256) +                      16               img_ycbcr[...,1] = 0.5389 * (Bp - img_ycbcr[...,0]) * (224/256) + 128               img_ycbcr[...,2] = 0.6350 * (Rp - img_ycbcr[...,0]) * (224/256) + 128               img_ycbcr[img__ycbcr < 16] = 16               idx = img_ycbcr[..., 2] > 240               img__ycbcr[idx, 2] = 240               idx = img_ycbcr[..., 1] > 240               img_ycbcr[idx, 1] = 240               idx = img_ycbcr[..., 0] > 235               img_ycbcr[idx, 0] = 235               return img_ycbcr.astype(np.uint8)

Algorithm to Convert Image to HSV Format (Python Language)

[0049] The following algorithm is used to convert the captured image to HSV format using the Python language.

TABLE-US-00002 import numpy as np           def rgb_to_hsv(img):             out = np.zeros(img.shape)              # Calculate V              V = !mg.max(-1)              out[..., 2] = V              # Calculate S              delta = img.ptp(-1)              # Ignore warning for zero divided by zero              old__settings = np.seterr(invalid=‘ignore’)              out[..., 1] = 255. * delta/V              out[delta == 0., 1] = 0.              # Calculate H              X = img.min(-1)              # If R is max and G is min              idx = np.logical-and((img[...,0] == V),(img[..., 1] == X))              out[idx, 0] = 5. + (V[idx] - img[idx, 2]) /delta[idx]              # If R is max and G is not min              idx = np.logical__and((img[..., 0] == V),np.logical_not((img[..., 1] == X)))              out[idx, 0] = 1. - (V[idx] - img[idx, 1]) /delta[idx]              # If G is max and B is min              idx = np.logical_and((img[..., 1] == V),(img[..., 2] == X))              out[idx, 0] = 1. + (V[idx] - img[idx, 0]) /deltafidx]              # If G is max and B is not min              idx = np.logical_and((img[..., 1] == V),np.logical_not((img[..., 2] == X)))              out[idx, 0] = 3. - (V[idx] - img[idx, 2]) /delta[idx]              # If B is max and R is min              idx = np.logical_and((img[..., 2] == V),(img[..., 0] == X))              out[idx, 0] = 3. + (V[idx] - img[idx, 1]) / delta[idx]              # If B is max and R is not min              idx = np.logical_and((img[..., 2] == V),np.logical_not((img[..., 0] == X)))              out[idx, 0] = 5. - (V[idx] - irrig[idx, 0]) / delta[idx]              out[..., 0] = (255. /6. ) * out[ ..., 0]              out[delta == 0.] = 0.              np.seterrt(**old_settings)              # # Remove NaNs              out[np.isnan(out)] = 0.              return out.astype(np.uint8)

Algorithm to Create Hue Masks (Python Language)

[0050] The following algorithm is used to create the hue masks using the Python language.

TABLE-US-00003 import numpy as np           def createMask(img, min0, max0, min1, max1, min2, max2):              mask0 = np.logical_and(img[:,:,0] >= min0, img[:,:,0] <= max0)              mask1 = np.logical__and(img[:,:,1] >= min1, img[:,:,1] <= max1)              mask2 = np.logical_and(img[:,:,2] >= min2, img[:,:,2] <= max2)              return np.logicaland(mask0,np.logical__and(mask1,mask2))           import numpy as np           def createMaskHSV(img, min0, max0, min1, max1, min2, max2):              mask0 = np.logical_or(img[:,:,0] >= min0, img[:,:,0] <= max0)              mask1 = np.logical_and(img[:,:,1] >= mini, img[:,:,1] <= maxi)              mask2 = np.logical_and(img[:,:,2] >= min2, img[:,:,2] <= max2)              return np.logical_and(mask0,np.logical_and(mask1 ,mask2))

Algorithm to Find Threshold Transitions (Python Language)

[0051] The following algorithm is used to find the threshold transitions from the column-wise 1 -dimensional array calculated in Step 7 (placed into variable “f,” which is a vector list of numbers where the term “f[n]” below refers to the nth number of “f”).

TABLE-US-00004 def findThreshold(T,f):              loc = [ ]              upSlope = True              for n in range (f.shape [0]):                if f[n] > T and upSlope:                   loc.append (n)                   upSlope = False                elif f[n] < T and not upSlope:                   loc.append (n)                   upSlope = True              return loc

[0052] Turning now to FIG. 4, FIG. 4 shows the region of the image of a partially-filled capillary that has been masked by the logical AND of the two generated masks, showing the selection of the regions with the reddish color.

[0053] FIG. 5 is an illustration/graph of the column-wise 1-dimensional array calculated in Step 6, the summing of the values in the columns of the logical AND ofthe two generated masks. This plot is a function of the horizontal direction and shows how many pixels with the selected hue are in each vertical column. The array sBWYH is then optionally run through erosion and dilation operations to reduce noise: [0054] 8) sBWYH = ndimage.grey_erosion(sBWYH,structure=np.ones((50,))) [0055] 9) sBWYH = 2 * ndimage.grey_dilation(sBWYH,structure=np.ones((50,)))

[0056] The array sBWYH is then put through the function findThreshold, which finds the horizontal locations of transitions greater than the specified threshold of 40:

[0057] 10) locs = findThreshold(40, sBWYH)

[0058] The start of the blood in the capillary is a blood start location 80, the end of the blood in the capillary is a blood end location 82: [0059] 11) bloodStart = min(locs) [0060] 12) bloodEnd = max(locs)

[0061] The percent fill value is the difference between the blood start location 80 and the blood end location 82, multiplied by a calibration value (calVal).

[0062] 13) pcntFill = (bloodEnd - bloodStart) x calVal

Determination of Calibration Value (calVal)

[0063] The calibration value is previously determined, using a reference capillary known to be 100% filled with blood or a substitute such as red dye or red epoxy. The image from this calibration/reference capillary is run through the same processing steps, with the exception that step 13 is skipped and the step 14 below is used to calculate the calibration value:

[0064] 14) calVal = 100.0 / (bloodEnd - bloodStart)

[0065] The calibration/reference capillary can be filled with any substance of the required red hue. One formulation used that works consists of a mixture of 0.30 grams of UV cure clear epoxy NOA 81 and 0.06 grams of Congo Red dye powder Sigma C6277-25G (lot MKCF4499 with a dye content of 95%). The mixture is forced into the capillary with a syringe and needle until it is 100% full, then cured with a UV cure lamp.

[0066] FIG. 6 shows the resulting percent fill calculation for the partially filled capillary. The vertical lines in the figure are blood start 80 and blood end 82 locations.

[0067] Although the preferred embodiments of the present invention have been described herein, the above description is merely illustrative. Further modification of the invention herein disclosed will occur to those skilled in the respective arts and all such modifications are deemed to be within the scope of the invention as defined by the appended claims.