-
Notifications
You must be signed in to change notification settings - Fork 5
/
Singularity_elikopy
152 lines (126 loc) · 5.02 KB
/
Singularity_elikopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
Bootstrap: docker
From: nvidia/cuda:9.1-devel-centos7
%post -c /bin/bash
cd /
# Prepare directories for installing applications
mkdir -p Software
mkdir -p Installer_tmp
# Update all libraries
yum -y update
yum install epel-release -y
# Install X11 + some utils
yum install -y xorg-x11-server-Xorg xorg-x11-xauth xorg-x11-apps nano
yum groupinstall "Development Tools"
# Requirements FreeSurfer
yum update -y
yum install git wget tcsh gcc gcc-c++ libgfortran-static make vim-common ca-certificates -y
yum install lapack-devel lapack-static blas-devel blas-static zlib-devel -y
yum install python-devel python3-devel -y
yum install libX11-devel libXmu-devel mesa-libGL-devel -y
# Requirements FSL
yum install expat-devel libX11-devel mesa-libGL-devel zlib-devel libpng-devel -y
# Requirements MRTrix3
yum install git gcc-g++ python eigen3-devel zlib-devel mesa-libGL-devel fftw-devel libtiff-devel -y
python3 -m pip install numpy
yum install centos-release-scl -y
yum install devtoolset-8 -y
scl enable devtoolset-8 bash
#Requirements Convert3D
yum -y install wget tar
#Requirements ANTs
yum -y install git gcc-c++ zlib-devel cmake cmake3
alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake 10 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake \
--family cmake
alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
--family cmake
# Install MRTrix3
cd /Software
git clone https://github.com/MRtrix3/mrtrix3.git
cd mrtrix3
git checkout 3.0.3
./configure -nogui -openmp
./build
cd /
# Install FSL
wget -O /Installer_tmp/fslinstaller.py "https://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py"
cd /Installer_tmp
export LC_ALL="en_US.UTF-8"
python fslinstaller.py -d /Software/fsl6 -V 6.0.4
cd /
# Install Convert3D (stable build 1.0.0)
wget -O /Installer_tmp/c3d-1.0.0-Linux-x86_64.tar.gz "https://downloads.sourceforge.net/project/c3d/c3d/1.0.0/c3d-1.0.0-Linux-x86_64.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fc3d%2Ffiles%2Fc3d%2F1.0.0%2Fc3d-1.0.0-Linux-x86_64.tar.gz%2Fdownload&ts=1571934949"
tar -xf /Installer_tmp/c3d-1.0.0-Linux-x86_64.tar.gz -C /Software/
cd /
# Clean up
rm -r /Installer_tmp/c3d-1.0.0-Linux-x86_64.tar.gz
# Install ANTs
cd /Installer_tmp
mkdir ants_installer
cd ants_installer
git clone https://github.com/stnava/ANTs.git
cd ANTs
git checkout v2.3.5
cd ..
mkdir ants_build
cd ants_build
cmake3 /Installer_tmp/ants_installer/ANTs -DCMAKE_INSTALL_PREFIX=/Software/ants
make 2>&1 | tee build.log
make 2>&1 | tee build.log
cd ANTS-build
make install 2>&1 | tee install.log
cd /
# Clean up
rm -r /Installer_tmp/ants_installer/
# Install FreeSurfer
yum -y install bc binutils libgomp1 perl psmisc sudo tar tcsh unzip uuid-dev vim-common libjpeg62-dev
wget -O /Installer_tmp/freesurfer-linux-centos7_x86_64-7.1.1.tar.gz "https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.1.1/freesurfer-linux-centos7_x86_64-7.1.1.tar.gz"
tar -C /Software -xzvf /Installer_tmp/freesurfer-linux-centos7_x86_64-7.1.1.tar.gz
echo "This is a dummy license file. Please bind your freesurfer license file to this file." > /Software/freesurfer/license.txt
cd /
# Clean up
rm -r /Installer_tmp/freesurfer-linux-centos7_x86_64-7.1.1.tar.gz
# Make custom folders
mkdir -p PROJECTS
# Set Permissions
chmod 755 /PROJECTS
chmod 755 /Software
# Install MF
yum -y install git gcc libpq-dev python-dev python-pip python3 python3-dev python3-pip python3-venv python3-wheel
cd /Software
git clone https://github.com/rensonnetg/microstructure_fingerprinting.git
cd microstructure_fingerprinting
python3 setup.py install
cd /
# Install ElikoPy
cd /Software
git clone https://github.com/Hyedryn/elikopy
cd elikopy
python3 -m pip install -r requirements.txt
python3 setup.py install
cd /
# Clean up
rm -r /Installer_tmp
%environment
# MRTrix3
export PATH="/Software/mrtrix3/bin:$PATH"
# FSL
FSLDIR=/Software/fsl6
. ${FSLDIR}/etc/fslconf/fsl.sh
PATH=${FSLDIR}/bin:${PATH}
export FSLDIR PATH
# Convert3D
export PATH="/Software/c3d-1.0.0-Linux-x86_64/bin:$PATH"
# ANTs
export ANTSPATH=/Software/ants/bin/
export PATH=${ANTSPATH}:$PATH
# FreeSurfer
export FREESURFER_HOME=/Software/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.sh
%runscript
xvfb-run -a --server-num=$((65536+$$)) --server-args="-screen 0 1600x1280x24 -ac" bash /Software/elikopy/run_elikopy.sh /PROJECTS "$@"