Function that AC/PC re-orients the images for SPM spatial normalization routine. Uses nii_setOrigin from http://www.mccauslandcenter.sc.edu/CRNL/sw/spm8/spm.zip

acpc_reorient(infiles, modality = c("T1", "T2", "CT", "fMRI"),
  spmdir = spm_dir(), verbose = TRUE, install_dir = NULL, ...)

Arguments

infiles

(character) Files to reorient. First file will be used to estimate AC/PC, then rest will be transformed

modality

T1, T2, CT, fMRI (T2*)

spmdir

(character) path for SPM12. If NULL, assumes SPM12 is in matlabpath and so is spm8/toolbox Must have nii_setOrigin installed. In system.file("", package="spm12r") from http://www.mccauslandcenter.sc.edu/CRNL/sw/spm8/spm.zip

verbose

(logical) Print diagnostic output

install_dir

directory to download SPM12

...

Arguments to pass to run_matlab_code

Value

Exit code from MATLAB. If not zero, there was an error