tests/testthat/test_readDICOM.R

context("Reading DICOM files")

abdo <- system.file("dcm/Abdo.dcm", package="oro.dicom")

test_that("Reading DICOM file Abdo.dcm", {
  expect_is(readDICOMFile(abdo), "list")
  expect_is(readDICOMFile(abdo)$hdr, "data.frame")
  expect_is(readDICOMFile(abdo)$img, "matrix")
})

spine <- system.file("dcm/Spine1.dcm", package="oro.dicom")

test_that("Reading DICOM file Spine1.dcm", {
  expect_is(readDICOMFile(spine), "list")
  expect_is(readDICOMFile(spine)$hdr, "data.frame")
  expect_is(readDICOMFile(spine)$img, "matrix")
})

sphere <- system.file("sphere3", package="oro.dicom")

test_that("Reading DICOM files sphere3", {
  expect_is(readDICOM(sphere), "list")
  expect_is(readDICOM(sphere)$hdr[[1]], "data.frame")
  expect_is(readDICOM(sphere)$img[[1]], "matrix")
})

Try the oro.dicom package in your browser

Any scripts or data that you put into this service are public.

oro.dicom documentation built on Oct. 30, 2019, 9:59 a.m.