From 9c90f6975055a590ea4467730fe926e542f33493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Sch=C3=A4fer?= Date: Wed, 27 Nov 2019 12:43:16 +0100 Subject: [PATCH] use is.matrix --- R/read_fs_mgh.R | 2 +- R/write_fs_mgh.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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."); }