Core-CT: A MATLAB application for the quantitative analysis of sediment and coral cores from X-ray computed tomography (CT)

X-ray computed tomography (CT) is a non-destructive imaging technique that provides three-dimensional (3D) visualisation and high-resolution quantitative data in the form of CT numbers. CT numbers are derived from the X-ray energy, effective atomic number and density of the analysed material. The sensitivity of the CT number to changes in material density means that it can be used to identify facies changes within sediment cores by detecting downcore shifts in sediment properties, and to quantify skeletal linear extension rates and internal biological erosion from coral cores. Here we present two algorithms to analyse CT scan images for geoscience research and package them within an open-source MATLAB application (Core-CT) that is freely available at GitHub (https://github.com/yuting-yan/Core-CT). The first algorithm computes CT numbers from a user-defined region of interest to identify boundaries of density change (e.g., sedimentary facies, laminations, coral growth bands). The second algorithm segments regions with major density contrast (e


Introduction
Computed Tomography (CT) is a non-destructive method used for creating detailed imagery that has been widely applied to many geoscience-related fields (Cnudde and Boone, 2013;Ketcham and Carlson, 2001).This imaging technique uses mono-energetic X-rays to produce high-resolution cross-sectional images, which are then stacked together to construct complex three-dimensional (3D) volumes (e.g., Duliu, 1999;Ketcham and Carlson, 2001).CT scan images are made up of voxels that records the attenuation of the X-ray directed at the object.As X-ray attenuation is dependent on density, voxel values can be used to make sub-millimetre scale measurements of bulk density in a non-destructive way (Duchesne et al., 2009;Orsi and Anderson, 1999;Toscano et al., 2018).

Geoscience applications of CT scanning
The ability of CT scanning to produce detailed internal visualisations of a range of material types makes it an excellent tool to study sedimentary and rock structures (e.g., Nasseri et al., 2011;Orsi et al., 1994), rare and fragile fossils (e.g., Rahman et al., 2012) and biogenic structures (e.g., Dufour et al., 2005).The non-destructive approach also does not result in the damage or destruction of valuable specimens (Dufour et al., 2005).In palaeontology, detailed internal and external 3D visualisations of fossils are helpful for taxonomic classification and to facilitate analysis of their internal composition and architecture (Cunningham et al., 2014;Rahman et al., 2012).
Similarly, the presence of fossils (e.g., shells or charcoals) or changes in sediment facies can also be identified within an unsplit sediment core using CT scan images.Collectively, a greater knowledge of the internal composition of sediment cores prior to splitting can optimise laboratory procedures by pre-determining sampling intensity and identifying the best splitting plane to avoid destroying valuable materials for chronological reconstructions.High-resolution CT profiles have also been previously used to identify changes in sediment facies to infer past climatic oscillations from sediment cores (Gagnoud et al., 2009;St-Onge and Long, 2009).However, current CT methods do not allow CT number profiles to be computed from a specific area, which is critical to ensure that the resulting profile is not affected by other materials.
CT scanning has also expanded to palaeoceanographic studies using coral cores (DeCarlo and Cohen, 2017;Saenger et al., 2009).Scleractinian corals (e.g., Porites spp.) provide archives of ocean conditions (e.g., temperature, salinity, pH) within their skeletons.Reconstructions of coral annual growth bands, coupled with geochemical proxy analysis of the skeletal material, have been used to constrain the timing and magnitude of past environmental and climatic changes (e.g., Carilli et al., 2010;D'Olivo et al., 2013;DeCarlo et al., 2019).However, these growth bands, representing seasonal couplets of high-and low-density skeletal portions, are often irregular to the coral surface due to intra-colony variations in growth rates and coral morphologies (e.g., Barnes and Lough, 1993;Morgan and Kench, 2012).Thus, it is often difficult to establish a plane for slabbing and analysis without prior knowledge of the internal coral growth morphology.

Challenges of using CT data
There is currently a paucity of freely available software for manipulating CT data specific for geoscience applications.Data and image processing are commonly performed by certified technicians, and while geoscientists have access to open-source CT scan image viewers that provide basic viewing properties, the manipulation or reconstruction of images requires expensive professional software.Furthermore, these software and toolkits are mostly developed for health and life sciences, where measurements of CT numbers usually involve point sampling only (Escott and Rubinstein, 2003), and are therefore insufficient to analyse sediment cores continuously.
Geoscientists have therefore relied on their own codes, such as CoralCT (DeCarlo and Cohen, 2016) and SedCT (Reilly et al., 2017), to process and analyse CT scan data for specific investigations.CoralCT is a suite of MATLAB code that maps out annual laminations in 3D to calculate growth (skeletal linear extension and density) from CT scan images (DeCarlo and Cohen, 2016).SedCT isolates sediment horizons by sorting the CT numbers and computing a CT number profile using values along a continuous slope specified by users (Reilly et al., 2017), but analysis is not comprehensively tailored to each user's needs.

Core-CT
We present Core-CT, a multi-use MATLAB based user-interactive platform to facilitate the extraction of useful data from CT images for a variety of geoscience investigations.Core-CT provides a significant advancement in analysing CT scan images by improving and integrating various types of analytical tools into a single platform.We developed an algorithm that allows users to define a region of interest (ROI) within the CT scan images, from which a continuous CT profile can be obtained.This is a key feature of Core-CT that will greatly benefit sediment core analysis.Sediment core analysis often requires targeting specific areas as they are mostly scanned together with PVC pipe and/or core lining that have a different density from the sediments.Therefore, an average value across each image slice is not representative of the sampled material.To this end, the ability of Core-CT to specify an ROI within the CT scan images will be advantageous.Coral studies can also benefit from Core-CT as CT scans are becoming more commonly used to generate 3D evaluations of coral growth that also consider growth morphology.On top of identifying growth bands, we further enhanced 3D visualisation for coral core analysis by including a function in Core-CT to conduct geometric measurements on irregular volumes, such as internal void spaces, which can be used for quantification or characterisation purposes.We demonstrate the versatility of Core-CT for geoscience applications using CT scan images from a variety of environmental settings (1.Lake Huelde, Chile; 2. Kallang River Basin, Singapore; and 3. Red Sea, Saudi Arabia).

Quantitative data in CT scan images
A single CT scan image is produced using mono-energetic X-ray.As each X-ray beam passes through the sample, it attenuates varyingly, and the transmitted X-ray is received by a detector (Hounsfield, 1973).The X-ray attenuation depends on the X-ray energy and effective atomic density of the sample and can be determined using Beer Lambert's law (Equation ( 1)).Each rotation of the X-ray source around the sample produces a cross sectional image, which can then be stacked to form a 3D volume.
where I is the intensity of the transmitted X-ray, I o is the initial X-ray intensity, μ is the linear X-ray attenuation coefficient and d is the length of X-ray path inside the object.As the X-ray energy and intensity are kept constant, linear attenuation of X-ray occurs as a function of density, resulting in sensitivity of CT images to density changes (Duchesne et al., 2009;Heismann et al., 2003).These attenuation coefficients are converted to Hounsfield Unit (HU) using a simple linear transformation (Equation ( 2)) during image reconstruction, where water and air is arbitrarily assigned a value of 0 and -1000 respectively.Higher HU values indicate higher density values and appear lighter in a grayscale image.
The HU values are stored in each voxel of the CT scan image, and the number of voxels (image resolution) is dependent on the number of detectors (Hounsfield, 1973).The current maximum resolution of CT scan images is ~0.02 mm in the x, y and z axis.We refer to these HU values as CT numbers henceforth.CT images are stored in a DICOM (Digital and Imaging Communications in Medicine) format, a universally standardized format used for the sharing of medical imaging information (Mildenberger et al., 2002).A DICOM object groups the scanning parameters and scanned object identification under different attributes in its metadata.From the metadata, the PixelSpacing and SliceThickness attributes are important for geoscience applications as they record the dimension of each voxel in the x, y and z direction in millimeters.Each CT number can be assigned a real-world distance (or depth), allowing CT number profiles to be constructed with respect to depth and geometrical measurements to be calculated.

Methods
We describe two separate methods (Methods 1 and 2) to obtain representative CT number profiles from a user-defined region of interest and to segment and calculate geometric measurements of regions with major density contrast.

Method 1: constructing mean CT number profiles from ROI
Geoscience applications of CT scanning requires CT information from only the actual sediment and coral material.Therefore, it is essential to remove unwanted materials such as PVC pipes or core lining which can significantly skew the distribution of CT numbers due to density differences.Method 1 allows a user-defined ROI to be cropped from each image slice using a binary mask, from which an arithmetic mean and standard deviation of CT number is computed.This is iterated through the entire core to produce a CT number profile representative of the ROI (Fig. 1).

Cropping of ROI
To isolate the ROI from the CT scan images, we first define a crosssection to be cropped from each image slice.Depending on the type of core scanned (whole or split core), the cross-sectional area can be defined as a circle or rectangle (determined by user's investigation purpose) to compute a CT number profile from a specific volume.The dimensions of the defined area are used as a threshold to define a mask matrix.The mask matrix is a binary matrix with the same dimensions as the original CT scan images where the value of each element depends on its coordinate positions and can be defined by Equation ( 3): where X is the value of the element of an image slice, C x and C y are the distances of the element from the centre of the cropped ROI, and M x and M y represent the distances between the perimeter of the ROI and the centre of the cropped ROI.The CT scan images are stored as a 3D matrix, where the position of each pixel corresponds to the actual position in the core itself.Element-wise multiplication of the mask matrix removes the value from the original dataset if the pixel is located out of the designated mask perimeter (Fig. 1).
The defined cylinder or cuboid mask can be tilted along the x and y plane as required and is advantageous if the core has not been scanned straight.This is achieved using a rotation matrix, Equations ( 4) and ( 5): where R is the rotation matrix, C is the original coordinates of the pixel, and D is the coordinates of the rotated pixel.

Computing and analysing CT number profiles
A representative CT number profile for the ROI is obtained by calculating the arithmetic mean and standard deviation of the CT numbers per image slice.We assume a normal distribution of CT numbers across each image slice (typically 512 x 512 pixels) and the entire core can be visualised as a stack of distributions (Fig. 1).This method of representing 3D CT scan images as a one-dimension profile has been used for maintaining quality control of CT measurements (e.g., Tonai et al., 2019).

Identifying change points in CT numbers downcore
A change in the mean CT numbers indicate the presence of either higher or lower density material.A sharp change in the downcore CT number can therefore be interpreted as a potential lithostratigraphic contact.Identifying these contacts before core-splitting can expedite laboratory sampling by prioritizing and allocating resources to specific cores, or regions of interest within cores.
We use the findchangepts function in MATLAB to identify statistically significant shifts in CT numbers.The function adopts a global parametric method where an arbitrary point is first selected as a changepoint that divides the CT number profile (A) into two, and a line is fitted through each segment (A i ).Within each segment, the error between the data point and fitted line is minimized using a cost function (Equation ( 6)).This process is iterated by varying the location and number of change points until the total residual error of all segments attains a minimum and is less than the total error of the whole data set (Equation ( 7)) (Killick et al., 2012).To avoid overfitting, a penalty value (t) is added for each identified changepoint.No additional changepoints will be detected if the improvement in residual error is less than this value.
Where C (A i ) is the sum of error of each segment, k is the number of change points, t is the penalty value and C is the cost function defined in Equation ( 6).
We then test how noise arising from natural variability can affect the results using a CT number profile obtained from Lake Huelde, Chile.Random white gaussian noise were added to the CT number profile and the detected contacts are plotted as points (Fig. 2).This is iterated a thousand times with noise of various strengths, resulting in a signal-tonoise ratio of ~26 and ~46 respectively.The original dataset was used as a control where 7 contacts were identified (Fig. 2b).All 7 contacts were detected at all noise levels.However, at higher noise levels, other contacts that were less prominent can be picked up (Fig. 2d).This can then be countered by increasing the penalty value (Fig. 2e).
One potential issue of this approach is the detection of false contacts, such as air-filled cracks in sediment cores.However, such artefacts are highly visible on CT scan images and therefore can be reliably crosschecked.

Method 2: localized CT number profile
The alternative method of obtaining a CT number profile is based on the voxel values along a user-defined line.The 3D dataset implies that a CT number profile can be constructed anywhere along the CT scan images, allowing density variations to be detected in any direction (Fig. 3).This method is useful for identifying small density variation across certain sections of the core caused by the presence of fossils or biogenic structures (Fig. 3a).Laminations in sediment cores, or annual growth bands in corals, can also be identified using this method as they appear as sets of peaks and troughs along the CT number profile (Fig. 3b).Using the SliceThickness and PixelSpacing attributes of the CT scan images, the location of the peaks and linear distance between the peaks can be accurately identified and rapidly measured using the FindPeaks function in MATLAB (Fig. 3b).

Image and volume segmentation of identified regions
Biogenic structures in sediment cores or boring cavities in coral cores have a different density relative to the surrounding material (Fig. 4a).Therefore, they appear lighter (or darker) in CT images and we are able to calculate the area and volume of these structures as each voxel is associated with real-life dimensions described by the DICOM metadata (PixelSpacing and SliceThickness).
To identify these areas, we apply Otsu's method of image segmentation to each image slice.Otsu's method uses a global thresholding technique that aims to find a threshold (i.e., value that determines if a pixel is in the foreground or background) that minimizes the withingroup variance (Otsu, 1979).The output is a logical matrix that identifies the pixels corresponding to the foreground (Fig. 4b), which we can use to calculate the area and volume of the identified region using Equations ( 8) and ( 9): where N is the number of pixels, and PixelSpacing values are determined from the DICOM metadata.
where i and n are the lower and upper ends of image slices that contain the region and S is the SliceThickness value determined from the DICOM metadata.
This method provides geometric measurements of irregular structures such as biogenic burrows in sedimentary matrix, or internal boring cavities within coral skeletal material where conventional calculations for cylinders and cuboids cannot be used (Fig. 4c).The resultant measurement error is dependent on the CT scan image resolution.

Implementation
We integrate the algorithms above into a MATLAB application, Core-CT, for the quantitative analysis of CT scan images for geosciences.Core-CT is developed using a MacBook Pro with a 3.1 GHz quad-core and 16 Gb memory.It requires the Image Processing and Signal Processing Toolbox and runs on MATLAB 2019a and newer versions.Most key functions are computationally inexpensive (<0.5 min) except for the import and export of DICOM images (~1-3 min), which depends on the size of the CT images used.The application and codes for the various functions are available for download on GitHub (https://github.com/yuting-yan/Core-CT).The link also includes supplementary materials such as examples of CT scan images and a user operating guide.
The application promptly launches a graphical user interface (GUI) when opened (Fig. 5), consisting of panels to import, visualize, plot, analyse and export CT data.CT scan images of standard DICOM format are first imported for analysis (Fig. 5a).Some CT scan images may not be the right way up due to inversions when scanning.Users can check and re-orientate CT images using the "Flip upright" box to ensure that the CT scan images are loaded correctly prior to analysis (Fig. 5a).To obtain a downcore ROI, the user can draw either a circle or rectangular mask onto the axial image which can be tilted in both x and y directions using the sliders (Fig. 5b).A visualisation of the mask is printed on the sagittal and coronal image for the user's reference (Figs.5f and 6a).A slice-byslice and volume viewer are available for 3D viewing of the cropped ROI (Fig. 5c).The "Plot" button (Fig. 5d) is then used to compute the CT number profile of the cropped volume, resulting in a line graph of mean values and their associated standard deviation (Fig. 5g).Users can then define a threshold value to identify change points along the generated CT number profile (Fig. 5e).
To obtain a localized CT number profile, users can draw on any The peaks, which can be identified and numbered easily using the CT metadata, correspond to sediment varves which can be counted for chronological reconstruction.

Applications of Core-CT in geoscience investigations
To demonstrate the application of Core-CT for reliably quantifying CT scan images, we applied the methods described to both sediment and coral cores collected from different environmental settings, with varying research objectives.

Case study 1: identification of historical tsunami deposits in the sedimentary record: Lake Huelde, Chile
Core-CT was used to detect paleotsunami deposits preserved within the sedimentary record by constructing a mean CT number profile of lacustrine cores collected from Lake Huelde, Chile (Kempf et al., 2015(Kempf et al., , 2017)).Lake Huelde is located on the west coast of Chiloé Island in south-central Chile, along the centre of the 1960 CE Great Chilean Earthquake rupture zone that induced a large tsunami event across the Pacific Ocean.Lake Huelde contains a long sedimentary record (up to ~5500 cal years BP) of tsunami events in the region.The stratigraphy of the lake is dominated by either homogenous or laminated gyttja.Deposits of tsunami inundations into Lake Huelde interrupt the gyttja sedimentation through episodic deposition of sandy layers, resulting in a sharp change in sediment properties (e.g. grain size and density).The tsunami deposits generally contain these three sedimentary facies in sequence: (1) sandy matrix with mud rip-up clasts, (2) massive sand layer, and (3) a mud cap (Kempf et al., 2015(Kempf et al., , 2017)).
13 sediment cores were recovered by Kempf et al. (2017), some CT scanned using a Siemens Flash Medical CT scanner with a voxel resolution of ~0.15 x 0.15 × 0.6 mm (xyz).In this case study, we apply Core-CT to the top section of the master core (POS 15) to identify the tsunami deposits.A cylindrical mask is first created to isolate the middle section of the sediment core, from which a continuous mean CT number profile is constructed.Change points were then identified on the CT number profile and these detected contacts and units were compared to the known stratigraphy of the core.
Seven contacts corresponding to contacts between the tsunami deposits and gyttja sediments were detected using Core-CT (Fig. 7).Gyttja sediments have relatively low CT numbers (~400 ± 50) with low standard deviation due to their largely homogenous composition.In contrast, the tsunami deposits have a wider range of CT numbers (~500-1600) and standard deviation values due to the intermittent sandy inclusions in the sedimentary succession.The massive sand layer of the tsunami deposits is most prominent in both the CT scan images and CT number profile.The unit is characterised by a very sharp increase (from ~1000 to ~1500) and subsequent plateau of high CT numbers at ~1500 ± 150 with relatively high standard deviations.The three massive sand layers identified using Core-CT correspond to the three inundating waves of the 1960 CE tsunami event and probably an earlier tsunami inundation of 1837 CE (Kempf et al., 2015(Kempf et al., , 2017)).
The present case study demonstrates the ability of Core-CT to accurately and reliably identify sedimentological contact points within cores from the CT scan images.While the sandy layers are often clearly observed from orthogonal image slices, some less prominent units may not be easily identified from visual observations of the core images.Core-CT provides a quantitative approach to base facies boundaries upon, especially when tsunami deposits are not well-preserved.The high resolution of CT scan images and their sensitivity to density changes, coupled with other proxies, can be useful to support the geologist's eye and judgment in identifying less prominent deposits within sediment core records with a quantitative and reproducible tool.

Case study 2: identification of sedimentary units in unsplit sediment cores: Kallang River Basin, Singapore
We applied Core-CT to a shallow marine sediment core (MSBH01B) from the Kallang River Basin in southern Singapore (1.27266 • N, 103.8653 • E) to identify downcore lithostratigraphic change (Chua et al., 2020).MSBH01B was obtained through geotechnical coring and extrusion methods, resulting in 44 sediment segments encased in PVC pipes.Wash-boring methods utilised during core extraction only revealed estimated lithology and the top and bottom of each core segment.Using Core-CT, intra-core stratigraphic change can be readily identified, as well as quantitatively determine through CT values the intercalated stratigraphic units, if any.
Each core segment was CT-scanned with a Mediso Multiscan LFER 150PT/CT machine at the Singapore Experimental Medical Centre with a voxel resolution of ~0.2 x 0.2 × 0.2 mm (xyz).Core-CT was used to create a cylinder mask of ~7 cm diameter to remove the PVC core casing and compute a mean CT number profile for one of the core segments (OD3).Potential lithostratigraphic contacts are detected from the profile and cross-referenced to the high-resolution line scan image of the split core using the Avaatech Color Line Scan Camera (Fig. 8b).
Using Core-CT, we identified two change points from the mean CT number profile.This highlights OD3 as a core segment of interest with 2 possible lithostratigraphic contacts even before core splitting.The CT data from Core-CT (Fig. 8a) also suggests a transition from a basal unit of high CT values (possibly sandy or highly consolidated), overlain by a unit of low CT values (possibly highly organic) which is succeeded by another unit of intermediate CT values.This sequence could thus be interpreted as a transgressive sequence representing deposition of nearshore sediments associated with a rising sea level.
Results from visual logging and subsequent sedimentological work performed on OD3 (Fig. 8c) validates the supposition provided by the initial CT data analysis by Core-CT.The lowermost unit is identified as the Marina South Member (MSM), a very dense, highly oxidised unit formed by subaerial weathering of late Pleistocene marine muds, which accounted for the relatively high CT numbers (~500 ± 100) of this unit.The sharp decrease in CT numbers from ~500 to 200 marks the first detected contact at 63 cm.Overlying the MSM is the Kranji Formation, a highly organic peaty unit of mangrove origin (Chua et al., 2021) which accounts for the lowest CT number (250 ± 50) in this core segment.The Kranji Formation grades over ~15 cm into the marine muds known as the Rochor Formation (Chua et al., 2020).The strong agreement between the sedimentology of OD3 and the CT data output from Core-CT highlights the strength of using this program to provide a robust first level of understanding of core segments prior to any destructive core sampling and analysis methods.

Case study 3: identification and quantification of coral growth bands and internal bioerosion: Red Sea, Saudi Arabia
The applications of Core-CT for palaeoceanography and coral reef ecology are demonstrated using CT scan images of a massive Porites sp.coral core (core K5) collected from Thuwal region of Red Sea, Saudi Arabia (DeCarlo, 2020).Identifying annual coral growth bands is critical for the accurate determination of coral chronology to reconstruct past climate and environmental conditions (Carilli et al., 2010;D'Olivo et al., 2013;DeCarlo et al., 2019;Saenger et al., 2009).However, traditional methods used to identify and measure coral growth bands using X-radiography are time-consuming and potentially prone to measurement errors (Barnes and Lough, 1993;Carricart-Ganivet and Barnes, 2007).Cores need to be precisely slabbed (~0.7 cm slabs), X-rayed and then digitised with a scale and calibration standards before growth, density and calcification rates can be determined.Such existing approaches also result in a singular plane for analysis, that may not provide a continuous record along the entire core due to growth unconformities.
The coral core was scanned using a General Electric BrightSpeed CT scanner at King Abdullah University of Science and Technology with a voxel resolution of ~0.1875 x 0.1875 × 1.25 mm (xyz) (DeCarlo, 2020).We use Core-CT to identify the most representative plane for analysis before constructing a CT number profile along a user-defined growth axis (Fig. 8a and b).Growth bands can be easily identified as peaks along the profile, relating to the consecutive seasonal changes in skeletal density over time (Fig. 9b).The metadata of CT scan images facilitates rapid and accurate measurement of the distance between the peaks allowing for skeletal linear extension rates (cm y − 1 ) to be calculated, a metric widely used in modern ecological studies as an environmental indicator of reef health (Carilli et al., 2010;D'Olivo et al., 2013).However, a single line may not fully encapsulate changes in growth patterns across the core.Therefore, for corals with complex morphologies that require multi-dimensional measurements of linear extension, we recommend CoralCT (DeCarlo and Cohen, 2016).Fig. 7. Core-CT identifies 7 contacts which corresponds to boundaries between gyttja and tsunami deposits based on mean CT number profile of a lacustrine core section from Lake Huelde (Kempf et al., 2017).Core-CT was also used to calculate the volume of an internal bioerosion cavity within the coral core.Internal bioerosion is caused by a variety of taxa on reefs (e.g., molluscs, worms, sponges), and contributes to reef breakdown (Glynn and Manzello, 2015;Morgan, 2014).Using CT scan images, Core-CT can calculate the area of internal void space per image slice to determine a total cavity volume.Additionally, 3D visualisations of cavity size and shape can be used to identify the bioeroding taxa, particularly in fossil records where organic material is no longer present.The bioerosion cavity we show here (Fig. 9c) is likely formed by a polychaete worm (volume ~0.9 cm 3 ).This case study illustrates the versatility of Core-CT in analysing CT scan images of coral cores, both from modern and fossil assemblages, and as a platform to quickly explore and select the most appropriate sample plane for detailed investigations.

Conclusions
CT scanning is a powerful imaging technique that is able to study and analyse specimens in 3D without destroying them.CT numbers can also be used as a proxy for bulk density and to identify changes within a core.Core-CT integrates various functions for geoscience investigations to quantitatively analyse CT images.Users can define a ROI from CT images interactively, from which a CT number profile can be computed and analysed.Regions with major density contrast such as internal void space in a coral core can also be segmented.The geometric measurements of these irregularities can then be calculated rapidly using the CT metadata.Core-CT is not limited to sediment and coral core analysis but can also potentially be used for the identification of laminations in speleothem samples or cryptotephra in sediment cores for dating purposes.With an easy-to-use GUI, Core-CT aims to cater to a wider range of geoscientists and strives to be a platform that can help facilitate and integrate the use of CT scanning in a greater variety of earth science studies.

Computer code availability
Core-CT is an open-source MATLAB application developed under the GNU license and is available for download at https://github.com/yuting-yan/Core-CT.It requires the Image Processing and Signal Processing toolbox and runs on MATLAB 2019a and newer versions.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Fig. 1 .
Fig. 1.(a) Element wise multiplication of a cylindrical mask matrix to the original CT images produces a cropped volume of sediment core (b).(c) Mean CT number from each image slice is used to compute a mean CT number profile.

Fig. 2 .
Fig. 2. (a) CT image (POS15) from Lake Huelde, Chile (Kempf et al., 2017); (b) 7 contacts (red horizontal lines) were identified from the original CT number profile (navy line).These contacts are also detected when random white gaussian noise (yellow line) was added to the CT number profile at (c) 10dBW, (d) 30dBW and (e) 30dBW with increased penalty.(For interpretation of the references to colour in this figure legend, the reader is referred to the Web version of this article.)

Fig. 3 .
Fig. 3. (a) Localised CT number profiles can help identify lateral density variation.CT profile A-A ′ shows two peaks, which correspond to a shell present in the sediment core from the Kallang River Basin, Singapore.(b) B-B ′ shows the CT profile along a segment of the sediment core (POS15-HUEL05B) of Lake Huelde, Chile.The peaks, which can be identified and numbered easily using the CT metadata, correspond to sediment varves which can be counted for chronological reconstruction.

Fig. 4 .
Fig. 4. Computing area and volume of detected regions using Otsu's method of image thresholding (Otsu 1979).(a) Axial image of a coral core from Thuwal region of Red Sea, Saudi Arabia.(b) Binary image of the axial slice, with the cavity highlighted in pink.(c) The cavity is identified using Otsu's method and the area can be calculated using the image metadata.Total volume of the cavity is the sum of the axial image.(For interpretation of the references to colour in this figure legend, the reader is referred to the Web version of this article.)

Fig. 5 .
Fig. 5. Interface of Core-CT analysing sediment core.(a) Import the CT scan images, name of the folder will be printed on the interface.(b) Either a cylinder or cuboid mask can be drawn on the Axial Image; User can tilt the 3-dimensional mask in both X and Y direction using the slider.(c) The DICOM files can be cropped in 3-dimension based on the mask created.(d) Plotting the CT mean number profile.(e) Identifying change points in the CT number profile with a given threshold.(f) Axial, coronal and sagittal views of the original sediment core, with a mask overlay.(g) Image of cropped sediment core and corresponding mean CT number profile.(h) Cropped DICOM volume, figures and CT data can be exported.

Fig. 6 .
Fig. 6.Interface of Core-CT analysing coral core.(a) Axial, coronal and sagittal image of original coral core, with a cylindrical mask overlay.(b) Identify and measurement of void areas in the coral core.(c) User-defined line drawn on the coronal image of cropped coral core, with the corresponding CT number profile.(d) Select the most representative image slice using the radio button and spinner to obtain a localised CT number profile by clicking the "Draw line" button.(e) Total number of peaks can be identified and the distance between each peak can be calculated.(f) Cropped DICOM volume, figures and CT data can be exported.

Fig. 8 .
Fig. 8. (a) CT number profile from Core-CT detected two contacts and three sedimentary units.(b) CT scan image of MSBH01B segment OD3 (c) Highresolution line scan image reveals three sedimentary units, corresponding to the units identified from the CT profile.

Fig. 9 .
Fig. 9. (a).3D illustration of a coral core with the identified bioerosion structure and the viewing plane, (b) annual growth bands identified from the viewing plane.Core-CT is able to count the number of peaks identified (represented by the black numbers) and the distance between each peaks can be calculated and printed on the plot (represented by the red numbers), (c) volumetric 3D rendering of the bioerosion cavity (mm) within the coral core.This visualisation represents internal void space removed from the coral by a boring organism.(For interpretation of the references to colour in this figure legend, the reader is referred to the Web version of this article.)