detect_pith {CTRing} | R Documentation |
Automatically detect pith in a CT scan image
Description
Automatically detect pith in a CT scan image
Usage
detect_pith(
im,
toPlot = TRUE,
n_segments = 25,
flag = TRUE,
x_0 = 0.5,
y_0 = 0.5,
n_run_max = 15,
threshold = 0.1,
pixel = TRUE
)
Arguments
im |
Matrix of the CT scan image |
toPlot |
Boolean to plot the location of the pith on the image |
n_segments |
Number of segements used to locate pith |
flag |
FALSE if pith location is known |
x_0 |
Estimate of pith location in x |
y_0 |
Estimate of pith location in y |
n_run_max |
Maximum number of iterations |
threshold |
Thershold value for identifying ring transition points |
pixel |
If TRUE, returns x,y coordinates in pixel numbers, else FALSE returns x,y coordinates in relative values of x and y |
Value
x,y pith coordinates
Examples
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)
[Package CTRing version 0.1.0 Index]