Development of a modular system to provide confidence in porosity analysis of additively manufactured components using x-ray computed tomography

X-ray computed tomography (XCT) offers a promising non-destructive method to assess high value components that are additively manufactured (AM) for space-based imaging. However, AM components can be often challenging to measure and the true resolution of the XCT system used is both non-trivial to determine and may change locally. To solve this, we used high precision micro-machining to manufacture a cylindrical reference pin with internal holes. This pin can then be inserted into any component via subtractive machining, prior to the XCT process. A pre-existing AM flexure is modified to allow our modular system to be implemented. This allows XCT scanning and porosity analysis of similar components (similar geometry and manufacturing process) to be refined and adjusted based on the known internal micro-machined hole size. Analysis of the XCT volumetric data is implemented using a Python script developed for Avizo 2022.1, to compare and suggest the ideal threshold grey value (GV). The plugin threshold comparison is semi-automatic and 15 times faster than a manual comparison. Study findings showed how different calibrated micro-machined hole sizes (30 μm–120 μm) needed different thresholding values (188 GV–195 GV). Challenges and future studies related to traceability of the suggested method are discussed.


Introduction
Additive manufacturing (AM) is the process of joining material layer-by-layer.Intricate shapes that are hard or impossible to machine can now be AM in different metals like aluminium [1], Inconel [2] or copper [3].Another benefit of AM is the often lower cost and shorter time needed when manufacturing a small custom batch of metal parts, especially if they feature freeform or intricate geometries.However, AM has a number of challenges, for example, manufacturing parameters in the powder bed fusion process can reach over a 100 variables [4], making it challenging to optimise the manufacturing process.Nonetheless, research is ongoing to develop optimisation models that are geometry, material and machine dependant, resulting in defect free parts [5].AM defects can be in the form of geometric deviations from the original computer aided design (CAD), which can be caused by residual stress originating from the rapid heating and cooling cycles [6].Defects can also include significantly higher surface roughness caused by the staircase effect, or dross formation on the down skin of the part, which can lead to failure [7].Another common defect, which is the focus of this paper, is unwanted internal porosity.Internal pores can negatively affect the structural integrity of the part and act like crack initiators, leading to a premature failure of the part [8,9].

Porosity
Porosity can be caused by trapped gas, lack of fusion or keyholes.Trapped gas is the most common form of porosity in AM parts [10] and it originates from gas that is already present in AM powder, or trapped from the printer environment during the melting process [11].Lack of fusion is caused by incomplete melting due to low laser energy density, which is dependant on laser power, scanning velocity, hatch spacing and layer thickness [10], leading to unmelted powder and resulting in unwanted pores.Conversely, keyholes are caused by an excess of laser energy density, leading to excessive penetration and resulting in a pore at the bottom of the meltpool [11].
To measure porosity, non destructive tools (NDTs) including density based methods can be used, like the Archimedes' principle or gas pycnometry.These methods however only measure the global part density without providing localised porosity information [12].An alternative method is ultrasonic testing, but it is often challenging to use in AM parts due to the increased internal reflections caused by microstructure inhomogeneity [13].The NDT method that has been increasingly used in the AM field is x-ray computed tomography (XCT), which allows the quantification of internal pore location and size, and has been shown to be important when assessing the pore-crack initiator [9].
XCT was initially used as a medical tool, but recent advancements have enabled industrial XCT machines and software that can be used for assessing dimensional deviation, surface roughness and porosity analysis of AM parts [14,15].Nonetheless, XCT comes with several challenges.The direct effect of each scanning parameter on the resulting measurement is still not fully understood, which makes it challenging to provide uncertainty statements [16].Consequently, researchers have increasingly proposed methods to increase measurement confidence when using XCT, for example, in this paper, the focus is to increase the measurement confidence when analysing porosity.
One of the methods to increase measurement confidence is to use the substitution method [17].The substitution method relies on using a calibrated workpiece, previously measured using an accepted standardised measurement approach, for example, coordinate measurement machines or scanning electron microscope (SEM).Based upon the direct measurement results and comparison to the non-direct XCT reference measurement, correction models can then be applied.The substitution method has been used in different applications in literature, for example in determining the XCT measurement error for dimensional measurement [18][19][20], surface texture evaluation [21] or porosity analysis [22,23].

Thresholding techniques
One of the challenges in using XCT for porosity analysis is choosing the threshold value that would binarise the datasets into either solid material or pore data.A threshold value can be either global, which means a single value applied on the whole dataset, or local, which means that it differs across the studied volume based on local neighbourhood.Common global threshold methods include ISO-50, which is the mean grey value (GV) between the material and the background peaks, or Otsu [24], which searches for the threshold that minimises the weighted variance between foreground and background.The challenge with using global methods is that they only use one threshold value across the whole volume as they assume that the dataset has a perfect bimodal GV histogram, which cannot be guaranteed and can result in inaccurate measurements.These methods are often inaccurate when the GV distribution across the material, or the background, is not homogeneous due to noise, low contrast ratio between pore and material, or XCT scanning artefacts.The disadvantage of using a single global threshold, compared to a local one, on XCT datasets has been previously shown in studies related to XCT surface roughness [25] and porosity analysis [22].
Early uses of local thresholding were related to segmenting of historical scanned texts [26,27] and detailed reviews of the different thresholding algorithms can be found in [28,29].When applied to XCT data, Kim et al [10] used a local thresholding method [30], to correctly binarise the XCT data, which works well within the part but fails at part edges.Lifton and Liu [26] suggests a workflow using Rosin's local thresholding method [31] that first corrects for the edges by isolating the part using a global threshold, filling it, and using it as a mask to only apply the local threshold within the part, ignoring the transitional voxels at the edge.Previous research also explored machine learning algorithms for thresholding.For example, the Gobert et al [32] study had an agreement between threshold value calculated using the developed machine learning algorithm and threshold value calculated or chosen by experienced users.However, porosity measured by experienced users was used as ground-truth instead of a physical measurement of porosity.Also, the same research highlighted that the method was optimised for XCT scans with similar conditions to the training dataset and was artefact free.
Another thresholding workflow as described by Hermanek et al [22] starts using a global ISO 50 threshold value, then an optimisation process was applied by performing an iterative process that keeps changing the threshold value until the difference to the measured hole diameter was minimal.This study is very important as it provided an indication of an uncertainty statement.However, the used threshold was global and applied for pores of all sizes and across the whole component, which is not always valid, since the GV of pores can differ depending on their size and location.
In summary, research and standardisation is much needed in this field since different thresholding methods can deliver different results.Researchers are also using different workflows or thresholding techniques that are sometimes based on commercial algorithms that are not fully explained (black box), which makes it challenging to be confident in XCT porosity analysis results and hinders the advancements in the XCT metrology field.To tackle this challenge, a workflow that can assist users in comparing different thresholding methods is presented.The workflow starts with a reference pin with micro-machined holes, measured in SEM and it is used as ground-truth when comparing different thresholding techniques.The XCT obtained porosity is then compared with Archimedes' principle measured porosity.The study also provides the Python plugin that can be used in Avizo 2022.1 (Termo Fisher Scientifc, Germany) to semi-automatically iterate through different threshold values or settings and obtain the one with the closest measurement to the SEM dimensions of the machined holes in the reference pin.

AM part and SEM of reference pin
The AM part used in this experiment is a flexure hinge with box dimensions of 30 mm × 12 mm × 5 mm.The flexure was designed to hold a piezoelectric actuator and to impart an amplified displacement normal to the actuator displacement.The motivation to use AM to create the flexure was to explore the fidelity of AM to recreate the thin flexure hinges (0.3 mm) [33].To accommodate the reference pin, which has three rows of hole diameters (30 µm, 50 µm, 90 µm and 120 µm), a hole is machined in the AM part, as shown in figure 1.
The reference pin has the same nominal material as the AM part (aluminium) to allow for similar GV.Furthermore, micromachining operations on this small scale can be expensive, which is why the proposed reference pin design is modular, in the sense that its thickness can be edited to only have one or two rows, depending on the AM part thickness.It can also be removed and reassembled to the same or other AM parts with the same reference pin diameter.To compare and refine the thresholding method, a benchmark measurement was conducted using SEM on the third row of the part holes labelled C1, shown in figure 2.
The reference pin C1 row (figure 2.) was first measured in the Zeiss EVO 10 SEM and used in this study as the benchmark, and as such only this row is discussed in this study.The 120_C1, 90_C1, 50_C1, 30_C1 holes had SEM measured diameters of 123.76 µm ± 1.25 µm, 89.80 µm ± 0.91 µm, 52.12 µm ± 0.53 µm and 30.08 µm ± 0.31 µm respectively.The reported expanded uncertainty (U SEM ) is based on a standard uncertainty (u SEM ) multiplied by a coverage factor of k = 2, providing a level of confidence of approximately 95%.The standard uncertainty is the result of quadrature addition of five repeated measurements (u Meas ), the measurement resolution (u Resol ), and calibration uncertainty (u Cal ) as shown in equations ( 1) and ( 2), (2)

Density measurement
An experimental density measurement was performed on the AM part using Archimedes' principle.The standard followed is ASTM B311-17 [34].The porosity of the AM part P is obtained from equation ( 3), where ρ bulk is the bulk density of the AM part and ρ powder is the density of the AM powder used to fabricate the part, The standard uncertainty (u P ) is obtained from partial derivatives of equation (3), and is composed of the standard uncertainty of the bulk density measurement u ρ bulk and of standard uncertainty of powder density measurement u ρ powder as seen in equation ( 4); this method is explained in detail in Lifton et al [35], where The standard uncertainty of the part bulk density (u ρ bulk ) was calculated from eight repeated measurements of the mass of the AM part in the air and eight repeated measurements of the mass of the AM part in deionised water.The density of the deionised water at the measurement temperature of 22 • C was obtained from ASTM B311-17 [34].The uncertainty of the deionised water density corresponded to the change in density with temperature and was limited by the measurement resolution of the thermometer ±0.5 • C [35].The AM powder vendor used to produce the flexure is Concept Laser CL 31 AL (Concept Laser, Germany).The vendor does not include pycnometric density of their CL 31 AL powder in the material datasheet [36].The standard uncertainty of the powder density (u ρ powder ) was calculated from the element density composition of the CL 31 AL material as provided by the vendor [36], which led to a mean value of 2.70 g cm −3 with upper/lower limits of ±0.03 g cm −3 .The standard uncertainty of the powder density was obtained by dividing the ±0.03 g cm −3 limit by √ 3, assuming a rectangular distribution, giving a value of ±0.02 g cm −3 .The density of each element was obtained from Royal Society of Chemistry database [37].

XCT process
A Nikon (Nikon Metrology, Japan) MCT 225 was used to XCT scan the flexure containing the reference pin.The XCT scan was limited to the half of the flexure containing the reference pin to decrease the voxel size.The scan settings included a voltage of 145 kV, filament current of 41 µA, number of projections of 1650 and a voxel size of 8.5 µm × 8.5 µm × 8.5 µm.
After reconstruction in Nikon CT Pro 3D, Avizo 2022.1 software was used to convert and down sample the scan data from 32-bit to 8-bit in order to reduce the computing power required to do the intensive batch thresholding study, which uses the developed plugin discussed in the appendix A.2.The scan was then aligned to the original CAD and re-sampled according to the new transformation, as shown in figure 3. The alignment of the scan to the CAD is done to minimise the diameter error that can be caused by the non perpendicularity of the axis of the holes to the plane of images used for measurement.The diameter measurement is done by averaging the diameters of the cylinder 2D contours from its corresponding multiple 2D slices.The non alignment to the CAD and resampling of XCT images could have led to the cylinder diameters being elliptical and distorted.When re-sampling transformed images, the dimensions were preserved and the voxel size changed to 9.4 µm × 9.4 µm × 8.8 µm.

XCT scan and effect of threshold value
The reconstructed XCT scan of the flexure plus reference pin assembly is shown in figure 4. The green region of interest (ROI) contains the micro-machined holes previously measured in SEM and inserted in the AM part and the blue ROI contains the cube (box dimensions of approximately 2 mm × 2 mm × 2 mm) used for porosity analysis.The purpose of the study is to use the green ROI holes of known size to refine the threshold value and use it to binarise the data and quantify porosity within the blue ROI.Trialling different thresholds and comparing them with the SEM can be manually intensive which is why the plugin was developed (appendix A.2).The global thresholding method was applied in Avizo 2022.1 using the 'Interactive Thresholding' tool.The local thresholding method was applied in Avizo 2022.1 using the 'Adaptive Thresholding' tool.The adaptive threshold applies a binarisation that is based on the mean intensity of the sliding window centred around each pixel.This means that each pixel is compared to the mean intensity of its local window and the range of values assessed here is the comparison criterion.A value of 0.86 means that pixels with GV lower than 86% of their local mean will be binarised.
The threshold value used to binarise the data can directly impact the quantification of porosity as discussed in the appendix A.1.Porosity analysis was conducted in Avizo 2022.1 using a label analysis and a minimum pore size filter that removed any pores with a volume less than five times the voxel volume.Performing this filtering can assist in deleting any noise that could act as synthetic pores.Porosity in the Blue ROI was calculated using the volume fraction tool, which divides thresholded pores volume against the full cube volume.

Density measurement
The AM part porosity, measured using Archimedes' principle, was 2.61% ± 1.33%, giving a minimum porosity result of 1.28% and maximum porosity result of 3.94%.The reported expanded uncertainty (U P ) of ±1.33% is based upon a standard uncertainty (u P ) of ±0.67%, multiplied by a coverage factor of k = 2, providing a level of confidence of 95% (see equation ( 1)).
The uncertainty of the porosity obtained using Archimedes' principle is significant and was dominated by the standard uncertainty of the powder density.For example, if u ρ powder was only considered, then the expanded uncertainty of the Archimedes' porosity measurement would have been approximately ±1.25% (k = 2), which implies that there is a 95% probability that the AM part porosity value is between 1.36% and 3.86%.
Uncertainty and potential measurement error was also present in bulk density measurement of the AM part, with the dominant contribution from the measurement variability of the AM part in water.For example, if u ρ bulk was only considered, then the expanded uncertainty of the Archimedes' porosity measurement would have been approximately ±0.47% (k = 2).The surface roughness and intricate features of the AM part trap air bubbles, affecting the measurement repeatability.Methods to reduce the uncertainty of Archimedes' method measurement are highlighted in the Discussion (section 3.4).

Global threshold
The first graphical output from the developed plugin, shown in figure 5, shows the CAD and SEM lines relative to all global thresholds chosen to be analysed with their equivalent diameter.Otsu is a global method so its result is also included in the global thresholding graph.In the figure, the diamond marker represents the threshold value that gave a diameter with the closest value to the SEM, termed in the rest of the study as 'ideal global threshold value' (IGTV).
This process was applied for the different hole ROIs and the obtained IGTVs for 120_C1, 90_C1, 50_C1 and 30_C1 were 192, 195, 188 and 190 respectively.Subsequently, a porosity analysis was applied on the isolated cube at 192, 195, 188 and 190 threshold values and the porosity volume fractions were 0.14%, 0.17%, 0.12% and 0.13% respectively.

Local threshold
The second graph from the plugin, shown in figure 6, is a local thresholding result that shows the CAD and SEM lines alongside all local thresholds chosen to be analysed with their equivalent diameter.In the figure, the diamond marker represents the threshold value that gave a diameter with the closest value to the SEM, called in the rest of the study as 'ideal local threshold value' (ILTV).

Discussion
The proposed method assists the user in choosing the ideal thresholding method semi-automatically.A manual comparison of each iteration done by the plugin for one hole would have taken ≈50 min compared to ≈3 min taken by the plugin.Also, the micro-machined holes in the reference pin, acted as porosity within the part, of which the dimensions were known, assisting in the refinement of the ideal threshold for porosity analysis.However different hole sizes resulted in different ideal thresholds.These differences were minor in the global thresholds comparison with the highest threshold of 195 relating to the 90_C1 hole leading to 0.17% porosity and the lowest threshold of 188 relating to the 50_C1 hole leading to a porosity of 0.12%.However, in the case of local thresholding, the differences were more significant for the ideal ILTV between larger and smaller holes, with porosity volume fraction resulting from a significant 45.17% when using ILTV of 120_C1 hole to 0.30% when using ILTV of 30_C1.As can be seen in table 1, the AM part XCT measured porosity values using IGTV were consistently lower than the Archimedes' method measured value while the ILTV resulting porosity values were either lower or higher than the Archimedes' method measurement.Unfortunately, this highlights the current limitations of this method for determining threshold values.It may be necessary to investigate other threshold selection methods (not described here) if a suitable method for repeatable and accurate quantification of CT data is to be developed.A portion of this difference may be due to the Archimedes' method measurement being applied on the whole AM part while the XCT porosity analysis is only applied on a sub volume cube within the AM part.The porosity value of the isolated cube might not be necessarily representative of the whole AM part, due to AM pores being frequently present on the contour regions of AM parts.The main limitation in this study is that the method has been tested on machined pin holes that are assumed to act as 'AM pores', rather than directly on AM pores.To overcome this limitation, future studies will need to look at validating the developed method directly on AM pores, which can be done in two stages, by reducing Archimedes' method measurement uncertainty, and by allowing for a validation of XCT thresholded pores.First, to reduce Archimedes' method uncertainty, powder density used to fabricate the part can be experimentally measured instead of estimated from the datasheet.For example, Lifton et al reached a smaller expanded uncertainty of the porosity measurement of ±0.14% (k = 2).This was achieved using a pycnometer and a standard uncertainty of the powder that took in consideration measurement bias, measurement repeatability, thermal expansion of the powder, uncertainty due to error of thermometer, uncertainty due to thermal expansion of the coefficient of the powder and uncertainty of the material standard used to calibrate the part [35].The main challenge reported by Lifton et al in the bulk porosity measurement using Archimedes' principle is the repeatability of the bulk part measurement in water, where the rough texture of the AM part can trap micro-bubbles.This effect can be reduced by machining the AM part surfaces, whenever possible, prior to the measurement.Nonetheless, the uncertainty of the porosity measurement of AM parts is rarely discussed in literature or by AM powder vendors, which questions the validity of low porosity values (∼0.01%) quoted without uncertainty statements within datasheets.
Second, the dimensions of the pores within the AM part can be directly measured and compared against the dimensions of the same pores using the IGTV and ILTV values.This would likely require slicing the AM part at different cross sections, which is notably time consuming and include the risk of distorting the pore.For example, the XCT of the part in this study seen in figure 1, which is only half the flexure, has 1500 slices in the Z axis.Manually cutting just a third of these slices would mean cutting 500 slices, at a ∼30 µm interval, and measuring the slices on an SEM.A realistic approach can involve designing an AM part for this experiment that can also host the designed pin, but incorporate external fiducials that can assist in marking cutting planes, thereby assisting the registration of the XCT and SEM data.Validating the developed method by destructively slicing the AM component is important, because relying solely on bulk porosity can lead to a scenario where the threshold value is blindly set to meet the experimentally measured bulk porosity, without confidence that the pores generated in the XCT analysis are true and accurate.
Further limitations of this study, introduced below, include the voxel size; spatial performance variability; XCT uncertainty; measurement strategy of XCT and SEM; and the feasibility of the developed method at the industrial level.The voxel size should ideally be as small as possible to increase confidence, especially in the 30_C1 measurements.This could be overcome in future examples by placing the reference pin in a location that allows for a smaller voxel size while still capturing ROI of the AM part, or by using a smaller AM component.Spatial performance of the XCT can be different across different regions of the part due to its non homogeneity across the XCT machine [38].This means that the ideal threshold could be different if the reference pin was in another location within the part, or if the part is scanned at a different orientation.To investigate this challenge, data comparison can be done on scans of the reference pin placed in different locations of the AM part and scanned at different orientations.This comparison can assist in mapping the impact of spatial variability of XCT on the developed method.XCT uncertainty can be approximated when applying this method [19], while considering the impact of voxel size and downsampling data to 8-bit, especially on small features, like the 30_C1 hole in this case.Measurement strategy can be investigated in order to be similar between SEM and XCT, instead of measuring only one 2D diameter of the pin holes in SEM and comparing it with XCT measured diameter at multiple 2D diameters of the pin hole cylinder.Finally, the repeatability of the method across different parts can also be investigated in order to use the threshold results of one part + reference pin on another similar component without the need of a reference pin, which can make the process accessible at the industrial level.

Conclusion
In this study, a reference pin was designed, micro-machined, SEM measured and inserted in an AM part, to assist in calibrating and selecting the ideal threshold value for the porosity analysis.An Avizo 2022.1 plugin has been developed, to assist the user in semi-automating thresholds comparisons, and displaying the ones that gave the closest value to the SEM measurement.The plugin significantly reduced the time needed to manually compare different thresholds from ≈50 min to ≈3 min.However, this study also showed that different calibrated micro-machined pore sizes resulted in different ideal threshold values.This means that the user needs to initially decide on the critical pore size range, or ranges, to be measured in the AM parts as this can affect the size of calibrated micro-machined holes and thresholding algorithms that can be used.The AM part XCT measured porosity using IGTV was underestimating the Archimedes' method measured porosity while the ILTV values were either too high or too low, highlighting the need for further development and refinement to be undertaken on the presented method before it is suitable for application.
Finally, clearer metrics and agreed standards are crucially needed to unify the thresholding and porosity analysis results, allowing them to be more repeatable and comparable, which can greatly increase XCT measurement confidence and subsequently the use of AM.With clearer and agreed workflows, custom made plugins can assist greatly in semi-automating not only threshold value selection but also the porosity analysis as a whole, providing important data that can be used directly in the correction models for building defect free AM components.

Figure 1 .
Figure 1.Different steps showing the initial flexure design with machined hole (a), the reference pin with 30 µm, 50 µm, 90 µm and 120 µm holes (b), the assembly (c) an example of XCT porosity analysis of both in (d).

Figure 3 .
Figure 3. Alignment of the CT scan to the CAD (a), resampling of the aligned data (b).

Figure 4 .
Figure 4. XCT scan result showing the green ROI containing the C1 row micro-machined holes measured in the SEM and blue ROI containing the cube used for porosity analysis.

Figure 5 .
Figure 5. Avizo 2022.1 plugin calculating the 120_C1 XCT scan hole diameter at different global thresholds set by the user and plotting it alongside Otsu Threshold.The ideal global threshold here is considered the be the one closest to SEM.

Figure 6 .
Figure 6.Avizo 2022.1 plugin calculating the 120_C1 XCT scan hole diameter at different local thresholds set by the user.The ideal local threshold here is considered the one closest to SEM.

Figure 7 .
Figure 7. Example showing how two different global thresholding GV resulted in a significant difference on the porosity volume fraction data.

Figure 8 .
Figure 8.Each hole separated to different sub-volumes ready for the plugin (a).Example of the developed plugin being called in Avizo 2022.1 and linked to 120_C1 data.The CAD and SEM values as well as threshold ranges are also inserted.

Table 1 .
IGTV and ILTV of each hole and their average effect on the volume fraction of the isolated cube, followed by Archimedes' method.