Skip to content

Commit

Permalink
Getting the nii unit tests upand running for RNifti objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
muschellij2 committed Jan 8, 2018
1 parent 06a8c81 commit 7c4709d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/testthat/test_nii2oro.R
@@ -1,7 +1,8 @@
context("oro2 other stuff")

nim <- readNIfTI(system.file("nifti/mniRL.nii.gz", package = "oro.nifti"))
nii_img = oro2nii(nim)
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")
Expand All @@ -13,15 +14,16 @@ test_that("nii2oro()", {
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_( nii_img))
expect_silent(origin( nii_img))
expect_silent(voxdim( nii_img))
expect_silent(datatype( nii_img))
expect_silent(dim_( orig_nii))
expect_silent(origin( orig_nii))
expect_silent(voxdim( orig_nii))
expect_silent(datatype( orig_nii))

})

0 comments on commit 7c4709d

Please sign in to comment.