Skip to contents

dicomtk is a complete, modern rebuild of the R dcmtk wrapper, synchronized with OFFIS DCMTK 3.7.1 (PS 3.6-2026d) and powered by a bundled C++17 / Rcpp engine requiring zero external installation.

Installation

Install pre-compiled binaries or source directly from R-Universe:

install.packages(
  "dicomtk",
  repos = c(
    "https://lauyeehow1986-hub.r-universe.dev",
    "https://cloud.r-project.org"
  )
)

Or install the development version from GitHub:

# install.packages("remotes")
remotes::install_github("lauyeehow1986-hub/dicomtk")

Key Features

Quick Start

library(dicomtk)
library(dplyr)

dcm_file <- system.file("extdata", "example.dcm", package = "dicomtk")

# 1. Read DICOM header as a tidy tibble
read_dicom(dcm_file) |>
  filter(group == "0028") |>
  select(tag, vr, keyword, value)

# 2. Visualize with ggplot2 and clinical CT/MR window presets
plot_dicom(dcm_file, window = "auto", palette = "gray")

# 3. Launch interactive Shiny DICOM viewer
if (interactive()) {
  dicom_viewer(dcm_file)
}

# 4. Connect to Local Ollama or OpenAI / Claude for AI-Assisted Analysis
llm <- dicom_llm("ollama", model = "llava:13b")
dicom_summarize(dcm_file, llm = llm)
dicom_describe_image(dcm_file, llm = llm)
dicom_report(dcm_file, llm = llm)