|
a |
|
b/scripts/configure_ANTs.sh |
|
|
1 |
#!/bin/bash |
|
|
2 |
|
|
|
3 |
# --------------------------------------------- |
|
|
4 |
# create local ~/.antspy dir and move package data to it |
|
|
5 |
|
|
|
6 |
if [[ ! -d ~/.antspy ]]; then |
|
|
7 |
mkdir ~/.antspy |
|
|
8 |
fi |
|
|
9 |
|
|
|
10 |
cp data/* ~/.antspy/ |
|
|
11 |
|
|
|
12 |
# --------------------------------------------- |
|
|
13 |
# clone ANTs and move all files into library directory |
|
|
14 |
|
|
|
15 |
antsgit=https://github.com/ANTsX/ANTs.git |
|
|
16 |
antstag=fc0589fd23826e53d51e67eb8a3f9a3d63e63a14 # 02-26-2025 label geometry fix |
|
|
17 |
echo "ANTS;${antstag}" >> ./data/softwareVersions.csv |
|
|
18 |
|
|
|
19 |
cd src # go to lib dir |
|
|
20 |
|
|
|
21 |
# if antscore doesnt exist, create it |
|
|
22 |
if [[ ! -d antscore ]] ; then |
|
|
23 |
git clone $antsbranch $antsgit antsrepo |
|
|
24 |
|
|
|
25 |
if [[ ! -d antscore ]] ; then |
|
|
26 |
mkdir antscore |
|
|
27 |
fi |
|
|
28 |
|
|
|
29 |
cd antsrepo # go to antscore |
|
|
30 |
# check out right branch |
|
|
31 |
if [[ -d .git ]]; then |
|
|
32 |
git checkout master |
|
|
33 |
git pull |
|
|
34 |
git checkout $antstag |
|
|
35 |
fi |
|
|
36 |
cd .. |
|
|
37 |
# copy antscore files into library |
|
|
38 |
cp -r antsrepo/Examples/* antscore/ |
|
|
39 |
cp -r antsrepo/Examples/include/* antscore |
|
|
40 |
cp -r antsrepo/ImageRegistration/* antscore/ |
|
|
41 |
cp -r antsrepo/ImageSegmentation/* antscore/ |
|
|
42 |
cp -r antsrepo/Tensor/* antscore/ |
|
|
43 |
cp -r antsrepo/Temporary/* antscore/ |
|
|
44 |
cp -r antsrepo/Utilities/* antscore/ |
|
|
45 |
|
|
|
46 |
|
|
|
47 |
rm -rf antsrepo # remove directory |
|
|
48 |
|
|
|
49 |
# lil hack bc of stupid angled import bug in actual files |
|
|
50 |
# cp ReadWriteData.h antscore/ReadWriteData.h |
|
|
51 |
# lil hack bc ANTsVersionConfig.h is only created if you build ANTs... |
|
|
52 |
cp ANTsVersionConfig.h antscore/ANTsVersionConfig.h |
|
|
53 |
fi |
|
|
54 |
|
|
|
55 |
cd ../../ # go back to main dir |