inst/tinytest/test-05-data.R

data <- array(rnorm(24), dim=c(3L,2L,4L))
image <- asNifti(data)

expect_equal(ndim(data), 3L)
expect_inherits(image, "niftiImage")
expect_equal(dim(image), c(3L,2L,4L))
expect_equal(pixdim(data), c(1,1,1))
expect_equal(pixdim(image), c(1,1,1))
expect_equal(pixunits(data), "Unknown")
expect_equal(pixunits(image), "Unknown")
expect_equal(image$datatype, 64L)

Try the RNifti package in your browser

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

RNifti documentation built on June 22, 2024, 10:20 a.m.