A single-pixel and non-redundant branching-based algorithm for nailfold capillary skeleton line extraction
Original Article

A single-pixel and non-redundant branching-based algorithm for nailfold capillary skeleton line extraction

Bin Zhou1 ORCID logo, Hao Yin1, Yanxiong Wu1,2, Qianyao Ye1, Jianan Lin1, Cong Ye1, Mugui Xie1, Xiaosong Li1, Wei Bin3, Zhimin Yang3

1School of Physics and Optoelectronic Engineering, Foshan University, Foshan, China; 2Ji Hua Laboratory, Foshan, China; 3State Key Laboratory of Traditional Chinese Medicine Syndrome/Health Construction Center, The Second Affiliated Hospital of Guangzhou University of Chinese Medicine, Guangzhou, China

Contributions: (I) Conception and design: B Zhou; (II) Administrative support: B Zhou, Y Wu; (III) Provision of study materials or patients: All authors; (IV) Collection and assembly of data: All authors; (V) Data analysis and interpretation: B Zhou; (VI) Manuscript writing: All authors; (VII) Final approval of manuscript: All authors.

Correspondence to: Yanxiong Wu, PhD. School of Physics and Optoelectronic Engineering, Foshan University, 33 Guangyun Road, Shishan Town, Nanhai District, Foshan 528000, China; Ji Hua Laboratory, 28 Huandao South Road, Guicheng Street, Nanhai District, Foshan 528200, China. Email: wuyanxiong@fosu.edu.cn; Zhimin Yang, PhD, MD. State Key Laboratory of Traditional Chinese Medicine Syndrome/Health Construction Center, The Second Affiliated Hospital of Guangzhou University of Chinese Medicine, 111 Dade Road, Guangzhou 510120, China. Email: yangyoVIP@126.com.

Background: Static nailfold capillary parameters are important parameters that reflect the health of the human body. Disease onset or progression is often accompanied by changes in the physiological parameters of the nailfold. Hence, the physiological parameters of the nailfold are closely related to the study of disease, with their automated and high-precision measurements playing a crucial role in these studies. Currently, manually measured values of the nailfold’s parameters are the gold standard; however, they are time consuming and labor intensive, making the development of automated measurement methods essential. Most automated measurement methods use skeleton lines; however, current skeleton-thinning algorithms have non-single pixels and redundant branches that lead to reduced measurement accuracy. This study proposes a single-pixel and non-redundant branching-based skeleton line extraction algorithm for nailfold capillaries, which is then applied to nailfold static parameter calculations to improve accuracy.

Methods: The algorithm includes deletion and restoration templates combined with the depth-first search method to obtain single-pixel skeleton lines without redundant branches. These lines are applied to the static nailfold capillary parameter measurement method based on digital image processing to calculate the blood vessel diameter.

Results: The results show that the proposed method can obtain the single-pixel skeleton line without the redundant branches that are required for the parameter calculations and improve the accuracy of the nailfold capillary diameter measurement. Experiments showed that the root mean square errors (RMSEs) of the labeled apical diameter, arterial limb diameter, and venous limb diameter were 0.794, 0.756, and 0.830 µm, respectively, when the calculated results were compared with those of the manual calculations. According to the accuracy formula, the accuracy of the method in this study is 90%. We calculated the P values of the algorithmic and manual measurements to P<0.001 and found that the difference in the measurements of the proposed algorithm is statistically significant. Therefore, the method in this study has high sensitivity and specificity for the measurement of normal nailfold capillaries.

Conclusions: The proposed algorithm could obtain single-pixel skeleton lines without redundant branches, thereby improving the nailfold static parameter measurement accuracy.

Keywords: Image thinning; nailfold capillary; nailfold microcirculation; single-pixel skeleton; static parameter measurement


Submitted Apr 26, 2024. Accepted for publication Aug 20, 2024. Published online Sep 26, 2024.

doi: 10.21037/qims-24-847


Introduction

Microcirculation accounts for approximately 99% of the vasculature in adults, and cutaneous microvascular injury is characteristic of systemic diseases, such as connective tissue diseases, vasculitis, Raynaud’s phenomenon, diabetes mellitus, chronic kidney disease, and arterial hypertension (1). Common locations in the human body where microcirculation is detected include the nailfolds, retina (2), and sublingual microcirculation (3). Among these, the detection of nailfold microcirculation is particularly important because it can be lesioned in systemic diseases or specific skin diseases. The study of nailfold microcirculation can aid in preventing, detecting, and treating certain diseases as early as possible, which is an important direction in clinical microcirculation research (4). Nailfold capillary microscopy is often performed manually or semi-automatically using a computer program (5). Thus, results that are obtained via manual calculation are the current gold standard for nailfold capillary testing. The static nailfold capillary parameters are important parameters that reflect the health status of the human body during nailfold capillary testing and usually include the apical diameter, arterial limb, venous limb, vessel width, vessel height, and vessel internal diameter. The measurement of static nailfold capillary parameters based on digital image processing is mainly performed manually or semi-automatically with the aid of computers by manually measuring blood vessel images captured via nailfold capillary microscopy. With the development of computer science and advancements in computer technology, methods based on digital image processing and deep learning for the measurement of static nailfold capillary parameters have been developed. Among these, one method requires skeletonizing vascular images and combining the raw image contour information of the vascular images for parameter measurement. Corliss et al. (6) calculated the microvascular canal diameter of mouse retina via skeletonization. More recently, Nirmala et al. used Wiener and bilateral filters to enhance the images and further employed morphological operations to identify and segment the boundaries of capillaries (7), which measured the length and width of the nailfold capillary. Deep learning image processing methods are trained by labeling images, identifying each parameter region of the image, and calculating the results. Recently, Tello et al. proposed a deep learning and data-driven method that can recognize capillary images obtained using a microscope and generate automatic measurements for each capillary (8). However, this method only calculates the diameter of the highest point of the capillary loop and selects the diameter of one of the points of the arterial and venous branches as the value of the diameter of the entire vessel, which may cause errors in the measurement of the static nailfold capillary parameters. In contrast, the static nailfold capillary parameter measurement method based on digital image processing can obtain the diameter values of each part of the nailfold capillary. The averaging of these diameter values can significantly reduce the resultant error, thereby improving the measurement accuracy.

Although there are a number of skeleton line methods that are currently being used in clinical practice (9-12), none of these methods have been used for vascular vessel diameter calculations. Therefore, it is not possible to discuss the sensitivity and specificity of these methods for clinical calculations of static parameters in the nailfold. However, they can effectively obtain the complete skeleton line structure, which lays the foundation for us to realize the accurate calculation of static nailfold capillary parameters. In specific clinical practice, the quality assurance of these methods is mainly the responsibility of the individual physician. Hence, it is the physician’s personal experience that provides the guarantee for clinical testing.

Image thinning (also known as skeletonization) is a key step in the method of calculating static nailfold capillary parameters. Image thinning is an algorithmic process that partially eliminates the front sights in a binary image according to a predefined rule and finally retains a single-pixel skeleton algorithm with the topology of the raw image. Existing image thinning algorithms include the Zhang-Suen fast parallel thinning algorithm (FPTA) (13-16) (hereinafter referred to as the Zhang-Suen algorithm) and one-pass parallel thinning algorithm (OPTA) (17-20). The Zhang-Suen algorithm has higher accuracy for pixel points at corners, T-intersections, and straight-line thinning and offers the advantages of continuity and fast thinning speed. However, it exhibits the problems of local redundant pixels and a loss of feature information (21). In addition, it is affected by edge noise and is prone to producing redundant branches, which in turn affects the accuracy of the static parameter calculation of the nailfold capillary. Although OPTA effectively solves the non-single-pixel skeleton and skeleton disconnection problems, it may lead to excessive erosion problems. In addition to the above methods, in 2013, Mou et al. (22) proposed the FPTA, which is an improvement of the Zhang-Suen algorithm that solves part of the redundant pixel point problem that exists in the Zhang-Suen algorithm. In 2021, Ma et al. (23) proposed a new fully parallel thinning algorithm (NFPSA) that combines the advantages of the Zhang-Suen algorithm and OPTA to realize a single-pixel skeleton. However, these two algorithms are susceptible to edge noise and produce redundant branches when dealing with blurrier images. In contrast, FPTA is better than NFPSA for corner pixel points and also preserves a more complete skeleton structure. FPTA has redundant pixel points only at T-intersections, and the algorithm proposed in this study aims to remove those redundant pixel points and redundant branches. The proposed algorithm adds median filtering to eliminate some of the redundant branches caused by vessel edge noise, and new deletion and restoration templates are included to solve the problem of redundant pixels caused by redundant branches. The remaining redundant branches are eliminated by retaining the longest capillary skeleton line via the depth-first search (DFS) method.

The remainder of this study is organized as follows: Section “Methods” describes the experimental setup, source of experimental data, and algorithm of this study. The application of the algorithm to a digital image processing-based method for measuring the static nailfold capillary parameters is presented in Section “Results”. The results are discussed in Section “Discussion”. Finally, Section “Conclusions” summarizes the study and outlines its development prospects.


Methods

This study was conducted in accordance with the Declaration of Helsinki (as revised in 2013). The nailfold study was non-invasive. Thus, the requirement for ethical approval for this study was waived by the Ethics Committee of Foshan University. Written informed consent was provided by each volunteer for all vascular images in the study.

Research devices

Figure 1 depicts the experimental setup used in this study. The experimental setup mainly consisted of a complementary metal-oxide semiconductor (CMOS) camera (Mshot-MSX11; Micro-shot Technology, Guangzhou, China), an LED light source, and a finger holder. The camera had a resolution of 5,280×3,956 pixels, a pixel size of 3.3×3.3 µm, a field of view of up to 17.42×13.05 mm, and a magnification of 5.5×. The LED light source had a power of 3 W, color temperature of 10,000 K, and cool blue-white luminous effect.

Figure 1 Experimental equipment. CMOS, complementary metal-oxide semiconductor; LED, light emitting diode.

Research participants

We selected 30 healthy volunteers aged between 18 and 26 years, and we performed nailfold capillary image acquisition on 10 of their fingers. Prior to image acquisition, the volunteers were required to sit still for 10–20 min in a room with a temperature of 22–24 °C and avoid strenuous exercise. Thereafter, the volunteer washed his/her hands and waited for them to dry naturally. Before starting the acquisition, a drop of cedar oil was placed on the nailfold area of each volunteer’s finger to improve light transmission (24). During the image acquisition process, the volunteers were required to remain seated to ensure that the heart was flush with the hand (25). Figure 2 shows a standard nailfold vessel acquisition image.

Figure 2 Standard nailfold vessel acquisition image.

Study methods

Evaluation metrics

In the experiments conducted during this study, we used evaluation metrics, such as the root mean square error (RMSE) and accuracy. The RMSE is a common metric by which to evaluate the performance of a regression model, and it is usually employed to measure the difference between the value predicted by a model and the actual value. Its formula is as follows:

RMSE=1ni=1n(yiy^i)2

where n is the number of samples, yi is the actual value, and y^i is the predicted value. Accuracy is used to measure the number of samples correctly predicted by the model as a proportion of the total number of samples, and it is calculated using the following formula:

Accuracy=TruePositives(TP)+TrueNegatives(TN)TotalNumberofSamples

where TP denotes true positives (i.e., the number of correctly predicted positive categories); TN denotes true negatives (i.e., the number of correctly predicted negative categories); and Total Number of Samples denotes the total number of samples in the dataset.

Basic concepts

In this study, a pixel (or pixel point) is a closed square in a plane that has four edges and four vertices. The edges of a pixel are parallel to the coordinate axes with a length of one. Two pixels are said to be neighboring if they are different and share at least one vertex. If a pixel is adjacent to another pixel, it is said to be a neighbor of the other pixel (22). A pixel in a two-dimensional image has up to eight neighbors. The 4-neighbors of pixel P are four adjacent pixels that share a common edge with pixel P. The 4-diagonal neighbors (D-neighbors) of pixel P consist of four diagonal neighbor pixels that share a common vertex with pixel P. Figure 3A,3B are the 4-neighbors and 4-diagonal neighbors of pixel P, respectively.

Figure 3 Basic terminology demonstration. (A) The 4-neighbors of point P, (B) the 4-diagonal neighbors of point P, (C) an edge point, (D) an endpoint, and (E) point P and its 8-neighbors.

In a binarized image, a pixel can have a value of 0 or 1. A pixel point with a value of 0 is referred to as a background point. Similarly, a pixel point with a value of 1 is known as a foreground point. When at least one of the eight neighbors of the foreground point is a background point, it is known as an edge point. When only one of the eight neighbors of the point is a foreground point, it is referred to as an endpoint. As shown in Figure 3C, P is an edge point if at least one background point exists in its 8-neighborhood, whereas Figure 3D shows that P is an endpoint if only one neighbor is a foreground point.

Zhang-Suen algorithm

The Zhang-Suen algorithm, which was proposed in 1984, is an algorithm that obtains a skeleton line that retains the shape of the raw image by pinning the 8-neighborhood pixels around each pixel. The 8-neighborhood of an arbitrary pixel point P is shown in Figure 3E. The Zhang-Suen algorithm is fast, maintains the connectivity of the thinned skeleton line, and has no blur generation. However, its thinned skeleton line cannot be guaranteed to be a single pixel. Hence, its thinning is not complete (22).

The Zhang-Suen algorithm is divided into two sub-iteration processes. In the first sub-iteration process, pixel P is removed from the original digital image if it satisfies the following conditions:

2B(P)6

A(P)=1

P1×P3×P5=0

P3×P5×P7=0

In the second sub-iteration, the final two conditions are modified as follows:

P1×P3×P7=0

P1×P5×P7=0

where A(P) is the number of changes from 0 to 1 in the 8-neighbors of P in the ordered sets P1, P2, ..., P8, and B(P) denotes the sum of the foreground pixel points in the 8-neighbors:

A(P)=a=14(P¯2a1×P2a+P¯2a×P(2a+1)mod8)

P¯=1Pa

B(P)=a=18Pa

FPTA

The Zhang-Suen algorithm produces non-single pixels because some of the points that should be deleted do not satisfy Eq. [4]. Mou et al. (22) classified these redundant points into three categories and constructed 16 deletion templates for removing these redundant pixel points.

They also matched the template by converting it into binary encoding with eight bits from P1 to P8. Each bit is represented in binary. If the value of the neighboring point is 1, the corresponding binary bit is also 1. If the value of the neighbor point is 0, the corresponding binary bit is 0 (22), as shown in Figure 4A. Hence, the 8-neighborhood of the target point P is converted into binary encoding, as shown in Figure 4B.

Figure 4 8-neighborhood of target point P with binary code conversion.

Mou et al. (22) converted the 16 deletion templates corresponding to the three types of redundant pixel points into binary numbers and then into decimal numbers. To ensure that there were no breaks in the skeleton line, the 10 points with the best results were selected to form the set {65, 5, 20, 80, 13, 22, 52, 133, 141, 54}, which is denoted as U. If the 8-neighborhood of the current pixel point does not satisfy Eq. [4] after improvement, the target point 8-neighborhood binary code is calculated via S(P)=a=18Pn×2n2, and the target point is deleted if S(P)∈U.

Algorithm of this study

Although NFPSA, FPTA, and the Zhang-Suen algorithm achieve a skeleton line without breakpoints, the blurring of the image results in segmentation that produces a binary image with edge noise or multiple cracks, which leads to the creation of branches that are not necessary for the calculation of the static nailfold capillary parameters. Ma et al. (23) found that the number of redundant branches in the skeleton increases with an elevation in the noise level and that there may be redundant pixel points in these redundant branches. Therefore, the proposed algorithm adds new deletion templates to remove redundant pixel points and ensure the single-pixel characteristics of the skeleton. For the breakpoints caused by the deletion templates, restoration templates are used to realize reconnection, which ensures the connectivity of the entire skeleton line. The longest skeleton line is retained using the DFS method, thereby eliminating redundant branches. Figure 5 shows the overall flow of the algorithm.

Figure 5 The overall flowchart of the proposed algorithm. FPTA, fast parallel thinning algorithm; Templates, deletion templates and restoration templates; DFS, depth-first search.

Deletion templates

The Zhang-Suen algorithm and FPTA are prone to redundant pixels at the intersection of “T” branches when dealing with redundant branches caused by multiple cracks or edge noise. Figure 6 shows the redundant pixels as red pixels. The removal of redundant pixels does not affect the basic structure or shape of the image.

Figure 6 “T” branches (colored red to distinguish redundant pixel points).

The proposed algorithm adds 16 new deletion templates to remove the redundant pixel points of this type to ensure that the entire skeleton is a single-pixel skeleton. Figure 7 shows the 16 deletion templates.

Figure 7 16 deletion templates.

The set of the above deletion templates after binary encoding and conversion into decimal numbers is {69, 101, 77, 109, 84, 212, 86, 214, 81, 83, 89, 91, 21, 149, 53, 181}.

Restoration templates

Following image thinning, some of the skeleton lines exhibited broken points. An analysis revealed that this was because the Zhang-Suen algorithm and FPTA are parallel thinning algorithms. That is, these algorithms process multiple pixel points simultaneously. As shown in Figure 8, as there is only one pixel point in the branch of the “T” branch, the green pixel point in Figure 8A is incorrectly considered an edge point and is thus added to the list to be deleted. However, because the edge point has not yet been deleted, it matches the “T” branch template indicated by the yellow dashed boxes in Figure 8A. Therefore, while deleting the green pixel point in Figure 8A, the red pixel point in Figure 8A is also deleted by mistake, resulting in the creation of a breakpoint, as evidenced in Figure 8B.

Figure 8 The situation of breakpoints (to distinguish the edge of the pixel points, such points are colored green): (A) the yellow dashed boxes show the locations of the pixel points that match the “T” template; (B) the light blue dashed box shows the location of a breakpoint.

The generation of breakpoints leads to an inability to traverse the pixel points that follow such breakpoints when deleting the redundant branches using the DFS method. This leads to missed redundant branches, which may affect the accuracy of the nailfold capillary diameter measurement. Restoration templates are used to repair the breakpoints generated by the deletion templates. Figure 9 shows the 12 restoration templates.

Figure 9 12 restoration templates.

The set of the above restoration templates after binary encoding and conversion into decimal numbers is {68, 72, 66, 132, 36, 17, 33, 9, 136, 144, 34, 18}. With the above restoration templates, it is possible to connect all breakpoints effectively and ensure the connectivity of the overall skeleton line.

Removal of redundant branches

The Zhang-Suen algorithm, NFPSA, and FPTA typically produce redundant branches when thinning the target image. As shown in Figure 10, the skeleton lines obtained via thinning using these algorithms may have one or more redundant branches. The red dashed box in Figure 10C is one such example. These redundant branches may affect the accuracy of the calculation of the static nailfold capillary parameters. Thus, they must be removed.

Figure 10 Single-pixel skeletal line in the presence of redundant branches: (A) a raw image of a blood vessel; (B) a binarized image in the presence of abnormal cracks; (C) a skeleton line with redundant branches. To enhance contrast, the skeleton lines are colored in black to represent foreground points and white to represent background points.

First, the binarized images obtained via segmentation do not form exactly the same connected regions owing to image blurring and noise. As shown in Figure 11, the raw image is blurred, and there is considerable noise. After segmenting the raw image of Figure 11A to obtain the binarized image in Figure 11B using U-Net (26-29), some redundant cracks were generated as a result of noise. These redundant cracks led to redundant branches in the binarized image after thinning. Figure 11C shows the skeleton lines with redundant branches. To solve this problem, the proposed algorithm removes redundant branches, as shown in Figure 11C, thereby obtaining the skeleton lines with maximum connectivity, as shown in Figure 11D.

Figure 11 Preservation of skeleton lines with maximum connectivity: (A) a raw image with noise in the red box; (B) a binarized image with the presence of anomalous cracks found in the red boxes; (C) a skeleton line in the presence of redundant branches found in the red boxes; (D) a skeleton line with maximum connectivity. The redundant branches on the skeleton line with maximum connectivity are not removed here for demonstration purposes.

Second, in the skeleton line of the maximally connected region, part of the redundant branch generation is caused by the influence of edge noise. Thus, the image edges can be smoothened by filtering to eliminate this noise, thereby suppressing the generation of redundant branches. We selected median filtering for this purpose, which is a commonly used image processing technique whose main function is to remove noise and minor disturbances from the image while retaining edge information. Redundant branches may be generated after directly skeletonizing the binarized image. Adding median filtering to the binarized image and performing an image thinning operation can effectively remove some of the original redundant branches and retain the basic shape of the original figure.

Finally, although some redundant branches can be removed by filtering, not all branches can be completely eliminated. Edge noise will not be completely eliminated after filtering, and anomalous cracks caused by image blurring will also produce redundant branches that cannot be removed by filtering when the binarized image is thinned and segmented. Therefore, we established a plane rectangular coordinate system using the obtained skeleton line image, with its upper left corner as the origin, to obtain the coordinates of each point. Taking the first point in the lower right corner of the skeleton line as the starting point, each point and all pixel points in its 8-neighborhood are traversed in turn. The visited point is denoted as the P-point. Each traversal is required to record the number of previous points within the 8-neighborhood, mark point P as visited, and record the number of points visited. If the number of antecedent points within the 8-neighborhood of the P-point is 1, the P-point is not a branch point. The next point is then visited. If the number of antecedent points within the 8-neighborhood of the P-point is 2, the P-point is a branch point. The coordinates of the two foreground points within the domain of the 8-neighborhood of the P-point are recorded. The branches with these two coordinates as their starting points are visited recursively, and the length of each branch is recorded. At the end of each recursive visit, the branch lengths are compared, and the longest branch is retained. After skeletonizing the binarized image, a single-pixel skeleton line with redundant branches is obtained, and the redundant branches are eliminated by comparing the branch lengths using DFS. A single-pixel skeleton line without redundant branches is obtained and then applied to the static parameter measurements of the nailfold capillary based on digital image processing, thereby effectively improving the measurement accuracy.


Results

Datasets

A total of 500 nailfold images were taken of 30 volunteers. Among the images, 203 were of high quality and were selected for use. These images were used to identify the distal blood vessels using the YOLOv5 model (30). Then, the identified blood vessels were segmented using the U-Net semantic segmentation model. Finally, the segmented images were binarized to obtain the target images.

Experimental platform

The experiment was conducted using the PyTorch (https://pytorch.org/) framework. Table 1 lists the software and hardware configuration parameters used.

Table 1

Software and hardware configuration parameters

Software/hardware Parameter/version
Operating system Windows 11
CPU Intel(R) Core(TM) i9-13900HX 2.20 GHz
GPU NVIDIA® RTX™ 4060 8G
PyTorch 2.1.1
CUDA 12.1

CPU, central processing unit; GPU, graphics processing unit; CUDA, compute unified device architecture.

Comparison experiment of redundant pixel points and redundant branches of skeleton line

We performed image thinning operations on 100 binarized images of nailfold capillary images to compare the Zhang-Suen algorithm, NFPSA, FPTA, and proposed algorithms. Among the 100 thinned images, we selected four images with “T” branches in all four algorithms, and we locally reconstructed and enlarged them at the same position, as shown in Figure 12.

Figure 12 The Zhang-Suen algorithm, NFPSA, FPTA, and proposed algorithm. The skeleton lines of the thinning blood vessels are differentiated at the “T” branches. (A1-A4), (B1-B4), (C1-C4), and (D1-D4) represent the four algorithms mentioned above for the comparison of the reconstructed images of four different blood vessels after thinning, respectively. Pixel enlargement reconstruction images were compared at the same location. To reflect the single-pixel difference, the redundant branches were not removed in this comparison, and the red dots represent the redundant pixel points. NFPSA, new fully parallel thinning algorithm; FPTA, fast parallel thinning algorithm.

As can be observed in Figure 12, the four algorithms use different skeletonization rules, which leads to differences in the reconstructed images of the four algorithms. We take the Zhang-Suen algorithm and NFPSA as examples. The Zhang-Suen algorithm processes an 8-neighborhood of pixels P per execution, whereas NFPSA processes a 20-neighborhood of pixels P. This leads to the aforementioned differences in the skeletonization of the two algorithms, as shown in the top regions of the tabs in Figure 12, A1,B1. Therefore, when skeletonizing the same blood vessel, different skeleton line algorithms have different processing steps at the same location. In addition, the Zhang-Suen algorithm ignores some details to preserve the raw image structure, which leads to the existence of redundant pixel points, the problem of excessive diagonal erosion (23), and a susceptibility to noise. Although the NFPSA eliminates some of the redundant pixel points of the Zhang-Suen algorithm and suppresses some of the interference of the noise, some of the redundant pixel points for the inflections have not yet been eliminated, presenting a reason for the differences in their skeleton lines. Therefore, the differences in the skeletonization rules used by different algorithms lead to differences in their reconstructed images. The Zhang-Suen algorithm, NFPSA, and FPTA failed to realize the single-pixel skeleton in the thinning process, and there are redundant pixels in the “T” branches. In addition, the Zhang-Suen algorithm and NFPSA created non-single-pixel skeletons for the redundant pixels at the corners to ensure connectivity, as shown in Figure 12, A1,B1. In contrast, the proposed algorithm successfully removed the redundant pixels at the “T” branches, as shown in Figure 12, D1-D4, by adding new deletion and restoration templates, handling the corner pixels better, and realizing a single-pixel skeleton while guaranteeing connectivity. Therefore, our algorithm fulfills the requirement of a single-pixel skeleton for nailfold capillary skeleton lines.

Next, we compared the effects of the four algorithms on redundant branch processing after the image thinning of the nailfold capillary. We selected four representative images of 100 nailfold capillary binarization images with edge noise and abnormal segmentation cracks and used the Zhang-Suen algorithm, NFPSA, FPTA, and proposed algorithms to carry out thinning operations. Figure 13 shows the obtained skeleton lines.

Figure 13 Comparison of skeleton lines after vascular thinning by the Zhang-Suen algorithm, NFPSA, FPTA, and proposed algorithm. NFPSA, new fully parallel thinning algorithm; FPTA, fast parallel thinning algorithm.

As shown in Figure 13, the proposed algorithm successfully removed all redundant skeleton lines with minimum connectivity, retained the skeleton lines with maximum connectivity, and removed the redundant branches that were present in the remaining three algorithms. In summary, the proposed algorithm can obtain a single-pixel and redundant branch-free skeleton line of the nailfold capillary, which proves the applicability of our algorithm for calculating the static nailfold capillary parameters.

Comparison of static parameter measurements

As shown in Figure 12, differences exist in the structures of the skeleton lines of the four algorithms, and these differences are mainly reflected in the redundant branches with redundant pixel points. Applying these skeleton lines with redundant branches and redundant pixel points to the subsequent pipe diameter calculation will affect its calculation accuracy. The results in Table 2 show that the accuracy of the nailfold static parameter is lower because of the presence of redundant pixels and redundant branches in the skeleton lines obtained by the other three algorithms. The method employed in this study removes the redundant branches and redundant pixel points, and it preserves the original structure of the blood vessels, thus improving the accuracy of the measurements of the static parameters of the nailfold capillaries. Therefore, redundant branches and redundant pixel points lead to lower computational accuracy. Since the Zhang-Suen algorithm, NFPSA, and FPTA have more redundant branches and redundant pixel points, they are unable to obtain the slope of the blood vessels via skeleton line fitting for subsequent calculations under the static parameter measurement methods for nailfolds that are based on digital image processing. Hence, only the parameter values for 89, 89, and 85 blood vessels were successfully calculated, and this was with lower measurement accuracy. The static parameter measurement method of nailfolds based on digital image processing that was employed in this study was able to calculate the static parameter values of 100 blood vessels with higher accuracy than those of other methods. The RMSE (µm) values of the apical, arterial limb, and venous limb were 0.794, 0.756, and 0.830, respectively, all of which were less than 1.

Table 2

Comparison of RMSE (µm) values after applying four algorithms to static parameter calculation

Algorithm Total vessels/successfully calculated vessels Apical RMSE Arterial limb RMSE Venous limb RMSE
Zhang-Suen 100/89 18.077 4.812 10.575
NFPSA 100/89 15.993 7.145 20.525
FPTA 100/85 18.721 5.045 9.198
Proposed 100/100 0.794 0.756 0.830

RMSE, root mean square error; NFPSA, new fully parallel thinning algorithm; FPTA, fast parallel thinning algorithm.


Discussion

We compared the results of the static parameter calculations on 100 binarized nailfold capillary images obtained by the proposed algorithm for skeleton lines, combined with a digital image processing-based method of static nailfold capillary parameter measurements, with those obtained via a manual measurement method. That is, the static parameter data obtained via the manual method were compared with the data calculated using the proposed algorithm. A professional nailfold capillary surveyor performed two measurements to obtain the average value, and the difference data between the two methods were obtained. The measurements of the gold standard were obtained by semi-automatic labeling by professionals using commercial software, for which at least 10 positions of the canal diameter were measured and averaged due to the short top region of the collaterals, and for the arterial branches and venous branches, the canal diameter was labeled and averaged at 10–30 positions depending on their length (this fetching was carried out on a computer with a 24-inch, 1,080 P resolution). The interval between each location should be the same to ensure the average value). The detailed data are presented in the Appendix 1. After taking the absolute values of the differences, the error scatter plots corresponding to the apical diameter, arterial limb, and venous limb were obtained, as shown in Figure 14.

Figure 14 Scatter plot of the error of the apical diameter, arterial limb diameter, and venous limb diameter obtained by applying the proposed algorithm to the static nailfold capillary parameter measurement based on digital image processing versus manual computation.

We can observe from Figure 14 that the errors calculated for the apical diameter, arterial limb diameter, and venous limb diameter were smaller than those of the manually measured values. To evaluate the measurement accuracy, we calculated the RMSE of the apical diameter, arterial limb diameter, and venous limb diameter as 0.794, 0.756, and 0.830 µm, respectively. Thus, applying our proposed single-pixel and non-redundant branching skeleton line to the measurement of static nailfold capillary parameters based on digital image processing can significantly improve the measurement accuracy, which is important for the clinical measurement of nailfold capillary static parameters.

In addition, the method employed in this study has currently been applied only to normal volunteers, and the clinical utility of the method is being tested in partner hospitals. The nailfold capillary characteristics of the vessels provided for measurement by 30 volunteers were reported according to the nailfold capillary characterization criteria provided by the Scleroderma Clinical Trials Consortium (SCTC) and the European League Against Rheumatism (EULAR) Rheumatic Disease Microcirculation Study Group (31). Of the vessels measured manually in this study, 59 were normal capillaries, and 41 were dilated capillaries. Among the vessels measured using the method proposed in this study, 51 were normal capillaries, and 49 were dilated capillaries. Of these, nine normal capillaries were considered dilated capillaries, and one dilated vessel was considered a normal capillary. The accuracy of the method proposed in this study was calculated to be 90% (Eq. [2]). Hence, the proposed method has high sensitivity and specificity for the measurement of normal nailfold capillaries. In addition, the proposed method is applicable to hairpin vessels and malformed vessels of giant, meandering, and other (32) types of hairpins, but it is not applicable to severely malformed vessels, which presents a direction for future research.

The method proposed in this study aims to improve the accuracy of the measurement of static parameters of nailfold capillaries, but the method is limited to the vessel morphology only and not the clinical site. Therefore, for different clinical sites, we believe that vessels with the required morphology can be calculated with the corresponding diameters.


Conclusions

Nailfold capillary static parameters are important for analyzing the health of the human body, but the traditional manual measurement method is time consuming and expensive. A commonly used automated measurement method involves calculating them through the skeleton line. However, current skeleton thinning algorithms may be non-single-pixel and have redundant branches, which may lead to a reduction in measurement accuracy. Therefore, in this study, we have proposed a single-pixel and non-redundant branching-based skeleton line extraction algorithm for the nailfold capillary. The algorithm obtains a single-pixel skeleton line without redundant branches by adding new deletion and restoration templates and combining them with the DFS method. The static parameter values of the nailfold capillary were calculated by combining them with the static parameter measurement method based on digital image processing. Experiments showed that the RMSE of the labeled apical diameter, arterial limb diameter, and venous limb diameter were 0.794, 0.756, and 0.830 µm, respectively, when the calculated results were compared with those of the manual calculations. According to the accuracy formula, the accuracy of the method in this study is 90%. The P values of the algorithmic and manual measurements were calculated to P<0.001, indicating that the difference in the measurements of the proposed algorithm is statistically significant. Therefore, the method in this study has high sensitivity and specificity for the measurement of normal nailfold capillaries. In conclusion, the proposed algorithm could obtain the single-pixel skeleton line without redundant branches, thereby improving the nailfold static parameter measurement accuracy. These results are important for the clinical measurement of nailfold capillary static parameters. In the future, the calculation of more malformed vessels will be optimized to improve the calculation accuracy further.


Acknowledgments

We thank the 30 volunteers and the nailfold experts for their contributions to this study.

Funding: This work was supported by the Guangzhou Key Field R&D Plan Project (No. 2024B03J0029), Guangdong Provincial Key Field R&D Plan Project (No. 2020B1111120004), National Natural Science Foundation of China (No. 62075042), Guangdong-Hong Kong-Macao Joint Laboratory for Intelligent Micro-Nano Optoelectronic Technology (No. 2020B1212030010), and the 2022 Academic Fund of Foshan University.


Footnote

Conflicts of Interest: All authors have completed the ICMJE uniform disclosure form (available at https://qims.amegroups.com/article/view/10.21037/qims-24-847/coif). The other authors have no conflicts of interest to declare.

Ethical Statement: The authors are accountable for all aspects of the work in ensuring that questions related to the accuracy or integrity of any part of the work are appropriately investigated and resolved. This study was conducted in accordance with the Declaration of Helsinki (as revised in 2013). As the nailfold study was non-invasive, the requirement for ethical approval for this study was waived by the Ethics Committee of Foshan University. Written informed consent was provided by each volunteer for all vascular images in the study.

Open Access Statement: This is an Open Access article distributed in accordance with the Creative Commons Attribution-NonCommercial-NoDerivs 4.0 International License (CC BY-NC-ND 4.0), which permits the non-commercial replication and distribution of the article with the strict proviso that no changes or edits are made and the original work is properly cited (including links to both the formal publication through the relevant DOI and the license). See: https://creativecommons.org/licenses/by-nc-nd/4.0/.


References

  1. Neubauer-Geryk J, Wielicka M, Myśliwiec M, Zorena K, Bieniaszewski L. The Relationship between TNF-a, IL-35, VEGF and Cutaneous Microvascular Dysfunction in Young Patients with Uncomplicated Type 1 Diabetes. Biomedicines 2023;11:2857. [Crossref] [PubMed]
  2. Yuan Y, Dong M, Wen S, Yuan X, Zhou L. Retinal microcirculation: A window into systemic circulation and metabolic disease. Exp Eye Res 2024;242:109885. [Crossref] [PubMed]
  3. Güven G, Uz Z, Hilty MP, Bilecenoğlu B, Akin Ș, Ince Y, Ince C. Morphologic Mapping of the Sublingual Microcirculation in Healthy Volunteers. J Vasc Res 2022;59:199-208. [Crossref] [PubMed]
  4. Ye Q, Yin H, Lin J, Liang J, Xie M, Ye C, Zhou B, Huang A, Wu Z, Li X, Wu Y. Improved nested U-structure for accurate nailfold capillary segmentation. Microvasc Res 2024;154:104680. [Crossref] [PubMed]
  5. Sáez-Comet L, Fanlo-Mateo P, Gracia-Tello B. Med Clin (Barc) 2020;155:509-10. [Crossref] [PubMed]
  6. Corliss BA, Doty RW, Mathews C, Yates PA, Zhang T, Peirce SM. REAVER: A program for improved analysis of high-resolution vascular network images. Microcirculation 2020;27:e12618. [Crossref] [PubMed]
  7. Nirmala K, Naveen P, Farazallah M, Raj SAK. Study of microvascular morphology from optical image of nailfold capillary using image processing techniques. 2022 International Conference on Futuristic Technologies (INCOFT), Belgaum, India, 2022:1-5.
  8. Gracia Tello B, Ramos Ibañez E, Fanlo Mateo P, Sáez Cómet L, Martínez Robles E, Ríos Blanco JJ, Marí Alfonso B, Espinosa Garriga G, Todolí Parra J, Ortego Centeno N, Callejas Rubio JL, Freire Dapena M, Marín Ballvé A, Selva-O’Callaghan A, Guillén Del Castillo A, Simeón Aznar CP, Fonollosa Pla V. The challenge of comprehensive nailfold videocapillaroscopy practice: a further contribution. Clin Exp Rheumatol 2022;40:1926-32. [Crossref] [PubMed]
  9. Zhang J, Wu F, Chang W, Kong D. Techniques and Algorithms for Hepatic Vessel Skeletonization in Medical Images: A Survey. Entropy (Basel) 2022;24:465. [Crossref] [PubMed]
  10. Fu Z, Fu Z, Fang Z, Wang Z, Fei J, Xie R, Han H. Prior skeleton based online deep reinforcement learning for coronary artery centerline extraction. Proc Inst Mech Eng H 2023;237:557-70. [Crossref] [PubMed]
  11. Pan J, Zhang J, Luo S, Zhang J, Liang Y. Automatic annotation of liver computed tomography images based on a vessel skeletonization method. Int J Imaging Syst Technol 2020;30:704-15.
  12. Kalutantirige FC, He J, Yao L, Cotty S, Zhou S, Smith JW, Tajkhorshid E, Schroeder CM, Moore JS, An H, Su X, Li Y, Chen Q. Beyond nothingness in the formation and functional relevance of voids in polymer films. Nat Commun 2024;15:2852. [Crossref] [PubMed]
  13. Zhang TY, Sue CY. A fast parallel algorithm for thinning digital patterns. Commun ACM 1984;27:236-9.
  14. Li Z, Yin C, Zhang X. Crack Segmentation Extraction and Parameter Calculation of Asphalt Pavement Based on Image Processing. Sensors (Basel) 2023;23:9161. [Crossref] [PubMed]
  15. ChangHDiaoZWangZQiQ. Vascular segment bifurcation detection and key point calculation based on CT radiomics. doi: .
  16. Nazarkevych M, Dmytruk S, Hrytsyk V, Vozna O, Kuza A, Shevchuk O, Voznyi Y, Maslanych I, Sheketa V. Evaluation of the effectiveness of different image skeletonization methods in biometric security systems. Int J Sensors Wireless Commun Control 2021;11:542-52.
  17. Jang BK, Chin RT. One-pass parallel thinning: analysis, properties, and quantitative evaluation. IEEE Transactions on Pattern Analysis and Machine Intelligence 1992;14:1129-40.
  18. Wang RZ, Zhao YR, Ji TH, Liu LP. Fingerprint refinement model based on improved OPTA. J Comput (Taiwan) 2020;31:274-83.
  19. Ma J, Ren X, Liu Y, Tsviatkou VY, Kanapelka VK. An Improved Adaptive Thinning Framework. Eng Lett 2022;30.
  20. Zheng Y, Ren H. Research of ESPI Stripe Skeleton Line Extraction Based on Improved Fast Parallel Algorithm. Frontiers Comput Intell Syst 2024;7:71-4.
  21. Chen X, Chen LF, Hong H. Application of improved Zs refinement algorithm to FPc defect location. Sci Technol (Nat Sci Ed) 2023;38:42-8.
  22. Mou SM, Du HY, Su P, Cha XH, Chen GY. A New improved fast parallelthinning algorithm. Microelectron & Comput 2013;30:53-5.
  23. Ma J, Ren X, Tsviatkou VY, Kanapelka VK. A novel fully parallel skeletonization algorithm. Pattern Anal Applic 2022;25:169-88.
  24. El Miedany Y, Ismail S, Wadie M, Hassan M. Nailfold capillaroscopy: tips and challenges. Clin Rheumatol 2022;41:3629-40. [Crossref] [PubMed]
  25. Dong LB, Wei YZ, Lan GP, Chen JT, Xu JJ, Qin J, An L, Tan HS, Huang YP. High resolution imaging and quantification of the nailfold microvasculature using optical coherence tomography angiography (OCTA) and capillaroscopy: a preliminary study in healthy subjects. Quant Imaging Med Surg 2022;12:1844-58. [Crossref] [PubMed]
  26. Ronneberger O, Fischer P, Brox T. U-Net: Convolutional Networks for Biomedical Image Segmentation. In: Navab N, Hornegger J, Wells W, Frangi A. editors. Medical Image Computing and Computer-Assisted Intervention – MICCAI 2015. Lecture Notes in Computer Science, Springer, 2015;9351:234-41.
  27. Cai S, Tian Y, Lui H, Zeng H, Wu Y, Chen G. Dense-UNet: a novel multiphoton in vivo cellular image segmentation model based on a convolutional neural network. Quant Imaging Med Surg 2020;10:1275-85. [Crossref] [PubMed]
  28. Chen J, Shen X, Zhao Y, Qian W, Ma H, Sang L. Attention gate and dilation U-shaped network (GDUNet): an efficient breast ultrasound image segmentation network with multiscale information extraction. Quant Imaging Med Surg 2024;14:2034-48. [Crossref] [PubMed]
  29. Wang X, Feng C, Huang M, Liu S, Ma H, Yu K. Cervical cancer segmentation based on medical images: a literature review. Quant Imaging Med Surg 2024;14:5176-204. [Crossref] [PubMed]
  30. Yin H, Wu Z, Huang A, Luo J, Liang J, Lin J, Ye Q, Xie M, Ye C, Li X, Wu Y. Automated nailfold capillary density measurement method based on improved YOLOv5. Microvasc Res 2023;150:104593. [Crossref] [PubMed]
  31. Smith V, Herrick AL, Ingegnoli F, Damjanov N, De Angelis R, Denton CP, et al. Standardisation of nailfold capillaroscopy for the assessment of patients with Raynaud’s phenomenon and systemic sclerosis. Autoimmun Rev 2020;19:102458. [Crossref] [PubMed]
  32. Smith V, Ickinger C, Hysa E, Snow M, Frech T, Sulli A, Cutolo M. Nailfold capillaroscopy. Best Pract Res Clin Rheumatol 2023;37:101849. [Crossref] [PubMed]
Cite this article as: Zhou B, Yin H, Wu Y, Ye Q, Lin J, Ye C, Xie M, Li X, Bin W, Yang Z. A single-pixel and non-redundant branching-based algorithm for nailfold capillary skeleton line extraction. Quant Imaging Med Surg 2024;14(10):7442-7458. doi: 10.21037/qims-24-847

Download Citation