Skip to content

Commit

Permalink
add unit tests for more MGH header functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsp-spirit committed Feb 11, 2020
1 parent 9776d5a commit c084ec6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/testthat/test-mghheader.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,13 @@ test_that("The tkregister ras2vox matrix can be computed from a conformed volume
expect_equal(ras2vox_tkr, known_ras2vox_tkr, tolerance=1e-4);
})


test_that("The slice direction and orientation can be computed", {
brain_image = system.file("extdata", "brain.mgz", package = "freesurferformats", mustWork = TRUE);
mgh = read.fs.mgh(brain_image, with_header=TRUE);
expect_true(mghheader.is.conformed(mgh));
expect_equal(mghheader.primary.slice.direction(mgh), 'coronal');
expect_equal(mghheader.crs.orientation(mgh), 'LIA');
})


0 comments on commit c084ec6

Please sign in to comment.