diff --git a/R/read_fs_mgh.R b/R/read_fs_mgh.R index 84c2aae..cd707ad 100755 --- a/R/read_fs_mgh.R +++ b/R/read_fs_mgh.R @@ -77,7 +77,7 @@ read.fs.mgh <- function(filepath, is_gzipped = "AUTO", flatten = FALSE, with_hea blah = Mdc %*% D; M = matrix(rep(0, 16), nrow=4); - M[1:3,1:3] = blah; + M[1:3,1:3] = as.matrix(blah); M[4,1:4] = c(0,0,0,1); M[1:3,4] = Pxyz_0; diff --git a/R/write_fs_mgh.R b/R/write_fs_mgh.R index d29be9f..6ca7cc2 100644 --- a/R/write_fs_mgh.R +++ b/R/write_fs_mgh.R @@ -34,7 +34,7 @@ write.fs.mgh <- function(filepath, data, vox2ras_matrix = NULL, mr_params = c(0. } else { cat(sprintf("The class of the 'vox2ras_matrix' argument is '%s'.", class(vox2ras_matrix))); print(vox2ras_matrix); - if(class(vox2ras_matrix) != "matrix") { + if(! is.matrix(vox2ras_matrix)) { stop("The 'vox2ras_matrix' argument must be a matrix."); }