Running ‘testthat.R’ [9s/35s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(tractor.base)
  > 
  > test_check("tractor.base")
  ── 1. Failure: we can read and write NIfTI-1 files (@test-05-files.R#49)  ──────
  image$setSource(NULL)$serialise() not equal to rereadImage$setSource(NULL)$serialise().
  Component "origin": Mean relative difference: 0.973191
  Component "xform": Mean relative difference: 1
  
  ── 2. Failure: we can read ANALYZE files (@test-05-files.R#66)  ────────────────
  image$getOrigin() not equal to c(49, 39, 23).
  3/3 mismatches (average diff: 37)
  [1] 0 - 49 == -49
  [2] 0 - 39 == -39
  [3] 0 - 23 == -23
  
  
   *** caught segfault ***
  address 160, cause 'memory not mapped'
  
  Traceback:
   1: RNifti:::hasData(from)
   2: asMethod(object)
   3: as(images[[1]], "MriImage")
   4: readDicomDirectory(file.path(path, "6157_fl3D_t1_sag"), method = "divest",     interactive = FALSE)
   5: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6: withVisible(code)
   7: force(code)
   8: withr::with_output_sink(temp, withVisible(code))
   9: eval_with_output(code, print = print, width = width)
  10: capture_output_lines(code, print, width = width)
  11: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)),     ...)
  12: quasi_capture(enquo(object), label, capture_output, width = width)
  13: expect_output(image <- readDicomDirectory(file.path(path, "6157_fl3D_t1_sag"),     method = "divest", interactive = FALSE)$image, "Found 2 DICOM")
  14: eval(code, test_env)
  15: eval(code, test_env)
  16: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  17: doTryCatch(return(expr), name, parentenv, handler)
  18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  19: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  20: doTryCatch(return(expr), name, parentenv, handler)
  21: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  22: tryCatchList(expr, classes, parentenv, handlers)
  23: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  24: test_code(desc, code, env = parent.frame())
  25: test_that("we can sort and read DICOM files", {    path <- system.file("extdata", "dicom", package = "tractor.base")    temp <- tempdir()    file.copy(path, temp, recursive = TRUE)    path <- file.path(temp, "dicom")    sortDicomDirectories(path, deleteOriginals = TRUE)    expect_equal(length(list.files(path)), 2L)    expect_true(all(c("4630_DTIb3000s5", "6157_fl3D_t1_sag") %in%         list.files(path)))    files <- list.files(file.path(path, "6157_fl3D_t1_sag"),         full.names = TRUE)    dicom <- readDicomFile(files[1])    expect_length(dicom$getAsciiFields("Version"), 1)    expect_output(print(dicom), "GROUP")    image <- readDicomDirectory(file.path(path, "6157_fl3D_t1_sag"))$image    expect_equal(image$getDimensions(), c(2, 224, 256))    expect_equal(image$getVoxelDimensions(), rep(1, 3L))    expect_equal(round(image$getOrigin()), c(19, 95, 135))    reportr::setOutputLevel(OL$Verbose)    expect_output(image <- readDicomDirectory(file.path(path,         "6157_fl3D_t1_sag"), method = "divest", interactive = FALSE)$image,         "Found 2 DICOM")    expect_equal(image$getDimensions(), c(2, 224, 256))    expect_equal(image$getVoxelDimensions(), rep(1, 3L))    unlink(path, recursive = TRUE)})
  26: eval(code, test_env)
  27: eval(code, test_env)
  28: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  29: doTryCatch(return(expr), name, parentenv, handler)
  30: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  31: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  32: doTryCatch(return(expr), name, parentenv, handler)
  33: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  34: tryCatchList(expr, classes, parentenv, handlers)
  35: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  36: test_code(NULL, exprs, env)
  37: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  38: force(code)
  39: doWithOneRestart(return(expr), restart)
  40: withOneRestart(expr, restarts[[1L]])
  41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  42: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        reporter$start_file(basename(path))        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE,             wrap = wrap)        reporter$.end_context()        reporter$end_file()    })
  43: FUN(X[[i]], ...)
  44: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  45: force(code)
  46: doWithOneRestart(return(expr), restart)
  47: withOneRestart(expr, restarts[[1L]])
  48: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  49: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE, wrap = wrap))
  50: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  51: test_dir(path = test_path, reporter = reporter, env = env, filter = filter,     ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     wrap = wrap)
  52: test_package_dir(package = package, test_path = test_path, filter = filter,     reporter = reporter, ..., stop_on_failure = stop_on_failure,     stop_on_warning = stop_on_warning, wrap = wrap)
  53: test_check("tractor.base")
  An irrecoverable exception occurred. R is aborting now ...