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

Help mid_sagittal_align function #10

Closed
AcostaFranco opened this issue Jul 12, 2017 · 3 comments
Closed

Help mid_sagittal_align function #10

AcostaFranco opened this issue Jul 12, 2017 · 3 comments

Comments

@AcostaFranco
Copy link

Hi everyone,

I want to use the function mid_sagittal_align in R. I already have installed FSL5.0, R, R studio, fslr, etc...
So, when I use it, it gives me the next error:

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/fslhd "/tmp/Rtmpveqwpe/file14d614372173.nii.gz"
/usr/share/fsl/5.0/bin/fslhd: error while loading shared libraries: libfslio.so: cannot open shared object file: No such file or directory
Error in system(cmd, intern = TRUE) : error in running command

I checked to have the fslhs and libfslio.so files
I am using Ubuntu 16.10
Does anyone knows what could be the problem?

Thanks in advance.

@muschellij2
Copy link
Owner

Neurodebian has caused some issues in the past for me. I used the following script to just shotgun copy everything.

You may want to symlink instead:

FSLDIR=/usr/local/fsl
FSLSHARE=/usr/share/data

mkdir -p ${FSLDIR}/bin && cp /usr/lib/fsl/5.0/* ${FSLDIR}/bin/
mkdir -p ${FSLDIR}/data/standard && mkdir -p ${FSLDIR}/data/atlases 


#######################################
# Setting things up like other installers
#######################################
cp -R ${FSLSHARE}/fsl-mni152-templates/* ${FSLDIR}/data/standard/

# setting up atlases
cp -R ${FSLSHARE}/harvard-oxford-atlases/* ${FSLDIR}/data/atlases/ 
cp -R ${FSLSHARE}/juelich-histological-atlas/* ${FSLDIR}/data/atlases/ 
cp -R ${FSLSHARE}/bangor-cerebellar-atlas/* ${FSLDIR}/data/atlases/ 
cp -R ${FSLSHARE}/jhu-dti-whitematter-atlas/* ${FSLDIR}/data/atlases/ 
cp -R ${FSLSHARE}/forstmann-subthalamic-nucleus-atlas/* ${FSLDIR}/data/atlases/ 
cp -R ${FSLSHARE}/fsl-resting-connectivity-parcellation-atlases/* ${FSLDIR}/data/atlases/ 
cp -R ${FSLSHARE}/mni-structural-atlas/* ${FSLDIR}/data/atlases/ 
cp -R ${FSLSHARE}/oxford-thalamic-connectivity-atlas/* ${FSLDIR}/data/atlases/ 
cp -R ${FSLSHARE}/talairach-daemon-atlas/* ${FSLDIR}/data/atlases/ 

@johncolby
Copy link

Hey John, thanks for all the great work. Is this hack still the preferred way to play nice with neurodebian, or is there a more elegant solution? thx!

@muschellij2
Copy link
Owner

I think the current implementation works out of the box:
Can you try in a new R session:

devtools::install_github("muschellij2/fslr")
library(fslr)
if (have.fsl()){
  system.time({
    dims = c(50, 50, 20)
    x = array(rnorm(prod(dims)), dim = dims)
    img = nifti(x, dim= dims, 
                datatype = convert.datatype()$FLOAT32, cal.min = min(x), 
                cal.max = max(x), pixdim = rep(1, 4))
    s.img = fslsmooth(img, retimg=TRUE)
  })
}

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

3 participants