Learn R Programming

CTRing (version 0.1.0)

getEwLw: Establish the transition point from earlywood to latewood for a series of rings

Description

Establish the transition point from earlywood to latewood for a series of rings

Usage

getEwLw(densProfile)

Value

xRingList with EW to LW transition points with transition type added (1: low number of points in ring; 2: inflexion point estimated by polynomial; 3: min or max are out of range; 4: inflexion point close to min or max; 5: convex-concave)

Arguments

densProfile

Density profile

Examples

Run this code

library(oro.dicom)
file_path <- system.file("extdata", "disk.dcm", package = "CTRing")
dcm <-  readDICOM(file_path)
hdr_df <- dcm$hdr[[1]]
image_info <- getImageInfo(hdr = hdr_df)

im <- imageToMatrix(dcm$img)
im_8bit <- xBitTo8Bit(im, image_info$grayScale)
im_dens <- grayToDensity(im_8bit)

pith_coord <- detect_pith(im_dens, n_segments = 12, pixel = TRUE, toPlot = FALSE)

endPath <- c(472, 284) # manual
# not run - endPath <- locatePathEnd(im_dens, pith_coord) # using the image

path <- extractProfile(im_dens, image_info, pith_coord, endPath, k = 2, r = 5, threshold = 0.002)

pathEwLw <- getEwLw(path)

densityDf <- densityDataFrame(path)

Run the code above in your browser using DataLab