Skip to content

Commit

Permalink
use is.matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsp-spirit committed Nov 27, 2019
1 parent 3acc84b commit 9c90f69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/read_fs_mgh.R
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion R/write_fs_mgh.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}

Expand Down

0 comments on commit 9c90f69

Please sign in to comment.