tests/testthat/test_nii2oro.R

context("oro2 other stuff")

fname = system.file("nifti/mniRL.nii.gz", package = "oro.nifti")
nim <- readNIfTI(fname)
orig_nii = RNifti::readNifti(fname)

test_that("nii2oro()", {
  expect_s4_class(nii2oro(nim), "nifti")
  expect_true({
    inherits(oro2nii(nim), "niftiImage")
    })
})

test_that("oro2nii and back again", {
  nii_img = oro2nii(nim)
  expect_s4_class(nii2oro(nii_img), "nifti")
  expect_s4_class(nii2oro(orig_nii), "nifti")
})



test_that("nii object", {
  expect_silent(dim_(  orig_nii))
  expect_silent(origin(  orig_nii))
  expect_silent(voxdim(  orig_nii))
  expect_silent(datatype(  orig_nii))
  
})
  

Try the oro.nifti package in your browser

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

oro.nifti documentation built on Aug. 10, 2022, 5:09 p.m.