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

fslviewer not found from within r #9

Closed
Tazinho opened this issue May 11, 2017 · 4 comments
Closed

fslviewer not found from within r #9

Tazinho opened this issue May 11, 2017 · 4 comments

Comments

@Tazinho
Copy link

Tazinho commented May 11, 2017

After some trouble with packrat and updating fslr I am getting the following error, when I try to open a nifit from within R:

library(fslr)
ld = Sys.getenv("LD_LIBRARY_PATH")
Sys.setenv("LD_LIBRARY_PATH"=paste0(ld, ":/usr/lib/fsl/5.0"))
mni <-  readNIfTI("data/Input/mni.nii.gz",
                  reorient = FALSE)
> fslr::fslview(mni)
FSLDIR='/usr/share/fsl/5.0'; PATH=${FSLDIR}/bin:${PATH};export PATH FSLDIR; sh "${FSLDIR}/etc/fslconf/fsl.sh"; FSLOUTPUTTYPE=NIFTI_GZ; export FSLOUTPUTTYPE; ${FSLDIR}/bin/fslview '/tmp/Rtmpc9D8No/file126f73c02102.nii.gz' 

sh: 1: /usr/share/fsl/5.0/bin/fslview: not found
Error in system(cmd, intern = intern) : error in running command
In addition: Warning messages:
1: In get.fsl() : Setting fsl.path to /usr/share/fsl/5.0
2: In get.fsloutput() : Can't find FSLOUTPUTTYPE, setting to NIFTI_GZ

Here my (local) .bash_profile:

. ~/.profile
. ~/.bashrc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/fsl/5.0

And the last lines of my (local) .bash_rc

# fslr tipp, 01.03.17
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/fsl/5.0 in your .bashrc

# from terminal man fsl
 . /etc/fsl/5.0/fsl.sh

## bash
export FREESURFER_HOME=/usr/local/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.sh

My Ubuntu version is: 16.04.2 LTS (Xenial Xerus)
R version: 3.3.4
fslr version: 2.13.1 (but I get the same error, when using the cran version).

Any ideas?

@muschellij2
Copy link
Owner

Does /usr/share/fsl/5.0/bin/fslview exist? What do you get when you put

which fslview

in the terminal?

@Tazinho
Copy link
Author

Tazinho commented May 11, 2017

No it is in 'usr/bin/fslview'

@muschellij2
Copy link
Owner

That is why it's failing. How was fsl installed? One option is to either symlink or copy fslview to /usr/share/fsl/5.0

@Tazinho
Copy link
Author

Tazinho commented May 11, 2017

I don't remember how it was installed, but the symlink option works
$ sudo ln -s /usr/bin/fslview /usr/share/fsl/5.0/bin
Thanks!

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