Uses Sys.which to check if command is in the PATH.

dcmtk_cmd_path(cmd)

Arguments

cmd

DCMTK command name

Value

Logical TRUE if command is available.

Examples

if (!have_dcmtk_cmd("dcmodify")) {
install_dir = tempdir()
options(dcmtk.path = install_dir)
  res = try({
    install_dcmtk(install_dir = install_dir)
  })
  if (inherits(res, "try-error")) {
    res = FALSE
  }
  if (!res) {
    source_install_dcmtk(install_dir = install_dir)
  }
}
dcmtk_cmd("dcmodify")
#> /tmp/RtmpbIKxLr/bin/dcmodify   
#> [1] 126