View source: R/grayToDensity.R
grayToDensity | R Documentation |
Convert from 8bit gray scale to density
grayToDensity(im, a = -0.1321, b = 0.01834)
im |
Matrix of CT scan image in 8bit gray scale |
a |
Intercept of the calibration curve |
b |
Slope of the calibration curve |
Matrix of density values
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)
range(im_8bit)
im_dens <- grayToDensity(im_8bit)
range(im_dens)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.