# Resolution-Free Accurate DNA Contour Length Estimation from Atomic Force Microscopy Images

Authors: Peter I. Chang; Ming-Chi Hsaio
Journal: Scanning
 (2019)

---

## Abstract

This research presented an accurate and efficient contour length estimation method developed for DNA digital curves acquired from Atomic Force Microscopy (AFM) images. This automation method is calibrated against different AFM resolutions and ideal to be extended to all different kinds of biopolymer samples, encompassing all different sample stiffnesses. The methodology considers the digital curve local geometric relationship, as these digital shape segments and pixel connections represent the actual morphology of the biopolymer sample as it is being imaged from the AFM scanning. In order to incorporate the true local geometry relationship that is embedded in the continuous form of the original sample, one needs to find this geometry counterpart in the digitized image. This counterpart is realized by taking the skeleton backbone of the sample contour and by using these digitized pixels’ connection relationship to find its local shape representation. In this research, one uses the 8-connect Freeman Chain Code (CC) to describe the directional connection between DNA image pixels, in order to account for the local shapes of four connected pixels. The result is a novel shape number (SN) system derived from CC, which is a fully automated algorithm that can be applied to DNA samples of any length for accurate estimation, with efficient computational cost. This shape-wise consideration is weighted to modify the local length with great precision, accounting for all the different morphologies of the biopolymer sample, and resulted with accurate length estimation, as the error falls below 0.07%, an order of magnitude improvement compared to previous findings.


---

## Body

## 1. Introduction

The Atomic Force Microscopy (AFM) system has the ability to probe samples at the nanometer scale, owing to its ability in sensing the sample surface to resolve force interaction at the pico-Newton level [1]. This feature makes AFM systems a useful imaging device in the field of nanotechnology, molecular biology, and many others. It is well known in AFM’s biological application to image biopolymers thanks to its ability to image in liquid, the biopolymer’s natural environment [2].One very interesting characteristic is the length of a single DNA strand, denoted aslc. This contour length can be applied to identify genome editing results and other application outcomes [3]. And accuracy in getting lc correct is essential at this scale, as there is small room for error in genome editing, since one base-pair distance for DNA is only 0.34 nm. Thus, AFM images of DNA samples provide means for such lc studies on accurate DNA length estimation, like the image illustrated here in Figure 1.Figure 1
DNA image acquired by the atomic force microscopy system [4].There are two ways in findinglc from AFM images. One is by manual fitting, and the other is by automatic skeleton tracing with image processing. Fitting typically relies on human operators picking specific positions along the DNA contour by examination on the acquired image, which relies on the trained eye of a scholar to map out the contour length lc [5, 6], as illustrated in Figure 2.Figure 2
(a) Linear/straight fitting with selected points manually. (b) Cubic spline fit utilizing the same manual selective points on the AFM image.
(a)
(b)On the other hand, the automaticlc estimation traces the DNA image along its backbone skeleton. This is done by thinning the strand image to its median position from the overall acquired outline and retaining only the skeleton of the DNA, as is illustrated in Figure 3.Figure 3
Illustration of DNA image preprocess to extract contour skeleton backbone. (a) Original AFM image cut-out with a single DNA sample. (b) Binary image acquired by thresholding the original. (c) Skeleton extracted by a repetitive thinning process to produce a single-pixel width, connected contour.
(a)
(b)
(c)The backbone extracted from the original AFM image is asingle-width connected pixel arranged with the following rule: only one adjacent pixel is allowed to connect to the central pixel to form a continuous contour, either directly (horizontal or vertical) or diagonally, as is illustrated in Figure 4.Figure 4
(a) 8-connect chain code connectivity from the center pixel, illustrating the connection code 0∼7 associated according to the adjacent pixel location. (b) An example of a single-pixel width biopolymer skeleton backbone used for deriving the chain code. Starting from head to tail codes: 07107565 and tail to head codes: 12134534.
(a)
(b)From this single width contour pixel arrangement, a continuouschain code (CC), defined as C=c1c2⋯cn, can be formed by tracing the connectedness of adjacent pixels from the skeleton’s one end to the other, according to the 8-connect Freeman’s eight directions [7].Researchers have been using the Freeman CC to estimatelc, by counting the number of even and odd occurrences along the DNA skeleton, which is to trace along the chain code, C=ci,i=1∼n, and tally up the occurrences of even number chain codes ne as well as its odd occurrences no.Since the even chain code connects adjacent pixels directly (vertically/horizontally), and the odd CC connects diagonally, one estimateslc first by finding the Euclidean length (norm) of all the pixel center connections and then multiply the pixel resolution r to find lc. This is defined as the Freeman estimator LF=rne+2no. [8].However,LF lacks the accuracy that is required in these microscopy systems. Thus, there are researches that made modifications to LF. These include the Kupla estimator LK and the corner estimator LC. LK modified the diagonal √2 values due to digital slope inclination, and LC further accounts for tight turns geometrically. Thus, in the end LK and LC end up with different coefficients from LF [9].There were further researches to improvelc accuracy. One research smooths out the digitized pixilation of the contour skeleton backbone and applied a spatial Fourier transform on the image. Through tuning the Gaussian filter in 2D, a smother lc is estimated [10].Other than modifying the pixel connection Euclidian length, another research modifieslc by adjusting the pixel center coordinate representation xp. A weight k is added to modify the coordinate location by considering the three consecutive points with Xp=kxp−1−xp+xp+kxp+1−xp. This length estimator LP calculates lc according to the modified Xp [11].Anotherlc estimator is designed specifically for DNA strand samples, named LDNA. This estimator introduced a nominal coefficient for different DNA lengths and is defined as LDNA=rCfne+√2no, where Cf is inversely calculated from simulated lc data, so a table of Cf helps LDNA to match the expected value of lc [12].More recently, a machine learning approach utilized a feature extraction to fit different cubic spline segment occurrences with the following:horizontal, vertical, diagonal, perpendicular, variating height and thickness, as defined by nhorz,nvert,ndiag,nperp,nhtcv,ntkcv [13]. This machine learning estimator LML is trained to generate coefficients considering the abovementioned feature from known DNA lc.A summary table in Table1 provides a quick review of the abovementioned lc estimators.Table 1
Comparison of digital contour length methodology difference with biopolymer samples.
Author
Year
Estimator
Algorithm
Specific to DNA
Spisz et al. [8]
1998
Freeman estimatorLF
LF=rne+√2no
Rivetti and Codeluppi [9]
2001
KuplaLK and corner LC estimator
LK=r0.948ne+1.343no, LC=r0.980ne+1.406no−0.091nc
✓
Sanchez-Sevilla et al. [10]
2002
Curvature filtering
Coordinate transform to complex plane with Fourier transform
Ficarra et al. [11]
2005
Pixel coordinate
Relocation of pixel representative coordinateX
Rivetti [12]
2009
DNA estimatorLDNA
LDNA=rCfne+√2no, Cf=lc/LF
✓
Sundstorm et al. [13]
2012
Machine learning
LML=∑nhorz,nvert,ndiag,nperp,nhtcv,ntkcv
✓In this paper, the authors propose an estimator based on the DNA imaged contour shape, thus having the nameShape estimator LS, where LS is designed to be robust to image resolution and only uses minimal computational resource. This is achieved by considering the neighboring shape of the original two-pixel connection inspired from LF, but as all the DNA local morphology shapes are considered for estimating lc, the resultant accuracy is shown to improve by more than an order of magnitude.Detailed methodology of theLS estimator is explained in Section 2, starting from the general image preprocessing to the identification of twelve local 4-pixel segment configuration shapes. Then, the 12-shape correction coefficients k1∼k12 are calibrated in Section 3, with different resolutions considered. Finally, the lc values for LS are compared with LDNA and LF in Section 4.


## 2. Contour Length Estimation with Local Shape Consideration

LS estimation essentially takes into account the local shape considerations. As two neighboring pixels are connected together in this AFM image, the overall shape around the two connected pixels represents different local lengths as this DNA morphology is observed. In a tight turn; i.e., a “kink,” this local length will certainly be longer then a smooth linear local profile.Thus,LS considers the two additional pixels extending from the center two-pixel connection and identifies the different 4-pixel segmented shapes surrounding along the DNA skeleton backbone. Then, LS makes shape-corrected length adjustments, by multiplying the local shape’s corresponding coefficient to adjust for the estimated lc. It can be observed that the extension of this segmented elemental shape is not limited to 4 pixels, as with more pixels such as a 5-pixel segment can also be considered. However, due to the trade-off for computational cost and performance, this research investigates the LS with 4-pixel elements.


### 2.1. Pixel Resolution and Image Preprocessing

A standard preprocess extracts the DNA image into thelc’s skeleton backbone, by thinning the DNA strand into the centerline of the biopolymer. This research’s automatic image process is illustrated here in Figure 5.Figure 5
DNA image preprocess. (a) Original image, (b) binary transform, (c) image filtering, (d) image thresholding, (e) thinning and debranching and (f) final result compared with the original image.
(a)
(b)
(c)
(d)
(e)
(f)First, the DNA image is prefiltered and mapped into a binary image with thresholding. Then, further, 2-D filters remove isolated pixel islands, ensuring that a single DNA contour is captured. And finally, an iterative debranch thinning morphology is applied to find the skeleton backbone that can be chain-coded [14].It is well known that AFM systems have a tip broadening effect when imaging, which expands the DNA strand width to a larger value. A repeated thinning preprocess in average converges the single-width pixel contour, towards the mid-point of the DNA strand automatically, given an AFM image with enough resolution across the DNA width [15].


### 2.2. Identification of 4-Pixel Segment Shape Connectivity

Given the resultant single-width pixelsP=pi,i=0∼n for the contour’s skeleton backbone, its CC C=cii=1∼n is coded from one end to the other. Note that this research utilizes the 8-connect chain code, resulting in integers ranging from 0∼7 for all ci and that ci is one off from pi, as there are n connections between n+1 pixels.With the 4-pixel segment setup, there are up to a total of 64 ways44 to connect the 4 pixels into single-pixel width arrangements. This research paper has fully outlined all the possibilities, and the full table of all 64 different single-width 4-pixel segments is arranged in Figures 6 and 7. They are arranged by the assigned k1∼k12 types, with all the same types grouped together.Figure 6
Four-pixel segments of the shapes fork1∼k7, with their associated rotation and mirror alternatives.Figure 7
Four-pixel segments of the shapes fork8∼k12, with their associated rotation and mirror alternatives.It is clear that all the same types ofkj shape are grouped with the 4-pixel segment’s mirror and rotational images. Take for example the k8 shape, where the segment is rotated clockwise/counterclockwise for 90 degrees individually and mirrored on the y-axis, shown here in Figure 8.Figure 8
Rotational and mirror representation ofk8 shape 4-pixel segment.Having thesek1∼k7 segment shapes distinguished, the original inner 2-pixel connection’s distance can now be corrected, by considering the outward extended 4-pixel segment shape. This would take into account the local geometric features according to its categorized shape. Since the skeleton backbone is composed of consecutive 4-pixel segments all along its contour, when tracing from one end to the other, this research makes sure that the LS estimator identifies every 4-pixel segment to the twelve unique kj shapes, as shown in Figure 9.Figure 9
Geometric connectivity of the twelve independentk1∼k12 shapes for 4-pixel segments. The inner two direct connections (horizontal/vertical and diagonal) are connected with two additional outward pixels, accounting for the local 2D morphology change.


#### 2.2.1. Chain Code, Shape Number, and Identifier

In order to identify a skeleton backbone’s different 4-pixel segment shapes along the contour, this research utilizes its chain code, formed as a series of integer number, and developed a novel algorithm called the shape number (SN) identification, labeledS, and uses it to derive an exclusive identifier (ID) number for matching the abovementioned unique k1∼k12 shapes.A typical CC collection,C=c1c2c3⋯cn−2cn−1cn, is a series of integers made from 0∼7, provided the n+1single-width skeleton backbone pixels P=p0p1p2··pn−1pn. Note that C is one-off from P and that pis is numbered from 0∼n. This research emphasizes the general ability to distinguish any skeleton backbone, and while for any given backbone, it creates a set of two distinct CC for every skeleton, due to starting the connection from different ends of the pixel chain. The algorithm will demonstrate the ability to converge on the distinguished 4-pixel segment shapes.As the algorithm needs to continuously identify the 4-pixel segments throughout the contour backbone, a rolling window starts from any end ofC and collects the following n-segments (Figure 10)
(1)Seg=seg1,seg2,⋯,segi,⋯,segn.Figure 10It is clear that eachsegi segment is comprised of three consecutive chain codes ci−1,ci,ci+1, since a 4-pixel segment consists of three connections. With the exception of the first and last segments of the contour skeleton, where there are not enough pixels to form a 4-pixel segment, thus the algorithm just takes the original two connecting pixels, i.e., the original c1 or cn. The pixel/geometric representation of a rolling window CC segmentation is demonstrated in the Figure 11.Figure 11
Consecutive determination of the 4-pixel segment shape number through the rolling window. Two sets of chain code provided HTCC (head to tail) and THCC (tail to head), with their associated local segment CC, also bidirectional: SECC (start to end) and ESCC (end to start), which leads to their derived SESN (start to end) and ESSN (end to start).Notice that the rolling window inC moves the 4-pixel segment consecutively from Head to Tail, and each segment can be coded as segi=ci−1,ci,ci+1, from i=2∼n−1, excluding Headi=1 and Taili=n.This research now defines a shape number (SN), derived from each of the rolling segments as(2)Sseq=sseg2sseg3sseg4⋯ssegn−3ssegn−2ssegn−1.In short,S=ssegi,i=2∼n−1 is a collection of the ordered cyclic difference from each segment’s continuous 3 chain codes. Thus, for each segment, SN is composed of three integer numbers as Ssegi=si−1,si,si+1, defined as
(3)ssegi=si−1=ci−1−ci+1,si=ci−ci−1,si+1=ci+1−ci,.Since all CC is comprised of integers from0∼7, SNs si are also retained between 0∼7. Thus, whenever si is derived as negative, we automatically take 8’s compliment to correct it, with si=si+8 if si<0.One such example of SN derived is illustrated in the lower part of Figure11, where the SN is calculated from both directions of the chain code inside each segment: the Start to End Chain Code (SECC) as well as the End to Start Chain Code (ESCC). It is obvious that SECC and ESCC are different; therefore, the resulting Start to End Shape Number (SESN) and End to Start Shape Number (ESSN) are also derived different, albeit representing the exact same segment.To ensure exclusive identification on the same 4-pixel segment, for both bidirectional CC and SN coding, in addition to all the same shape mirroring and rotational configuration, a simple unique identifier (ID) number is needed to match the rolling 4-pixel segments to thek1∼k12 shapes.


#### 2.2.2. Unique Identifier (ID) Matching

In order to deal with such bidirectional, mirroring, and rotational segment ambiguity, the following rule has been applied to ensure a single SN identifier (ID) to match explicitly onek1∼k12 shape, for any given random shape number in the lengthy lc contour skeleton backbone.This is provided by examining all the SESN and ESSN for all thek1∼k12 shapes and capturing the combinatory relative adjacent arrangements from the 4-pixel segment geometry, i.e., reordering the representative numerals of SN to allow for the direct/diagonal connections, to make representation of the given shape.Since the rolling window segmental SNssegi will fall into the recognizable k1∼k12 shapes, the ID number can be derived from the known segment numbers as specified in Figure 9. Thus, the identifier is a unique number for each of the shape kj,j=1∼12, such that when the rolling window covers a 4-pixel segment, by performing this numeral operation (algorithm), one will find the identifier.The following Algorithm (1) outlines the unique identifier (ID)’s reorder methodology for all of the k1∼k12 shapes.Algorithm 1 : ID number derived from shape number.
Require:kj shapes, j = 1 ∼ 12 and their respective SESN or ESSN skj = s1s2s3
Ensure: Unique ID numbers for all k1 ∼ k12 shapes.
1:forj = 1 ∼ 12 do
2:  take thekj’s SN: s = {s1, s2, s3}
3:ifs1 ≥ 4 then
4:   take 8’s complement for this sequence ofs, for bi-direction and mirroring re-ordering, but
5:ifs2 = 0 or s3 = 0 then
6:    keeps2 or s3 zero
7:else
8:s2 = 8 − s2 and s3 = 8 − s3
9:  end if
10: end if
11: Take the newS (with s1 ≤ 4), and further re-order s2 and s3, to match the rotational varieties, by
12:ifs2 > s3then
13:  switchs2 with s3
14:else
15:  retain original order
16:end if
17: Find final ID number for given SNskj
18: end forThe rules for the identifier are stated as follows:Unique—there exists one unique ID number for each of k5, k8, k9, and k12 shapes.Common—there exists common ID numbers for the following pairs: k1,k2, k3,k4, k6,k7, and k10,k11.Distinguish—the aforementioned sets are discerned by the connection type of the center pixels, {direct or diagonal}, by checking its original CC number ci, with even/odd numbers representing direct/diagonal, respectively.Take for example thek8SN, as there exist four different SN combinations: 116, 772, 727, and 161 form shaping of the eight different segments, as shown in the last row of Figure 8, due to coding of all the different mirrors/rotations and bidirectional CC.After performing the abovementioned ID algorithm, we are able to uniquely transform all SN to the same identifier (ID) number: 116, as shown from Table2.Table 2
Example ID number retrieval fork8 shape numbers.
Originalk8 SN
116
772
727
161
Step one
Checks1, take 8’s complement if s1>4
116
116⎵8’scomp
161⎵8’scomp
161
Step two
Reorders2 and s3 digits when s2>s3
116
116
116⎵reorder
116⎵reorder
Final uniquek8 ID
116Finally, the algorithm arrives withk5, k8, k9, and k12 matching up with their respective ID numbers: 026, 116, 206, and 367. In addition, the algorithm matches the pairs k1,k2, k3,k4, k6,k7, and k10,k11 commonly to 000, 017, 107, and 277, respectively. In order to distinguish between the pairs, the original {direct, diagonal} connection is once again used: by checking if the original ci is either even or odd, then it can be trivially matched to the correct shape in the pair Table 3.Table 3
ID number derivation from SN for allk1∼k12 shapes.
Shape
k1
k2
k3
k4
k5
k6
k7
k8
k9
k10
k11
k12
ID number
000even
000odd
017even
017odd
026
107even
107odd
116
206
277even
277odd
367
Original SN
000
000
017071
017071
026062
107170
107170
116161
206260
277611
277611
367376
701
701
727
602
512
710
710
772
620
521All the ID numbers are listed fork1∼k12 shapes here in Figure 9, derived from all the 64 shapes in Figures 6 and 7. Note that the common ID numbers are annotated with (-even/-odd) for distinguishing.


### 2.3.kj Parameter Equation Representation

Now that the unique ID number is obtained, it is then ready to amass a collection of the different samples of a givenlc length, in order to retrieve the correction parameter for the different kjs, provided with the same DNA characteristics, i.e., with a fixed lp=50nm.


#### 2.3.1. Length Calculation with Coefficients

This is first done by identification on one individual DNA sample’s contour, by summing up each shape componentkj’s occurrence contribution for its segment’s connection length. In other words, one identifies along the skeleton backbone and tallies the individual occurrences of the twelve kjs, multiplied by the corresponding connection length (1 or √2 pixel length) along with its correction coefficient. This makes the sum of all the length contributions equal to the contour length lc as
(4)lc=r∑j=112nkjkjlkj+lH+lT,where nkj,j=1∼12 is the number of occurrences of the type kj shapes, provided from the identification along the skeleton backbone. kj is the correction coefficient, and lkj is the connection length (either 1 or √2 according to the kj shape). lH and lT are the head and tail length, respectively, and finally r is the AFM image pixel resolution.From Figure9, lk1∼lk12 length is ordered in Table 4.Table 4
Connection length forlk1∼lk12.
Shape
k1
k2
k3
k4
k5
k6
Length
1
√2
1
√2
√2
1
Shape
k7
k8
k9
k10
k11
k12
Length
√2
√2
√2
1
√2
√2


#### 2.3.2. Matrix Form for Inverse Calculation

The second step is to collect a sufficient amount of representation of this same type of biopolymer samples and list all the length equations based on these samples. The logic is that with multiple samples of the same kind, imaged under the same pixel resolution, thekj shapes collectively represent the same type of twist/turn, resulting in the same length contribution for the same class of biopolymers lc.Combining equation (4) with the associated lkj values in Table 4, we arrive at
(5)lm,c=rnm,k1k11+nm,k2k2√2+nm,k3k31+nm,k4k4√2+nm,k5k5√2+nm,k6k61+nm,k7k7√2+nm,k8k8√2+nm,k9k9√2+nm,k10k101+nm,k11k11√2+nm,k12k12√2+lm,H+lm,T,for any given backbone skeleton length lm,c, given the index m’th sample. Equation (5) can be represented with a matrix form, with
(6)rNDK+B=L,where
(7)N=n1,k1n2,k2⋯n1,k12n2,k1n2,k2⋯n2,k12⋮⋮⋱⋮nm,k1nm,k2⋯nm,k12,K=k1k2⋮k12,and(8)B=b1b2⋮bm,and(9)L=lc,1lc,2⋮lc,mprovided D=diag1,√2,1,√2,√2,1,√2,√2,√2,1,√2,√2 is a 12-by-12 square matrix, such that DK=k1,√2k2,k3,√2k4,√2k5,k6,√2k7,√2k8,√2k9,k10,√2k11,√2k12T.Note thatbm=lh,m+lt,m is the head and tail (boundary) connection length summation. Also note that N is an m-by-12 matrix, K is 12 by 1, and B and L are both m-by-1 matrices.The final procedure here is to derive matrixK using a standard linear regression and find the best fit for the k1∼k12 value. The final results are presented in the next section.


## 2.1. Pixel Resolution and Image Preprocessing

A standard preprocess extracts the DNA image into thelc’s skeleton backbone, by thinning the DNA strand into the centerline of the biopolymer. This research’s automatic image process is illustrated here in Figure 5.Figure 5
DNA image preprocess. (a) Original image, (b) binary transform, (c) image filtering, (d) image thresholding, (e) thinning and debranching and (f) final result compared with the original image.
(a)
(b)
(c)
(d)
(e)
(f)First, the DNA image is prefiltered and mapped into a binary image with thresholding. Then, further, 2-D filters remove isolated pixel islands, ensuring that a single DNA contour is captured. And finally, an iterative debranch thinning morphology is applied to find the skeleton backbone that can be chain-coded [14].It is well known that AFM systems have a tip broadening effect when imaging, which expands the DNA strand width to a larger value. A repeated thinning preprocess in average converges the single-width pixel contour, towards the mid-point of the DNA strand automatically, given an AFM image with enough resolution across the DNA width [15].


## 2.2. Identification of 4-Pixel Segment Shape Connectivity

Given the resultant single-width pixelsP=pi,i=0∼n for the contour’s skeleton backbone, its CC C=cii=1∼n is coded from one end to the other. Note that this research utilizes the 8-connect chain code, resulting in integers ranging from 0∼7 for all ci and that ci is one off from pi, as there are n connections between n+1 pixels.With the 4-pixel segment setup, there are up to a total of 64 ways44 to connect the 4 pixels into single-pixel width arrangements. This research paper has fully outlined all the possibilities, and the full table of all 64 different single-width 4-pixel segments is arranged in Figures 6 and 7. They are arranged by the assigned k1∼k12 types, with all the same types grouped together.Figure 6
Four-pixel segments of the shapes fork1∼k7, with their associated rotation and mirror alternatives.Figure 7
Four-pixel segments of the shapes fork8∼k12, with their associated rotation and mirror alternatives.It is clear that all the same types ofkj shape are grouped with the 4-pixel segment’s mirror and rotational images. Take for example the k8 shape, where the segment is rotated clockwise/counterclockwise for 90 degrees individually and mirrored on the y-axis, shown here in Figure 8.Figure 8
Rotational and mirror representation ofk8 shape 4-pixel segment.Having thesek1∼k7 segment shapes distinguished, the original inner 2-pixel connection’s distance can now be corrected, by considering the outward extended 4-pixel segment shape. This would take into account the local geometric features according to its categorized shape. Since the skeleton backbone is composed of consecutive 4-pixel segments all along its contour, when tracing from one end to the other, this research makes sure that the LS estimator identifies every 4-pixel segment to the twelve unique kj shapes, as shown in Figure 9.Figure 9
Geometric connectivity of the twelve independentk1∼k12 shapes for 4-pixel segments. The inner two direct connections (horizontal/vertical and diagonal) are connected with two additional outward pixels, accounting for the local 2D morphology change.


### 2.2.1. Chain Code, Shape Number, and Identifier

In order to identify a skeleton backbone’s different 4-pixel segment shapes along the contour, this research utilizes its chain code, formed as a series of integer number, and developed a novel algorithm called the shape number (SN) identification, labeledS, and uses it to derive an exclusive identifier (ID) number for matching the abovementioned unique k1∼k12 shapes.A typical CC collection,C=c1c2c3⋯cn−2cn−1cn, is a series of integers made from 0∼7, provided the n+1single-width skeleton backbone pixels P=p0p1p2··pn−1pn. Note that C is one-off from P and that pis is numbered from 0∼n. This research emphasizes the general ability to distinguish any skeleton backbone, and while for any given backbone, it creates a set of two distinct CC for every skeleton, due to starting the connection from different ends of the pixel chain. The algorithm will demonstrate the ability to converge on the distinguished 4-pixel segment shapes.As the algorithm needs to continuously identify the 4-pixel segments throughout the contour backbone, a rolling window starts from any end ofC and collects the following n-segments (Figure 10)
(1)Seg=seg1,seg2,⋯,segi,⋯,segn.Figure 10It is clear that eachsegi segment is comprised of three consecutive chain codes ci−1,ci,ci+1, since a 4-pixel segment consists of three connections. With the exception of the first and last segments of the contour skeleton, where there are not enough pixels to form a 4-pixel segment, thus the algorithm just takes the original two connecting pixels, i.e., the original c1 or cn. The pixel/geometric representation of a rolling window CC segmentation is demonstrated in the Figure 11.Figure 11
Consecutive determination of the 4-pixel segment shape number through the rolling window. Two sets of chain code provided HTCC (head to tail) and THCC (tail to head), with their associated local segment CC, also bidirectional: SECC (start to end) and ESCC (end to start), which leads to their derived SESN (start to end) and ESSN (end to start).Notice that the rolling window inC moves the 4-pixel segment consecutively from Head to Tail, and each segment can be coded as segi=ci−1,ci,ci+1, from i=2∼n−1, excluding Headi=1 and Taili=n.This research now defines a shape number (SN), derived from each of the rolling segments as(2)Sseq=sseg2sseg3sseg4⋯ssegn−3ssegn−2ssegn−1.In short,S=ssegi,i=2∼n−1 is a collection of the ordered cyclic difference from each segment’s continuous 3 chain codes. Thus, for each segment, SN is composed of three integer numbers as Ssegi=si−1,si,si+1, defined as
(3)ssegi=si−1=ci−1−ci+1,si=ci−ci−1,si+1=ci+1−ci,.Since all CC is comprised of integers from0∼7, SNs si are also retained between 0∼7. Thus, whenever si is derived as negative, we automatically take 8’s compliment to correct it, with si=si+8 if si<0.One such example of SN derived is illustrated in the lower part of Figure11, where the SN is calculated from both directions of the chain code inside each segment: the Start to End Chain Code (SECC) as well as the End to Start Chain Code (ESCC). It is obvious that SECC and ESCC are different; therefore, the resulting Start to End Shape Number (SESN) and End to Start Shape Number (ESSN) are also derived different, albeit representing the exact same segment.To ensure exclusive identification on the same 4-pixel segment, for both bidirectional CC and SN coding, in addition to all the same shape mirroring and rotational configuration, a simple unique identifier (ID) number is needed to match the rolling 4-pixel segments to thek1∼k12 shapes.


### 2.2.2. Unique Identifier (ID) Matching

In order to deal with such bidirectional, mirroring, and rotational segment ambiguity, the following rule has been applied to ensure a single SN identifier (ID) to match explicitly onek1∼k12 shape, for any given random shape number in the lengthy lc contour skeleton backbone.This is provided by examining all the SESN and ESSN for all thek1∼k12 shapes and capturing the combinatory relative adjacent arrangements from the 4-pixel segment geometry, i.e., reordering the representative numerals of SN to allow for the direct/diagonal connections, to make representation of the given shape.Since the rolling window segmental SNssegi will fall into the recognizable k1∼k12 shapes, the ID number can be derived from the known segment numbers as specified in Figure 9. Thus, the identifier is a unique number for each of the shape kj,j=1∼12, such that when the rolling window covers a 4-pixel segment, by performing this numeral operation (algorithm), one will find the identifier.The following Algorithm (1) outlines the unique identifier (ID)’s reorder methodology for all of the k1∼k12 shapes.Algorithm 1 : ID number derived from shape number.
Require:kj shapes, j = 1 ∼ 12 and their respective SESN or ESSN skj = s1s2s3
Ensure: Unique ID numbers for all k1 ∼ k12 shapes.
1:forj = 1 ∼ 12 do
2:  take thekj’s SN: s = {s1, s2, s3}
3:ifs1 ≥ 4 then
4:   take 8’s complement for this sequence ofs, for bi-direction and mirroring re-ordering, but
5:ifs2 = 0 or s3 = 0 then
6:    keeps2 or s3 zero
7:else
8:s2 = 8 − s2 and s3 = 8 − s3
9:  end if
10: end if
11: Take the newS (with s1 ≤ 4), and further re-order s2 and s3, to match the rotational varieties, by
12:ifs2 > s3then
13:  switchs2 with s3
14:else
15:  retain original order
16:end if
17: Find final ID number for given SNskj
18: end forThe rules for the identifier are stated as follows:Unique—there exists one unique ID number for each of k5, k8, k9, and k12 shapes.Common—there exists common ID numbers for the following pairs: k1,k2, k3,k4, k6,k7, and k10,k11.Distinguish—the aforementioned sets are discerned by the connection type of the center pixels, {direct or diagonal}, by checking its original CC number ci, with even/odd numbers representing direct/diagonal, respectively.Take for example thek8SN, as there exist four different SN combinations: 116, 772, 727, and 161 form shaping of the eight different segments, as shown in the last row of Figure 8, due to coding of all the different mirrors/rotations and bidirectional CC.After performing the abovementioned ID algorithm, we are able to uniquely transform all SN to the same identifier (ID) number: 116, as shown from Table2.Table 2
Example ID number retrieval fork8 shape numbers.
Originalk8 SN
116
772
727
161
Step one
Checks1, take 8’s complement if s1>4
116
116⎵8’scomp
161⎵8’scomp
161
Step two
Reorders2 and s3 digits when s2>s3
116
116
116⎵reorder
116⎵reorder
Final uniquek8 ID
116Finally, the algorithm arrives withk5, k8, k9, and k12 matching up with their respective ID numbers: 026, 116, 206, and 367. In addition, the algorithm matches the pairs k1,k2, k3,k4, k6,k7, and k10,k11 commonly to 000, 017, 107, and 277, respectively. In order to distinguish between the pairs, the original {direct, diagonal} connection is once again used: by checking if the original ci is either even or odd, then it can be trivially matched to the correct shape in the pair Table 3.Table 3
ID number derivation from SN for allk1∼k12 shapes.
Shape
k1
k2
k3
k4
k5
k6
k7
k8
k9
k10
k11
k12
ID number
000even
000odd
017even
017odd
026
107even
107odd
116
206
277even
277odd
367
Original SN
000
000
017071
017071
026062
107170
107170
116161
206260
277611
277611
367376
701
701
727
602
512
710
710
772
620
521All the ID numbers are listed fork1∼k12 shapes here in Figure 9, derived from all the 64 shapes in Figures 6 and 7. Note that the common ID numbers are annotated with (-even/-odd) for distinguishing.


## 2.2.1. Chain Code, Shape Number, and Identifier

In order to identify a skeleton backbone’s different 4-pixel segment shapes along the contour, this research utilizes its chain code, formed as a series of integer number, and developed a novel algorithm called the shape number (SN) identification, labeledS, and uses it to derive an exclusive identifier (ID) number for matching the abovementioned unique k1∼k12 shapes.A typical CC collection,C=c1c2c3⋯cn−2cn−1cn, is a series of integers made from 0∼7, provided the n+1single-width skeleton backbone pixels P=p0p1p2··pn−1pn. Note that C is one-off from P and that pis is numbered from 0∼n. This research emphasizes the general ability to distinguish any skeleton backbone, and while for any given backbone, it creates a set of two distinct CC for every skeleton, due to starting the connection from different ends of the pixel chain. The algorithm will demonstrate the ability to converge on the distinguished 4-pixel segment shapes.As the algorithm needs to continuously identify the 4-pixel segments throughout the contour backbone, a rolling window starts from any end ofC and collects the following n-segments (Figure 10)
(1)Seg=seg1,seg2,⋯,segi,⋯,segn.Figure 10It is clear that eachsegi segment is comprised of three consecutive chain codes ci−1,ci,ci+1, since a 4-pixel segment consists of three connections. With the exception of the first and last segments of the contour skeleton, where there are not enough pixels to form a 4-pixel segment, thus the algorithm just takes the original two connecting pixels, i.e., the original c1 or cn. The pixel/geometric representation of a rolling window CC segmentation is demonstrated in the Figure 11.Figure 11
Consecutive determination of the 4-pixel segment shape number through the rolling window. Two sets of chain code provided HTCC (head to tail) and THCC (tail to head), with their associated local segment CC, also bidirectional: SECC (start to end) and ESCC (end to start), which leads to their derived SESN (start to end) and ESSN (end to start).Notice that the rolling window inC moves the 4-pixel segment consecutively from Head to Tail, and each segment can be coded as segi=ci−1,ci,ci+1, from i=2∼n−1, excluding Headi=1 and Taili=n.This research now defines a shape number (SN), derived from each of the rolling segments as(2)Sseq=sseg2sseg3sseg4⋯ssegn−3ssegn−2ssegn−1.In short,S=ssegi,i=2∼n−1 is a collection of the ordered cyclic difference from each segment’s continuous 3 chain codes. Thus, for each segment, SN is composed of three integer numbers as Ssegi=si−1,si,si+1, defined as
(3)ssegi=si−1=ci−1−ci+1,si=ci−ci−1,si+1=ci+1−ci,.Since all CC is comprised of integers from0∼7, SNs si are also retained between 0∼7. Thus, whenever si is derived as negative, we automatically take 8’s compliment to correct it, with si=si+8 if si<0.One such example of SN derived is illustrated in the lower part of Figure11, where the SN is calculated from both directions of the chain code inside each segment: the Start to End Chain Code (SECC) as well as the End to Start Chain Code (ESCC). It is obvious that SECC and ESCC are different; therefore, the resulting Start to End Shape Number (SESN) and End to Start Shape Number (ESSN) are also derived different, albeit representing the exact same segment.To ensure exclusive identification on the same 4-pixel segment, for both bidirectional CC and SN coding, in addition to all the same shape mirroring and rotational configuration, a simple unique identifier (ID) number is needed to match the rolling 4-pixel segments to thek1∼k12 shapes.


## 2.2.2. Unique Identifier (ID) Matching

In order to deal with such bidirectional, mirroring, and rotational segment ambiguity, the following rule has been applied to ensure a single SN identifier (ID) to match explicitly onek1∼k12 shape, for any given random shape number in the lengthy lc contour skeleton backbone.This is provided by examining all the SESN and ESSN for all thek1∼k12 shapes and capturing the combinatory relative adjacent arrangements from the 4-pixel segment geometry, i.e., reordering the representative numerals of SN to allow for the direct/diagonal connections, to make representation of the given shape.Since the rolling window segmental SNssegi will fall into the recognizable k1∼k12 shapes, the ID number can be derived from the known segment numbers as specified in Figure 9. Thus, the identifier is a unique number for each of the shape kj,j=1∼12, such that when the rolling window covers a 4-pixel segment, by performing this numeral operation (algorithm), one will find the identifier.The following Algorithm (1) outlines the unique identifier (ID)’s reorder methodology for all of the k1∼k12 shapes.Algorithm 1 : ID number derived from shape number.
Require:kj shapes, j = 1 ∼ 12 and their respective SESN or ESSN skj = s1s2s3
Ensure: Unique ID numbers for all k1 ∼ k12 shapes.
1:forj = 1 ∼ 12 do
2:  take thekj’s SN: s = {s1, s2, s3}
3:ifs1 ≥ 4 then
4:   take 8’s complement for this sequence ofs, for bi-direction and mirroring re-ordering, but
5:ifs2 = 0 or s3 = 0 then
6:    keeps2 or s3 zero
7:else
8:s2 = 8 − s2 and s3 = 8 − s3
9:  end if
10: end if
11: Take the newS (with s1 ≤ 4), and further re-order s2 and s3, to match the rotational varieties, by
12:ifs2 > s3then
13:  switchs2 with s3
14:else
15:  retain original order
16:end if
17: Find final ID number for given SNskj
18: end forThe rules for the identifier are stated as follows:Unique—there exists one unique ID number for each of k5, k8, k9, and k12 shapes.Common—there exists common ID numbers for the following pairs: k1,k2, k3,k4, k6,k7, and k10,k11.Distinguish—the aforementioned sets are discerned by the connection type of the center pixels, {direct or diagonal}, by checking its original CC number ci, with even/odd numbers representing direct/diagonal, respectively.Take for example thek8SN, as there exist four different SN combinations: 116, 772, 727, and 161 form shaping of the eight different segments, as shown in the last row of Figure 8, due to coding of all the different mirrors/rotations and bidirectional CC.After performing the abovementioned ID algorithm, we are able to uniquely transform all SN to the same identifier (ID) number: 116, as shown from Table2.Table 2
Example ID number retrieval fork8 shape numbers.
Originalk8 SN
116
772
727
161
Step one
Checks1, take 8’s complement if s1>4
116
116⎵8’scomp
161⎵8’scomp
161
Step two
Reorders2 and s3 digits when s2>s3
116
116
116⎵reorder
116⎵reorder
Final uniquek8 ID
116Finally, the algorithm arrives withk5, k8, k9, and k12 matching up with their respective ID numbers: 026, 116, 206, and 367. In addition, the algorithm matches the pairs k1,k2, k3,k4, k6,k7, and k10,k11 commonly to 000, 017, 107, and 277, respectively. In order to distinguish between the pairs, the original {direct, diagonal} connection is once again used: by checking if the original ci is either even or odd, then it can be trivially matched to the correct shape in the pair Table 3.Table 3
ID number derivation from SN for allk1∼k12 shapes.
Shape
k1
k2
k3
k4
k5
k6
k7
k8
k9
k10
k11
k12
ID number
000even
000odd
017even
017odd
026
107even
107odd
116
206
277even
277odd
367
Original SN
000
000
017071
017071
026062
107170
107170
116161
206260
277611
277611
367376
701
701
727
602
512
710
710
772
620
521All the ID numbers are listed fork1∼k12 shapes here in Figure 9, derived from all the 64 shapes in Figures 6 and 7. Note that the common ID numbers are annotated with (-even/-odd) for distinguishing.


## 2.3.kj Parameter Equation Representation

Now that the unique ID number is obtained, it is then ready to amass a collection of the different samples of a givenlc length, in order to retrieve the correction parameter for the different kjs, provided with the same DNA characteristics, i.e., with a fixed lp=50nm.


### 2.3.1. Length Calculation with Coefficients

This is first done by identification on one individual DNA sample’s contour, by summing up each shape componentkj’s occurrence contribution for its segment’s connection length. In other words, one identifies along the skeleton backbone and tallies the individual occurrences of the twelve kjs, multiplied by the corresponding connection length (1 or √2 pixel length) along with its correction coefficient. This makes the sum of all the length contributions equal to the contour length lc as
(4)lc=r∑j=112nkjkjlkj+lH+lT,where nkj,j=1∼12 is the number of occurrences of the type kj shapes, provided from the identification along the skeleton backbone. kj is the correction coefficient, and lkj is the connection length (either 1 or √2 according to the kj shape). lH and lT are the head and tail length, respectively, and finally r is the AFM image pixel resolution.From Figure9, lk1∼lk12 length is ordered in Table 4.Table 4
Connection length forlk1∼lk12.
Shape
k1
k2
k3
k4
k5
k6
Length
1
√2
1
√2
√2
1
Shape
k7
k8
k9
k10
k11
k12
Length
√2
√2
√2
1
√2
√2


### 2.3.2. Matrix Form for Inverse Calculation

The second step is to collect a sufficient amount of representation of this same type of biopolymer samples and list all the length equations based on these samples. The logic is that with multiple samples of the same kind, imaged under the same pixel resolution, thekj shapes collectively represent the same type of twist/turn, resulting in the same length contribution for the same class of biopolymers lc.Combining equation (4) with the associated lkj values in Table 4, we arrive at
(5)lm,c=rnm,k1k11+nm,k2k2√2+nm,k3k31+nm,k4k4√2+nm,k5k5√2+nm,k6k61+nm,k7k7√2+nm,k8k8√2+nm,k9k9√2+nm,k10k101+nm,k11k11√2+nm,k12k12√2+lm,H+lm,T,for any given backbone skeleton length lm,c, given the index m’th sample. Equation (5) can be represented with a matrix form, with
(6)rNDK+B=L,where
(7)N=n1,k1n2,k2⋯n1,k12n2,k1n2,k2⋯n2,k12⋮⋮⋱⋮nm,k1nm,k2⋯nm,k12,K=k1k2⋮k12,and(8)B=b1b2⋮bm,and(9)L=lc,1lc,2⋮lc,mprovided D=diag1,√2,1,√2,√2,1,√2,√2,√2,1,√2,√2 is a 12-by-12 square matrix, such that DK=k1,√2k2,k3,√2k4,√2k5,k6,√2k7,√2k8,√2k9,k10,√2k11,√2k12T.Note thatbm=lh,m+lt,m is the head and tail (boundary) connection length summation. Also note that N is an m-by-12 matrix, K is 12 by 1, and B and L are both m-by-1 matrices.The final procedure here is to derive matrixK using a standard linear regression and find the best fit for the k1∼k12 value. The final results are presented in the next section.


## 2.3.1. Length Calculation with Coefficients

This is first done by identification on one individual DNA sample’s contour, by summing up each shape componentkj’s occurrence contribution for its segment’s connection length. In other words, one identifies along the skeleton backbone and tallies the individual occurrences of the twelve kjs, multiplied by the corresponding connection length (1 or √2 pixel length) along with its correction coefficient. This makes the sum of all the length contributions equal to the contour length lc as
(4)lc=r∑j=112nkjkjlkj+lH+lT,where nkj,j=1∼12 is the number of occurrences of the type kj shapes, provided from the identification along the skeleton backbone. kj is the correction coefficient, and lkj is the connection length (either 1 or √2 according to the kj shape). lH and lT are the head and tail length, respectively, and finally r is the AFM image pixel resolution.From Figure9, lk1∼lk12 length is ordered in Table 4.Table 4
Connection length forlk1∼lk12.
Shape
k1
k2
k3
k4
k5
k6
Length
1
√2
1
√2
√2
1
Shape
k7
k8
k9
k10
k11
k12
Length
√2
√2
√2
1
√2
√2


## 2.3.2. Matrix Form for Inverse Calculation

The second step is to collect a sufficient amount of representation of this same type of biopolymer samples and list all the length equations based on these samples. The logic is that with multiple samples of the same kind, imaged under the same pixel resolution, thekj shapes collectively represent the same type of twist/turn, resulting in the same length contribution for the same class of biopolymers lc.Combining equation (4) with the associated lkj values in Table 4, we arrive at
(5)lm,c=rnm,k1k11+nm,k2k2√2+nm,k3k31+nm,k4k4√2+nm,k5k5√2+nm,k6k61+nm,k7k7√2+nm,k8k8√2+nm,k9k9√2+nm,k10k101+nm,k11k11√2+nm,k12k12√2+lm,H+lm,T,for any given backbone skeleton length lm,c, given the index m’th sample. Equation (5) can be represented with a matrix form, with
(6)rNDK+B=L,where
(7)N=n1,k1n2,k2⋯n1,k12n2,k1n2,k2⋯n2,k12⋮⋮⋱⋮nm,k1nm,k2⋯nm,k12,K=k1k2⋮k12,and(8)B=b1b2⋮bm,and(9)L=lc,1lc,2⋮lc,mprovided D=diag1,√2,1,√2,√2,1,√2,√2,√2,1,√2,√2 is a 12-by-12 square matrix, such that DK=k1,√2k2,k3,√2k4,√2k5,k6,√2k7,√2k8,√2k9,k10,√2k11,√2k12T.Note thatbm=lh,m+lt,m is the head and tail (boundary) connection length summation. Also note that N is an m-by-12 matrix, K is 12 by 1, and B and L are both m-by-1 matrices.The final procedure here is to derive matrixK using a standard linear regression and find the best fit for the k1∼k12 value. The final results are presented in the next section.


## 3. Contour Parameter Calibration Result

In order to guarantee convergences of thek1∼k12 coefficients, different known values of lc and r single-pixel-width AFM images were simulated for kj calibration. Due to the combinations of different lc and r, plus a surplus amount of samples for each lc,r pair, a total of 58,800,000 images were generated.All the simulated images are based on DNA characteristics, as mentioned in Introduction, where all the samples have the same persistance length oflp=50nm.The different lengths calculated ranged from 340 to 1020 nm, for every 34 nm, and the different resolutionr is simulated between 5.1 and 7.8 nm/pixel, with a 0.1 nm interval. Thus, there are 21 different lc scales, along with 28 altering r, making a total of 21×28=588 test cases. Each case is studied with 10,000 DNA images, for sufficient representation on kjs. In order words, the test index m=10,000 was used for equation (6).


### 3.1. Convergence of thekj Coefficient

This research first checks the convergence of allkj coefficients, given a growing number of image files, i.e., growing number of m in equation (6). The results are illustrated in Figure 12.Figure 12
Convergence of allk1∼k12 coefficients, with growing number of m=2.1×106 image samples. Resolution at 6.4 nm/pixel, midrange from all simulation data.All coefficients verify its convergence when given more than 0.5 million samples and remain constant with fluctuation of less than 0.01% after 1 million samples. This result is verified for all resolutionsr=5.1 ∼ 7.6 nm/pixel, showing similar trend for all kjs.


### 3.2. Linear Variation ofkj Dependence on Resolution r

With the convergence for all thekj coefficients confirmed for all different r, the relationship for each kj· as a function of r, i.e., the linear fit for kjr results, is found in Figure 13.Figure 13
Linear fit of allk1∼k12 coefficients, with respect to resolution r, i.e., kjr=mr+b, as in equation (10).It is clear that using the convergedkj values for a specified r, the following linear fit equation,
(10)kr=mr+b,results with a table that contributes to all the twelve different coefficients; it is provided in Table 5.Table 5
Coefficient table ofm and b in kjr=mr+b.
kr
m
b
k1
0.0030698
1.0096
k2
0.0026365
1.0084
k3
0.0025729
1.0052
k4
-0.0037566
0.88691
k5
-0.00027806
0.7044
k6
0.010117
0.93777
k7
0.0045822
0.92897
k8
-0.0018511
0.79905
k9
0.013175
0.86184
k10
0.032808
0.7165
k11
0.015803
0.79656
k12
0.042707
0.70788


### 3.3. Performance with Shape Modification Coefficient

The above sections result in the calibration correction in equation (10) and can be used for the unknown lc estimation. In order to demonstrate such performance, the coefficient in equation (10) is used for the shape estimator LS and compared alongside the DNA estimator LDNA and the Freeman estimator LF.All estimatorsLS, LDNA, and LF are compared with different length lc and resolution r. All the estimators are applied for the same simulated pixel images and compared against the readily known lc for error calculation.Tables6, 7, and 8 outline the calculation error for different r settings. It shows that the LS estimator has an averaged relative error maxed at 0.07%, performing with an order of magnitude difference from the LDNA estimator, and two orders of magnitude smaller than LF. The relative error translates to an absolute value of maximum 0.20 nm for the r=5.1nm/pixel, well below the resolution, making LS ideal for lc estimation.Table 6
Error analysis ofLS, LDNA, and LF, atr=5.1nm/pixel.
r=5.1nm/pixel
Error
Estimator
lcnm
Relative (%)
Absolute (nm)
std (nm)
LS
340
0.05
0.19
3.6
680
0.00001
0.00009
4.51
1020
0.02
0.20
5.23
LDNA
340
0.26
0.99
4.71
680
0.24
1.67
6.18
1020
0.24
2.45
7.36
LF
340
3.42
11.63
4.86
680
3.40
23.12
6.38
1020
3.39
34.63
7.60Table 7
Error analysis ofLS, LDNA, and LF, at r=6.4nm/pixel.
r=6.4nm/pixel
Error
Estimator
lcnm
Relative (%)
Absolute (nm)
std (nm)
LS
340
0.06
0.23
4.77
680
0.0005
0.003
5.92
1020
0.02
0.24
6.92
LDNA
340
0.35
1.21
5.80
680
0.33
2.28
7.57
1020
0.32
3.31
9.06
LF
340
2.87
9.78
5.94
680
2.85
19.43
7.76
1020
2.84
29.03
9.29Table 8
Error analysis ofLS, LDNA, and LF, at r=7.7nm/pixel.
r=7.7nm/pixel
Error
Estimator
lc (nm)
Relative (%)
Absolute (nm)
std (nm)
LS
340
0.07
0.24
5.93
680
0.004
0.03
7.49
1020
0.02
0.29
8.76
LDNA
340
0.43
1.47
6.93
680
0.40
2.73
9.11
1020
0.39
4.01
10.86
LF
340
2.32
7.91
7.06
680
2.29
15.61
9.28
1020
2.28
23.33
11.07Since the error is averaged amongst the 100,000 samples provided, its standard deviation (STD) in nm is also an indicator for quantitative analysis. TheLS estimator also has a smaller standard deviation compared to both LDNA and LF, against a growing lc contour estimated.


## 3.1. Convergence of thekj Coefficient

This research first checks the convergence of allkj coefficients, given a growing number of image files, i.e., growing number of m in equation (6). The results are illustrated in Figure 12.Figure 12
Convergence of allk1∼k12 coefficients, with growing number of m=2.1×106 image samples. Resolution at 6.4 nm/pixel, midrange from all simulation data.All coefficients verify its convergence when given more than 0.5 million samples and remain constant with fluctuation of less than 0.01% after 1 million samples. This result is verified for all resolutionsr=5.1 ∼ 7.6 nm/pixel, showing similar trend for all kjs.


## 3.2. Linear Variation ofkj Dependence on Resolution r

With the convergence for all thekj coefficients confirmed for all different r, the relationship for each kj· as a function of r, i.e., the linear fit for kjr results, is found in Figure 13.Figure 13
Linear fit of allk1∼k12 coefficients, with respect to resolution r, i.e., kjr=mr+b, as in equation (10).It is clear that using the convergedkj values for a specified r, the following linear fit equation,
(10)kr=mr+b,results with a table that contributes to all the twelve different coefficients; it is provided in Table 5.Table 5
Coefficient table ofm and b in kjr=mr+b.
kr
m
b
k1
0.0030698
1.0096
k2
0.0026365
1.0084
k3
0.0025729
1.0052
k4
-0.0037566
0.88691
k5
-0.00027806
0.7044
k6
0.010117
0.93777
k7
0.0045822
0.92897
k8
-0.0018511
0.79905
k9
0.013175
0.86184
k10
0.032808
0.7165
k11
0.015803
0.79656
k12
0.042707
0.70788


## 3.3. Performance with Shape Modification Coefficient

The above sections result in the calibration correction in equation (10) and can be used for the unknown lc estimation. In order to demonstrate such performance, the coefficient in equation (10) is used for the shape estimator LS and compared alongside the DNA estimator LDNA and the Freeman estimator LF.All estimatorsLS, LDNA, and LF are compared with different length lc and resolution r. All the estimators are applied for the same simulated pixel images and compared against the readily known lc for error calculation.Tables6, 7, and 8 outline the calculation error for different r settings. It shows that the LS estimator has an averaged relative error maxed at 0.07%, performing with an order of magnitude difference from the LDNA estimator, and two orders of magnitude smaller than LF. The relative error translates to an absolute value of maximum 0.20 nm for the r=5.1nm/pixel, well below the resolution, making LS ideal for lc estimation.Table 6
Error analysis ofLS, LDNA, and LF, atr=5.1nm/pixel.
r=5.1nm/pixel
Error
Estimator
lcnm
Relative (%)
Absolute (nm)
std (nm)
LS
340
0.05
0.19
3.6
680
0.00001
0.00009
4.51
1020
0.02
0.20
5.23
LDNA
340
0.26
0.99
4.71
680
0.24
1.67
6.18
1020
0.24
2.45
7.36
LF
340
3.42
11.63
4.86
680
3.40
23.12
6.38
1020
3.39
34.63
7.60Table 7
Error analysis ofLS, LDNA, and LF, at r=6.4nm/pixel.
r=6.4nm/pixel
Error
Estimator
lcnm
Relative (%)
Absolute (nm)
std (nm)
LS
340
0.06
0.23
4.77
680
0.0005
0.003
5.92
1020
0.02
0.24
6.92
LDNA
340
0.35
1.21
5.80
680
0.33
2.28
7.57
1020
0.32
3.31
9.06
LF
340
2.87
9.78
5.94
680
2.85
19.43
7.76
1020
2.84
29.03
9.29Table 8
Error analysis ofLS, LDNA, and LF, at r=7.7nm/pixel.
r=7.7nm/pixel
Error
Estimator
lc (nm)
Relative (%)
Absolute (nm)
std (nm)
LS
340
0.07
0.24
5.93
680
0.004
0.03
7.49
1020
0.02
0.29
8.76
LDNA
340
0.43
1.47
6.93
680
0.40
2.73
9.11
1020
0.39
4.01
10.86
LF
340
2.32
7.91
7.06
680
2.29
15.61
9.28
1020
2.28
23.33
11.07Since the error is averaged amongst the 100,000 samples provided, its standard deviation (STD) in nm is also an indicator for quantitative analysis. TheLS estimator also has a smaller standard deviation compared to both LDNA and LF, against a growing lc contour estimated.


## 4. Conclusion and Future Direction

This research provided a novel way to estimate digitized contour length, in a general way that is applicable towards all kinds of contour curvature. Utilizing a localized shape connection approach, and correct upon the local connectivity between pixels, this algorithm accounts for both resolution and the sample stiffness.This research is general in the local 4-pixel segment identification method and extensible towards extension to more pixel elements. The general idea stands that a single-width pixel contour’s digital shape recognition is applicable towards all images acquired from different systems, not only with the AFM family but also optical microscopy systems, electron microscopy systems, and many others.Experimental verification is also needed for future research, provided with calibrated accurate sample lengthlc from DNA samples or other biopolymer samples imaged with AFM systems.



---

*Source: 4235865-2019-06-09.xml*