Installs the DICOM ToolKit

install_dcmtk(type = c("osx", "linux_static", "linux_dynamic",
  "windows"), force = FALSE, version = c("3.6.3", "3.6.0"),
  arch = c("x86_64", "i686"), install_dir = system.file(package =
  "dcmtk"))

dcmtk_filename(type, arch, version)

dcmtk_ftp_url(version)

source_install_dcmtk(type = c("osx", "linux", "windows"),
  version = c("3.6.3", "3.6.4", "3.6.0"),
  install_dir = system.file(package = "dcmtk"), cmake_opts = NULL)

Arguments

type

Which format of dcmtk should be downloaded. If not specified, it will be chosen from the platform

force

Should installing be forced even if folders exist?

version

version of DCMTK to install

arch

architecture to install, either 64 or 32

install_dir

Installation Directory

cmake_opts

options for CMAKE cmake command. Can be a character vector or character scalar. For example, if want to use ICU versus libiconv, use cmake_opts = "-DDCMTK_ENABLE_CHARSET_CONVERSION=ICU"

Value

Logical if installed

Examples

in_ci <- function() {
  nzchar(Sys.getenv("CI"))
}

install_dir =  tempfile()
dir.create(install_dir, showWarnings = FALSE, recursive = TRUE)
if (!have_dcmtk_cmd("dcmdump")) {
  res = try({
    install_dcmtk(install_dir = install_dir)
  })
  if (inherits(res, "try-error")) {
    res = FALSE
  }
  if (in_ci() & !res) {
    source_install_dcmtk(install_dir = install_dir)
  }
}

type =   type = c("osx", "linux_static", "linux_dynamic", "windows")
arch = c("x86_64", "i686")
version = c( "3.6.3", "3.6.0")
eg = expand.grid(type = type, arch = arch, version = version,
stringsAsFactors = FALSE)
lists = apply(eg, 1, as.list)
eg$filename = sapply(lists, function(x) {
do.call(dcmtk_filename, args = x)
})