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

issue running fslsmooth() function #32

Closed
khammerberg53 opened this issue Aug 25, 2022 · 1 comment
Closed

issue running fslsmooth() function #32

khammerberg53 opened this issue Aug 25, 2022 · 1 comment

Comments

@khammerberg53
Copy link

khammerberg53 commented Aug 25, 2022

R studio is kicking the error below when I try to run this code:

# Commented out as all packages are installed now
install.packages("flexdashboard")
install.packages("rmarkdown")
install.packages("knitr")
install.packages("readxl")
install.packages("oro.dicom")
# Install package "devtools" which is used to install package "neurobase" and "fslr"
install.packages("devtools")
# Install neurobase
devtools::install_github("muschellij2/neurobase")
# Install fslr
devtools::install_github("muschellij2/fslr")

# Loading all libraries
library(flexdashboard)
library(rmarkdown)
library(knitr)
library(readxl)
# Load required library to read multiple DICOM files
library(oro.dicom)
library(devtools)
# Load the neurobase and fslr
library(neurobase)
library(fslr)

options(fsl.path="/Library/Frameworks/R.framework/Versions/4.1/Resources/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)
  })
}

Error:

FSLDIR='/Library/Frameworks/R.framework/Versions/4.1/Resources/library/fslr'; PATH=${FSLDIR}/bin:${PATH};export PATH FSLDIR; FSLOUTPUTTYPE=NIFTI_GZ; export FSLOUTPUTTYPE; ${FSLDIR}/bin/fslmaths "/private/var/folders/1f/n1lfmhwx41gcpl_9k02ln2cr0000gn/T/RtmpMYGT6a/filee3ac73f6c7d1.nii.gz" -s 10 "/var/folders/1f/n1lfmhwx41gcpl_9k02ln2cr0000gn/T//RtmpMYGT6a/filee3ac4eb8a5d1";

rest/of/path/library/fslr/bin/fslmaths: No such file or directory
Error in oro.nifti::readNIfTI(..., reorient = reorient) :
File(s) not found!


Any idea why this might be? I'm lost with it right now.

@muschellij2
Copy link
Owner

You need to install FSL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki

See docs at https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation/MacOsX. The fsl.path is for FSL not fslr

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