Skip to content

Commit

Permalink
Also test vector indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
jonclayden committed Jun 19, 2024
1 parent 432cbd4 commit 2e1627a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inst/tinytest/test-25-composite.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Complex datatypes
# Basic data
image <- readNifti(system.file("extdata", "example.nii.gz", package="RNifti"))
tempPath <- paste(tempfile(), "nii.gz", sep=".")

# Complex datatypes
data <- sqrt(array(as.complex(image)-468, dim=dim(image)))
complexImage <- asNifti(data, image)

Expand Down Expand Up @@ -42,4 +43,5 @@ expect_equal(header$datatype, 128L)
expect_equal(header$bitpix, 24L)

rgbImage <- readNifti(tempPath, internal=TRUE)
expect_equal(rgbImage[40 + 39*96 + 29*9216], refValue)
expect_equal(rgbImage[40,40,30], refValue)

0 comments on commit 2e1627a

Please sign in to comment.