Introduction

Computed Tomography (CT) imaging has many applications outside the medical field. One such application in the field of environmental science is scanning sediment cores from coastal wetlands, a technique first demonstrated by Davey et al. (2011)[Davey, E., C. Wigand, R. Johnson, K. Sundberg, J. Morris, and C. Roman. 2011. Use of computed tomography imaging for quantifying coarse roots, rhizomes, peat, and particle densities in marsh soils. Ecological Applications 21(6): 2156-2171. (link to .pdf)]. The general goal is typically to quantify various soil/sediment components (particles, sand, water, roots) based on their densities; see sources citing Davey et al. (2011) for specific applications.

CT scanning produces large matrices of metadata-rich files with the .dcm extension. The extension is derived from data standard used in CT scanning, called Digital Imaging and Communications in Medicine (DICOM). The coreCT package is a small but powerful set of functions designed to streamline analysis of CT-scanned sediment cores, enabling rapid programmatic processing and synthesis of semi-processed DICOM images. 'Semi-processed' means that irrelevant parts of the images (PVC core tubes, etc.) have been masked out, and the only remaining data are for the actual sediment. coreCT builds on functionality in other packages, particulary the oro.dicom package (Whitcher et al. 2011)[Whitcher, B., V. J. Schmid and A. Thornton. 2011. Working with the DICOM and NIfTI Data Standards in R. Journal of Statistical Software 44(6): 1-28. (link)] for reading DICOM images and spatial analysis tools in the raster and igraph packages.

Key features of coreCT include:

This vignette introduces basic usage of the coreCT functions.

Data: core_426

The core_426 sample dataset included with coreCT includes three DICOM images from a CT-scanned sediment core. Each image represents a 0.625 mm depth interval, so this dataset is very small, but useful for demonstration purposes.

We'll use this provided dataset to demonstrate how the basic functions conv and rootSize work. These basic functions work with a matrix of DICOM images, but coreCT also includes wrapper functions convDir and rootSizeDir that are more flexible, automatically extracting metadata and operating on a directory of raw .dcm files. These wrapper functions load the DICOM images, extract relevant metadata like pixel dimensions, and analyze the images for components and root characteristics.

Usage

Using the basic functions requires some initial work to extract metadata and convert the raw values to Hounsfield Units, the standard units for CT output.

plot of chunk unnamed-chunk-1

This can be done more easily with coreCT::convDir, which automatically extracts DICOM metadata associated with pixel dimensions and converts raw values to Hounsfield Units:

plot of chunk unnamed-chunk-2

The conversion from Hounsfield Units to densities is done using calibration rods of known density analyzed with the sediment core. Reasonable default values are provided for four calibrants following Davey et al. (2011): air, water, colloidal silica, and glass. conv internally develops a relationship between the Hounsfield units and known densities of these calibrants, and applies that relationship to derive estimates of component masses by multiplying bulk densities by volumes (\(g.cm^3 * cm^3 = g\)).

Root characteristics are calculated by the rootSize function, which also has a wrapper function rootSizeDir that operates on a directory of raw DICOM images.

By default, root characteristics are calculated when convDir is used, but if root data aren't of interest or a separate set of DICOM images is being used to quantify roots, time can be saved by including rootData = FALSE as an argument to convDir.

Conversely, root characteristics can be analyzed without quantifying sediment composition. This uses the rootSize function and its metadata-scraping wrapper function, rootSizeDir:

plot of chunk unnamed-chunk-3