aaa_install_dcmtk: Install DCMTK

Description Usage Arguments Value Examples

Description

Installs the DICOM ToolKit

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
install_dcmtk(
  type = c("osx", "linux_static", "linux_dynamic", "windows"),
  force = FALSE,
  version = c("3.6.6", "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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 = eval(formals(install_dcmtk)$version)
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)
})

muschellij2/dcmtk documentation built on March 17, 2021, 9:11 p.m.