muschellij2 / fslr

FSL-R Interface package
41 stars 11 forks source link

fslmath -odt short #6

Closed yinkaiming1987 closed 8 years ago

yinkaiming1987 commented 8 years ago

Dear John,

I was trying to run fslmaths input output -odt short in fslr R package, as below:

fslmaths("data.img", opts = "-odt short") # data.img could be NIFTI or ANALYZE

FSLDIR='/usr'; PATH=${FSLDIR}/bin:${PATH};export PATH FSLDIR; FSLOUTPUTTYPE=NIFTI; export FSLOUTPUTTYPE; ${FSLDIR}/bin/fsl5.0-fslmaths "/home/kaimingyin/Desktop/data.img" -odt short "/tmp/RtmpceSI2O/file2244322574e3";

Error in command line: unknown option "-odt"

It reports error as above, do you know how to fix it?

Also, should I run the ourput in one of the below ways like:

output <- fslmaths("data.img", opts = "-odt short") or fslmaths("data.img", outfile = "output.img", opts = "-odt short")

Thanks, Kaiming

muschellij2 commented 8 years ago
r = fslmaths(file = "data.img", outfile = "output.img", opts = "-odt short", opts_after_outfile = TRUE)

NB: if FSLOUTPUTTYPE=NIFTI;, then the file will not have .img on the end but rather .nii. You need to change that using

options(fsl.outputtype = "NIFTI_PAIR")

if you want hdr/img pairs (I do not recommend this).

Also, you cannot currently perform an fslmaths operation while invoking odt and opts_after_outfile=TRUE as the other options must be before the output for fslmaths