The functionality of some of these packages requires Linux, Mac OSX, or a Unix-type system. This excludes Windows in some cases. The code was run on Linux and Mac OSX. Although we do not currently support it, Windows 10 has a Linux subsystem, which may allow for a working installation of all the dependencies of Neuroconductor.
Although still untested there is a good tutorial on running FSL on Windows as well as ANTsR on Windows.
You can install the latest R from http://cran.r-project.org/.
We also recommend installing the RStudio IDE
These are required by the ANTsR
suite of tools. To install these, see the relevant sections in the Installing ANTsR tutorial
See the installation instructions for FSL from https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation.
The following was done to make the Neurodebian installation look like that of Mac OSX:
##########################################
# FSL
##########################################
sudo apt-get update \
&& sudo apt-get install -y fsl-complete
# Debian has a fixed FSLDIR
export FSLDIR=/usr/local/fsl
export FSLSHARE=/usr/share/data
# add the fsl binary path to the search path
export PATH=$PATH:${FSLDIR}/bin
# export PATH=$PATH:/usr/lib/fsl/5.0
# Possum is installed in the same directory
export POSSUMDIR=$FSLDIR
sudo mkdir -p ${FSLDIR}/bin
sudo cp /usr/lib/fsl/5.0/* ${FSLDIR}/bin/
sudo mkdir -p ${FSLDIR}/lib
sudo mv ${FSLDIR}/bin/lib* ${FSLDIR}/lib/
export FSLOUTPUTTYPE=NIFTI_GZ
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/fsl/5.0
export LD_LIBRARY_PATH=${FSLDIR}/lib/:$LD_LIBRARY_PATH:
# sudo cp /usr/share/fsl/5.0/etc/fslconf/fsl.sh $FSLDIR/etc/fslconf/fsl.sh
export FSLOUTPUTTYPE=NIFTI_GZ
# sudo rm $FSLDIR/etc/fslconf/fsl.sh
sudo mkdir -p $FSLDIR/etc/fslconf/
fname=${FSLDIR}/etc/fslconf/fsl.sh
echo "FSLDIR=/usr/local/fsl" > ${fname}
echo 'PATH=${PATH}:${FSLDIR}/bin' >> ${fname}
echo 'LD_LIBRARY_PATH=${FSLDIR}/lib:$LD_LIBRARY_PATH' >> ${fname}
echo "FSLOUTPUTTYPE=NIFTI_GZ" >> ${fname}
##########################
# Setting global library
##########################
sudo echo "${FSLDIR}/lib" > /etc/ld.so.conf.d/fsl.conf
sudo ldconfig
sudo mkdir -p ${FSLDIR}/data/standard
sudo mkdir -p ${FSLDIR}/data/atlases
#######################################
# Setting things up like other installers
#######################################
# settring up standard
sudo cp -R ${FSLSHARE}/fsl-mni152-templates/* ${FSLDIR}/data/standard/
# setting up atlases
sudo cp -R ${FSLSHARE}/harvard-oxford-atlases/* ${FSLDIR}/data/atlases/
sudo cp -R ${FSLSHARE}/juelich-histological-atlas/* ${FSLDIR}/data/atlases/
sudo cp -R ${FSLSHARE}/bangor-cerebellar-atlas/* ${FSLDIR}/data/atlases/
sudo cp -R ${FSLSHARE}/jhu-dti-whitematter-atlas/* ${FSLDIR}/data/atlases/
sudo cp -R ${FSLSHARE}/forstmann-subthalamic-nucleus-atlas/* ${FSLDIR}/data/atlases/
sudo cp -R ${FSLSHARE}/fsl-resting-connectivity-parcellation-atlases/* ${FSLDIR}/data/atlases/
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/
The tutorial and breakdown for installing the devtools
package is located at: https://www.rstudio.com/products/rpackages/devtools/. Please read through it as most of the code below requires devtools
.
We need Bioconductor packages in some cases and we can install it with the code below:
# Installing Bioconductor
library(utils);
source("http://bioconductor.org/biocLite.R");
biocLite(pkgs = c("Biobase"), suppressUpdates = TRUE, suppressAutoUpdate = TRUE, ask = FALSE)
The rgl
package cand be installed using install.packages
usually.
The install.packages
command may have some problems on Linux machines. It can be installed in bash
using:
sudo apt-get -y update && sudo apt-get build-dep -y r-cran-rgl
There may be an error that may be mitigated by the following command in bash:
sudo sed -i -- 's/#deb-src/deb-src/g' /etc/apt/sources.list && sudo sed -i -- 's/# deb-src/deb-src/g' /etc/apt/sources.list
and re-running the code above.
source("https://neuroconductor.org/neurocLite.R")
# DICOM converter
neuro_install("dcm2niir")
library(dcm2niir); install_dcm2nii()
# HCP database connector
neuro_install("neurohcp")
# dcm2nii Rcpp implementation
neuro_install(c("RNifti", "divest", "oro.dicom", "oro.nifti", "WhiteStripe"))
# data for whitestripe
library(WhiteStripe); download_img_data()
# neurobase package
neuro_install("neurobase")
neuro_install("fslr")
Please see the the Installing ANTsR tutorial if anything errors here:
##########################################
# ANTs
##########################################
neuro_install("ITKR")
neuro_install("ANTsRCore", upgrade_dependencies = FALSE)
neuro_install("ANTsR", upgrade_dependencies = FALSE)
neuro_install("extrantsr", upgrade_dependencies = FALSE)
install.packages(c("formatR", "caTools", "rprojroot", "rmarkdown"))
The only package that isn’t directly available is the ms.lesion
package, which is due to restrictions on the data. This should be available from the tutorial
##############################
# Install MS LESION DATA!
# INSTALL KIRBY21
##############################
neuro_install("papayar")
neuro_install("oasis")
neuro_install("malf.templates")
neuro_install("kirby21.t1")
If all of these install correctly, restart R
and test:
library(fslr)
have_fsl()
example("fsl_smooth")
library(extrantsr)
example("smooth_image")