Reads and decodes 8-bit, 16-bit, or 32-bit monochrome or RGB pixel data
(including RLE-compressed frames) directly into an R matrix or array, applying
Modality LUT (RescaleSlope and RescaleIntercept) when rescale = TRUE.
Value
A numeric matrix [rows, cols] (for single-frame monochrome) or
3D/4D array [rows, cols, frames/channels] with class "dicom_pixels" and
DICOM imaging metadata attached as attributes.
Examples
dcm_file <- system.file("extdata", "example.dcm", package = "dicomtk")
px <- read_dicom_pixels(dcm_file)
dim(px)
#> [1] 512 512
