From 7593b4024b5e8ea9c7e617f1e407d113417c8e8f Mon Sep 17 00:00:00 2001 From: muschellij2 Date: Sun, 24 Nov 2019 22:09:20 -0500 Subject: [PATCH] fixing bug in mid_sagittal align --- R/mid_sagittal_align.R | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/R/mid_sagittal_align.R b/R/mid_sagittal_align.R index c690874..44053da 100644 --- a/R/mid_sagittal_align.R +++ b/R/mid_sagittal_align.R @@ -70,10 +70,14 @@ mid_sagittal_align = function( verbose = verbose, retimg = FALSE, outfile = tfile) - centered = reverse_rpi_orient_file( - file = tfile, - orientation = rp$orientation, - convention = rp$convention) + if (force_rpi) { + centered = reverse_rpi_orient_file( + file = tfile, + orientation = rp$orientation, + convention = rp$convention) + } else { + centered = tfile + } if (retimg) { centered = readnii(centered) }