-
Notifications
You must be signed in to change notification settings - Fork 35
Installing ANTsR in Windows 10 (along with FSL, Rstudio, Freesurfer, etc).
In August 2016, Windows 10 has enabled a full Ubuntu subsystem that enables bash
and allows any kind of Linux packages to be installed. You can now have ANTsR, ANTs, FSL, Freesurfer directly on Windows 10.
This will work only if your Windows 10 is updated with the anniversary update (Aug 2016).
Follow the instructions here: https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
You may need to disable antivirus software (Kaspersky, Avast, etc) to perform the next steps.
# quick way, but will install the older R 3.0.2
sudo apt-get update
sudo apt-get -y install r-base-core
# longer, but will install the most recent R (currently 3.3.1)
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install r-base
First, open install the dependencies in R:
install.packages(
c(
"Rcpp","magrittr","dplyr",
"abind",
"BGLR",
"caret",
"cluster",
"d3Network",
"DMwR",
"e1071",
"extremevalues",
"fastICA",
"fpc",
"glasso",
"glmnet",
"grid",
"igraph",
"knitr",
"lme4",
"magic",
"MASS",
"mFilter",
"misc3d",
"moments",
"nabor",
"pixmap",
"png",
"pracma",
"psych",
"randomForest",
"rgl",
"rmarkdown",
"robust",
"robustbase",
"RRedsvd",
"signal",
"sna",
"testthat",
"visreg",
"wmtsa")
)
Then exit R and install ANTsR:
sudo apt-get -y install git
sudo apt-get -y install cmake
git clone https://github.com/stnava/ITKR.git
git clone https://github.com/stnava/ANTsR.git
sudo R CMD INSTALL ITKR
sudo R CMD INSTALL ANTsR
Voila! you now have ANTsR on Windows.
The Linux subsystem was designed as a command line tool. To enable using graphic interfaces (Rstudio, FSL, Freesurfer) you have to install an X-server in Windows (for example: Xming or vcXsrv. The above options are not great, the most accurate display I tried is MobaXterm. However, none of them is stable, at some point all crashed for me. But most neuroimaging software run ok.
sudo apt-get install gdebi-core
sudo apt-get install libxslt1-dev # library needed for rstudio
# get rstudio 64bit for Ubuntu at https://www.rstudio.com/products/rstudio/download/
wget https://download1.rstudio.org/rstudio-0.99.903-amd64.deb
sudo gdebi rstudio-0.99.903-amd64.deb
And you can install FSL (see instructions).
And you can install Freesurfer (see instructions)
(To make sure freeview
will work, get the nightly builds. The official release did not work for me.)
And you can install MRtrix (see instructions and this post)
MRtrix viewer (mrview
) requires special drivers and will not work.
sudo apt-get install -y cmake-curses-gui ### install ccmake
git clone git://github.com/stnava/ANTs.git
mkdir antsbin
cd antsbin
ccmake ../ANTs
# in the ccmake display, type “c” (configure) twice, then type “g” (generate) and exit
make -j 4