System and Method for Measuring the Percent Fill of Blood Sampling Capillary
20230200693 · 2023-06-29
Assignee
Inventors
Cpc classification
A61B5/150801
HUMAN NECESSITIES
A61B5/150946
HUMAN NECESSITIES
A61B2560/0223
HUMAN NECESSITIES
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]
[0028]
[0029]
[0030]
[0031]
[0032]
DETAILED DESCRIPTION OF THE INVENTION
[0033] The embodiments of the present invention are illustrated in
[0034]
Process of Calculating the Percent Fill From a Capillary Image
[0035] Turning now to
[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
[0053]
[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]
[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.