{'fraction_non_alphanumeric': 0.02738015607580825, 'fraction_numerical': 0.01132664437012263, 'mean_word_length': 5.356575963718821, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Automated quantification of one-dimensional nanostructure alignment on surfaces

A method for automated quantification of the alignment of one-dimensional nanostructures from microscopy imaging is presented. Nanostructure alignment metrics are formulated and shown to able to rigorously quantify the orientational order of nanostructures within a two-dimensional domain (surface). A complementary image processing method is also presented which enables robust processing of microscopy images where overlapping nanostructures might be present. Scanning electron microscopy (SEM) images of nanowire-covered surfaces are analyzed using the presented methods and it is shown that past single parameter alignment metrics are insufficient for highly aligned domains. Through the use of multiple parameter alignment metrics, automated quantitative analysis of SEM images is shown to be possible and the alignment characteristics of different samples are able to be rigorously compared using a similarity metric. The results of this work provide researchers in nanoscience and nanotechnology with a rigorous method for the determination of structure/property relationships where alignment of one-dimensional nanostructures is significant.


Introduction
The application of image processing to materials and nanotechnology research has the potential to enable significant advancements, both fundamental and technological. A key activity in these research areas is the determination of quantitative relationships between material structure and properties, which can be enabled or augmented through the use of image processing methods.
Focusing on films and surfaces, imaging techniques have become increasingly more accurate and accessible to researchers, but suitable image processing methods have not advanced at the same pace. When successfully applied, image processing methods have resulted in an increased understanding of experimental observations in areas including nanoscale self-assembly [1][2][3][4], nanoparticle clustering [5], molecular topography [6], and nanorod/nanowire-coated films [7][8][9][10]. These examples also demonstrate that traditional image processing techniques alone are not sufficient and must be augmented through the identification of theoretically consistent metrics for quantification of material structure.
Films and surfaces composed of one-dimensional (1D) nanostructures -nanowires (NWs), nanorods (NRs), and nanotubes (NTs) -are the focus of a large sub-set of materials and nanotechnology research where image processing is gaining traction [7][8][9][10]. This area is significant in that 1D nanostructures are easily transferred onto arbitrary substrates [11][12][13][14][15] and there exist a broad range of applications of these materials in electronic, optical, sensing and energy devices [11,12,16,17]. Alignment of 1D nanostructures on substrates has been demonstrated [18,19] and the quality of alignment has been shown to qualitatively affect many useful material properties such as the ability to polarize light and increasing surface-enhanced Raman scattering (SERS) [20][21][22][23].
Frequently, measurement of alignment of individual nanostructures has been done by hand through measuring the angle of alignment θ i of individual 1D nanostructures [24][25][26] using scanning electron microscopy (SEM) images such as in Figure 1. Not only is this approach tedious and time consuming, but it is also inaccurate and nearly impossible to execute without bias. Automating the process through the use of image processing is clearly desirable, yet few studies have used such techniques due to the difficulty in developing suitable image processing code [7][8][9][10] and the absence of suitable alignment metrics. Recent work [7] has made progress towards both quantitative and automated measurement of alignment through the use of image processing methods and the introduction of an appropriate orientational order parameter S: where θ i is the angle between the average alignment vector n and the i th nanostructure alignment vector m i . S values range between 0 and 1, with values closer to 1 meaning the nanostructures are more aligned. To date there has been no rigorous basis developed for alignment quantification as is present in other fields such as orientational order quantification in liquid crystalline phases [27,28]. Additionally, progress has been made in imaging processing of dispersed (non-overlapping) 1D nanostructures [9,10], shown in Figures 1a-1b, but these approaches fail for dense 1D nanostructure coverages where overlapping is present (see Figure 1c). Thus, significant challenges still exist for automated alignment quantification and, with increasing numbers of 1D nanostructure devices and applications being developed, advances in image processing methods are as important as ever [29][30][31]. The overall objective of this work is to address two of the most significant current challenges in automated alignment quantification of one-dimensional nanostructures on surfaces: (i) alignment metrics formulation and (ii) image processing of dense (overlapping) nanostructure films. An appropriate alignment metric was first introduced in ref. [7], shown in eqn. 1. This orientational order parameter will be shown to be a coarse approximation for the orientational distribution function (ODF) of the nanostructures, especially for high-alignment cases. Thus, the first objective of this work is the derivation of a complete set of order parameters which enable reconstruction of the ODF of the 1D nanostructures and, thus, rigorously quantifies alignment. Additionally, past approaches to image processing of nanostructured films were limited to disperse non-overlapping films [7][8][9][10]. Thus, the second objective of this work is to develop an enhanced image processing method which is able to robustly and seamlessly handle both disperse (non-overlapping) and dense (overlapping) nanostructured films.

Theory
Quantification of orientational order of materials through the introduction of appropriate orientational order parameters has been rigorously addressed in the area of liquid crystal (LC) physics [28]. Orientational order in LC phases is traditionally quantified by a finite set of orientational order parameters [27]: where n is a positive integer, P 2n is the Legendre polynomial of order 2n, and θ i is the angle between the average alignment vector n and the i th molecular alignment vector m i . These order parameters were derived from a statistical mechanics representation of three-dimensional molecular alignment, the orientational distribution function (ODF) for nonpolar uniaxial molecules (in spherical coordinates): where the ODF can be shown to have the form [27]: and thus a finite set of scalar order parameters defined by eqn. 2 can be interpreted as a reduced-basis approximation of the exact ODF. While LC phases are composed of molecules whose orientation is inherently threedimensional, nanostructures deposited on surfaces have orientation that is essentially two-dimensional. Thus eqns. 2-4 are not applicable for the two-dimensional case. Past research has been performed on LC phases constrained to two-dimensions in which a two-dimensional orientational order parameter S =< cos 2θ i > was first introduced by Straley in ref. [32]. This can be shown to be equivalent to eqn. 1 using simple trigonometric identities. For two-dimensional LC phases, the scalar order parameter was later expanded on in ref. [33] introducing a two-dimensional alignment tensor: which provides a simple approach to compute the average molecular alignment vector n through eigenvalue decomposition of Q. The derivation of a suitable set of two-dimensional orientational order parameters in this work closely follows that of Zannoni in ref. [27] for the three-dimensional case. An ODF for a set of nonpolar cylindrically symmetric objects constrained to two-dimensions must obey the following constraints: where i is an integer and the normalization condition: An appropriate orthogonal expansion for f (θ) exists in terms of a Fourier cosine series, which is further constrained by eqn. 9 to include terms with only even integers: As with the three-dimensional orientational order case, this expansion defines a consistent set of orientational order parameters: the first of which S 2 is consistent with eqn. 1. Through computation of these order parameters the ODF (eqn. 9) may be reconstructed with increasing accuracy as higher order S 2n terms are included.

Computational Methods
Image processing of microscopy images typically consists of four sequential tasks [10]: filtering, thresholding, object detection, and shape fitting. In this work, both filtering and thresholding methods are used which are essentially unchanged from past work [7][8][9][10], although they will be summarized here for clarity. However, the presented image processing method differs substantially from past approaches in that mathematical morphology methods [34,35] are used for object detection and characterization, as opposed to computationally intensive shape fitting tasks used in past work [7][8][9][10].
The filtering and thresholding tasks are used to remove measurement noise from the raw microscopy image and segment the grayscale image into a binary image, respectively. A non-local denoising filter [36,37] is used with a length scale chosen to be smaller than the smallest characteristic nanostructure. Depending on the variation of background intensity in the image, either Otsu's Method [37,38] or adaptive thresholding [37] is used on the filtered grayscale image resulting in a binary image where each pixel is either foreground (1) or background (0). This binary image is the starting point for automated identification of one-dimensional nanostructures. Sample binary images resulting from filtering and thresholding of a sub-region of Figure 1c are shown in Figures 2a and 2b, respectively.
Given a binary image, past work [7,10] used least-squares fitting of ellipses to foreground objects to identify candidate one-dimensional nanostructures. This single operation both uniquely identifies foreground objects and provides approximations of their morphological quantities such as major axis length, minor axis length, aspect ratio, eccentricity, and axes orientations. This approach has limited applicability in that nanostructures need to be non-overlapping and thus is useful only for dispersed samples such as shown in Figures 1a-1b.
In order to robustly and seamlessly process images with both non-overlapping and overlapping nanostructure films, a topological skeleton [35] generated from the binary image is used in the presented method. A topological skeleton preserves foreground object shape but reduces its representation to a simple set of discretized curves which are more amenable to characterization. There are many methods for generating topological skeletons from a binary image; in this work morphological operators are used, specifically using the hit-or-miss transform [35]. This approach is chosen in that morphological operaters are also used to determine end-points and branch-points (overlapping areas) of one-dimensional nanostructures from the topological skeleton. Given a binary image in Figure 2b, the resulting topological skeleton is shown in Figure 2c.
Characterization of the one-dimensional nanostructures is facilitated by identification of end-points and branch-points in the topological skeleton. End-points in the topological skeleton correspond to end-points of the nanostructures in the image, while branch-points correspond to overlap areas of nanostructures. These points are efficiently identified through the use of mathematical morphology operations on the topological skeleton ( Figure 2c); sample output is shown in Figure 2d. For each object in the binary image, end-points and branch-points located within them may then be grouped together for further analysis (Section 4.2), including a second level of filtering to exclude features below a certain length threshold which results from artifacts introduced by the presence of noise in the source image.

Dispersed (Non-overlapping) Nanowire Films
A distinguishing feature of 1D nanostructure-covered films is that they are able to be fabricated with an extremely high degree of alignment with S > 0.9 [10], as shown in Figures 1b-1c. Conversely, orientational order found in liquid crystalline materials is typically low, where S ≈ 0.3 − 0.6. In high alignment regimes, single orientational order parameter measures of alignment [7] are insufficient for accurate reconstruction of the ODF, f (θ), and thus not adequate for rigorous quantification of alignment. In order to demonstrate this, SEM images of disperse (non-overlapping) 1D nanostructure-covered films were analyzed using the image processing method presented in ref. [10]. Figure 1a was used for the low alignment case and Figure 1b for the high alignment case; order parameters (eqn. 10) up to order 50 were computed. Figures 3a and 3b show histograms of the angle θ i between the orientation of individual nanostructures and the average orientational axis. As is seen in Figure 3a, the single order parameter approximation is adequate for the low alignment case in that higher order parameters quickly approach zero, shown in Figure 3c, which has oscillation of the higher order parameters resulting from the small sampling size of nanostructures in the image. However, the single order parameter approximation fails for the high alignment case, where a relatively complex ODF is reconstructed (Figure 3b) and higher order parameters are non-zero up to order 30 ( Figure 3c). Once again, oscillation in the higher order terms is observed due to the relatively small sample size.  A single orientational parameter is useful to determine if order is present and its approximate degree, but it does not reveal details of the angular distribution of the nanostructures. Two well-aligned samples with the same S could have a very different composition of nanostructure orientations, and this composition can affect the properties of the aggregate film. An example of two images with similar S 2 values but different higher order parameters is discussed in Section 4.3.

Optimized Image Processing Method
Given the combination of image segmentation and mathematical morphology image processing methods reviewed in Section 3, for a given image of 1D nanostructures, sets of end points and branch points for each contiguous feature can be computed. For dispersed films (Figures 1a-1b), 1D nanostructure orientation and length can be easily approximated from this data in that each feature should have only two end-points and no branch-points (since there are no overlapping nanostructures). Given, for each feature, a pair of end points {r 1 , r 2 } the nanostructure alignment vector is with the nanostructure length l i = ||r 1 − r 2 || 2 .
In the frequent case of overlapping 1D nanostructures, the identification of end points for each of them becomes significantly more difficult. Instead of developing a complex iterative method to determine end points, a more simple method is proposed. Given the case where two or more 1D nanostructures overlap, a single feature in the binary image (Figure 4a) will contain multiple 1D nanostructures and at least one branch-point will be identified within it. The addition of an intermediate step is proposed where branch points within the topological skeleton computed from the binary image are removed and treated as if they are background pixels. The modified topological skeleton now has no branch points and, for example, a feature which originally had two nanostructures overlapping now corresponds to four separate nonoverlapping nanostructures. The method for non-overlapping nanostructures may now be applied in that each feature in the modified topological skeleton has no branch points and only two end points. The result of applying this image processing method to the SEM image shown in Figure 2a is shown in Figure 4b. This approach does result in a loss of information in that the original topological skeleton is modified such that contiguous nanostructures are now non-contiguous. The implication of this is that determination of original nanostructure length is not possible, but orientation is unaffected. Within the present context of quantifying alignment of the nanostructures, this can be resolved through a reformulation of eqn. 10. Assuming that each nanostructure has an equal length l and, thus, equal contribution to the orientational order of the film: Now, taking into account that each nanostructure can have different lengths l i a weighted average can be used: where L = i l i is the total length of nanostructures present in the image. This approach both accounts for the differing length of nanostructures in the orientational order parameter formulation and circumvents the need for identification of a unique set of nanostructures in the image. Any nanostructure or combination of nanostructures may be decomposed into an arbritrary set of smaller nanostructures without any affect on the order parameters computed through eqn. 12, unlike with eqn. 10, which weights each nanostructure orientation equally. Furthermore, even for non-overlapping samples, eqn. 12 might be more appropriate than eqn. 10 if one desires the alignment of longer nanostructures to be weighted more heavily than shorter ones.

Dense (overlapping) Nanowire Films
Combining the ODF and image processing methods from Sections 4.1-4.2 results in a highly robust and descriptive method for quantification of 1D nanostructure alignment. The combined approach was applied to the dense nanostructure film shown in Figure  1c in order to both demonstrate its application and compare the use of non-weighted (eqn. 10) and weighted (eqn. 12) order parameters to reconstruct the ODF. Figures  5a-5b show reconstructions of the orientational distribution function using single and multiple order parameters for the unweighted (S 2n ) and weighted (S w 2n ) formulations, respectively. The nanostructures in the SEM image shown in Figure 1c are highly aligned and, thus, the single order parameter approximation again is found to be insufficient in reconstructing the ODF. Instead, orientational order parameters up to order 200 were required to reconstruct the ODF due to the extremely high alignment, where S 2 → 1.
Comparing the multiple order parameter reconstructions, a non-negligible correction of the unweighted ODF (Figure 5a) is found when compared to the more accurate weighted ODF reconstruction (Figure 5b). Figure 5c shows the magnitude of orientational order parameters of increasing order, which also shows a non-negligible difference.
In order to further support the use of multiple orientational order parameter quantification of alignment, length weighted order parameters were also computed for the dispersed nanostructure images shown in Figures 1a-1b. These images were already shown to have nanostructures with low and high alignment, respectively. Figure 6 shows length-weighted orientational order parameter plots for each of these images. Focusing on the single order parameter metric (S w 2 ), there is a clear difference in its magnitude for  the poorly aligned nanostructure image (Figure 1a) compared to those for the highly aligned nanostructure images (Figures 1b-1c). However, for the two highly aligned nanostructure images, the difference in S w 2 is very small. This implies that the single order parameter quantification of orientational order is not suitable for distinguishing between different highly aligned samples. Taking into account multiple orientational order parameters enables this comparison, with the caveat that the orientational order parameters and ODF quantify alignment only. Other metrics such as nanostructure shape or morphology could be included in the comparison, but would require the introduction of additional metrics. A simple way to compare the ODFs from each image is through treating the set of ] and compute the Euclidean distance between vectors from pairs of images. This value can be interpreted as a similarity metric, the smaller its value the more similar the orientational character of the nanostructures shown in the pair of images is, the larger the more different. Table 1 shows the similarity metric values resulting from comparing each of the three SEM images for both the single and multiple order parameter cases. Both the single and multiple order parameter similarity metrics are found to result in large values comparing the poorly aligned image to both highly aligned images. While this is correct in both cases, when comparing the highly aligned images to each other the single order parameter similarity metric is very small, which incorrectly implies that these images have very similar alignment characteristics. The multiple order parameter similarity metric performs well for all cases, indicating that the poorly aligned sample is less similar to the aligned samples and the aligned samples are similar but distinct.

Conclusions
Both alignment quantification theory and an image processing method were presented and applied to microscopy images of 1D nanostructures on surfaces. An appropriate set of two-dimensional orientational order parameters were derived which enable reconstruction of the orientational distribution function (ODF) with which nanostructure alignment is rigorously quantified. The use of high-order orientional order parameters is shown to be necessary for quantification of highly aligned nanostructures, where past single parameter methods are shown to be insufficient. Additionally, an image processing method based on mathematical morphology operations is presented which is robust in the presence of measurement uncertainty and nanostructure overlap.
The results of this work provide researchers in nanoscience and nanotechnology with a robust method for the determination of structure/property relationships where alignment of one-dimensional nanostructures is significant. Subsequently, a fully documented open-source implementation of the method is provided for general use ‡. ‡ The image processing code developed and used in this work is provided in the supplementary information under an open-source license.