dcmj2pnm: Convert DICOM images to PGM/PPM, PNG, JPEG or BMP using...

View source: R/dcmj2pnm.R

dcmj2pnmR Documentation

Convert DICOM images to PGM/PPM, PNG, JPEG or BMP using dcmdump from DCMTK

Description

Convert DICOM images to PGM/PPM, PNG, JPEG or BMP using dcmdump from DCMTK

Usage

dcmj2pnm(file, outfile = tempfile(fileext = ".png"), opts = "--write-png", ...)

Arguments

file

DICOM file name

outfile

output file name passed to dcmtk_cmd

opts

opts passed to dcmtk_cmd

...

options passed to dcmtk_cmd intern

Value

Character vector of information

Examples

if (have_dcmtk_cmd("dcmj2pnm")) {
  file = system.file("extdata", "example.dcm", package = "dcmtk")
  png_file = dcmj2pnm(file)
  print(png_file)
  print(file.exists(png_file))
  print(normalizePath(png_file))
  img = png::readPNG(png_file)
  plot(1:2, type='n')
  image(img)
}

muschellij2/dcmtk documentation built on March 6, 2025, 12:07 a.m.