plotImageProfile: Plot scan image, profile path and ring limits

View source: R/plotImageProfile.R

plotImageProfileR Documentation

Plot scan image, profile path and ring limits

Description

Plot scan image, profile path and ring limits

Usage

plotImageProfile(densProfile, im)

Arguments

densProfile

Density profile

im

Density matrix

Value

Plot

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)

endPath <- c(472, 284) # manual

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

plotProfile(path)

plotImageProfile(path, im_dens)


CTRing documentation built on Sept. 11, 2024, 6:45 p.m.