An experimental study on segmentation in X-Ray Computed Tomography

X-Ray Computed Tomography is an emerging technology for geometric inspection, in particular when complex and internal surfaces are involved. The typical work-ﬂow for an X-Ray Computed Tomography inspection includes scanning the part, reconstructing the volume, segmenting it by creating a surface, comparing the generated surface to the nominal geometry, and stating the inspection result (e.g. conformance to some speciﬁcation). In particular, the segmentation step has been demonstrated critical, greatly inﬂuencing the measurement result (both randomly and systematically), and then vastly affecting the uncertainty. In this work, we propose experimental evidence on how the choice of the segmentation method affects the measurement result.

1 Segmentation in X-Ray CT Recent years have seen a great interest on the applications of X-Ray Computed Tomography (XCT) in industry [1].Even if XCT has been known since the '80 as an effective technology for non destructive inspection, only in recent years the XCT scanners have reached the accuracy needed for their use in dimensional inspection [2].Compared to traditional coordinate measuring instruments, XCT has several advantages.It is the only technology capable of measuring internal geometric features with ease (the only competitor being ultrasound inspection, whose accuracy is insufficient for dimensional metrology applications).Furthermore, the difficulty and the time required for the scan does not significantly depend on the complexity of the part.This makes XCT particularly suitable for Additive Manufacturing made parts, which are said to allow "complexity for free" [3].But what really distinguishes XCT from any other geometric inspection systems is that it is not exactly a coordinate measuring system.Conventional coordinate measuring systems [4] probe/scan a cloud of points on the surface of a part, and then compare them to a CAD mode, apply some fitting algorithm on them to obtain estimates of geometric/dimensional deviations and then verify geometric/dimensional tolerances, or use them as support for reverse engineering (Figure 1A).But XCT does not work this way.In fact, its output is a voxel representation of the X-Ray absorption [5]: no cloud of points is directly available.As such, the measurement work-flow differs from the standard geometric measurement.After X-Ray projections have been collected and the volumetric representation has been reconstructed, segmentation must be applied before it is possible to perform a CAD model comparison, a geometrical verification, or a reverse modeling (Figure 1B): segmentation converts the volumetric (voxel) representation of the part into a cloud of points.Although some segmentation-free approaches have been recently proposed for  geometric verification [5,6], in particular when additive manufacturing parts are involved, segmentation is still the common approach.Unfortunately, segmentation is recognized as a significant contributor to measurement uncertainty (Figure 2).The origin of this uncertainty is related to several factors.The boundary between the material and the surrounding medium is never totally neat, but a (more or less) smooth transition that can involve a few voxels.XCT artifact like beam hardening and scattering can significantly alter the segmentation.The presence of different materials in the scan volume requires different boundaries [7].Noise can badly affect the segmentation, and even generate false points.In general, segmentation is recognized as one of the most significant sources of uncertainty when XCT is used for geometric metrology.Furthermore, in literature several algorithms can be found claiming to provide effective solutions for segmentation.Most of them derive from segmentation of images.Up to now, anyway, no recognized standard exist defining the approach to be applied in different situations.The aim of this work is to propose the results of an experimental activity conducted to compare five different approaches to the segmentation of XCT scans.The influence of other recognized sources of uncertainty will be considered as well, showing that the impact of the segmentation is prevalent.

Segmentation algorithms considered in the experiment
A segmentation algorithms is a sequence of logical/mathematical operations that attribute the voxels of a XCT scan to two or more segments, e.g. to divide the portion of the scan volume occupied by the measured object from the surrounding medium [8].Five segmentation algorithms have been considered in the the experiment: hysteresis thresholding, region growing, Sobel 3D, Sobel 5D, and Canny.In this paragraph they are briefly introduced.

Hysteresis thresholding
Hysteresis thresholding [9] is a variation of the most simple segmentation approach: global thresholding.In global thresholding a threshold is defined.Then all the voxels characterized by a value of the X-Ray absorption lower than the threshold belong to a segment, and the others to another segment.In hysteresis thresholding two thresholds θ 1 > θ 2 are considered instead: a voxel x is attributed to the the segment 1 if its X-Ray absorption f (x) is f (x) ≥ θ 1 , and to segment 2 if f (x) ≤ θ 2 .Voxels between the two thresholds are attributed to segment 1 if and anly if they are adjacent to voxels already belonging to segment 1.In formula: A main limitation of hysteresis thresholding is the need of defining a-priori the two thresholds.As Figure 3A shows, due to this arbitrariness several voxels can be incorrectly attributed to the segments.This does not, however, necessarily affect negatively the measurement results.

Region growing
Region growing is a class of similar algorithms that try to define, voxel by voxel, the segment of membership.Region growing algorithms are based on the fact that all voxels belonging to the same segment are "connected" and similar according to some properties.Starting from a seed the neighboring voxels are added to the segment as long as they satisfy some conditions M (x).A generic region growing algorithm expressed in pseudocode is shown in Figure 4. Differing from hysteresis thresholding, region growing do not need the a-priori definition of parameters.Furthermore, as Figure 3B shows, as voxels are progressively added to the segment, usually no external voxel is added.

Sobel 3D and Sobel 5D
While hysteresis thresholding and region growing base the membership to a segment on the value of the X-Ray absorption at a specific voxel, Sobel algorithm is based on the search for discontinuities in the X-Ray absorption.In practice the Sobel algorithm uses the Sobel's operator [10] to calculate the X-Ray absorption gradient, and then the boundary of the segments is identified by the voxels whose gradient passes some threshold value.The two proposed approaches (Sobel 3D and Sobel 5D) differ only in  the way the gradient is calculated.In particular, the evaluation of the Sobel 5D approach is more robust.Anyway, Figure 3C and D do not show any significant difference.These figures also show that this approach is particularly prone to noise, which can locally generate a high gradient.

Canny
The Canny's algorithm [11] is an improvement of the Sobel algorithm, which tries to get rid of the influence of the noise and to identify the location of the boundary with a better accuracy.Its application for XCT is already well known in literature [12].To obtain the improvement, a series of steps are required: 1. (Gaussian) smoothing 2. Calculation of the gradient (e.g.Sobel) and thresholding on the gradient 3. Non-maximum suppression -Sharpens the borders by removing blurred pixels 4. Double Thresholding -Eliminates fake borders generated by the noise in the scan As Figure 3E shows, compared to the Sobel results the identification of the boundary looks sharper and the influence of the noise is significantly reduced.

Experimental study
An experimental study has been planned and developed to describe the effect of the choice of the segmentation algorithm on the geometric measurement result.Ne next paragraphs describe the adopted artifacts, the experimental design, and the results.

Artifacts
Two artifacts have been manufactured by turning, the first made of 2011-T4 aluminum alloy, the other made of Ti6Al4V -Grade 5 titanium alloy (Figure 5).The sample design was inspired by the reference artifact defined in the VDI/VDE 2617-13 standard [13]: it is a multi-diameter cylinder.For the aluminum sample, the nominal diameter of the various parts where 8-12-16-20-24-28 mm, and the height of each step was equal to 5 mm.The size of the titanium sample was a bit smaller.This was due to the limited voltage of the CT scanner adopted.For the titanium sample, the nominal diameter of the various parts where 6-9-12-15-18 mm, and the height of each step was equal to 3 mm.The samples design allowed more that one measurement result per each CT scan (six for the aluminum sample, 5 for the titanium sample).It is worth noting that the different thickness of the various parts of the samples generated a different beam hardening.This made a software compensation of the beam hardening CT artifact (performed by the "NSI eFX-CT" software adopted for the reconstruction) mandatory.
All the diameters of all the parts of the two samples were calibrated on a "Zeiss Prismo VAST HTG" coordinate measuring machine.The calibration uncertainty was always less than 1 µm.As this uncertainty is about two order of magnitude lower than the typical measurement errors occurred in XCT measurements, it has been neglected in the following discussion.

Experimental design
The samples were scanned on a "NSI X25" micro-focus XCT scanner.The factors considered for the experiment were the voltage of the X-Ray source, and the presence or absence of a physical filter.In order to obtain good quality XCT scans, the X-Ray source intensity has been set depending on the combination of sample -voltage -filter.Also the different diameter of the various parts of the samples constitute a factor of the experiment.Finally, the five segmentation algorithms described in Section 2 are the main factor of interest.
For all measurements, the integration time was set to 302 ms.The voxel size was equal to 22.1 µm for the aluminum sample, and 12.5 µm for the titanium sample.
As such the complete experimental design for the aluminum sample was: Each experimental condition was repeated twice.In total, 240 measurement results were obtained on the aluminum sample and 200 on the titanium sample.

Analysis of the experimental results
The experimental results have been been analyzed by means of ANOVA [14].The response variable considered was the difference between the measured diameter of the various parts of the samples and the calibrated diameter (measurement error).All the hypotheses (normality, homoscedasticity, and absence of correlation of the residuals) were verified successfully.The results of the analysis are summarized in Figure 6 for the aluminum sample and in Figure 7 for the titanium sample.These figures show "main effects plots" for the two experiments, i.e. the average impact of the various levels of the factors on the response variable.
The figures clearly show that the algorithm impact is in both cases way larger than the impact of any factor.From a statistical point of view, the algorithm is statistically significant for both samples.For the aluminum, also the presence of the physical filter is relevant, while for the titanium sample, the diameter and the voltage are relevant.Considering now the average measurement error, it is worth noting that the Canny algorithm provides measurement results whose average error is closer to zero (indicated by the green line in Figure 6-7) than any other algorithm, if both samples are considered.

Conclusions
Several uncertainty sources affect XCT, but among the others, segmentation is probably the most relevant, as even slight variations in the approach can lead to large errors.Our experiments have shown that, among the parameters which are usually under the control of the operator (like the X-Ray source voltage and intensity, or the choice of a physical filter), it is probably the most relevant.As it is under the control of the operator, its impact could be minimized (or even avoided at all) if a complete knowledge of it would be available.As this knowledge is not yet available, our research, rather than giving a series of answers, rises a series of questions.First of all, can a standard test be developed for segmentation algorithms?A standard test could lead to a more informed choice of the segmentation algorithm, because it can map the behavior of the algorithm in different conditions.This leads to a second question: is the optimal segmentation approach task-specific?Probably it is.These questions can be extended to the whole XCT measurement work-flow as shown in Figure 1B.
Second, what kind of research is of more interest to reduce the uncertainty of XCT geometric measurement in industrial applications?Probably the development of guidelines for the optimal measurement is interesting, from an industrial point of view.But also more study on the absorption curves of different materials, which can help in the development of more effective reconstruction and segmentation algorithms, without the need of a the operator intervention, is of interest.Finally, is segmentation required?Some approaches have been proposed which do not need segmentation to state the conformance of a part to a geometric tolerance.However, it is still to be shown whether these approaches increase or reduce the reliability of the conformance statement.

Figure 1 :
Figure 1: Work-flow for dimensional inspection: A, by conventional coordinate metrology; B, by XCT.

Figure 4 :
Figure 4: Example of pseudocode of region growing algorithm.

Figure 5 :
Figure 5: Artifacts for the study of the influence of the segmentation approach, and their XCT scan.

9thFigure 6 :
Figure 6: Main effects plot for the aluminum sample.

Figure 7 :
Figure 7: Main effects plot for the titanium sample.