The Robustness of the Gray Level Co-Occurrence Matrices and X-Ray Computed Tomography Method for the Quantiﬁcation of 3D Mineral Texture

: Mineral textural quantiﬁcation methods have become critical in both geosciences and mineral processing as mineral texture is a critical factor contributing to ore variability. However, the lack of objective mineral texture classiﬁcation has made quantiﬁcation di ﬃ cult. The aim of this study is therefore to investigate the robustness of applying the gray level co-occurrence matrices (GLCM) to 3-dimensional (3D) gray scale images measured by X-ray computed tomography (XCT) for the quantiﬁcation of mineral texture in 3D. The data quality of the GLCM outputs like statistics, heat maps and histograms in response to changes in XCT conditions such as artefacts, resolution, and calibration was tested. The response of the GLCM outputs with respect to di ﬀ erent mineral texture types with anisotropic features and inter-sample variability was also explored. The methodology included testing core sizes of 26, 19, 14, and 6 mm diameter. Calibration was tested using copper and tungsten wires. The study demonstrated the versatility of the method for di ﬀ erent sample types. Inter-sample calibration and optimal scanning conditions (quality and integrity) were also demonstrated, and a basic link between the 3D GLCM statistical descriptors with the mineral texture features of rocks was established. The 3D mineral texture method can potentially bypass the XCT segmentation process for direct automation of 3D mineral texture information.

In particular, mineral texture quantification is needed for incorporation into spatial and predictive models, where integrative quantitative datasets are required [3,15,16,21,[24][25][26]. However, in geosciences, these mineral texture features are still often described in qualitative terminologies. Currently there is little consensus on the definition of the term "mineral texture" in the geoscience holistically define mineral texture in drill core in 3D. Although the method is being developed for drill core application, it can be extended to all geoscience and engineering applications.

3D Mineral Texture Quantification
In geological sciences and other mineral related sciences, X-ray computed tomography (XCT) is used to visualize the internal structure of rocks through the acquisition of numerous 2D images that are reconstructed to make up a 3D "image volume". The volume consists of gray values scaled according to differences in X-ray linear attenuation of the minerals that relate to density variations within the 3D space [48][49][50][51][52][53][54]. Since density reflects both the composition and crystallographic structure of a mineral, the gray levels reflected in the 3D image can be scaled to the known gray levels of different minerals. Thus, the XCT can be used to provide information on composition and their spatial relationships, two features that are the essence of mineral texture.
In terms of 3D mineral textural quantification, 3D GLCM textural quantification methods using XCT volumes do exist in the medical sciences discipline [55][56][57] and 3D seismic studies [58]. However, prior to the study of Jardine et al. [43] and related [59], this approach had not been directly applied for quantitative evaluation of mineral texture in rock materials. Jardine et al. [43] extended the original 2D GLCM approach of Haralick et al. [60] into a 3D script suitable for image analysis of XCT gray level volumes of rock materials. The GLCM is a measure of how much the gray value varies between neighbouring pixels and gives a description of the spatial relationship between gray values. Haralick et al. [60] proposed fourteen second-order statistical features calculated from the GLCM, where four of these features are commonly related to mineral texture; homogeneity, contrast, correlation and energy. In the simplest explanation, homogeneity and contrast refer to the number of gray level transitions and the local variability in these transitions respectively. Correlation and energy refer to the probability of the occurrence of any specified pixel pair and the sum of the squared elements in the GLCM respectively. These statistical features were part of the 3D script by Jardine et al. [43], and forms part of the outputs of the 3D GLCM. In other words, the script allows for numerical information to be extracted, and this defines the textural information within an image, which can also be extended to the entire 3D volume. This method has subsequently been applied in a variety of rock studies [47,[60][61][62].
The 3D GLCM script has other outputs ( Figure 1) comprising the actual gray-level co-occurrence matrices accompanied by heat maps and histograms [43]. The matrices are first-order statistical features, which capture the relative occurrence of grayscale values in an image as "black and white" spatial maps. The distribution within the map is the connected or disconnected populations captured from the grayscale occurences in an image, which is indicative of the mineral phases and their spatial arrangement. The heat maps enhance the hidden information within the conventional matrices where all the details are often not visible to the human eye because the matrices appear as these black and white images (Figure 1c vs. Figure 1e). The coloured heat maps are thus visual distributions (pictorial data) of the matrices, which are plotted as absolute gray level peak interactions. Both the matrices and the heat maps plot the grayscale distribution along the diagonal between two quadrants. The vertical axis represents the reference pixel value and the horizontal axis represents the neighbouring pixel value (Figure 1e). The GLCM will only consider pixel pair interactions within a specified bit range of the image. Thus, the gray level range on matrices will be between 0 and 255 in the case where images were downscaled to 8-bit images [43] from the original 32-bit XCT data.
The resultant GLCM distribution matrix is sensitive to the variance of specific interlinked parameters of mineral texture. The mineral texture variance is assessed by the density peak differences across the quadrants, indicative of the basic presence of mineral phases. The accompanying histograms (Figure 1d), reflects the same individual peak distributions.
Additionally, the histograms can discriminate and quantify these individual peak distributions. In other words, it can discriminate and quantify mineral phases that are present within a rock material. Thus, the gray level information captured by the 3D GLCM also reports different mineral attenuations or densities [43]. The gray level information which is indicative of these mineral attenuations is reflected on the 3D GLCM heat maps and histograms. The exact position of the reference pixel value relate to the gray level intensity of the peaks and this can also be read off from the accompanying histograms. Figure 1. The 3D mineral texture quantification method using shale as an example; (a) 2D images within the 3D X-ray computed tomography (XCT) volume, (b) the gray level co-occurrence matrices (GLCM) are run on selected 2D image slices, which produces the 3D GLCM outputs; (c) matrices, (d) 3D GLCM histograms, (e) 3D GLCM heat maps, and (i) 3D GLCM statistics. The (i) statistical features, contrast, energy, homogeneity and correlation, can also be calculated for (f,g) the entire 3D volume and (h) its matrices stack [63].
The 3D mineral texture quantification method of Jardine et al. [43] demonstrated that the spatial arrangement of grainsize variation can be captured and assessed qualitatively through visual interpretation of the shape of the distribution matrix across the two quadrants. Grainsize can be discriminated based on the broadness of the shape of the distribution matrix. However, the study by Voigt et al. [63] highlighted some limitations, particularly the robustness of the 3D mineral texture quantification method to inter-sample variability and the need for manual post processing methods to normalize the gray levels of rock materials. Until now, the GLCM has been viable in differentiating mineral texture; however, a shift occurred in the GLCM heat map and histogram's mineral peak positions when comparing different rock samples that was not necessarily related to changes in mineral texture. This is because currently, the XCT does not have a routine calibration step that allows comparison of equivalent absolute gray levels for the same mineral in different rocks. In other words, direct comparisons regardless of the mineral matrix cannot be made. Generally, samples are studied in isolation with one rock domain, or where multiple materials are used, the focus of the research does not necessarily require direct gray level comparisons [47][48][49][50][51][52][53][54]57,60,61].
A recent review by Guntoro et al. [61] on data analysis methods using the 3D XCT volumes for mineral texture characterization, corroborated the limitations of the 3D mineral texture quantification method [63]. This review stated that although the 3D mineral texture quantification method could quantify mineralogy (e.g., 3D GLCM heat maps and histograms), the spatial relationship between grains had to be interpreted qualitatively. In terms of the 3D GLCM statistics, it could not correlate mineral textural parameters such as shape, size and orientation of grains. However, the study by Jardine et al. [43] only demonstrated that the 3D GLCM statistics are able to give numerical data for each mineral texture related to intra-sample variability, but this data was not further interrogated and understood.
Recently, Singh et al. [48] demonstrated that by using the 3D GLCM statistics, absolute comparisons for grain sizes can be made in relation to intra-sample variability. Until now, this has not been achieved for inter-sample variability. The study by Voigt et al. [63] demonstrated the importance of calibration which would be critical in using the GLCM numerical data for inter-sample variability. Examples of calibration approaches in previous studies include using internal calibration with a copper wire in mineral leaching [64], or dual-energy calibration methods using the densities of known materials in a sample [64][65][66][67][68][69].
The GLCM can be calculated in 13 unique voxel pair directions (D1-D13), but thus far only the dominant voxel pair direction (D1-D4) has been used [62]. Studies on inter-sample variability will introduce variable rocks which would further include both isotropic and anisotropic features for mineral textures. The statistical feature, correlation, provides additional information depending on the degree of isotropy and anisotropy in rocks [48]. Isotropic rocks tend to have similar correlation values, whereas, anisotropic rocks will have larger differences in correlation values. Therefore, in the case of complex mineral textures, for example, anisotropic features, additional unique voxel pair directions may be needed for adequate quantification [70].

Effect of the XCT on the 3D GLCM
Like any other image analysis method, the 3D GLCM is also very dependent on the instrument capability and resultant image quality of the input XCT data. The quality of the images are affected by the signal-to-noise ratio (SNR), which relates to the X-ray intensity throughout a material [54].The image quality can be quantified in XCT using SNR measures and contrast [49,66,67], where the SNR can be calculated as a measure of the ratio between the mean gray value of a region of interest (ROI) and its standard deviation of the mean. Thus, it is the detectability of a specific ROI within a noisy image, where the noise is a function of the fluctuation in X-ray flux. The noise of an image is also a function of other factors such as scanning parameters, sample size, hardware, filtering and reconstruction [50,52,53,[67][68][69]71,72]. However, some of these limitations can be addressed by optimizing measurement parameters, whereas others are inherent limitations of the XCT, for instance beam hardening and ring artefacts [50,51,53].
Beam hardening is a phenomenon in XCT that occurs when the edges of an object appear brighter than its center, even though the material is homogeneous. This occurs because the XCT polychromatic beam contains a spectrum of X-ray energies and wavelengths [50,52,66].
X-ray penetration is a function of both sample density, chemical composition and thickness [51,54], as well as the energy spectrum of the X-rays [52]. Lower X-ray energies have strongly attenuated photons, whereas, higher energies are weakly attenuated. Hence, where there is a longer ray path through the object, the lower energy photons are absorbed more, resulting in a higher penetrating beam as the lower energy photons get eliminated from the beam at a faster rate. As the material gets attenuated, the attenuation coefficient decreases with photon energy, resulting in a beam spectrum relatively depleted in lower energies, and thus a "hardened' beam. The longer the passage through the material, the more hardened the beam will become [50][51][52]. Therefore, the size of a sample and its composition will affect the quality of the images [71]. Reducing the sample size and optimizing X-ray parameters such as energy, exposure time, beam current and number of projections, means that the artefacts can be minimized.
Rock samples often have minerals that have atomic compositions that are very similar, and this leads to another primary limitation of the XCT, its poor mineral discrimination [51,72]. Dual energy scanning methods can be used to discriminate mineral phases [10,51,66]. Alternatively, studies usually have a combination of complementary techniques that are critical for method development relating to mineralogy, for example using automated scanning electron microscopy with energy dispersive spectrometry (MLA or QEMSCAN) coupled with the XCT [10,14,37,73,74].
The core objective of this study considers these XCT limitations, and its relationship with the various GLCM outputs by addressing topics such as calibration, optimum conditions, integrity, reproducibility and versatility of the 3D mineral texture quantification method-in essence, the robustness of the method.

Sampling and Mineral Texture Characteristics
Ten samples of different mineral textural types were selected. The samples were cored by Hardcore Drilling CC (South Africa) to produce drill cores of 26, 19, 14, and 6 mm diameter ( Figure 2). The most commonly used drill collar types and systems used at mines and exploration sites range between 26 and 85 mm [75]. The top size of these cores was aligned to 26 mm. The cores were decreased in size by~5mm intervals between the 26 and 14 mm cores. However, the interval for the last core had to be adjusted to a 6 mm core size, because of the availability of drilling bits during the coring exercise. The decreasing core sizes were used to assess the ideal core size for XCT penetration. Mineralogical characterization was performed on the samples to facilitate more detailed GLCM method development. The mineralogy was characterized in 2D using automated SEM-EDS QEMSCAN analysis. Samples were prepared as 30 mm diameter polished resin blocks for quantitative mineralogical characterization using a FEI 650F FEG QEMSCAN at the University of Cape Town. Samples were scanned using the field image analysis routine with instrument operating parameters of 25 kV, 10 nA, 357 fields/frames at a 15 µm pixel spacing.
The variability of the sample set was initially described qualitatively based on the intensity of the mineral texture variations within the rock types, as observed by the naked eye ( Figure 3). The samples were arranged in the degree of heterogeneity by considering both the grainsize arrangement and their mineral complexity. The spatial arrangement of grain sizes for each rock was defined as follows: fine (<1 mm), medium (1-5 mm) or coarse grained (>5 mm). The term "foliated" was also used to describe a banded rock fabric (a layered distribution of specific minerals (usually mica) within the rock matrix).
The mineral complexity was assessed by subdividing the mineral abundances into categories of major (>5 vol.%); minor (1-5 vol.%) and accessory (<1 vol.%) minerals. The number of minerals present in each category further defined the degree of heterogeneity for each grainsize grouping. Consideration was also given to the presence of ore minerals within each sample. The ten samples were then divided into two groups; named the homogeneous group (no ore minerals) against the heterogeneous group (ore minerals present).
The homogeneous rock types used were quartzite, shale, granite and sandstone. The shale sample was collected from a Malmesbury shale quarry in Cape Town, South Africa [63]. The quartzite, sandstone and granite samples were from the local rock collection of the Council for Geoscience.
The homogeneous group is characterized as follows: (1) granite, a medium-grained igneous rock, dominated by major minerals; quartz, plagioclase, orthoclase and biotite, with minor and accessory amounts of amphibole, chlorite, epidote and apatite; (2) sandstone, a medium-grained sedimentary rock, dominated by quartz, associated with minor minerals of biotite, plagioclase, orthoclase and rutile; (3) shale, a fine-grained sedimentary rock, dominated by quartz, biotite, plagioclase and orthoclase, associated with minor minerals such amphibole and chlorite; and (4) quartzite, a medium-grained metamorphic rock, dominated by quartz with accessory amounts of pyrite.
The six heterogeneous rocks ( Figure 3) were collected underground from the Swartberg (Cu-Pb-Zn) sulphide ore deposit in South Africa [76]. These rocks were subdivided into three types of quartzite, two types of gneiss and one schist. They were further classified based on the dominant minerals present within each type.
Reference samples were chosen for the initial method development into the investigation of the robustness of the 3D mineral texture quantification method. Thereafter, the method was applied to all samples after the optimum conditions were assessed. One reference sample was selected from each group based on the closest similarity in mineralogy between the samples, both being quartzite. The mineralogy was considered a bigger factor at this stage of testing, because the XCT is more dependent on the mineral variance present within each rock versus the spatial arrangement of those minerals.
Knowing the mineral compositions and relative mineral densities of these minerals, enabled the calculation of an effective linear attenuation coefficient for each mineral. This was done using a nominal X-ray energy of 68.8 KeV, and the methodology given by Bam, [66]. The X-ray energy of 68.8 KeV was chosen because it is an equivalent effective energy of 175 kV which correlate to the scanning measurement for this study [66]. The effective linear attenuation coefficients for the relevant minerals are provided in Table 1. Table 1. Simplified list of the minerals/metals of interest for comparison with the X-ray computed tomography data based on relative mineral densities, their ideal chemical formula and their attenuation coefficients [77].

XCT Measurement and Data Acquisition
The initial XCT scanning and method development were done using a NIKON XTH 225 ST system housed in the Microfocus X-ray Radiography and Tomography facility at the South African Nuclear Energy Corporation (NECSA), Pelindaba. Additional tests, as well as the final dataset, were performed using a NIKON XTH 225 ST system housed at X-Sight X-ray services, Cape Town. Henceforth, these XCT instruments are labelled as instrument A (NECSA) and instrument B (X-Sight). For the first set of experiments one sample from the different core sizes (6, 14, 19 and 26 mm) representing each rock type, was scanned using a constant set of XCT scan parameters to acquire the 3D gray level volumes. The fixed scanning parameters were 175 kV, averaging of 3 frames, 1000 projections, using a 2.5 mm Cu filter, with approximately 30 min per scan (Table 2). However, the variable parameter was the resolution, which was directly proportional to the sample size, e.g., a 6 mm core would scan at a 5 µm resolution whereas the 26 mm core would scan at 20 µm resolution. Two stages of calibration were assessed using copper and tungsten wires of diameter 0.5 mm 0.1 mm respectively. The first stage was with two-point reference calibration using only the copper and air peak. The second stage was with three-point calibration using copper, tungsten and air peak. In both experiments the wires were attached using adhesive tape to each of the 6 mm core samples, with constant scanning parameters (as specified above). The 6 mm core samples were chosen as the ideal core size because they had the best XCT penetration. The scans were repeated for each 6 mm core by also removing the wire for comparison between the calibrated and non-calibrated 3D volumes. Seven XCT image stacks are given as Supplementary Materials at https://doi.org/10.6084/m9.figshare.c.4893774. The XCT image stacks are for quartzite, sandstone, granite, shale and magnetite-bearing quartzite samples using three-point (air-Cu-W) calibration. Additionally, two XCT image stacks are given for the magnetite-bearing quartzite sample using two-point (air-Cu) calibration against a XCT image stack with no calibration.

Image Preparation and Feature Extraction
The 3D GLCM were extracted using the dedicated MATLAB script developed by Jardine et al. [43]. All the 3D GLCM outputs were run systematically on the XCT 3D volumes for each of the samples (Table 3). In the case of using only the two-point reference calibration, it was necessary for processing of the gray levels because the gray levels of the reference material (copper wire) differed between samples. This was achieved by manually standardizing the gray levels using the copper wire as a reference in every image using the freeware image processing software Fiji ImageJ. Generally, this is standard practice to manually standardize gray levels post scanning [49,50]. A specific gray value was assigned to the copper wire, and thereafter gray levels of all other minerals present in an image were standardized relative to the copper wire. In the case of the three-point calibration, there was no need for post processing or standardizing of the gray levels as the gray levels were automatically standardized. ImageJ was then used to validate the standardization using copper wire as a reference. Additionally, ImageJ was used to crop the images to a standard size of 600 × 600 pixels per 2D image slice, a total of~2000 images per 3D volume. Table 3. 3D GLCM image analysis methodology. Each step was applied to every XCT scan to generate the GLCM outputs.

Step 3-Heat maps and histograms
Using D1 matrices, extract the heat maps from selected images in a volume by running 3D GLCM code 2 using Matlab.

Step 4-Statistics (four descriptors)
Extract statistical descriptors for the entire volume by running the 3D GLCM code 3 in Matlab. Acquire four textural parameters for a minimum of 1000 images per volume. Total of~10,000 quantitative records.

3D GLCM Interpretation
The initial interpretation by Jardine et al. [43] for the 3D GLCM heat maps and histograms was followed: The GLCM heat map matrices have two axes whereby the vertical axis represents the reference pixel value and the horizontal axis represents the neighboring pixel value. The red or 'hot' peaks of the distribution indicate the dominant gray value population(s) within the XCT slice, thus representing the dominant mineral density information. The peaks located in the bottom right hand quadrant generally represent the denser mineral phases such as sulphides, like pyrrhotite, pentlandite and chalcopyrite, and oxide minerals. Peaks located in the top left quadrant represent the lighter mineral phases, such as silicates, like quartz, micas and amphibole. The width of the GLCM peaks away from the diagonal correlated with mineral grain size. A narrow distribution indicated a coarse grain size population, whereas a broad distribution indicated a fine grain size population which relates to the degree of grain boundary interactions. A fine-grained material has a high degree of grain boundary interaction, arising from the high surface area to volume ratio. The heat maps are accompanied by histograms showing the distribution of the numerical data of the heat peaks, correlated to individual gray level peaks, by illustrating the mineral phases and their relative abundance.

Quantitative Mineralogical Characterization (2D)
Quantitative mineralogical characterization representing the basic rock classification are illustrated by the QEMSCAN field images (Figure 4) for the two reference samples (quartzite (homogeneous group) and magnetite-bearing quartzite (heterogeneous group)). Their differences are further quantified using the mineral volume percentages, and can be described as; (i) a medium-grained nearly monomineralic homogeneous rock, dominated by 98 vol.% quartz with a few dense pyrite inclusions of 0.5 vol.%; and (ii) a foliated, medium-grained heterogeneous rock, dominated by 62.6 vol.% quartz, 9.2 vol.% magnetite and 8.7 vol.% mica, associated with 17.3 vol.% sulphides (dominantly chalcopyrite and pyrite, with 13.6 vol.% and 3.8 vol.% respectively) and minor other silicates.

Effect of Sample Size on XCT Image
The effects of beam hardening artefacts by the XCT were demonstrated by comparing radiographs of the magnetite-bearing quartzite using the 26 mm and 6 mm cores (Figure 5a,b). The SNR was measured for each core size by selecting a ROI. Here the region comprised only a selected area of the high density sulphides (galena) within each image (Figure 5c-f). The quality of the image can be assessed quantitatively using the mean and standard deviation values of the ROI. As the image quality improved with decreasing core size, the mean SNR value improved (189.51-243.07), and the standard deviation decreased (15.94-5.78). The lack of XCT penetration in the high-density materials for the bigger core sizes produced poor discrimination in mineral features, and hence, unusable XCT data. This was especially evident for the magnetite-bearing quartzite which has a number of high-density minerals ( Figure 4, Table 1). The 6 mm cores produced the optimum core size, among the cores examined. This allowed XCT penetration and the discrimination of mineral features, which enhanced the image quality and therefore, the acquisition of usable XCT data.  (a,b). Their associated gray level XCT 2D images are given (c,f). XCT 2D image slices for 19 and 14 mm core sizes (d,e). Calculated signal to noise ratios (mean and standard deviation) are also given.

Effect of Sample Size on 3D GLCM
The effect of image quality is demonstrated using the 3D GLCM heat maps and histograms for the different core sizes of the two reference samples ( Figure 6). The 3D GLCM heat map and histogram outputs for each of the core sizes show that the heat peaks and distribution become more defined as the image quality improved, thus as the core size became smaller. Penetration artefacts (beam hardening) were more evident in the case of the magnetite-bearing quartzite (heterogeneous) sample (Figure 6a-c) in comparison with the quartzite (homogeneous) sample (Figure 6d-f). In the case of quartzite, the X-ray penetration was not inhibited between the three core sizes, and image contrast was optimal in all three because the rock is composed of predominantly low-density material of quartz (98 vol.%). However, the sample had some accessory pyrite inclusions, thus, the changes were seen in the accompanying 3D GLCM outputs as well. These high-density inclusions were not visible within the bigger core sizes, but this is a function of resolution, and thus the inclusions are not visible in the GLCM outputs.
In the case of the magnetite-bearing quartzite, which was heterogeneous and had a high proportion of dense magnetite and sulphide minerals, the overall high density of this core led to difficulties in X-ray penetration, and thus poorer image quality. As the core size increased, it subsequently led to poorer GLCM heat map peak discriminations. The best image contrast was observed for the 6 mm diameter cores for both samples. This also included better quantification of the information in the GLCM histograms, because the image noise and beam hardening were reduced. As soon as the optimal image quality was reached, the 3D GLCM statistical descriptors were calculated for each image ( Table 4). The 2D images were selected from the 3D volumes for each reference sample (per core size) for a comparison with the 3D GLCM heat maps and histograms ( Figure 6). Homogeneity values, which are the number of gray level transitions based on local variability, consistently decreased as core size increased for both samples. For example, homogeneity calculated for the magnetite-bearing quartzite decreased from 0.68, 0.25 to 0.23 for the 6, 14 and 19 mm cores respectively. However, as a limitation, the data could not be directly compared between the two samples, or cannot be considered as absolute numbers, because the XCT did not have routine calibration measures to standardize the gray levels for inter-sample comparison at this stage of testing [63].

Effect of Two and Three-Point Calibration
Direct comparison of the gray level information of the various XCT volumes was demonstrated using copper wire as a reference material to facilitate a two-point calibration. The images (Figure 7a,b) illustrate the effect that the XCT had on the 3D GLCM outputs when the sample was scanned with and without the copper wire using the magnetite-bearing quartzite as an example. The images were normalized relative to the copper wire using manual processing, by adjusting the image to where the copper wire has a gray level of 70, 150 or 255 within a 0-255 (8-bit) gray level range (Figure 7c-e). The accompanying 3D GLCM outputs illustrated how these adjustments affected the histograms and heat map distributions. The individual gray levels within the peaks of the GLCM histograms relates to individual mineral and/or mineral phases, and further quantifies the relative abundance for each gray level. This relates to quantification of the mineral's abundance. The trend remained the same (two main peaks), but these peaks were stretched or compressed relative to the gray level of the copper wire peak. At this stage of testing, it was not considered desirable to correct gray levels through post processing methods, as the overarching aim of the research is to develop an unsupervised method. Another problem that arose was that galena attenuated higher than the copper wire, and therefore appeared "brighter" on the image slices. Thus, the densities and attenuation coefficients of the minerals / metals were considered as it provided an indication of their response to the XCT (Table 1). Although the copper wire has a higher specific gravity than galena (8.93 g/cm 3 vs.~7.58 g/cm 3 ), the attenuation coefficient of copper was 12.95 cm −1 , whereas galena had a significantly higher attenuation coefficient of 31.59 cm −1 . The effect that this had on the 3D GLCM is that the distribution of sulphides or oxides did not appear separately on the 3D GLCM heat maps, as it was interpolated into the copper peak.  (a,b). Examples of the changes in gray values where the copper wire is adjusted to 70, 150 and 255 are given respectively (c-e), and how these changes affect the 3D GLCM heat maps and histograms.
As a result of these issues, tungsten was added to the calibration, as its attenuation coefficient was higher than all the minerals present in the sample. The effect of these differences was observed in the GLCM heat maps given by comparing the samples calibrated using the copper wire alone (Figure 7d) against calibration with both the copper and tungsten wires (Figure 8). The intensity of the individual mineral peaks did not change, but their relative spatial distribution changed (either stretched or compressed) relative to the air, copper or tungsten. Therefore, for direct comparison between different samples, it was necessary to artificially include a material of highest density which would automatically accommodate all mineral peaks within a sample, in effect eliminating manual post processing of gray level adjustments.

Effect of XCT Instrument
Comparison of results from the two different XCT facilities on the same samples allowed the reproducibility of the XCT and 3D GLCM method to be assessed. GLCM statistics were identical when comparing the exact same slice (Figure 8a,d). The statistical values for these parameters were also calculated through the entire 3D volume for the sample for each of the instruments (~1000 images per 3D volume) using the three-point calibration approach. Comparison of the full XCT volume showed only minor differences when comparing average values for each parameter (Table 5).

Effect of Mineral Texture
Pictorial 3D GLCM heat maps showed the shift in gray levels for the resultant mineral peaks after calibration by comparing the homogeneous sample set (Figure 9). This image relates only to basic mineralogy and shows calibrated peak positions. The image shows the position of quartz for each rock type. Quartz is the mineral that has the lowest attenuation coefficient (0.57 cm −1 at the effective energy of scanning) within each rock type, and the GLCM reflects this as the first mineral peak (top left hand corner) within each image. The dominant discriminatory factor is therefore based on mineralogical changes between each rock type. Figure 10 illustrates specifically grainsize distribution, as the discriminatory factor. The rock numerical database was summarized in the form of binary box-and-whisker plots, calculated for the four statistical descriptors (contrast, correlation, energy and homogeneity), although only contrast is used as an example here. The database included~1000 images for each of the 10 samples with the three-point calibration. The homogeneous rocks (shale, sandstone, and quartzite) had a smaller range in contrast, which was indicative of their more homogenous nature when comparing one image to another within its 3D volume.
In the case of the granite sample, which was the most heterogeneous from within this subgroup, mineral proportions may have changed slightly from one image slice to another, resulting in a broader statistical range indicative of its enhanced heterogeneity. Furthermore, the box-and-whisker plots also showed sensitivity to the high variability in composition for the heterogeneous ore samples. The basic trend in Figure 10 shows that finer-grained rocks had high absolute GLCM contrast statistical values, which decreased proportionally as the samples became more coarse-grained. This was indicative of the compositional variations within images for a specific sample. The inherent mineralogical properties, their variability and representation within each sample could then be captured.  . The GLCM contrast statistical descriptor illustrated as box-and-whisker plots for the different "mineral texture" types using the three-point (air, copper and tungsten) calibration. A thousand images were used for each of the samples. Drill core photographs of the different mineral texture types are shown to illustrate textural variation ranging in coarse-to fine-grained rocks. The statistical range captured illustrate the degree of mineralogical complexity within each mineral texture type.

Discussion
The optimum measurement parameters for XCT image quality [50,67] were tested using the two reference samples, a nearly monomineralic quartzite against a heterogeneous magnetite-bearing quartzite. Beam hardening artefacts [50] and the lack of XCT penetration produced unusable data for the bigger core sizes (>14 mm) in the magnetite-bearing quartzite, because of the dominance of high-density material within these samples. Image quality could be improved by reducing the sample size to cores of 6 mm in diameter. However, this is rock dependent, as image quality was not affected by sample size for the quartzite samples.
Once the optimum image quality was achieved, each of the various rocks representing a unique "mineral texture" type could be calibrated. Calibrating the gray levels of mineral phases (sulphides and oxides vs. silicates) was critical for consistency in data comparison between the individual mineral texture types [63]. This was done by attaching copper and tungsten wires to each sample prior to the XCT scanning. The result is a consistent spatial distribution of individual mineral peaks within the XCT histogram. The spread of the mineral peaks is thus consistent relative to air and tungsten peaks. As a result, post processing calibration was not needed, and the copper wire should rather be used as a reference point to validate the accuracy and precision for mineral peak positions.
Ultimately, if poor quality XCT data is used, the 3D GLCM outputs will be compromised, and may not provide any meaningful information. Therefore, optimum XCT measurements and calibration are also critical for 3D GLCM interpretation, and consequently 3D mineral textural quantification. If standardization of mineral peaks is not achieved, then the 3D GLCM statistical descriptors cannot be used in inter-sample comparisons or quantification. Calibration may not necessarily be needed in the case of only intra-sample comparison intended for 3D mineral textural quantification [43,48]. However, this assumes that the mineralogy remains consistent. This may not be sensitive to relative mineral abundance necessarily, but rather the consistency in the presence of the same mineral suite within each sample [63]. Close to identical results were obtained using this approach on two different instruments, further demonstrating the reproducibility and confidence of the 3D mineral texture quantification method.
Until now, the GLCM histograms quantifies basic mineralogy [43], by assigning a value for each gray level, indicative of mineral phases, and with no textural information. The GLCM heat maps show visual distributions of the mineral phases, through gray level peak positions, and the textural information can be qualitatively interpreted. The GLCM statistical descriptors can capture the inherent mineralogical properties and show their variability. Mineral heterogeneity can be captured by the 3D GLCM statistical descriptors, where they are directly proportional with the increase in mineral and textural heterogeneity. Heterogeneous rocks have larger statistical ranges, where the statistical range will decrease when mineral variability decreases. The 3D GLCM statistical descriptors also show sensitivity to textural changes, where the basic trend shows finer-grained rocks having higher contrast values that decrease proportionally with coarser-grained material [48,63].
The calibrated 3D GLCM statistical descriptors can therefore be used as building blocks for classification of mineral textural information using classification algorithms through discrimination and vectorization. However, the 3D GLCM statistical parameters may possibly be used as a basis for individual generic textural elements discrimination, like grainsize and mineralogy. This method thus far describes the other interlinked mineral textural parameters, such as associations, shapes and orientations, as factors contributing to the GLCM summary. Future research may further investigate these parameters within the GLCM outputs, as the XCT can also be used to calculate roundness and sphericity of mineral phases. It should be noted that the results presented in this paper were acquired by using the 3D GLCM in only one dominant voxel pair direction (D1-D4) [43]. Therefore, it needs to be assessed whether the other voxel pair directions will provide any additional information, and how this will affect the classification algorithms.
The long-term vision for this method is for drill core application, extended to other geoscience and engineering applications, especially in geometallurgical and process modelling applications for use in integrative and big datasets [3,7,8,26,38,39]. Thus, to be used in the context of automated logging systems for drill core management, related to ore deposit knowledge and modern mining, as increasingly complex rocks are being processed. Future work should include textural descriptors which incorporate the integral mineral composition, and can potentially predict processing response, for example, rock strength [63].

Conclusions
This paper demonstrated the effect of the XCT limitations and its relationship with the various GLCM outputs by demonstrating the effects of calibration, the optimum conditions, integrity, reproducibility and versatility which collectively is an investigation into the robustness of the 3D mineral texture quantification method. The XCT image quality affected the 3D GLCM outputs (heat maps, histograms and statistical descriptors respectively) and subsequently the quality of the 3D mineral textural quantification of rock drill core. It further introduced a potential XCT standardization step for mineral textures by using studies of various heterogeneous Cu-Pb-Zn ore against more homogeneous rocks of granite, shale, sandstone and quartzite. It can be concluded that under the same conditions and instrumentation, the different mineral textures can be calibrated and compared regardless of the mineral matrix by using the three-point calibration. Automation of the calibration technique may allow the GLCM statistics to be used for grainsize quantification, whereas the GLCM histograms and heat maps may be used for mineralogical quantification. Thus, the 3D mineral texture quantification method allowed direct automation of 3D mineral texture information and bypassed the XCT segmentation process. The quality of this calibration can be enhanced by artificially including multiple reference points that can potentially aid absolute quantification to surpass relative quantification.
Author Contributions: M.V. executed the formal analysis and writing of the paper, as part of the requirements for her PhD study, where M.B. is the principal supervisor. J.A.M. and A.N.M. are co-supervisors, and all three supervisors contributed towards review and editing of the paper. L.C.B. advised on the methodology for XCT scanning and validation. All authors have read and agreed to the published version of the manuscript.
Funding: This work is based on the research supported in part by the National Research Foundation of South Africa (Grant Numbers 86054, 99005). Any opinions, findings and conclusions or recommendations expressed in any publication generated by the NRF supported research is that of the author(s), and that the NRF accepts no liability whatsoever in this regard. This work is also supported through the South African Minerals to Metals Research Institute and the Department of Science and Innovation.