Skip to content

Commit

Permalink
investigate travis error on R dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsp-spirit committed Nov 27, 2019
1 parent 7947ecf commit 4891ade
Show file tree
Hide file tree
Showing 2 changed files with 5 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 @@ -94,7 +94,7 @@ read.fs.mgh <- function(filepath, is_gzipped = "AUTO", flatten = FALSE, with_hea
header$internal$M = M;
header$internal$Mdc = Mdc;

header$vox2ras_matrix = M;
header$vox2ras_matrix = as.matrix(M);
header$ras_xform = ras_xform;

RAS_space_size = (3*4 + 4*3*4); # 60 bytes
Expand Down
5 changes: 4 additions & 1 deletion R/write_fs_mgh.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ write.fs.mgh <- function(filepath, data, vox2ras_matrix = NULL, mr_params = c(0.
if(length(vox2ras_matrix) == 0) {
ras_flag = 0;
} else {
if (class(vox2ras_matrix) != "matrix") {
if(class(vox2ras_matrix) != "matrix") {
cat(sprintf("The class of the 'vox2ras_matrix' argument is '%s'.", class(vox2ras_matrix)));
print(vox2ras_matrix);
stop("The 'vox2ras_matrix' argument must be a matrix.");
}

if(length(vox2ras_matrix) != 16 || nrow(vox2ras_matrix) != 4) {
stop(sprintf("The 'vox2ras_matrix' argument must be a 4x4 matrix of length 16, but length is %d and nrow is %d.", length(vox2ras_matrix), nrow(vox2ras_matrix)));
}
Expand Down

0 comments on commit 4891ade

Please sign in to comment.