muschellij2/Neurohacking

fslr error while using fsl functions inside Rstudio

athanell opened this issue · 3 comments

Hello,
I installed fslr with devtools::install_github("muschellij2/fslr")
and also run the commands in the Installation.Rmd file
i.e
FSLDIR=/usr/local/fsl ; FSLSHARE=/usr/share/data; PATH=$PATH:${FSLDIR}/bin;
....
sudo cp -R ${FSLSHARE}/mni-structural-atlas/* ${FSLDIR}/data/atlases/ ; sudo cp -R ${FSLSHARE}/oxford-thalamic-connectivity-atlas/* ${FSLDIR}/data/atlases/ ; sudo cp -R ${FSLSHARE}/talairach-daemon-atlas/* ${FSLDIR}/data/atlases/;

I checked the folder /usr/local/fsl/bin and all files have been copied there from the folder /usr/lib/fsl/5.0/

But for some reason when I load the library

library(fslr)
Loading required package: oro.nifti
oro.nifti 0.8.0
Loading required package: neurobase

and try to run an fsl function like

fslmaths.help()
/usr/local/fsl/bin/fslmaths: error while loading shared libraries: libnewimage.so: cannot open shared object file: No such file or directory
Error in system(cmd, intern = TRUE) : error in running command
In addition: Warning messages:
1: In get.fsl() : Setting fsl.path to /usr/local/fsl
2: In get.fsloutput() : Can't find FSLOUTPUTTYPE, setting to NIFTI_GZ

I get the error that the shared library libnewimage.so does not exist, even though it is in the /usr/local/fsl/bin folder.

When I run it from a terminal R I do not encounter this error.
Any ideas on how to resolve this problem?
Thank you

Hello John,

Thank you for the lightning fast answer.
Yes when I exported the path to the LD_LIBRARY_PATH , the problem was resolved