convDir: Convert a directory of raw DICOM images to material classes

Description Usage Arguments Details Value See Also Examples

View source: R/convDir.R

Description

Calculates the area and volume of material classes for each CT slice in a directory. This approach directly replicates Earl Davey's manual classification approach. This method is deprecated as of coreCT version 1.3.0.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
convDir(directory = file.choose(), upperLim = 3045, lowerLim = -1025, 
airHU = -850.3233, airSD = 77.6953, 
SiHU = 271.7827, SiSD = 39.2814,
glassHU = 1345.0696, glassSD = 45.4129,
waterHU = 63.912, waterSD = 14.1728,
densities = c(0.0012, 1, 1.23, 2.2),
rootData = TRUE, 
diameter.classes = c(1, 2, 2.5, 10), 
class.names = diameter.classes,
pixel.minimum = 4)

Arguments

directory

a character string that can be a matrix of DICOM images or the address of an individual DICOM file in a folder of DICOM images. The default action is <code>file.choose()</code>; a browser menu appears so the user can select the the desired directory by identifying a single DICOM file in the folder of images.

upperLim

upper bound cutoff for pixels (Hounsfield Units)

lowerLim

lower bound cutoff for pixels (Hounsfield Units)

airHU

mean value for air-filled calibration rod (Hounsfield Units)

airSD

standard deviation for air-filled calibration rod

SiHU

mean value for colloidal silica calibration rod

SiSD

standard deviation for colloidal Si calibration rod

glassHU

mean value for glass calibration rod

glassSD

standard deviation for glass calibration rod

waterHU

mean value for water filled calibration rod

waterSD

standard deviation for water filled calibration rod

densities

numeric vector of known cal rod densities. Format must be c(air, water, Si, glass)

rootData

if TRUE, rootSize is also called on the matrix

diameter.classes

if rootData is TRUE, this argument provides an integer vector of diameter cut points used by rootSize. Units are mm (zero is added in automatically).

class.names

placeholder, not used presently

pixel.minimum

minimum number of pixels needed for a clump to be identified as a root

Details

Calculates the area and volume of material classes for each CT slice in a directory. Unlike conv, convDir accepts a folder of raw values and makes the conversion to Hounsfield Units using the metadata associated with the DICOM images.

Value

value convDir returns a dataframe with one row per CT slice. Values returned are the area and volume of seven material classes: gas, peat, roots and rhizomes, rock and shell, fine mineral particles, sand, and water. If rootData = TRUE, the output will also contain data on the abundance (number of particles), volume (cm3), and external surface area (cm2) of the root size classes specified in the diameter.classes argument.

See Also

convDir is a wrapper for conv. rootSizeDir operates similarly.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
materials <- convDir("core_426", rootData = FALSE)


## Not run:  
# plot using "ggplot" package after transforming with "reshape2" package
mass.long <- reshape2::melt(materials, id.vars = c("depth"), 
   measure.vars = grep(".g", names(materials)))
ggplot2::ggplot(data = mass.long, ggplot2::aes(y = -depth, x = value, 
   color = variable)) + ggplot2::geom_point() + ggplot2::theme_classic() + 
   ggplot2::xlab("mass per section (g)") 

## End(Not run)

coreCT documentation built on Feb. 5, 2021, 5:06 p.m.