Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fslmath -odt short #6

Closed
yinkaiming1987 opened this issue Apr 11, 2016 · 1 comment
Closed

fslmath -odt short #6

yinkaiming1987 opened this issue Apr 11, 2016 · 1 comment

Comments

@yinkaiming1987
Copy link

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants